jdd-sprint-kit 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +253 -0
  3. package/bin/cli.js +48 -0
  4. package/compat/baseline.json +6 -0
  5. package/package.json +40 -0
  6. package/src/commands/compat-check.js +178 -0
  7. package/src/commands/init.js +267 -0
  8. package/src/commands/update.js +132 -0
  9. package/src/lib/adapters/codex.js +68 -0
  10. package/src/lib/copy.js +131 -0
  11. package/src/lib/detect.js +81 -0
  12. package/src/lib/fingerprint.js +152 -0
  13. package/src/lib/manifest.js +51 -0
  14. package/src/lib/merge.js +109 -0
  15. package/src/lib/prompts.js +196 -0
  16. package/templates/.claude/agents/auto-sprint.md +882 -0
  17. package/templates/.claude/agents/brownfield-scanner.md +259 -0
  18. package/templates/.claude/agents/deliverable-generator.md +429 -0
  19. package/templates/.claude/agents/judge-business.md +91 -0
  20. package/templates/.claude/agents/judge-quality.md +82 -0
  21. package/templates/.claude/agents/judge-security.md +80 -0
  22. package/templates/.claude/agents/scope-gate.md +219 -0
  23. package/templates/.claude/agents/worker.md +82 -0
  24. package/templates/.claude/commands/circuit-breaker.md +106 -0
  25. package/templates/.claude/commands/parallel.md +110 -0
  26. package/templates/.claude/commands/preview.md +85 -0
  27. package/templates/.claude/commands/specs.md +206 -0
  28. package/templates/.claude/commands/sprint.md +552 -0
  29. package/templates/.claude/commands/summarize-prd.md +290 -0
  30. package/templates/.claude/commands/validate.md +143 -0
  31. package/templates/.claude/hooks/desktop-notify.sh +9 -0
  32. package/templates/.claude/hooks/protect-readonly-paths.sh +42 -0
  33. package/templates/.claude/hooks/sprint-pre-compact.sh +42 -0
  34. package/templates/.claude/hooks/sprint-session-recovery.sh +33 -0
  35. package/templates/.claude/rules/bmad-mcp-search.md +97 -0
  36. package/templates/.claude/rules/bmad-sprint-guide.md +176 -0
  37. package/templates/.claude/rules/bmad-sprint-protocol.md +178 -0
  38. package/templates/.claude/settings.json +50 -0
  39. package/templates/.mcp.json.example +16 -0
  40. package/templates/_bmad/docs/architecture-to-epics-checklist.md +59 -0
  41. package/templates/_bmad/docs/blueprint-format-guide.md +387 -0
  42. package/templates/_bmad/docs/brownfield-context-format.md +167 -0
  43. package/templates/_bmad/docs/prd-format-guide.md +538 -0
  44. package/templates/_bmad/docs/sprint-input-format.md +496 -0
  45. package/templates/preview-template/.redocly.yaml +10 -0
  46. package/templates/preview-template/api/.gitkeep +0 -0
  47. package/templates/preview-template/index.html +12 -0
  48. package/templates/preview-template/package-lock.json +5547 -0
  49. package/templates/preview-template/package.json +33 -0
  50. package/templates/preview-template/public/mockServiceWorker.js +307 -0
  51. package/templates/preview-template/src/App.tsx +9 -0
  52. package/templates/preview-template/src/api/client.ts +32 -0
  53. package/templates/preview-template/src/components/.gitkeep +0 -0
  54. package/templates/preview-template/src/components/DevPanel.tsx +76 -0
  55. package/templates/preview-template/src/main.tsx +26 -0
  56. package/templates/preview-template/src/mocks/browser.ts +4 -0
  57. package/templates/preview-template/src/mocks/handlers.ts +3 -0
  58. package/templates/preview-template/src/pages/.gitkeep +0 -0
  59. package/templates/preview-template/src/vite-env.d.ts +1 -0
  60. package/templates/preview-template/tsconfig.json +21 -0
  61. package/templates/preview-template/vite.config.ts +6 -0
