Skill: close
Transition a story from done to archived with retrospective and knowledge extraction.
Inputs
- Story file: Path to a
.swarm/backlog/{ID}.mdfile indonestatus
Steps
Step 1: Read Context
- Read
.swarm/config.mdfor project conventions. - Read the story file — gather all tasks, ACs, mini-retrospectives.
- Read the WoW to check if knowledge_extraction is enabled.
Step 2: Compute Metrics
- Count tasks: total, completed, skipped.
- Count ACs: total, passing, failing.
- Count files changed (via
git diff --stator similar). - Count tests added.
- Calculate cycle time from
execution.started_attoexecution.completed_at.
Step 3: Extract Learnings per Agent
- Parse each mini-retrospective from the story body.
- Consolidate "What worked", "What to remember", and "Suggestion" items.
- Group learnings by agent.
Step 4: Generate Retrospective
- Create the retrospective file at
.swarm/retrospectives/{ID}-retro.md. - Fill in the template with:
- Summary of what was accomplished
- What went well / what could improve
- Key decisions table
- Effort analysis table
- Learnings by agent
- Knowledge items extracted (with dimension, scope, and title)
- Update the retrospective frontmatter with metrics and
knowledge_extractedreferences.
Step 5: Extract Knowledge Items
Use the swarm_extract_knowledge tool with:
retro_path: absolute path to.swarm/retrospectives/${STORY_ID}-retro.mdstory_id: the story IDrepo: the repository name
This produces structured knowledge items at .swarm/knowledge/. Review the result for the list of created files.
Step 6: Update Agent Memory
- For each agent involved, append key learnings to
.claude/agent-memory/{agent}/MEMORY.md. - Include patterns, gotchas, and decisions relevant to that agent's role.
Step 7: Transition to Archived
Use the swarm_transition tool with path set to the absolute path of .swarm/backlog/${STORY_ID}.md and target_status set to archived.
Then move the story file:
- Move the story file from
.swarm/backlog/{ID}.mdto.swarm/archive/{ID}.md. - Update the
updatedtimestamp.
Step 8: List Knowledge Items
Use the swarm_list tool with directory set to the absolute path of .swarm/knowledge to verify extracted knowledge.
Outputs
- Retrospective file:
.swarm/retrospectives/{ID}-retro.md - Knowledge item files:
.swarm/knowledge/{ID}-{N}.md(one per extracted item) - Updated agent memory files
- Archived story:
.swarm/archive/{ID}.md - Story status:
archived
