@negikirin/repo-pattern 0.1.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.
- package/.claude/CLAUDE.md +61 -0
- package/.claude/settings.example.json +40 -0
- package/.claude/settings.local.example.json +24 -0
- package/.github/workflows/nodejs-package.yml +60 -0
- package/.repo-pattern.json +25 -0
- package/.repo-pattern.lock.json +23 -0
- package/LICENSE +21 -0
- package/README.md +145 -0
- package/THIRD_PARTY_NOTICES.md +51 -0
- package/docs/repo-pattern/setup-guide.md +725 -0
- package/docs/repo-pattern/workflow.md +429 -0
- package/mcp/profiles/backend.json +7 -0
- package/mcp/profiles/full.json +11 -0
- package/mcp/profiles/minimal.json +6 -0
- package/mcp/profiles/research.json +8 -0
- package/mcp/profiles/web.json +8 -0
- package/mcp/servers/chrome-devtools.json +10 -0
- package/mcp/servers/context7.json +13 -0
- package/mcp/servers/filesystem.json +11 -0
- package/mcp/servers/gitnexus.json +11 -0
- package/mcp/servers/playwright.json +12 -0
- package/mcp/servers/sequential-thinking.json +10 -0
- package/mcp/servers/tavily.json +13 -0
- package/package.json +71 -0
- package/scripts/lib/audit.mjs +127 -0
- package/scripts/lib/cleanup.mjs +35 -0
- package/scripts/lib/doctor.mjs +86 -0
- package/scripts/lib/ecc-rules.mjs +98 -0
- package/scripts/lib/ecc.mjs +61 -0
- package/scripts/lib/fs-utils.mjs +133 -0
- package/scripts/lib/mcp.mjs +203 -0
- package/scripts/lib/project-detect.mjs +107 -0
- package/scripts/lib/prompt.mjs +226 -0
- package/scripts/lib/provision.mjs +184 -0
- package/scripts/lib/rules.mjs +142 -0
- package/scripts/lib/setup.mjs +299 -0
- package/scripts/lib/skills.mjs +249 -0
- package/scripts/repo-pattern.mjs +156 -0
- package/scripts/self-check.mjs +175 -0
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
# Workflow
|
|
2
|
+
|
|
3
|
+
`repo-pattern` is setup infrastructure only.
|
|
4
|
+
|
|
5
|
+
After setup, use **ECC** as the workflow layer inside Claude Code.
|
|
6
|
+
|
|
7
|
+
This document explains the recommended ECC command flow for common development situations. It is intentionally practical: start with the default flow, then choose a deeper workflow only when the task needs more structure.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 1. Default ECC workflow
|
|
12
|
+
|
|
13
|
+
Use this for most normal coding tasks.
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
/plan <task>
|
|
17
|
+
→ confirm the plan
|
|
18
|
+
→ implement or /tdd
|
|
19
|
+
→ /build-fix if build/type errors appear
|
|
20
|
+
→ /code-review
|
|
21
|
+
→ /verify
|
|
22
|
+
→ /save-session or /learn-eval
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### When to use
|
|
26
|
+
|
|
27
|
+
Use the default flow for:
|
|
28
|
+
|
|
29
|
+
- small or medium features;
|
|
30
|
+
- scoped refactors;
|
|
31
|
+
- normal bug fixes;
|
|
32
|
+
- changes that touch multiple files;
|
|
33
|
+
- tasks where you want a plan before editing.
|
|
34
|
+
|
|
35
|
+
### Why this is the default
|
|
36
|
+
|
|
37
|
+
`/plan` is the safest entrypoint because it forces the assistant to restate requirements, inspect relevant code, identify risks, and wait for confirmation before implementation.
|
|
38
|
+
|
|
39
|
+
Use `/tdd` when the task should be implemented test-first. If the task is simple and already well understood, implementation can happen after `/plan` without a separate PRD flow.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 2. Quick decision guide
|
|
44
|
+
|
|
45
|
+
| Situation | Recommended workflow |
|
|
46
|
+
|---|---|
|
|
47
|
+
| Feature is clear and small/medium | `/plan` → implement or `/tdd` → `/code-review` → `/verify` |
|
|
48
|
+
| Feature idea is unclear | `/plan-prd` → `/plan` → implement or `/tdd` → `/code-review` → `/verify` |
|
|
49
|
+
| Feature is large or multi-phase | `/prp-prd` → `/prp-plan` → `/prp-implement` → `/code-review` |
|
|
50
|
+
| Build/type errors are the main issue | `/build-fix` → `/verify` |
|
|
51
|
+
| Code was just written | `/code-review` → fix findings → `/verify` |
|
|
52
|
+
| Reviewing a PR | `/code-review <pr-number-or-url>` |
|
|
53
|
+
| Need current library/API docs | `/docs <library>` → implement/update → `/update-docs` |
|
|
54
|
+
| Context is getting large | `/context-budget` → `/checkpoint` |
|
|
55
|
+
| Ending a long session | `/save-session` or `/learn-eval` |
|
|
56
|
+
| Resuming previous work | `/resume-session` |
|
|
57
|
+
| Multi-agent advanced work | `/multi-plan` → `/multi-workflow`, only if the external runtime is available |
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 3. Lean PRD workflow
|
|
62
|
+
|
|
63
|
+
Use this when the feature idea is not clear enough for implementation.
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
/plan-prd <feature idea>
|
|
67
|
+
→ review generated PRD
|
|
68
|
+
→ /plan .claude/prds/<name>.prd.md
|
|
69
|
+
→ confirm the plan
|
|
70
|
+
→ implement or /tdd
|
|
71
|
+
→ /code-review
|
|
72
|
+
→ /verify
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### When to use
|
|
76
|
+
|
|
77
|
+
Use this flow when you need to clarify:
|
|
78
|
+
|
|
79
|
+
- the user problem;
|
|
80
|
+
- success criteria;
|
|
81
|
+
- MVP scope;
|
|
82
|
+
- non-goals;
|
|
83
|
+
- open questions;
|
|
84
|
+
- product behavior.
|
|
85
|
+
|
|
86
|
+
### Rule
|
|
87
|
+
|
|
88
|
+
`/plan-prd` should capture **what** and **why**.
|
|
89
|
+
|
|
90
|
+
Implementation decomposition should happen later in `/plan`.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## 4. Deep PRP workflow
|
|
95
|
+
|
|
96
|
+
Use this when the work is large, risky, multi-phase, or needs a self-contained implementation artifact.
|
|
97
|
+
|
|
98
|
+
```text
|
|
99
|
+
/prp-prd <feature idea>
|
|
100
|
+
→ /prp-plan .claude/PRPs/prds/<name>.prd.md
|
|
101
|
+
→ /prp-implement .claude/PRPs/plans/<name>.plan.md
|
|
102
|
+
→ /code-review
|
|
103
|
+
→ /verify
|
|
104
|
+
→ /prp-pr or normal PR handoff
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### When to use
|
|
108
|
+
|
|
109
|
+
Use PRP flow for:
|
|
110
|
+
|
|
111
|
+
- large feature development;
|
|
112
|
+
- cross-cutting architectural work;
|
|
113
|
+
- multi-step migrations;
|
|
114
|
+
- work that needs explicit codebase pattern discovery;
|
|
115
|
+
- tasks that another agent may implement from the plan;
|
|
116
|
+
- changes where validation commands and acceptance criteria must be captured before coding.
|
|
117
|
+
|
|
118
|
+
### Rule
|
|
119
|
+
|
|
120
|
+
`/prp-plan` should capture enough codebase knowledge that `/prp-implement` can execute without rediscovering the same context repeatedly.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 5. Bug fix workflow
|
|
125
|
+
|
|
126
|
+
Use this when there is a reproducible bug.
|
|
127
|
+
|
|
128
|
+
```text
|
|
129
|
+
/plan <bug + reproduction>
|
|
130
|
+
→ create or identify failing check
|
|
131
|
+
→ implement minimal fix
|
|
132
|
+
→ /build-fix if build/type errors appear
|
|
133
|
+
→ /verify
|
|
134
|
+
→ /code-review
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Rules
|
|
138
|
+
|
|
139
|
+
- Prefer reproducing the bug before fixing it.
|
|
140
|
+
- Keep the fix surgical.
|
|
141
|
+
- Do not refactor unrelated code.
|
|
142
|
+
- If the first hypothesis fails, revise the plan instead of stacking random fixes.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## 6. Build/type error workflow
|
|
147
|
+
|
|
148
|
+
Use this when the main problem is a broken build, type-check, lint, or compile step.
|
|
149
|
+
|
|
150
|
+
```text
|
|
151
|
+
/build-fix
|
|
152
|
+
→ /verify
|
|
153
|
+
→ /code-review
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Rules
|
|
157
|
+
|
|
158
|
+
- Fix one error group at a time.
|
|
159
|
+
- Re-run the relevant build/type command after each meaningful fix.
|
|
160
|
+
- Stop and reassess if the same error repeats or the fix requires architectural changes.
|
|
161
|
+
- Do not perform unrelated cleanup during build repair.
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## 7. Code review workflow
|
|
166
|
+
|
|
167
|
+
Use this after implementation, before final handoff.
|
|
168
|
+
|
|
169
|
+
### Local review
|
|
170
|
+
|
|
171
|
+
```text
|
|
172
|
+
/code-review
|
|
173
|
+
→ fix HIGH/CRITICAL findings
|
|
174
|
+
→ /verify
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### PR review
|
|
178
|
+
|
|
179
|
+
```text
|
|
180
|
+
/code-review <pr-number-or-url>
|
|
181
|
+
→ fix requested changes
|
|
182
|
+
→ /verify
|
|
183
|
+
→ PR handoff
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Review focus
|
|
187
|
+
|
|
188
|
+
Review should check:
|
|
189
|
+
|
|
190
|
+
- correctness;
|
|
191
|
+
- security;
|
|
192
|
+
- maintainability;
|
|
193
|
+
- hidden edge cases;
|
|
194
|
+
- unnecessary complexity;
|
|
195
|
+
- test coverage;
|
|
196
|
+
- consistency with existing project patterns.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## 8. Verification workflow
|
|
201
|
+
|
|
202
|
+
Use verification after implementation, build fixes, review fixes, and before handoff.
|
|
203
|
+
|
|
204
|
+
```text
|
|
205
|
+
/verify
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
If `/verify` is not available or not suitable, run the project’s explicit checks manually:
|
|
209
|
+
|
|
210
|
+
```text
|
|
211
|
+
build
|
|
212
|
+
lint
|
|
213
|
+
type-check
|
|
214
|
+
test
|
|
215
|
+
format check
|
|
216
|
+
integration/e2e checks when relevant
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Important distinction
|
|
220
|
+
|
|
221
|
+
`/quality-gate` should not be treated as a full replacement for verification. It is useful as a quality/formatting gate, but full verification should still include the project’s actual build, test, lint, and type-check commands.
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## 9. Docs and research workflow
|
|
226
|
+
|
|
227
|
+
Use this when the task depends on current library, framework, API, or platform behavior.
|
|
228
|
+
|
|
229
|
+
```text
|
|
230
|
+
/docs <library-or-api>
|
|
231
|
+
→ implement or update docs
|
|
232
|
+
→ /update-docs if project docs changed
|
|
233
|
+
→ /code-review if code changed
|
|
234
|
+
→ /verify if code changed
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Rules
|
|
238
|
+
|
|
239
|
+
- Use current docs before making assumptions about APIs.
|
|
240
|
+
- Prefer Context7/MCP documentation lookup when available.
|
|
241
|
+
- Do not rely on outdated memory for fast-changing libraries.
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## 10. Session and context workflow
|
|
246
|
+
|
|
247
|
+
Use this for long-running work.
|
|
248
|
+
|
|
249
|
+
### Before context gets too large
|
|
250
|
+
|
|
251
|
+
```text
|
|
252
|
+
/context-budget
|
|
253
|
+
→ /checkpoint
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### End of session
|
|
257
|
+
|
|
258
|
+
```text
|
|
259
|
+
/save-session
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
or:
|
|
263
|
+
|
|
264
|
+
```text
|
|
265
|
+
/learn-eval
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Resume
|
|
269
|
+
|
|
270
|
+
```text
|
|
271
|
+
/resume-session
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Rules
|
|
275
|
+
|
|
276
|
+
- Save important decisions before compacting or ending a session.
|
|
277
|
+
- Use checkpoints before risky changes.
|
|
278
|
+
- Use `/learn-eval` when a session produced reusable lessons or project patterns.
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## 11. Advanced multi-agent workflow
|
|
283
|
+
|
|
284
|
+
Use only when the required runtime is available.
|
|
285
|
+
|
|
286
|
+
```text
|
|
287
|
+
/multi-plan <task>
|
|
288
|
+
→ /multi-workflow <task>
|
|
289
|
+
→ /multi-execute or specialized multi-agent command
|
|
290
|
+
→ /code-review
|
|
291
|
+
→ /verify
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### When to use
|
|
295
|
+
|
|
296
|
+
Use this only for:
|
|
297
|
+
|
|
298
|
+
- large tasks that benefit from parallel planning/execution;
|
|
299
|
+
- backend/frontend split work;
|
|
300
|
+
- research + implementation split work;
|
|
301
|
+
- tasks where external multi-agent runtime is installed and configured.
|
|
302
|
+
|
|
303
|
+
### Rule
|
|
304
|
+
|
|
305
|
+
Do not make multi-agent workflow the default. It is an advanced path, not the normal path.
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## 12. Recommended command sequence by task type
|
|
310
|
+
|
|
311
|
+
### A. Small feature
|
|
312
|
+
|
|
313
|
+
```text
|
|
314
|
+
/plan <feature>
|
|
315
|
+
→ confirm
|
|
316
|
+
→ implement
|
|
317
|
+
→ /code-review
|
|
318
|
+
→ /verify
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### B. Test-first feature
|
|
322
|
+
|
|
323
|
+
```text
|
|
324
|
+
/plan <feature>
|
|
325
|
+
→ confirm
|
|
326
|
+
→ /tdd
|
|
327
|
+
→ /code-review
|
|
328
|
+
→ /verify
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### C. Product idea
|
|
332
|
+
|
|
333
|
+
```text
|
|
334
|
+
/plan-prd <idea>
|
|
335
|
+
→ /plan .claude/prds/<name>.prd.md
|
|
336
|
+
→ confirm
|
|
337
|
+
→ /tdd or implement
|
|
338
|
+
→ /code-review
|
|
339
|
+
→ /verify
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### D. Large feature
|
|
343
|
+
|
|
344
|
+
```text
|
|
345
|
+
/prp-prd <idea>
|
|
346
|
+
→ /prp-plan .claude/PRPs/prds/<name>.prd.md
|
|
347
|
+
→ /prp-implement .claude/PRPs/plans/<name>.plan.md
|
|
348
|
+
→ /code-review
|
|
349
|
+
→ /verify
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### E. Bug fix
|
|
353
|
+
|
|
354
|
+
```text
|
|
355
|
+
/plan <bug + reproduction>
|
|
356
|
+
→ implement minimal fix
|
|
357
|
+
→ /build-fix if needed
|
|
358
|
+
→ /verify
|
|
359
|
+
→ /code-review
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
### F. Build broken
|
|
363
|
+
|
|
364
|
+
```text
|
|
365
|
+
/build-fix
|
|
366
|
+
→ /verify
|
|
367
|
+
→ /code-review
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### G. Review-only
|
|
371
|
+
|
|
372
|
+
```text
|
|
373
|
+
/code-review
|
|
374
|
+
→ fix findings
|
|
375
|
+
→ /verify
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
### H. Documentation/library research
|
|
379
|
+
|
|
380
|
+
```text
|
|
381
|
+
/docs <library>
|
|
382
|
+
→ implement/update docs
|
|
383
|
+
→ /update-docs
|
|
384
|
+
→ /verify if code changed
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
---
|
|
388
|
+
|
|
389
|
+
## 13. Project policy for repo-pattern initialized projects
|
|
390
|
+
|
|
391
|
+
A project initialized by `repo-pattern` should stay minimal.
|
|
392
|
+
|
|
393
|
+
Do not add local Claude runtime surfaces by default:
|
|
394
|
+
|
|
395
|
+
```text
|
|
396
|
+
.claude/skills/
|
|
397
|
+
.claude/commands/
|
|
398
|
+
.claude/hooks/
|
|
399
|
+
.claude/scripts/
|
|
400
|
+
.claude/rules/
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
ECC should provide the workflow surface through plugin-managed runtime.
|
|
404
|
+
|
|
405
|
+
`repo-pattern` provides:
|
|
406
|
+
|
|
407
|
+
```text
|
|
408
|
+
minimal Claude settings
|
|
409
|
+
MCP profiles
|
|
410
|
+
generated .mcp.json
|
|
411
|
+
ECC setup flow
|
|
412
|
+
audit/migrate/cleanup/doctor tools
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
---
|
|
416
|
+
|
|
417
|
+
## 14. Practical default
|
|
418
|
+
|
|
419
|
+
When unsure, use this:
|
|
420
|
+
|
|
421
|
+
```text
|
|
422
|
+
/plan <task>
|
|
423
|
+
→ confirm
|
|
424
|
+
→ implement or /tdd
|
|
425
|
+
→ /code-review
|
|
426
|
+
→ /verify
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
Use a deeper PRD/PRP workflow only when the task requires it.
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@negikirin/repo-pattern",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Minimal ECC-first Claude Code project setup and migrator",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"repo-pattern": "scripts/repo-pattern.mjs"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"audit": "node scripts/repo-pattern.mjs audit --target .",
|
|
11
|
+
"doctor": "node scripts/repo-pattern.mjs doctor --target .",
|
|
12
|
+
"mcp:web": "node scripts/repo-pattern.mjs mcp --target . --profile web",
|
|
13
|
+
"test": "node scripts/self-check.mjs && node scripts/repo-pattern.mjs doctor --target .",
|
|
14
|
+
"pack:dry": "npm pack --dry-run",
|
|
15
|
+
"prepublishOnly": "npm test && npm run pack:dry"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"author": "NegiKirin",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/NegiKirin/repo-pattern.git"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/NegiKirin/repo-pattern/issues"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/NegiKirin/repo-pattern#readme",
|
|
27
|
+
"keywords": [
|
|
28
|
+
"repo-pattern",
|
|
29
|
+
"claude-code",
|
|
30
|
+
"everything-claude-code",
|
|
31
|
+
"ecc",
|
|
32
|
+
"ecc-first",
|
|
33
|
+
"mcp",
|
|
34
|
+
"mcp-server",
|
|
35
|
+
"mcp-profiles",
|
|
36
|
+
"agentic-engineering",
|
|
37
|
+
"ai-engineering",
|
|
38
|
+
"developer-tools",
|
|
39
|
+
"project-template",
|
|
40
|
+
"project-scaffold",
|
|
41
|
+
"setup",
|
|
42
|
+
"migrator",
|
|
43
|
+
"automation",
|
|
44
|
+
"nodejs",
|
|
45
|
+
"javascript"
|
|
46
|
+
],
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=18"
|
|
49
|
+
},
|
|
50
|
+
"files": [
|
|
51
|
+
"scripts/",
|
|
52
|
+
".claude/CLAUDE.md",
|
|
53
|
+
".claude/settings.example.json",
|
|
54
|
+
".claude/settings.local.example.json",
|
|
55
|
+
"docs/",
|
|
56
|
+
"mcp/",
|
|
57
|
+
".repo-pattern.json",
|
|
58
|
+
".repo-pattern.lock.json",
|
|
59
|
+
"CLAUDE.md",
|
|
60
|
+
"README.md",
|
|
61
|
+
"LICENSE",
|
|
62
|
+
"THIRD_PARTY_NOTICES.md",
|
|
63
|
+
".github/workflows/"
|
|
64
|
+
],
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"access": "public"
|
|
67
|
+
},
|
|
68
|
+
"dependencies": {
|
|
69
|
+
"@clack/prompts": "^0.11.0"
|
|
70
|
+
}
|
|
71
|
+
}
|