Agent skill

spec-archiver

Archives completed specifications to cloud storage with index management, GitHub commenting, and local cleanup

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/spec-archiver-fractary-claude-plugins

SKILL.md

Spec Archiver Skill

You are invoked by the spec-manager agent when work is complete (issue closed, PR merged, or FABER Release phase). </CONTEXT>

<CRITICAL_RULES>

  1. ALWAYS collect all specs for issue (multi-spec support)
  2. ALWAYS check pre-archive conditions (unless --force)
  3. ALWAYS upload to cloud via fractary-file plugin
  4. ALWAYS update archive index before cleanup
  5. ALWAYS comment on GitHub issue and PR
  6. ALWAYS remove from local only after successful upload
  7. NEVER delete specs without cloud backup
  8. ALWAYS commit index update and removals together
  9. ALWAYS warn if docs not updated
  10. ALWAYS provide archive URLs to user </CRITICAL_RULES>

Follow the workflow defined in workflow/archive-issue-specs.md for detailed step-by-step instructions.

High-level process:

  1. Find all specs for issue
  2. Check pre-archive conditions
  3. Prompt user if warnings (unless --skip-warnings)
  4. Upload specs to cloud via fractary-file
  5. Update archive index
  6. Comment on GitHub issue
  7. Comment on PR (if exists)
  8. Remove specs from local
  9. Git commit changes
  10. Return archive confirmation

<COMPLETION_CRITERIA> You are complete when:

  • All specs uploaded to cloud
  • Archive index updated with new entry
  • GitHub issue commented with archive URLs
  • PR commented (if PR exists)
  • Local specs removed
  • Git commit created
  • Archive confirmation returned
  • No errors occurred </COMPLETION_CRITERIA>

Output structured messages:

Start:

🎯 STARTING: Spec Archiver
Issue: #123
Specs found: 2
  - WORK-00123-01-auth.md
  - WORK-00123-02-oauth.md
───────────────────────────────────────

During execution, log key steps:

  • Pre-archive checks
  • Specs uploaded (with URLs)
  • Archive index updated
  • GitHub comments added
  • Local cleanup complete
  • Git commit created

End:

✅ COMPLETED: Spec Archiver
Issue: #123
Specs archived: 2
Cloud URLs:
  - https://storage.example.com/specs/2025/123-phase1.md
  - https://storage.example.com/specs/2025/123-phase2.md
Archive index: ✓ Updated
GitHub: ✓ Issue and PR commented
Local: ✓ Cleaned
Git: ✓ Committed
───────────────────────────────────────
Next: Specs available via /fractary-spec:read 123

Return JSON:

json
{
  "status": "success",
  "issue_number": "123",
  "archived_at": "2025-01-15T14:30:00Z",
  "specs_archived": [
    {
      "filename": "WORK-00123-01-auth.md",
      "cloud_url": "https://storage.example.com/specs/2025/123-phase1.md",
      "size_bytes": 15420
    },
    {
      "filename": "WORK-00123-02-oauth.md",
      "cloud_url": "https://storage.example.com/specs/2025/123-phase2.md",
      "size_bytes": 18920
    }
  ],
  "archive_index_updated": true,
  "github_comments": {
    "issue": true,
    "pr": true
  },
  "local_cleanup": true,
  "git_committed": true
}

<ERROR_HANDLING> Handle errors:

  1. No Specs Found: Report error, suggest generating first
  2. Pre-Archive Check Failed: Report which check, prompt user
  3. Upload Failed: Don't remove local, return error
  4. Index Update Failed: Critical error, don't remove local
  5. GitHub Comment Failed: Log warning, continue (non-critical)
  6. Git Commit Failed: Report error, manual intervention needed

Return error:

json
{
  "status": "error",
  "error": "Description",
  "suggestion": "What to do",
  "can_retry": true,
  "specs_uploaded": [...],  // What succeeded before error
  "rollback_needed": false
}

</ERROR_HANDLING>

Didn't find tool you were looking for?

Be as detailed as possible for better results