backend-claude-code 1.0.0
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.
- package/.claude/settings.json +42 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +35 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +33 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +32 -0
- package/.mcp.json +19 -0
- package/CLAUDE.md +126 -0
- package/README.md +142 -0
- package/agents/code-reviewer.md +84 -0
- package/agents/database-reviewer.md +91 -0
- package/agents/java-build-resolver.md +127 -0
- package/agents/java-performance-reviewer.md +262 -0
- package/agents/planner.md +99 -0
- package/agents/security-reviewer.md +119 -0
- package/agents/tdd-guide.md +189 -0
- package/bin/cli.js +144 -0
- package/commands/db-migrate.md +134 -0
- package/commands/dev-build.md +72 -0
- package/commands/dev-coverage.md +73 -0
- package/commands/dev-fix.md +75 -0
- package/commands/dev-plan.md +501 -0
- package/commands/dev-review.md +144 -0
- package/commands/dev-run.md +385 -0
- package/commands/dev-test.md +89 -0
- package/commands/dev-verify.md +95 -0
- package/commands/dev.md +45 -0
- package/commands/git-commit.md +112 -0
- package/commands/git-issue.md +74 -0
- package/commands/git-pr.md +184 -0
- package/commands/git-push.md +28 -0
- package/package.json +24 -0
- package/rules/architecture.md +33 -0
- package/rules/coding-style.md +113 -0
- package/rules/controller-patterns.md +63 -0
- package/rules/dto-patterns.md +76 -0
- package/rules/entity-patterns.md +70 -0
- package/rules/error-handling.md +56 -0
- package/rules/hooks.md +73 -0
- package/rules/repository-patterns.md +75 -0
- package/rules/security.md +101 -0
- package/rules/service-patterns.md +70 -0
- package/rules/testing.md +174 -0
- package/skills/api-design/SKILL.md +523 -0
- package/skills/architecture-decision-records/SKILL.md +179 -0
- package/skills/database-migrations/SKILL.md +429 -0
- package/skills/hexagonal-architecture/SKILL.md +276 -0
- package/skills/java-coding-standards/SKILL.md +236 -0
- package/skills/jpa-patterns/SKILL.md +218 -0
- package/skills/postgres-patterns/SKILL.md +147 -0
- package/skills/springboot-patterns/SKILL.md +255 -0
- package/skills/springboot-security/SKILL.md +241 -0
- package/skills/springboot-tdd/SKILL.md +236 -0
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Execute an implementation plan with rigorous validation loops
|
|
3
|
+
argument-hint: <path/to/plan.md>
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
> Adapted from PRPs-agentic-eng by Wirasm. Part of the PRP workflow series.
|
|
7
|
+
|
|
8
|
+
# PRP Implement
|
|
9
|
+
|
|
10
|
+
Execute a plan file step-by-step with continuous validation. Every change is verified immediately — never accumulate broken state.
|
|
11
|
+
|
|
12
|
+
**Core Philosophy**: Validation loops catch mistakes early. Run checks after every change. Fix issues immediately.
|
|
13
|
+
|
|
14
|
+
**Golden Rule**: If a validation fails, fix it before moving on. Never accumulate broken state.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Phase 0 — DETECT
|
|
19
|
+
|
|
20
|
+
### Package Manager Detection
|
|
21
|
+
|
|
22
|
+
| File Exists | Package Manager | Runner |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| `bun.lockb` | bun | `bun run` |
|
|
25
|
+
| `pnpm-lock.yaml` | pnpm | `pnpm run` |
|
|
26
|
+
| `yarn.lock` | yarn | `yarn` |
|
|
27
|
+
| `package-lock.json` | npm | `npm run` |
|
|
28
|
+
| `pyproject.toml` or `requirements.txt` | uv / pip | `uv run` or `python -m` |
|
|
29
|
+
| `Cargo.toml` | cargo | `cargo` |
|
|
30
|
+
| `go.mod` | go | `go` |
|
|
31
|
+
|
|
32
|
+
### Validation Scripts
|
|
33
|
+
|
|
34
|
+
Check `package.json` (or equivalent) for available scripts:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# For Node.js projects
|
|
38
|
+
cat package.json | grep -A 20 '"scripts"'
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Note available commands for: type-check, lint, test, build.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Phase 1 — LOAD
|
|
46
|
+
|
|
47
|
+
Read the plan file:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
cat "$ARGUMENTS"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Extract these sections from the plan:
|
|
54
|
+
- **Summary** — What is being built
|
|
55
|
+
- **Patterns to Mirror** — Code conventions to follow
|
|
56
|
+
- **Files to Change** — What to create or modify
|
|
57
|
+
- **Step-by-Step Tasks** — Implementation sequence
|
|
58
|
+
- **Validation Commands** — How to verify correctness
|
|
59
|
+
- **Acceptance Criteria** — Definition of done
|
|
60
|
+
|
|
61
|
+
If the file doesn't exist or isn't a valid plan:
|
|
62
|
+
```
|
|
63
|
+
Error: Plan file not found or invalid.
|
|
64
|
+
Run /dev plan <feature-description> to create a plan first.
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**CHECKPOINT**: Plan loaded. All sections identified. Tasks extracted.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Phase 2 — PREPARE
|
|
72
|
+
|
|
73
|
+
### Git State
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
git branch --show-current
|
|
77
|
+
git status --porcelain
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Branch Decision
|
|
81
|
+
|
|
82
|
+
| Current State | Action |
|
|
83
|
+
|---|---|
|
|
84
|
+
| On feature branch | Use current branch |
|
|
85
|
+
| On main, clean working tree | Create feature branch: `git checkout -b feat/{plan-name}` |
|
|
86
|
+
| On main, dirty working tree | **STOP** — Ask user to stash or commit first |
|
|
87
|
+
| In a git worktree for this feature | Use the worktree |
|
|
88
|
+
|
|
89
|
+
### Sync Remote
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
git pull --rebase origin $(git branch --show-current) 2>/dev/null || true
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**CHECKPOINT**: On correct branch. Working tree ready. Remote synced.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Phase 3 — EXECUTE
|
|
100
|
+
|
|
101
|
+
Process each task from the plan sequentially.
|
|
102
|
+
|
|
103
|
+
### Per-Task Loop
|
|
104
|
+
|
|
105
|
+
For each task in **Step-by-Step Tasks**:
|
|
106
|
+
|
|
107
|
+
1. **Read MIRROR reference** — Open the pattern file referenced in the task's MIRROR field. Understand the convention before writing code.
|
|
108
|
+
|
|
109
|
+
2. **Implement** — Write the code following the pattern exactly. Apply GOTCHA warnings. Use specified IMPORTS.
|
|
110
|
+
|
|
111
|
+
3. **Validate immediately** — After EVERY file change:
|
|
112
|
+
```bash
|
|
113
|
+
# Run type-check (adjust command per project)
|
|
114
|
+
[type-check command from Phase 0]
|
|
115
|
+
```
|
|
116
|
+
If type-check fails → fix the error before moving to the next file.
|
|
117
|
+
|
|
118
|
+
4. **Track progress** — Log: `[done] Task N: [task name] — complete`
|
|
119
|
+
|
|
120
|
+
### Handling Deviations
|
|
121
|
+
|
|
122
|
+
If implementation must deviate from the plan:
|
|
123
|
+
- Note **WHAT** changed
|
|
124
|
+
- Note **WHY** it changed
|
|
125
|
+
- Continue with the corrected approach
|
|
126
|
+
- These deviations will be captured in the report
|
|
127
|
+
|
|
128
|
+
**CHECKPOINT**: All tasks executed. Deviations logged.
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Phase 4 — VALIDATE
|
|
133
|
+
|
|
134
|
+
Run all validation levels from the plan. Fix issues at each level before proceeding.
|
|
135
|
+
|
|
136
|
+
### Level 1: Static Analysis
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# Type checking — zero errors required
|
|
140
|
+
[project type-check command]
|
|
141
|
+
|
|
142
|
+
# Linting — fix automatically where possible
|
|
143
|
+
[project lint command]
|
|
144
|
+
[project lint-fix command]
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
If lint errors remain after auto-fix, fix manually.
|
|
148
|
+
|
|
149
|
+
### Level 2: Unit Tests
|
|
150
|
+
|
|
151
|
+
Write tests for every new function (as specified in the plan's Testing Strategy).
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
[project test command for affected area]
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
- Every function needs at least one test
|
|
158
|
+
- Cover edge cases listed in the plan
|
|
159
|
+
- If a test fails → fix the implementation (not the test, unless the test is wrong)
|
|
160
|
+
|
|
161
|
+
### Level 3: Build Check
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
[project build command]
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Build must succeed with zero errors.
|
|
168
|
+
|
|
169
|
+
### Level 4: Integration Testing (if applicable)
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
# Start server, run tests, stop server
|
|
173
|
+
[project dev server command] &
|
|
174
|
+
SERVER_PID=$!
|
|
175
|
+
|
|
176
|
+
# Wait for server to be ready (adjust port as needed)
|
|
177
|
+
SERVER_READY=0
|
|
178
|
+
for i in $(seq 1 30); do
|
|
179
|
+
if curl -sf http://localhost:PORT/health >/dev/null 2>&1; then
|
|
180
|
+
SERVER_READY=1
|
|
181
|
+
break
|
|
182
|
+
fi
|
|
183
|
+
sleep 1
|
|
184
|
+
done
|
|
185
|
+
|
|
186
|
+
if [ "$SERVER_READY" -ne 1 ]; then
|
|
187
|
+
kill "$SERVER_PID" 2>/dev/null || true
|
|
188
|
+
echo "ERROR: Server failed to start within 30s" >&2
|
|
189
|
+
exit 1
|
|
190
|
+
fi
|
|
191
|
+
|
|
192
|
+
[integration test command]
|
|
193
|
+
TEST_EXIT=$?
|
|
194
|
+
|
|
195
|
+
kill "$SERVER_PID" 2>/dev/null || true
|
|
196
|
+
wait "$SERVER_PID" 2>/dev/null || true
|
|
197
|
+
|
|
198
|
+
exit "$TEST_EXIT"
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Level 5: Edge Case Testing
|
|
202
|
+
|
|
203
|
+
Run through edge cases from the plan's Testing Strategy checklist.
|
|
204
|
+
|
|
205
|
+
**CHECKPOINT**: All 5 validation levels pass. Zero errors.
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Phase 5 — REPORT
|
|
210
|
+
|
|
211
|
+
### Create Implementation Report
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
mkdir -p .claude/PRPs/reports
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Write report to `.claude/PRPs/reports/{plan-name}-report.md`:
|
|
218
|
+
|
|
219
|
+
```markdown
|
|
220
|
+
# Implementation Report: [Feature Name]
|
|
221
|
+
|
|
222
|
+
## Summary
|
|
223
|
+
[What was implemented]
|
|
224
|
+
|
|
225
|
+
## Assessment vs Reality
|
|
226
|
+
|
|
227
|
+
| Metric | Predicted (Plan) | Actual |
|
|
228
|
+
|---|---|---|
|
|
229
|
+
| Complexity | [from plan] | [actual] |
|
|
230
|
+
| Confidence | [from plan] | [actual] |
|
|
231
|
+
| Files Changed | [from plan] | [actual count] |
|
|
232
|
+
|
|
233
|
+
## Tasks Completed
|
|
234
|
+
|
|
235
|
+
| # | Task | Status | Notes |
|
|
236
|
+
|---|---|---|---|
|
|
237
|
+
| 1 | [task name] | [done] Complete | |
|
|
238
|
+
| 2 | [task name] | [done] Complete | Deviated — [reason] |
|
|
239
|
+
|
|
240
|
+
## Validation Results
|
|
241
|
+
|
|
242
|
+
| Level | Status | Notes |
|
|
243
|
+
|---|---|---|
|
|
244
|
+
| Static Analysis | [done] Pass | |
|
|
245
|
+
| Unit Tests | [done] Pass | N tests written |
|
|
246
|
+
| Build | [done] Pass | |
|
|
247
|
+
| Integration | [done] Pass | or N/A |
|
|
248
|
+
| Edge Cases | [done] Pass | |
|
|
249
|
+
|
|
250
|
+
## Files Changed
|
|
251
|
+
|
|
252
|
+
| File | Action | Lines |
|
|
253
|
+
|---|---|---|
|
|
254
|
+
| `path/to/file` | CREATED | +N |
|
|
255
|
+
| `path/to/file` | UPDATED | +N / -M |
|
|
256
|
+
|
|
257
|
+
## Deviations from Plan
|
|
258
|
+
[List any deviations with WHAT and WHY, or "None"]
|
|
259
|
+
|
|
260
|
+
## Issues Encountered
|
|
261
|
+
[List any problems and how they were resolved, or "None"]
|
|
262
|
+
|
|
263
|
+
## Tests Written
|
|
264
|
+
|
|
265
|
+
| Test File | Tests | Coverage |
|
|
266
|
+
|---|---|---|
|
|
267
|
+
| `path/to/test` | N tests | [area covered] |
|
|
268
|
+
|
|
269
|
+
## Next Steps
|
|
270
|
+
- [ ] Code review via `/code-review`
|
|
271
|
+
- [ ] Create PR via `/git pr`
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Update PRD (if applicable)
|
|
275
|
+
|
|
276
|
+
If this implementation was for a PRD phase:
|
|
277
|
+
1. Update the phase status from `in-progress` to `complete`
|
|
278
|
+
2. Add report path as reference
|
|
279
|
+
|
|
280
|
+
### Archive Plan
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
mkdir -p .claude/PRPs/plans/completed
|
|
284
|
+
mv "$ARGUMENTS" .claude/PRPs/plans/completed/
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**CHECKPOINT**: Report created. PRD updated. Plan archived.
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## Phase 6 — OUTPUT
|
|
292
|
+
|
|
293
|
+
Report to user:
|
|
294
|
+
|
|
295
|
+
```
|
|
296
|
+
## Implementation Complete
|
|
297
|
+
|
|
298
|
+
- **Plan**: [plan file path] → archived to completed/
|
|
299
|
+
- **Branch**: [current branch name]
|
|
300
|
+
- **Status**: [done] All tasks complete
|
|
301
|
+
|
|
302
|
+
### Validation Summary
|
|
303
|
+
|
|
304
|
+
| Check | Status |
|
|
305
|
+
|---|---|
|
|
306
|
+
| Type Check | [done] |
|
|
307
|
+
| Lint | [done] |
|
|
308
|
+
| Tests | [done] (N written) |
|
|
309
|
+
| Build | [done] |
|
|
310
|
+
| Integration | [done] or N/A |
|
|
311
|
+
|
|
312
|
+
### Files Changed
|
|
313
|
+
- [N] files created, [M] files updated
|
|
314
|
+
|
|
315
|
+
### Deviations
|
|
316
|
+
[Summary or "None — implemented exactly as planned"]
|
|
317
|
+
|
|
318
|
+
### Artifacts
|
|
319
|
+
- Report: `.claude/PRPs/reports/{name}-report.md`
|
|
320
|
+
- Archived Plan: `.claude/PRPs/plans/completed/{name}.plan.md`
|
|
321
|
+
|
|
322
|
+
### PRD Progress (if applicable)
|
|
323
|
+
| Phase | Status |
|
|
324
|
+
|---|---|
|
|
325
|
+
| Phase 1 | [done] Complete |
|
|
326
|
+
| Phase 2 | [next] |
|
|
327
|
+
| ... | ... |
|
|
328
|
+
|
|
329
|
+
> Next step: Run `/git pr` to create a pull request, or `/code-review` to review changes first.
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## Handling Failures
|
|
335
|
+
|
|
336
|
+
### Type Check Fails
|
|
337
|
+
1. Read the error message carefully
|
|
338
|
+
2. Fix the type error in the source file
|
|
339
|
+
3. Re-run type-check
|
|
340
|
+
4. Continue only when clean
|
|
341
|
+
|
|
342
|
+
### Tests Fail
|
|
343
|
+
1. Identify whether the bug is in the implementation or the test
|
|
344
|
+
2. Fix the root cause (usually the implementation)
|
|
345
|
+
3. Re-run tests
|
|
346
|
+
4. Continue only when green
|
|
347
|
+
|
|
348
|
+
### Lint Fails
|
|
349
|
+
1. Run auto-fix first
|
|
350
|
+
2. If errors remain, fix manually
|
|
351
|
+
3. Re-run lint
|
|
352
|
+
4. Continue only when clean
|
|
353
|
+
|
|
354
|
+
### Build Fails
|
|
355
|
+
1. Usually a type or import issue — check error message
|
|
356
|
+
2. Fix the offending file
|
|
357
|
+
3. Re-run build
|
|
358
|
+
4. Continue only when successful
|
|
359
|
+
|
|
360
|
+
### Integration Test Fails
|
|
361
|
+
1. Check server started correctly
|
|
362
|
+
2. Verify endpoint/route exists
|
|
363
|
+
3. Check request format matches expected
|
|
364
|
+
4. Fix and re-run
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## Success Criteria
|
|
369
|
+
|
|
370
|
+
- **TASKS_COMPLETE**: All tasks from the plan executed
|
|
371
|
+
- **TYPES_PASS**: Zero type errors
|
|
372
|
+
- **LINT_PASS**: Zero lint errors
|
|
373
|
+
- **TESTS_PASS**: All tests green, new tests written
|
|
374
|
+
- **BUILD_PASS**: Build succeeds
|
|
375
|
+
- **REPORT_CREATED**: Implementation report saved
|
|
376
|
+
- **PLAN_ARCHIVED**: Plan moved to `completed/`
|
|
377
|
+
|
|
378
|
+
---
|
|
379
|
+
|
|
380
|
+
## Next Steps
|
|
381
|
+
|
|
382
|
+
- Run `/code-review` to review changes before committing
|
|
383
|
+
- Run `/git commit` to commit with a descriptive message
|
|
384
|
+
- Run `/git pr` to create a pull request
|
|
385
|
+
- Run `/dev plan <next-phase>` if the PRD has more phases
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Java TDD 워크플로우 — 테스트 먼저 작성하고 Spring Boot 기능을 구현합니다
|
|
3
|
+
argument-hint: <feature, class, or method to test>
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Java TDD
|
|
7
|
+
|
|
8
|
+
**Feature**: $ARGUMENTS
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 개요
|
|
13
|
+
|
|
14
|
+
Spring Boot TDD 워크플로우: RED → GREEN → REFACTOR → COVERAGE
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Phase 1 — PLAN
|
|
19
|
+
|
|
20
|
+
`$ARGUMENTS`를 분석:
|
|
21
|
+
1. 어떤 계층을 테스트하는가? (서비스/컨트롤러/레포지토리)
|
|
22
|
+
2. 정상 경로 (happy path)는?
|
|
23
|
+
3. 실패 케이스 (에러/엣지케이스)는?
|
|
24
|
+
4. 필요한 모의 객체 (Mock)는?
|
|
25
|
+
|
|
26
|
+
**복잡한 기능**이면 먼저 `planner` 에이전트로 구현 계획 수립.
|
|
27
|
+
|
|
28
|
+
## Phase 2 — RED (테스트 작성)
|
|
29
|
+
|
|
30
|
+
`tdd-guide` 에이전트로 테스트 작성:
|
|
31
|
+
|
|
32
|
+
### 테스트 슬라이스 선택
|
|
33
|
+
- 서비스 로직 → `@ExtendWith(MockitoExtension.class)`
|
|
34
|
+
- 컨트롤러/API → `@WebMvcTest`
|
|
35
|
+
- JPA 레포지토리 → `@DataJpaTest`
|
|
36
|
+
- 통합 → `@SpringBootTest`
|
|
37
|
+
|
|
38
|
+
### 테스트 실행 (실패 확인)
|
|
39
|
+
```bash
|
|
40
|
+
./mvnw test -Dtest=<TestClassName> -q 2>&1 | tail -20 || \
|
|
41
|
+
./gradlew test --tests "<full.package.TestClassName>" 2>&1 | tail -20
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
실패 확인 — 테스트가 통과하면 이미 구현이 있거나 테스트가 잘못됨.
|
|
45
|
+
|
|
46
|
+
## Phase 3 — GREEN (최소 구현)
|
|
47
|
+
|
|
48
|
+
테스트를 통과하는 최소한의 코드 작성:
|
|
49
|
+
- 과도한 구현 금지
|
|
50
|
+
- 리팩토링 금지 (이 단계에서)
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# 테스트 재실행
|
|
54
|
+
./mvnw test -Dtest=<TestClassName> -q 2>&1 | tail -10
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
모든 테스트 통과 확인.
|
|
58
|
+
|
|
59
|
+
## Phase 4 — REFACTOR
|
|
60
|
+
|
|
61
|
+
테스트 통과 상태에서:
|
|
62
|
+
1. 중복 제거
|
|
63
|
+
2. 명명 개선
|
|
64
|
+
3. 메서드 분리
|
|
65
|
+
4. 매 변경 후 테스트 재실행
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
./mvnw test -q 2>&1 | tail -5
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Phase 5 — COVERAGE
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
./mvnw test jacoco:report -q 2>&1 | tail -5
|
|
75
|
+
./gradlew test jacocoTestReport 2>&1 | tail -5
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
80% 미만이면 누락된 경로 테스트 추가.
|
|
79
|
+
|
|
80
|
+
## Output
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
TDD Cycle — <기능명>
|
|
84
|
+
Tests Written: N
|
|
85
|
+
RED: FAIL (확인됨)
|
|
86
|
+
GREEN: PASS
|
|
87
|
+
Coverage: XX%
|
|
88
|
+
Status: COMPLETE | NEEDS_MORE_TESTS
|
|
89
|
+
```
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Spring Boot 전체 검증 파이프라인 — 빌드·정적 분석·테스트·커버리지·보안 스캔 순차 실행
|
|
3
|
+
argument-hint: [--fast | --full | blank for standard]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Verify
|
|
7
|
+
|
|
8
|
+
Spring Boot 프로젝트의 전체 품질 게이트를 순차적으로 실행합니다.
|
|
9
|
+
|
|
10
|
+
**Mode**: $ARGUMENTS
|
|
11
|
+
- 빈 값 / `--standard`: 빌드 + 테스트 + 커버리지
|
|
12
|
+
- `--fast`: 빌드 + 테스트만 (커버리지·보안 스킵)
|
|
13
|
+
- `--full`: 빌드 + 테스트 + 커버리지 + 보안 스캔 + 정적 분석
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Phase 1 — BUILD
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
./mvnw compile -q --no-transfer-progress 2>&1 | tail -5 || \
|
|
21
|
+
./gradlew compileJava -q 2>&1 | tail -5
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
실패 시 즉시 중단 → `/dev build` 실행 권장.
|
|
25
|
+
|
|
26
|
+
## Phase 2 — STATIC ANALYSIS
|
|
27
|
+
|
|
28
|
+
`--fast` 모드는 건너뜀.
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Checkstyle
|
|
32
|
+
./mvnw checkstyle:check -q 2>&1 | tail -5 || \
|
|
33
|
+
./gradlew checkstyleMain -q 2>&1 | tail -5
|
|
34
|
+
|
|
35
|
+
# SpotBugs
|
|
36
|
+
./mvnw spotbugs:check -q 2>&1 | tail -5 || \
|
|
37
|
+
./gradlew spotbugsMain -q 2>&1 | tail -5
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
오류 있으면 파일·라인·규칙 보고. 계속 진행 (차단하지 않음).
|
|
41
|
+
|
|
42
|
+
## Phase 3 — TEST + COVERAGE
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
./mvnw test -q --no-transfer-progress 2>&1 | tail -10 || \
|
|
46
|
+
./gradlew test -q 2>&1 | tail -10
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
테스트 실패 시 실패한 테스트 목록 보고 후 중단.
|
|
50
|
+
|
|
51
|
+
커버리지 리포트 생성:
|
|
52
|
+
```bash
|
|
53
|
+
./mvnw jacoco:report -q 2>&1 || \
|
|
54
|
+
./gradlew jacocoTestReport -q 2>&1
|
|
55
|
+
|
|
56
|
+
# 커버리지 수치 확인
|
|
57
|
+
grep -A3 "LINE" target/site/jacoco/index.html 2>/dev/null | \
|
|
58
|
+
grep -oP '\d+%' | head -1 || echo "커버리지 리포트를 찾을 수 없습니다"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
80% 미만이면 경고.
|
|
62
|
+
|
|
63
|
+
## Phase 4 — SECURITY SCAN
|
|
64
|
+
|
|
65
|
+
`--full` 모드에서만 실행.
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# OWASP Dependency Check
|
|
69
|
+
./mvnw dependency-check:check -q 2>&1 | grep -E "CRITICAL|HIGH|One or more" | head -10 || \
|
|
70
|
+
./gradlew dependencyCheckAnalyze -q 2>&1 | grep -E "CRITICAL|HIGH" | head -10
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
CRITICAL 취약점 발견 시 → `security-reviewer` 에이전트 실행 권장.
|
|
74
|
+
|
|
75
|
+
## Phase 5 — SUMMARY REPORT
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
Verify — <날짜> Mode: standard | fast | full
|
|
79
|
+
────────────────────────────────────────────
|
|
80
|
+
Phase 1 Build PASS | FAIL
|
|
81
|
+
Phase 2 Static Analysis PASS | FAIL | SKIP (N issues)
|
|
82
|
+
Phase 3 Tests PASS | FAIL (N/N passed)
|
|
83
|
+
Coverage XX% (≥80% required)
|
|
84
|
+
Phase 4 Security Scan PASS | FAIL | SKIP (N CVEs)
|
|
85
|
+
────────────────────────────────────────────
|
|
86
|
+
Overall: PASS | FAIL
|
|
87
|
+
|
|
88
|
+
Next steps:
|
|
89
|
+
- FAIL Build → /dev build
|
|
90
|
+
- FAIL Tests → /java-test
|
|
91
|
+
- Low Coverage → /test-coverage
|
|
92
|
+
- CVEs found → security-reviewer 에이전트
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
> 상세 검증 패턴은 `skill: springboot-verification` 참조.
|
package/commands/dev.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 기능 개발 전체 워크플로우 — 계획 → 구현 → 테스트 순서로 실행
|
|
3
|
+
argument-hint: <기능 설명>
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Dev
|
|
7
|
+
|
|
8
|
+
**Input**: $ARGUMENTS — 구현할 기능 설명
|
|
9
|
+
|
|
10
|
+
`/dev plan` → `/dev run` → `/dev test` 를 순서대로 실행합니다.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Step 1 — PLAN
|
|
15
|
+
|
|
16
|
+
`/dev plan $ARGUMENTS` 실행.
|
|
17
|
+
|
|
18
|
+
구현 계획서가 완성되면 사용자에게 확인을 받는다.
|
|
19
|
+
계획이 승인되면 Step 2로 진행한다.
|
|
20
|
+
|
|
21
|
+
## Step 2 — RUN
|
|
22
|
+
|
|
23
|
+
`/dev run <계획서 경로>` 실행.
|
|
24
|
+
|
|
25
|
+
구현이 완료되고 빌드가 통과되면 Step 3으로 진행한다.
|
|
26
|
+
|
|
27
|
+
## Step 3 — TEST
|
|
28
|
+
|
|
29
|
+
`/dev test` 실행.
|
|
30
|
+
|
|
31
|
+
테스트가 통과되고 커버리지 80%+ 확인되면 완료를 보고한다.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 완료 리포트
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
Dev — <기능명>
|
|
39
|
+
─────────────────────────
|
|
40
|
+
Plan DONE <계획서 경로>
|
|
41
|
+
Run DONE <변경 파일 수>개 파일
|
|
42
|
+
Test DONE <테스트 수>개 통과 / 커버리지 XX%
|
|
43
|
+
─────────────────────────
|
|
44
|
+
Next: /git commit → /git pr
|
|
45
|
+
```
|