| name | archive |
| description | Phase 3: merge spec/design deltas, code review, atomic commits, push, and trigger self-evolution |
| argument-hint | <feature-id e.g. F001> |
Archive โ Merge, Review, Commit & Evolve
You are finalizing a completed feature: merging incremental specs back into the full documents, running a final code review, making clean commits, and triggering self-evolution.
Parameter: $ARGUMENTS โ feature ID (e.g. F001)
Step 1: Verify Prerequisites
cat .harness/evidence/${FEATURE_ID}/verdict.md 2>/dev/null
The feature must be verified (verdict = PASS) before archiving. If not verified โ suggest running /verify first.
Step 2: Merge Spec & Design Deltas
2.1 Merge Spec Delta into Full Spec
Read .harness/specs/{FXXX}-*.md (the incremental spec).
Read .harness/full-spec.md (the full project spec, if exists).
Merge the feature spec into the full spec:
- Add the feature to the "Existing Features" section
- Update "Module Inventory" if new modules were created
- Update "Architecture Summary" if architecture changed
- Preserve all existing content, only ADD the new feature
If conflicts detected (e.g., feature contradicts existing spec), present to user for resolution.
2.2 Merge Design Delta into Full Design
Read .harness/designs/{FXXX}-*.md (if exists).
Read .harness/full-design.md (if exists).
Merge similarly: add new components, update dependency graph, add new data models.
Step 3: Final Code Review
Launch a comprehensive code review sub-agent:
Agent(subagent_type: "code-reviewer", run_in_background: true,
prompt: "Final code review for feature {FXXX}.
Review ALL files changed for this feature:
git diff {base_commit}..HEAD -- {files from tasks.md}
Check:
1. Code quality: naming, readability, complexity
2. Error handling: no swallowed errors, proper messages
3. Security: no hardcoded secrets, input validation
4. Immutability: no mutation of shared state
5. Style consistency: matches project conventions
Report: CRITICAL / HIGH / MEDIUM issues only.
Ignore cosmetic issues.")
Read the review. If CRITICAL issues โ fix before proceeding. HIGH issues โ fix or acknowledge.
Step 4: Style Unification
If a lint/format command is configured:
{lint_command} --fix 2>&1
{format_command} 2>&1
Commit style fixes separately: chore(style): unify code style for {FXXX}
Step 5: Atomic Commit Splitting
Review the git history for this feature. If commits are messy or mixed:
- Identify logical units of change
- Suggest splitting into clean, atomic commits:
- One commit per logical unit (e.g., "add auth middleware", "add login endpoint", "add login tests")
- Each commit should build and pass tests independently
Present the commit plan to user:
"ๅฝๅๆ {N} ไธช commitsใๅปบ่ฎฎๆด็ไธบ {M} ไธชๅๅญ commits: {list}ใๆฏๅฆๅๆ๏ผ"
If user agrees, execute interactive rebase (only if user explicitly approves).
Step 6: Push & MR
git push origin {current_branch}
Ask user:
"ไปฃ็ ๅทฒๆจ้ใๆฏๅฆ้่ฆๅๅปบ MR/PR๏ผ"
If yes:
gh pr create --title "feat({FXXX}): {feature name}" --body "$(cat <<'EOF'
## Summary
{feature description}
## Changes
{list of key changes}
## Test Evidence
- V1 (Unit): โ
{pass count}/{total}
- V2 (Integration): โ
{pass count}/{total}
- V3 (E2E): โ
{pass count}/{total}
- Evaluation Score: {score}/10
## Evidence
See `.harness/evidence/{FXXX}/` for full reports.
EOF
)"
Step 7: Update Evolution Data
Record this iteration for self-evolution analysis:
Append to .harness/evolution/memory.jsonl:
{"iteration": N, "feature": "FXXX", "name": "{feature name}", "date": "{ISO}", "complexity": "{complexity}", "waves": M, "tasks": K, "eval_score": X.X, "lessons": [], "process_improvements": []}
Update config iteration count:
"evolution": { "iteration_count": N+1 }
Step 8: Trigger Self-Evolution (if iteration_count โฅ 2)
If this is the 2nd or later feature completed, ask:
"ๅทฒๅฎๆ {N} ไธช feature ่ฟญไปฃใๆฏๅฆ่ฆ่ฟ่ก่ช่ฟๅๅๆ๏ผๆฃๆฅๆจกๆฟๅๆต็จๆฏๅฆ้่ฆไผๅ๏ผ๏ผ"
If user agrees โ execute /evolve logic.
Next Step โ Auto-Navigate
๐ SDD ่ฟๅบฆ โ {FXXX}: {feature name}
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
proposal โ โ
tdd-align โ โ
decompose โ โ
sprint โ โ
evaluate โ โ
verify โ โ
archive
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Feature {FXXX}: {feature name} ๅทฒๅฎๆๅ
จ้จ SDD ๆต็จ๏ผ
่ฏไผฐๅพๅ: {score}/10 | ไปปๅก: {completed}/{total} | Waves: {M}
"Feature ๅทฒๅฝๆกฃๅฎๆใๆฏๅฆ่ฆๅผๅงไธไธไธช Feature๏ผ"