@cloudkinetix/bmad-enhanced
Version:
Cloud-Kinetix enhanced fork of BMAD-METHOD - Breakthrough Method of Agile AI-driven Development with robust versioning and unified validation.
178 lines (131 loc) • 4.82 kB
Markdown
# Work Directory Archive Utility
## Purpose
Archive important temporal reports from `.bmad-workspace/ck-jira-integration/` directory for compliance, historical reference, or analysis purposes.
## Archive Strategies
### 1. Time-Based Archives (Recommended)
Create monthly or quarterly archives:
```bash
# Monthly archive
tar -czf archives/work-$(date +%Y-%m).tar.gz .bmad-workspace/ck-jira-integration/
# Quarterly archive
tar -czf archives/work-$(date +%Y)-Q$(( ($(date +%-m)-1)/3+1 )).tar.gz .bmad-workspace/ck-jira-integration/
# Weekly archive
tar -czf archives/work-$(date +%Y-W%V).tar.gz .bmad-workspace/ck-jira-integration/
```
### 2. Sprint-Based Archives
Archive at the end of each sprint:
```bash
# Sprint archive (replace SPRINT-NAME)
SPRINT="2024-Q1-Sprint-3"
tar -czf archives/sprint-${SPRINT}-work.tar.gz \
.bmad-workspace/ck-jira-integration/reports/sprint-health-*.md \
.bmad-workspace/ck-jira-integration/standups/ \
.bmad-workspace/ck-jira-integration/sync/
```
### 3. Selective Archives
Archive specific report types:
```bash
# Archive sync reports
tar -czf archives/sync-reports-$(date +%Y%m%d).tar.gz .bmad-workspace/ck-jira-integration/sync/
# Archive reconciliation reports
tar -czf archives/reconciliation-$(date +%Y%m%d).tar.gz \
.bmad-workspace/ck-jira-integration/reconciliation/ \
.bmad-workspace/ck-jira-integration/analysis/roadmap-variance-*.md
# Archive audit trails
tar -czf archives/audit-trails-$(date +%Y%m%d).tar.gz \
.bmad-workspace/ck-jira-integration/cleanup/audit-trail-*.md
```
## Archive Management
### Directory Structure
```
archives/
├── work/ # Full .bmad-workspace/ck-jira-integration archives
├── sprints/ # Sprint-specific archives
├── compliance/ # Audit and compliance archives
└── analysis/ # Historical analysis archives
```
### Create Archive Index
```bash
# Generate index of archived files
for archive in archives/*.tar.gz; do
echo "=== $archive ===" >> archives/INDEX.txt
tar -tzf "$archive" | head -20 >> archives/INDEX.txt
echo "" >> archives/INDEX.txt
done
```
### Search Archives
```bash
# Find specific report in archives
for archive in archives/*.tar.gz; do
if tar -tzf "$archive" | grep -q "sprint-health-ABLE-Sprint-15"; then
echo "Found in: $archive"
fi
done
```
### Extract Specific Files
```bash
# Extract single file from archive
tar -xzf archives/work-2024-03.tar.gz .bmad-workspace/ck-jira-integration/reports/sprint-health-ABLE-Sprint-15-2024-03-15.md
# Extract all sprint health reports
tar -xzf archives/work-2024-Q1.tar.gz --wildcards "*/sprint-health-*.md"
```
## Automated Archiving
### Script Template
```bash
#!/bin/bash
# work-archive.sh - Automated work directory archiving
ARCHIVE_DIR="./archives/work"
WORK_DIR=".bmad-workspace/ck-jira-integration"
RETENTION_DAYS=30
# Create archive directory
mkdir -p "$ARCHIVE_DIR"
# Create timestamped archive
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
ARCHIVE_FILE="$ARCHIVE_DIR/work-archive-$TIMESTAMP.tar.gz"
echo "Creating archive: $ARCHIVE_FILE"
tar -czf "$ARCHIVE_FILE" "$WORK_DIR"
# Optional: Remove old files after archiving
if [ "$1" == "--clean" ]; then
echo "Cleaning files older than $RETENTION_DAYS days..."
find "$WORK_DIR" -name "*.md" -mtime +$RETENTION_DAYS -delete
fi
# Generate archive summary
echo "Archive created: $ARCHIVE_FILE" > "$ARCHIVE_DIR/last-archive.log"
echo "Size: $(du -h "$ARCHIVE_FILE" | cut -f1)" >> "$ARCHIVE_DIR/last-archive.log"
echo "Files: $(tar -tzf "$ARCHIVE_FILE" | wc -l)" >> "$ARCHIVE_DIR/last-archive.log"
```
## Integration with JIRA Agent
```markdown
[[LLM: Archive work reports task
1. Determine archive strategy (time/sprint/selective)
2. Check available disk space
3. Create archive with appropriate naming
4. Verify archive integrity
5. Generate archive summary report
6. Optional: Clean up archived files
]]
## Archive Summary Report
**Archive Created**: {{filename}}
**Archive Size**: {{size}}
**Files Archived**: {{count}}
**Date Range**: {{oldest}} to {{newest}}
**Categories Included**:
- Sprint Reports: {{sprint_count}}
- Sync Reports: {{sync_count}}
- Dashboards: {{dashboard_count}}
- Analysis: {{analysis_count}}
```
## Best Practices
1. **Regular Schedule**: Archive monthly or per sprint
2. **Compression**: Use gzip for space efficiency
3. **Naming Convention**: Include dates in archive names
4. **Index Files**: Maintain searchable index
5. **Offsite Backup**: Store critical archives remotely
6. **Retention Policy**: Define how long to keep archives
## Compliance Considerations
For regulated environments:
- Keep audit trails for required period (often 7 years)
- Ensure archives are immutable (write-once)
- Document archive chain of custody
- Encrypt sensitive report archives
- Maintain archive access logs