@@ -0,0 +1,290 @@
1
+ ---
2
+ name: summarize-prd
3
+ description: 'Summarize and analyze a PRD document, collect feedback, and edit the original PRD. Use the analyze subcommand for PRD analysis. Pass the project folder name as an argument.'
4
+ ---
5
+
6
+ # /summarize-prd — PRD Summary, Analysis & Edit
7
+
8
+ > **Dispatch Target**: None (direct CLI execution, no sub-agent delegation)
9
+
10
+ ## Purpose
11
+
12
+ Summarize and analyze PRD documents in `prd/`, then **directly edit the original PRD file** based on user feedback.
13
+
14
+ ## When to Use
15
+
16
+ When you need to summarize, analyze, or edit a PRD document.
17
+
18
+ ## Inputs
19
+
20
+ Parse `$ARGUMENTS`:
21
+ - `$ARGUMENTS[0]`: project-name or `help`
22
+ - `$ARGUMENTS[1]`: optional `analyze`
23
+
24
+ Formats:
25
+ - `<project-name>` → Default Mode (summary → feedback → edit original)
26
+ - `<project-name> analyze` → Analyze Mode (summary + PRD analysis → feedback → edit original)
27
+ - `help` → Help Mode (usage instructions)
28
+
29
+ If argument is `help` → **Help Mode**. If last argument is `analyze` → **Analyze Mode**. Otherwise → **Default Mode**.
30
+
31
+ ## Procedure
32
+
33
+ Load config per Language Protocol in bmad-sprint-guide.md.
34
+
35
+ ### Help Mode
36
+
37
+ If argument is `help`, output the following (in {communication_language}) and exit.
38
+
39
+ ```
40
+ /summarize-prd Usage
41
+
42
+ Summarize a PRD document, collect feedback, and edit the original PRD.
43
+
44
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
45
+
46
+ Usage:
47
+ /summarize-prd <project-name> Default mode
48
+ /summarize-prd <project-name> analyze Analyze mode
49
+ /summarize-prd help This help
50
+
51
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
52
+
53
+ Default Mode
54
+ Summarize the PRD, then collect feedback to directly edit the original PRD.
55
+
56
+ Flow: Select PRD → Summary output → Feedback → Edit original → Repeat → Done
57
+
58
+ Example:
59
+ /summarize-prd trial-lesson-flow
60
+
61
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
62
+
63
+ Analyze Mode (analyze)
64
+ Outputs a PRD analysis report in addition to the summary.
65
+ Auto-reviews internal conflicts, ambiguous definitions, missing edge cases, etc.
66
+
67
+ Analysis items:
68
+ 1. Internal conflicts - Contradictory content between sections
69
+ 2. Ambiguous definitions - Vague expressions like TBD, "appropriate"
70
+ 3. Missing edge cases - Unhandled error/state combinations
71
+ 4. Success metric issues - Unmeasurable metrics
72
+ 5. Priority/dependency - P0 depending on P1, etc.
73
+ 6. Technical risks - Concurrency, API design gaps, etc.
74
+
75
+ Severity: CRITICAL | WARNING | INFO
76
+
77
+ Example:
78
+ /summarize-prd trial-lesson-flow analyze
79
+
80
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
81
+
82
+ Feedback Loop (shared by Default/Analyze)
83
+ After summary (+analysis) output, your feedback directly edits the original PRD.
84
+ A preview is shown before applying changes, requiring your approval.
85
+ Enter "done" to finish.
86
+
87
+ Feedback examples:
88
+ - "Fix the conflict issue #1 from the analysis report"
89
+ - "Add DAU metric to success metrics"
90
+ - "Change the error message in FR17"
91
+ - "Make the reservation failure UX policy more specific"
92
+ ```
93
+
94
+ ### Common Steps
95
+
96
+ #### 1. Verify Project Folder
97
+
98
+ If project folder name is empty, list projects in `prd/` and ask for selection (in {communication_language}).
99
+
100
+ Verify that `prd/<project-name>/` folder exists. If not, list projects in `prd/` and guide to the correct name (in {communication_language}).
101
+
102
+ #### 2. Select PRD File
103
+
104
+ List all `.md` files in the folder and **confirm which file is the latest PRD** (in {communication_language}).
105
+
106
+ #### 3. Read and Summarize PRD
107
+
108
+ Read the user-specified file and summarize with the following structure (in {document_output_language}):
109
+
110
+ ```markdown
111
+ # [Project Name] PRD Summary
112
+
113
+ ## One-Line Summary
114
+ [Core purpose of the project in one sentence]
115
+
116
+ ## Background & Intent
117
+ - Why this project is needed
118
+ - Core problem being solved
119
+
120
+ ## Key Features (by priority)
121
+
122
+ ### MVP (P0)
123
+ - Feature 1: description
124
+ - Feature 2: description
125
+
126
+ ### MVP (P1)
127
+ - Feature 3: description
128
+
129
+ ### Growth Phase
130
+ - Feature 4: description
131
+
132
+ ## Success Metrics
133
+ | Metric | Current | Target |
134
+ |--------|---------|--------|
135
+ | Metric name | Current value | Target value |
136
+
137
+ ## Technical Considerations
138
+ - Key technical issues or constraints
139
+
140
+ ## MVP Scope vs Follow-up
141
+ - What's included in MVP / what's excluded (summary)
142
+ ```
143
+
144
+ ### Default Mode
145
+
146
+ After summary output, enter **Feedback Loop** immediately.
147
+
148
+ ### Analyze Mode
149
+
150
+ After summary output, **output PRD analysis report** then enter Feedback Loop.
151
+
152
+ #### Analysis Report Writing
153
+
154
+ Thoroughly review the full PRD and find issues per category. Mark categories with no issues as "No issues found."
155
+
156
+ ```markdown
157
+ # PRD Analysis Report
158
+
159
+ ## 1. Internal Conflicts
160
+ Find contradictory or conflicting content within the document.
161
+ - Section A says X, but Section B says Y
162
+ - Numbers/conditions differ across sections
163
+ - Priorities stated differently across sections
164
+
165
+ Example:
166
+ > WARNING: **[Conflict]** Executive Summary says "reservation period +2 days", but
167
+ > FR4-1 says "3 days including today". Same policy but confusing expression.
168
+ > Location: Executive Summary vs FR4-1
169
+
170
+ ## 2. Ambiguous or Unclear Definitions
171
+ Find vague expressions that make development/QA judgment difficult.
172
+ - Unclear expressions like "appropriate", "as needed", "etc."
173
+ - Requirements missing specific values/conditions
174
+ - Items remaining as TBD
175
+
176
+ Example:
177
+ > WARNING: **[Ambiguous]** FR3 says "specific image assets require further discussion (TBD)".
178
+ > Must be finalized before development starts.
179
+ > Location: FR3
180
+
181
+ ## 3. Missing Edge Cases / Omitted Scenarios
182
+ Find unhandled cases in documented flows.
183
+ - Missing error/failure scenarios
184
+ - Unaddressed user state combinations
185
+ - Concurrency/timing issues
186
+
187
+ Example:
188
+ > WARNING: **[Missing]** When network disconnects right after reservation completion,
189
+ > server sees success but client perceives failure — this case is not in test scenarios.
190
+ > Location: QA Considerations > Test Scenarios
191
+
192
+ ## 4. Success Metrics / Measurability Issues
193
+ Review realism of target numbers and specificity of measurement methods.
194
+ - Metrics with unclear measurement methods
195
+ - Metrics lacking current values to judge achievement
196
+ - Misaligned causal relationships between metrics
197
+
198
+ ## 5. Priority / Dependency Issues
199
+ Find problems with feature dependencies or priority placement.
200
+ - P0 feature depending on P1 feature
201
+ - Growth Phase features conflicting with MVP features
202
+ - Features that should come first but are placed later
203
+
204
+ ## 6. Technical Risks
205
+ Find implementation concerns.
206
+ - Inadequate concurrency/race condition handling
207
+ - Gap between performance targets and feature complexity
208
+ - Missing parts of API design
209
+
210
+ ## Summary
211
+
212
+ | Severity | Count | Key Issues |
213
+ |----------|-------|------------|
214
+ | CRITICAL (must fix) | N | ... |
215
+ | WARNING (recommend fix) | N | ... |
216
+ | INFO (can improve) | N | ... |
217
+ ```
218
+
219
+ ### Feedback Loop
220
+
221
+ #### 5. Request Feedback
222
+
223
+ After summary (+ analysis report in Analyze Mode) output, request feedback for editing the original PRD (in {communication_language}).
224
+
225
+ ```
226
+ ---
227
+ If there are parts to modify/improve in the original PRD, please provide feedback.
228
+ If none, enter "done".
229
+
230
+ Examples:
231
+ - "Fix the conflict issue #1 from the analysis report"
232
+ - "Success metrics are missing DAU. Add it."
233
+ - "Reservation failure UX policy is vague. Make it specific."
234
+ - "Change the error message in FR17 requirement."
235
+ ```
236
+
237
+ #### 6. Edit Original PRD
238
+
239
+ When user provides feedback:
240
+
241
+ 1. **Find the relevant section in the original PRD file.**
242
+ - Read the original PRD file selected in step 2 to locate the edit target.
243
+
244
+ 2. **Show edit preview** (in {communication_language}):
245
+ ```
246
+ Edit target: prd/<project-name>/<filename>
247
+
248
+ Changes:
249
+ - (before) ...
250
+ + (after) ...
251
+
252
+ Apply these changes?
253
+ ```
254
+
255
+ 3. **Edit the original file after user approval.**
256
+ - On approval: edit the original PRD file using the Edit tool.
257
+ - On rejection: collect additional feedback on the edit direction.
258
+
259
+ 4. **Request feedback again after edit** (in {communication_language}):
260
+ ```
261
+ ---
262
+ Original PRD has been updated.
263
+ If there are more parts to modify, please provide feedback. If none, enter "done".
264
+ ```
265
+
266
+ Repeat this process until user enters "done".
267
+
268
+ #### 7. Completion
269
+
270
+ Output (in {communication_language}):
271
+ ```
272
+ PRD editing complete.
273
+ Modified file: prd/<project-name>/<filename>
274
+ ```
275
+
276
+ ## Outputs
277
+
278
+ - Modified PRD file: `prd/<project-name>/<filename>`
279
+
280
+ ## Constraints
281
+
282
+ 1. **Always cite evidence.** Specify the exact location in the original PRD (section name, FR number, table, etc.) with a `Location:` marker.
283
+ 2. **Classify severity.**
284
+ - CRITICAL: Conflicts/omissions that must be resolved before development
285
+ - WARNING: Should fix, but development can proceed
286
+ - INFO: Suggestions for quality improvement
287
+ 3. **Provide fix suggestions.** Don't just point out problems — concretely suggest how to fix them.
288
+ 4. **Don't force issues.** Mark categories with genuinely no problems as "No issues found."
289
+
290
+ $ARGUMENTS
@@ -0,0 +1,143 @@
1
+ ---
2
+ description: "Entropy-based 3-Phase verification pipeline (Auto + AI Judge + Visual)"
3
+ ---
4
+
5
+ # /validate — Multi-Phase Verification Pipeline
6
+
7
+ > **Dispatch Target**: `@judge-quality` + `@judge-security` + `@judge-business` (parallel)
8
+
9
+ ## Purpose
10
+
11
+ A multi-dimensional verification pipeline that adjusts verification density based on Entropy Tolerance.
12
+
13
+ ## When to Use
14
+
15
+ After Worker implementation is complete. Run after PARALLEL completion + merge.
16
+
17
+ ## Inputs
18
+
19
+ `$ARGUMENTS`: not used
20
+
21
+ Prerequisites:
22
+ - PARALLEL complete: all Worker tasks done
23
+ - Code merged into main branch
24
+ - Build succeeds
25
+
26
+ ## Procedure
27
+
28
+ Load config per Language Protocol in bmad-sprint-guide.md.
29
+
30
+ ### Phase 1: Automated Verification (all tasks)
31
+ Applied to all Entropy levels:
32
+
33
+ ```bash
34
+ npm run lint
35
+ npm run type-check
36
+ npm run test
37
+ npm run build
38
+ ```
39
+
40
+ Phase 1 failure → request fix from file's owning Worker → re-run Phase 1 after fix
41
+
42
+ ### Phase 2: AI Judge Verification (Medium + Low Entropy)
43
+ Run Judge agents in parallel. Pass each Judge:
44
+ - `changed_files`: result of `git diff --name-only {base_branch}...HEAD`
45
+ - `feature_dir`: `specs/{feature}/`
46
+ - `brownfield_path`: `specs/{feature}/brownfield-context.md`
47
+
48
+ 1. **Code Quality Judge** (`judge-quality`):
49
+ - Code structure, patterns, duplication
50
+ - Project convention compliance
51
+ - **Existing codebase pattern compliance** (based on configured client-docs MCP)
52
+ - Specmatic API contract final verification
53
+
54
+ 2. **Security Judge** (`judge-security`):
55
+ - OWASP Top 10 vulnerability check
56
+ - Injection, XSS, auth bypass
57
+ - **Consistency with existing auth/permission patterns** (based on configured backend-docs MCP)
58
+
59
+ 3. **Business Logic Judge** (`judge-business`):
60
+ - Implementation verification against BMad PRD acceptance criteria
61
+ - Architecture ADR compliance
62
+ - **Alignment with existing domain policies/customer journeys** (based on configured backend-docs, svc-map MCP)
63
+
64
+ **Low Entropy tasks**: Judges operate in Adversarial mode — thorough review, findings classified by severity:
65
+ - `CRITICAL`: Functional failure or security vulnerability. Must fix.
66
+ - `HIGH`: Design violation or performance issue. Must fix.
67
+ - `SUGGESTION`: Style, refactoring suggestions. Record only, does not block.
68
+
69
+ **Adversarial exit condition**: PASS when 0 new CRITICAL/HIGH findings. SUGGESTION-only means pass.
70
+
71
+ Judge invocation — **must invoke all 3 Tasks simultaneously in a single response**:
72
+ ```
73
+ Task(subagent_type: "judge-quality", model: "sonnet")
74
+ prompt: "Read .claude/agents/judge-quality.md and follow it.
75
+ changed_files: {changed_files}
76
+ feature_dir: specs/{feature}/
77
+ brownfield_path: specs/{feature}/brownfield-context.md"
78
+
79
+ Task(subagent_type: "judge-security", model: "sonnet")
80
+ prompt: "Read .claude/agents/judge-security.md and follow it.
81
+ changed_files: {changed_files}
82
+ feature_dir: specs/{feature}/
83
+ brownfield_path: specs/{feature}/brownfield-context.md"
84
+
85
+ Task(subagent_type: "judge-business", model: "sonnet")
86
+ prompt: "Read .claude/agents/judge-business.md and follow it.
87
+ changed_files: {changed_files}
88
+ feature_dir: specs/{feature}/
89
+ brownfield_path: specs/{feature}/brownfield-context.md
90
+ sprint_input_path: specs/{feature}/inputs/sprint-input.md"
91
+ ```
92
+ → Collect all 3 results
93
+ → Critical finding present → FAIL
94
+ → Classify each finding's `failure_source`:
95
+ - `local`: Worker can fix (code bugs, test failures, etc.)
96
+ - `upstream:architecture`: Architecture ADR violation, design mismatch
97
+ - `upstream:prd`: PRD AC contradiction, requirements conflict
98
+ → `local` findings → request Worker fix → re-run only affected Judge
99
+ → `upstream` findings → forward to Circuit Breaker (include failure_source)
100
+
101
+ ### Phase 3: Visual Verification (UI-related tasks)
102
+ Applied only to tasks with UI:
103
+ 1. Visual regression check against BMad UX Design
104
+ 2. **Change verification against existing service map screens** (configured svc-map MCP screenshots)
105
+ 3. **Match verification against latest Figma design mockups** (`figma` MCP)
106
+ 4. Responsive design check
107
+ 5. Basic accessibility check
108
+
109
+ ### Entropy-Based Phase Matrix
110
+
111
+ | Entropy | Phase 1 | Phase 2 | Phase 3 |
112
+ |---------|---------|---------|---------|
113
+ | High | O | - | - |
114
+ | Medium | O | O | (if UI) |
115
+ | Low | O | O (Adversarial) | (if UI) |
116
+
117
+ ## Constraints
118
+
119
+ ### Fix Process
120
+ After `/parallel` completion, Workers are inactive. On verification failure, follow this procedure:
121
+ 1. Judge generates failure report (file path + line number + severity + fix suggestion)
122
+ 2. **Create new fix tasks** (TaskCreate) per failed task
123
+ 3. Re-run small-scale `/parallel` for fix implementation
124
+ 4. Re-run `/validate` for re-verification
125
+
126
+ ### Retry Limits
127
+ - Max **5 iterations** of the above cycle
128
+ - Adversarial mode (Low Entropy): failure determined by CRITICAL/HIGH only. SUGGESTIONs do not count toward loop
129
+ - **5 cumulative failures** or **3 consecutive failures in same category** → Circuit Breaker auto-triggers
130
+ - On Circuit Breaker trigger → run `/circuit-breaker`
131
+
132
+ ## Outputs
133
+ Verification result report:
134
+ ```markdown
135
+ ## VALIDATE Report: {feature}
136
+ - Phase 1 (Auto): PASS/FAIL — [details]
137
+ - Phase 2 (Judge): PASS/FAIL — [X critical, Y warnings]
138
+ - Failure Sources: {N} local, {M} upstream
139
+ - Phase 3 (Visual): PASS/FAIL/SKIP
140
+ - **Overall: PASS/FAIL**
141
+ - **Upstream Issues** (if any):
142
+ - {finding} → failure_source: upstream:{stage} → suggested_fix: {fix}
143
+ ```
@@ -0,0 +1,9 @@
1
+ #!/bin/bash
2
+ # Notification hook: Send desktop notification when Claude needs user input
3
+ # macOS only — JP1/JP2 대기 시 사용자에게 알림
4
+
5
+ if [[ "$(uname)" == "Darwin" ]]; then
6
+ osascript -e 'display notification "Claude Code needs your attention" with title "JDD Sprint Kit"' 2>/dev/null
7
+ fi
8
+
9
+ exit 0
@@ -0,0 +1,42 @@
1
+ #!/bin/bash
2
+ # PreToolUse(Write|Edit) hook: Block writes to read-only paths
3
+ # Sprint 원본 입력 파일과 BMad 설정 파일을 보호
4
+
5
+ INPUT=$(cat)
6
+ FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty')
7
+
8
+ if [ -z "$FILE_PATH" ]; then
9
+ exit 0
10
+ fi
11
+
12
+ # Protected patterns
13
+ case "$FILE_PATH" in
14
+ */specs/*/inputs/*)
15
+ # Extract feature dir from path: specs/{feature}/inputs/...
16
+ FEATURE_DIR=$(echo "$FILE_PATH" | sed -n 's|.*/specs/\([^/]*\)/inputs/.*|\1|p')
17
+ SPRINT_INPUT="specs/${FEATURE_DIR}/inputs/sprint-input.md"
18
+ # Allow writes before Phase 0 completes (sprint-input.md not yet generated)
19
+ if [ -n "$FEATURE_DIR" ] && [ -f "$SPRINT_INPUT" ]; then
20
+ jq -n '{
21
+ hookSpecificOutput: {
22
+ hookEventName: "PreToolUse",
23
+ permissionDecision: "deny",
24
+ permissionDecisionReason: "specs/*/inputs/ is read-only after Phase 0. sprint-input.md already exists."
25
+ }
26
+ }'
27
+ exit 0
28
+ fi
29
+ ;;
30
+ */_bmad/_config/*)
31
+ jq -n '{
32
+ hookSpecificOutput: {
33
+ hookEventName: "PreToolUse",
34
+ permissionDecision: "deny",
35
+ permissionDecisionReason: "_bmad/_config/ is read-only. Agent manifest and config must not be modified during Sprint."
36
+ }
37
+ }'
38
+ exit 0
39
+ ;;
40
+ esac
41
+
42
+ exit 0
@@ -0,0 +1,42 @@
1
+ #!/bin/bash
2
+ # PreCompact hook: Save active Sprint state before compaction
3
+ # Sprint 진행 중 auto-compaction 발생 시 상태를 recovery 파일에 저장
4
+
5
+ INPUT=$(cat)
6
+ CWD=$(echo "$INPUT" | jq -r '.cwd')
7
+
8
+ # Find the most recently modified sprint-log.md
9
+ SPRINT_LOG=$(find "$CWD/specs" -name "sprint-log.md" -type f -maxdepth 3 2>/dev/null | head -1)
10
+
11
+ if [ -z "$SPRINT_LOG" ]; then
12
+ exit 0 # No active sprint
13
+ fi
14
+
15
+ FEATURE_DIR=$(dirname "$SPRINT_LOG")
16
+ FEATURE_NAME=$(basename "$FEATURE_DIR")
17
+ SPRINT_INPUT="$FEATURE_DIR/inputs/sprint-input.md"
18
+
19
+ # Extract sprint-input frontmatter (between --- markers)
20
+ FRONTMATTER=""
21
+ if [ -f "$SPRINT_INPUT" ]; then
22
+ FRONTMATTER=$(sed -n '/^---$/,/^---$/p' "$SPRINT_INPUT" 2>/dev/null)
23
+ fi
24
+
25
+ # Read sprint-log
26
+ LOG_CONTENT=$(cat "$SPRINT_LOG" 2>/dev/null)
27
+
28
+ # Save recovery file
29
+ RECOVERY_FILE="$CWD/.claude/sprint-recovery.json"
30
+ jq -n \
31
+ --arg feature "$FEATURE_NAME" \
32
+ --arg log "$LOG_CONTENT" \
33
+ --arg input "$FRONTMATTER" \
34
+ --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
35
+ '{
36
+ feature_name: $feature,
37
+ saved_at: $ts,
38
+ sprint_log: $log,
39
+ sprint_input_frontmatter: $input
40
+ }' > "$RECOVERY_FILE"
41
+
42
+ exit 0
@@ -0,0 +1,33 @@
1
+ #!/bin/bash
2
+ # SessionStart(compact) hook: Reinject Sprint state after compaction
3
+ # Compaction 후 Sprint 상태를 additionalContext로 복원
4
+
5
+ INPUT=$(cat)
6
+ CWD=$(echo "$INPUT" | jq -r '.cwd')
7
+ RECOVERY_FILE="$CWD/.claude/sprint-recovery.json"
8
+
9
+ if [ ! -f "$RECOVERY_FILE" ]; then
10
+ exit 0 # No recovery data
11
+ fi
12
+
13
+ FEATURE=$(jq -r '.feature_name' "$RECOVERY_FILE")
14
+ SAVED_AT=$(jq -r '.saved_at' "$RECOVERY_FILE")
15
+ SPRINT_LOG=$(jq -r '.sprint_log' "$RECOVERY_FILE")
16
+ SPRINT_INPUT=$(jq -r '.sprint_input_frontmatter' "$RECOVERY_FILE")
17
+
18
+ CONTEXT="[Sprint Recovery — saved at ${SAVED_AT}]
19
+ Active Sprint: ${FEATURE}
20
+
21
+ Sprint Input (frontmatter):
22
+ ${SPRINT_INPUT}
23
+
24
+ Sprint Log:
25
+ ${SPRINT_LOG}"
26
+
27
+ jq -n --arg ctx "$CONTEXT" '{
28
+ hookSpecificOutput: {
29
+ hookEventName: "SessionStart",
30
+ additionalContext: $ctx
31
+ }
32
+ }'
33
+ exit 0
@@ -0,0 +1,97 @@
1
+ # MCP Search Protocol
2
+
3
+ ## Project MCP Server Configuration
4
+
5
+ This project can reference existing service backend, client, and design data through MCP servers.
6
+
7
+ ### MCP Server Setup
8
+
9
+ Create a `.mcp.json` file at the project root to configure MCP servers. See `.mcp.json.example` for reference.
10
+
11
+ MCP server roles used in Sprint:
12
+
13
+ | Role | Purpose | Agent Reference Name |
14
+ | ----------------- | ----------------------------------------------------------- | -------------------- |
15
+ | **backend-docs** | Backend domain policies, API specs, business logic | `backend-docs MCP` |
16
+ | **client-docs** | Client UI/UX, screen flows, component structure | `client-docs MCP` |
17
+ | **svc-map** | Brownfield service map: customer journeys, screenshots, flow data | `svc-map MCP` |
18
+ | **figma** | Figma live design data: wireframes, components, design tokens | `figma MCP` |
19
+
20
+ > - The `figma` MCP server uses OAuth authentication. Add via `claude mcp add --transport http figma https://mcp.figma.com/mcp`, then authenticate at `/mcp`.
21
+ > - When `svc-map` and `figma` data conflict, prefer `figma` (more recent).
22
+
23
+ ### Search Strategy
24
+
25
+ When answering domain-related questions, **always search from multiple perspectives and provide an integrated answer**.
26
+
27
+ #### Search Order
28
+
29
+ 1. **Classify question**: Determine if it concerns client / backend / design / multiple areas
30
+ 2. **Multi-search**: Search relevant MCP servers in parallel when possible
31
+ 3. **Integrated answer**: Distinguish backend, client, and design perspectives in the response
32
+
33
+ #### Search Criteria by Perspective
34
+
35
+ | Keywords/Topics | Search Target |
36
+ | ---------------------------------------------------------- | ------------------------------------- |
37
+ | API, endpoints, data models, business logic, auth, permissions | backend-docs MCP |
38
+ | UI code, component implementation, state management, code structure | client-docs MCP |
39
+ | Customer journeys, screen flows, service maps, screenshots | svc-map MCP |
40
+ | Wireframes, design mockups, layouts, design tokens, styles | figma MCP |
41
+ | Full feature, domain policies, service flows | **backend + client + svc-map + Figma** |
42
+
43
+ ### Response Format
44
+
45
+ Use the following format when answering domain-related questions:
46
+
47
+ ```
48
+ ## [Topic]
49
+
50
+ ### Backend Perspective
51
+ - API endpoints: ...
52
+ - Business logic: ...
53
+ - Data models: ...
54
+
55
+ ### Client Perspective
56
+ - Screen flows: ...
57
+ - State management: ...
58
+ - UI components: ...
59
+
60
+ ### Design Perspective
61
+ - Wireframes/mockups: ...
62
+ - Design tokens: ...
63
+ - Component specs: ...
64
+
65
+ ### Integrated Summary
66
+ [Explain how backend, client, and design connect]
67
+ ```
68
+
69
+ ## Local Codebase Search Protocol
70
+
71
+ In co-located topologies (monolith, MSA, monorepo), the local codebase can be searched directly.
72
+
73
+ ### Local Search Tool Mapping
74
+
75
+ | MCP Action | Local Equivalent | Purpose |
76
+ |----------------|------------------|------------------------------------|
77
+ | MCP index read | **Glob** | Directory structure, file patterns |
78
+ | MCP search | **Grep** | Code keyword and pattern search |
79
+ | MCP file read | **Read** | Full file content reading |
80
+
81
+ ### Search Priority (co-located)
82
+
83
+ When the same information is found in multiple sources within a co-located topology:
84
+
85
+ 1. **Local codebase** (most accurate — actual code)
86
+ 2. **document-project artifacts** (structured documentation)
87
+ 3. **MCP servers** (external reference)
88
+
89
+ ### Excluded Paths
90
+
91
+ Always exclude the following paths from local searches:
92
+
93
+ ```
94
+ node_modules/ .git/ dist/ build/
95
+ vendor/ target/ __pycache__/ coverage/
96
+ .next/ .nuxt/ out/ .cache/
97
+ ```