AgentSkillsCN

sprint-closure

how-to-work 第2步:梳理需求并明确范围。

SKILL.md
--- frontmatter
name: sprint-closure
description: Sprint closure patterns for archiving, lesson capture, report consolidation, and retrospective generation. Use at end of sprint cycle.
triggers:
  [
    "close sprint",
    "sprint retrospective",
    "archive sprint",
    "lessons learned",
    "sprint closure",
  ]
version: 1.0
last_updated: 2025-12-24

Sprint Closure Skill

Patterns and templates for comprehensive sprint closure workflow.

When to Use

  • End of sprint cycle (before retrospective meeting)
  • Archiving sprint artifacts
  • Capturing and integrating lessons learned
  • Generating consolidated reports

Report Types Inventory

Sprint closure discovers and consolidates these report types:

Report TypeLocationPurpose
PR Reviewsreports/pr-reviews/Code review findings
Test Qualityreports/test-quality/TDD compliance
Security Auditsreports/security-audit/OWASP findings
QA Reportsreports/qa/Quality assurance
Architecturetasks/sprints/*/Design decisions
Researchtasks/research/Technical investigations

LESSONS-LEARNED.md Structure

Header (create if not exists):

markdown
# Lessons Learned (Living Document)

Last updated: [YYYY-MM-DD] (Sprint [N] closure)

## Status Legend

- ✅ **PROCESSED** - Fully implemented, no action needed
- ⚠️ **PARTIAL** - Partially implemented, ongoing work
- ❌ **TODO** - Identified but not yet implemented

Lesson Format (Full Detail for Current Sprint):

markdown
### Lesson: [Descriptive Title]

**Discovered in:** Sprint [N] ([context])
**What we learned:**
[Description of the lesson]

**Implementation:**

- ✅ **Code:** [specific file paths or N/A]
- ✅ **Tests:** [test file paths or patterns]
- ✅ **Docs:** [documentation file paths]
- ✅ **Skills:** [skill file paths]
- ✅ **Commands:** [command file paths]

**Status:** ✅ PROCESSED | ⚠️ PARTIAL | ❌ TODO
**Sprint:** [N]

Compression Rules (Phase 4.0)

Before adding new sprint lessons, compress previous PROCESSED lessons:

BEFORE (15-20 lines):

markdown
### Lesson: Test Immutability Prevents Test Cheating

**Discovered in:** Sprint 2 (Backend development, day-02)
**What we learned:**
LLM agents may delete tests instead of fixing code when tests fail...
[full details]

**Implementation:**

- ✅ **Code:** N/A (process change)
- ✅ **Tests:** All tests committed separately...
- ✅ **Docs:** `docs/TDD-WORKFLOW.md`...
  ...

**Status:** ✅ PROCESSED
**Sprint:** 2

AFTER (4-5 lines):

markdown
### Lesson: Test Immutability Prevents Test Cheating

Commit tests separately in RED phase makes them immutable. Any modification during GREEN/REFACTOR is visible in git history.
**WHERE:** docs/TDD-WORKFLOW.md, .claude/skills/tdd-workflow/, red-tdd/green-tdd/refactor-tdd commands
**STATUS:** ✅ PROCESSED | **SPRINT:** 2

Compression Criteria:

  • ✅ PROCESSED lessons from Sprint < N → Compress
  • ⚠️ PARTIAL lessons → Keep full detail (action items remain)
  • ❌ TODO lessons → Keep full detail (not yet implemented)

Retrospective Template

markdown
# Sprint [N] Retrospective

**Date:** [YYYY-MM-DD]
**Duration:** [Start] to [End]

## Sprint Goal

[Extract from planning or infer from artifacts]

## What Went Well ✅

- High test coverage: [percentage]%
- Security score: [before] → [after]
- [Other positive outcomes]

## What Didn't Go Well ❌

- Time estimation: [planned] vs [actual]
- [Challenges encountered]

## Metrics 📊

| Category           | Value   | Target  | Status |
| ------------------ | ------- | ------- | ------ |
| Test Coverage      | [X]%    | 80%/75% | ✅/❌  |
| Security Score     | [X]/100 | 90      | ✅/❌  |
| Features Completed | [X]/[Y] | 100%    | ✅/❌  |

## Action Items for Next Sprint

| Action | Owner | Priority     | Category   |
| ------ | ----- | ------------ | ---------- |
| [Item] | [Who] | High/Med/Low | [Category] |

## Lessons Learned Summary

[Top 5 lessons with links to LESSONS-LEARNED.md]

Archive Directory Structure

code
tasks/archive/[YYYY-MM]/sprint-[N]/
├── README.md                    # Sprint summary
├── RETROSPECTIVE-[date].md      # Retrospective
└── [daily directories]          # Preserved from sprint
    ├── tests/
    ├── implementation/
    ├── refactor/
    └── security/

Report Summary Templates

QA Summary:

markdown
# QA Summary - Sprint [N]

## Test Quality Metrics

| Criterion        | Violations | Resolution |
| ---------------- | ---------- | ---------- |
| Business logic   | [count]    | [status]   |
| Assertions       | [count]    | [status]   |
| Error paths      | [count]    | [status]   |
| Edge cases       | [count]    | [status]   |
| Behavior testing | [count]    | [status]   |

Security Summary:

markdown
# Security Summary - Sprint [N]

## OWASP Top 10 Coverage

| Category            | Status | Findings |
| ------------------- | ------ | -------- |
| A01 Broken Access   | ✅/❌  | [count]  |
| A02 Crypto Failures | ✅/❌  | [count]  |

...

## Risk Register

| Severity | Count | Resolved | Deferred |
| -------- | ----- | -------- | -------- |
| CRITICAL | [X]   | [Y]      | [Z]      |
| HIGH     | [X]   | [Y]      | [Z]      |

Integration Workflow (Phase 4.5)

After adding lessons to LESSONS-LEARNED.md:

  1. Identify affected files using .claude/LESSONS-INTEGRATION.md
  2. Add references to skills/commands (embedded <10 lines, link >30 lines)
  3. Update integration map in .claude/LESSONS-INTEGRATION.md
  4. Validate integration:
    bash
    grep -r "LESSONS-LEARNED.md#" .claude/ app/CLAUDE.md
    

Lesson Categories

CategoryExample Topics
TDD WorkflowTest immutability, 5 criteria, RED/GREEN/REFACTOR
Multi-WorktreeDatabase isolation, schema ownership, port mapping
Security PatternsBackend permissions, OWASP, input validation
ArchitectureStrategy Pattern, type safety, permission helpers
Test QualityMock patterns, integration vs unit, coverage
ToolingWasp 0.20.1, safe-start, db-manager
ProcessPhased commands, artifact tracking, sprintdag
Anti-PatternsClient-side auth, useAction overuse, test theater

References

  • Command: /close-sprint (complete orchestration)
  • Integration map: .claude/LESSONS-INTEGRATION.md
  • Living document: docs/LESSONS-LEARNED.md