compact-agent 1.1.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/README.md +394 -0
- package/bin/anycode.js +2 -0
- package/bin/crowcoder.js +19 -0
- package/bin/ecc-hooks.cjs +138 -0
- package/dist/agents.d.ts +17 -0
- package/dist/agents.js +1603 -0
- package/dist/agents.js.map +1 -0
- package/dist/api.d.ts +16 -0
- package/dist/api.js +115 -0
- package/dist/api.js.map +1 -0
- package/dist/autonomous-loops.d.ts +108 -0
- package/dist/autonomous-loops.js +526 -0
- package/dist/autonomous-loops.js.map +1 -0
- package/dist/codemaps.d.ts +53 -0
- package/dist/codemaps.js +325 -0
- package/dist/codemaps.js.map +1 -0
- package/dist/compaction.d.ts +30 -0
- package/dist/compaction.js +125 -0
- package/dist/compaction.js.map +1 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.js +79 -0
- package/dist/config.js.map +1 -0
- package/dist/content-engine.d.ts +97 -0
- package/dist/content-engine.js +721 -0
- package/dist/content-engine.js.map +1 -0
- package/dist/cost-tracker.d.ts +49 -0
- package/dist/cost-tracker.js +150 -0
- package/dist/cost-tracker.js.map +1 -0
- package/dist/counter-button.d.ts +35 -0
- package/dist/counter-button.js +48 -0
- package/dist/counter-button.js.map +1 -0
- package/dist/counter.d.ts +21 -0
- package/dist/counter.js +31 -0
- package/dist/counter.js.map +1 -0
- package/dist/coverage.d.ts +23 -0
- package/dist/coverage.js +215 -0
- package/dist/coverage.js.map +1 -0
- package/dist/docs-sync.d.ts +23 -0
- package/dist/docs-sync.js +266 -0
- package/dist/docs-sync.js.map +1 -0
- package/dist/ecc.d.ts +41 -0
- package/dist/ecc.js +644 -0
- package/dist/ecc.js.map +1 -0
- package/dist/evaluation.d.ts +24 -0
- package/dist/evaluation.js +412 -0
- package/dist/evaluation.js.map +1 -0
- package/dist/export.d.ts +22 -0
- package/dist/export.js +109 -0
- package/dist/export.js.map +1 -0
- package/dist/git-workflow.d.ts +22 -0
- package/dist/git-workflow.js +197 -0
- package/dist/git-workflow.js.map +1 -0
- package/dist/hook-controls.d.ts +34 -0
- package/dist/hook-controls.js +90 -0
- package/dist/hook-controls.js.map +1 -0
- package/dist/hooks.d.ts +30 -0
- package/dist/hooks.js +130 -0
- package/dist/hooks.js.map +1 -0
- package/dist/html-parser.d.ts +18 -0
- package/dist/html-parser.js +101 -0
- package/dist/html-parser.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +1230 -0
- package/dist/index.js.map +1 -0
- package/dist/learning.d.ts +35 -0
- package/dist/learning.js +238 -0
- package/dist/learning.js.map +1 -0
- package/dist/login.d.ts +37 -0
- package/dist/login.js +191 -0
- package/dist/login.js.map +1 -0
- package/dist/memory.d.ts +39 -0
- package/dist/memory.js +183 -0
- package/dist/memory.js.map +1 -0
- package/dist/model-router.d.ts +23 -0
- package/dist/model-router.js +145 -0
- package/dist/model-router.js.map +1 -0
- package/dist/modes.d.ts +17 -0
- package/dist/modes.js +217 -0
- package/dist/modes.js.map +1 -0
- package/dist/orchestration.d.ts +37 -0
- package/dist/orchestration.js +139 -0
- package/dist/orchestration.js.map +1 -0
- package/dist/package-detect.d.ts +36 -0
- package/dist/package-detect.js +529 -0
- package/dist/package-detect.js.map +1 -0
- package/dist/permissions.d.ts +25 -0
- package/dist/permissions.js +50 -0
- package/dist/permissions.js.map +1 -0
- package/dist/pm2-manager.d.ts +40 -0
- package/dist/pm2-manager.js +127 -0
- package/dist/pm2-manager.js.map +1 -0
- package/dist/query.d.ts +15 -0
- package/dist/query.js +278 -0
- package/dist/query.js.map +1 -0
- package/dist/refactor.d.ts +22 -0
- package/dist/refactor.js +226 -0
- package/dist/refactor.js.map +1 -0
- package/dist/retry.d.ts +20 -0
- package/dist/retry.js +88 -0
- package/dist/retry.js.map +1 -0
- package/dist/rules.d.ts +34 -0
- package/dist/rules.js +942 -0
- package/dist/rules.js.map +1 -0
- package/dist/schema.d.ts +23 -0
- package/dist/schema.js +12 -0
- package/dist/schema.js.map +1 -0
- package/dist/search-first.d.ts +17 -0
- package/dist/search-first.js +301 -0
- package/dist/search-first.js.map +1 -0
- package/dist/security.d.ts +10 -0
- package/dist/security.js +145 -0
- package/dist/security.js.map +1 -0
- package/dist/sessions.d.ts +21 -0
- package/dist/sessions.js +112 -0
- package/dist/sessions.js.map +1 -0
- package/dist/skill-create.d.ts +38 -0
- package/dist/skill-create.js +389 -0
- package/dist/skill-create.js.map +1 -0
- package/dist/skills.d.ts +34 -0
- package/dist/skills.js +161 -0
- package/dist/skills.js.map +1 -0
- package/dist/strategic-compaction.d.ts +24 -0
- package/dist/strategic-compaction.js +144 -0
- package/dist/strategic-compaction.js.map +1 -0
- package/dist/system-prompt.d.ts +3 -0
- package/dist/system-prompt.js +101 -0
- package/dist/system-prompt.js.map +1 -0
- package/dist/theme.d.ts +60 -0
- package/dist/theme.js +220 -0
- package/dist/theme.js.map +1 -0
- package/dist/tools/bash.d.ts +2 -0
- package/dist/tools/bash.js +49 -0
- package/dist/tools/bash.js.map +1 -0
- package/dist/tools/edit.d.ts +2 -0
- package/dist/tools/edit.js +76 -0
- package/dist/tools/edit.js.map +1 -0
- package/dist/tools/glob.d.ts +2 -0
- package/dist/tools/glob.js +54 -0
- package/dist/tools/glob.js.map +1 -0
- package/dist/tools/grep.d.ts +2 -0
- package/dist/tools/grep.js +64 -0
- package/dist/tools/grep.js.map +1 -0
- package/dist/tools/index.d.ts +5 -0
- package/dist/tools/index.js +27 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/list-dir.d.ts +2 -0
- package/dist/tools/list-dir.js +51 -0
- package/dist/tools/list-dir.js.map +1 -0
- package/dist/tools/read.d.ts +2 -0
- package/dist/tools/read.js +56 -0
- package/dist/tools/read.js.map +1 -0
- package/dist/tools/types.d.ts +45 -0
- package/dist/tools/types.js +2 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/tools/web-fetch.d.ts +2 -0
- package/dist/tools/web-fetch.js +41 -0
- package/dist/tools/web-fetch.js.map +1 -0
- package/dist/tools/web-search.d.ts +27 -0
- package/dist/tools/web-search.js +139 -0
- package/dist/tools/web-search.js.map +1 -0
- package/dist/tools/write.d.ts +2 -0
- package/dist/tools/write.js +36 -0
- package/dist/tools/write.js.map +1 -0
- package/dist/types.d.ts +28 -0
- package/dist/types.js +57 -0
- package/dist/types.js.map +1 -0
- package/dist/users.d.ts +51 -0
- package/dist/users.js +193 -0
- package/dist/users.js.map +1 -0
- package/dist/verification.d.ts +73 -0
- package/dist/verification.js +269 -0
- package/dist/verification.js.map +1 -0
- package/dist/walkthrough.d.ts +10 -0
- package/dist/walkthrough.js +121 -0
- package/dist/walkthrough.js.map +1 -0
- package/package.json +58 -0
- package/resources/ecc/agents/architect.json +16 -0
- package/resources/ecc/agents/architect.md +212 -0
- package/resources/ecc/agents/build-error-resolver.json +17 -0
- package/resources/ecc/agents/build-error-resolver.md +116 -0
- package/resources/ecc/agents/chief-of-staff.json +17 -0
- package/resources/ecc/agents/chief-of-staff.md +153 -0
- package/resources/ecc/agents/code-reviewer.json +16 -0
- package/resources/ecc/agents/code-reviewer.md +238 -0
- package/resources/ecc/agents/database-reviewer.json +16 -0
- package/resources/ecc/agents/database-reviewer.md +92 -0
- package/resources/ecc/agents/doc-updater.json +16 -0
- package/resources/ecc/agents/doc-updater.md +108 -0
- package/resources/ecc/agents/e2e-runner.json +17 -0
- package/resources/ecc/agents/e2e-runner.md +109 -0
- package/resources/ecc/agents/go-build-resolver.json +17 -0
- package/resources/ecc/agents/go-build-resolver.md +96 -0
- package/resources/ecc/agents/go-reviewer.json +16 -0
- package/resources/ecc/agents/go-reviewer.md +77 -0
- package/resources/ecc/agents/harness-optimizer.json +15 -0
- package/resources/ecc/agents/harness-optimizer.md +34 -0
- package/resources/ecc/agents/loop-operator.json +16 -0
- package/resources/ecc/agents/loop-operator.md +36 -0
- package/resources/ecc/agents/planner.json +15 -0
- package/resources/ecc/agents/planner.md +212 -0
- package/resources/ecc/agents/python-reviewer.json +16 -0
- package/resources/ecc/agents/python-reviewer.md +99 -0
- package/resources/ecc/agents/refactor-cleaner.json +17 -0
- package/resources/ecc/agents/refactor-cleaner.md +87 -0
- package/resources/ecc/agents/security-reviewer.json +16 -0
- package/resources/ecc/agents/security-reviewer.md +109 -0
- package/resources/ecc/agents/tdd-guide.json +17 -0
- package/resources/ecc/agents/tdd-guide.md +93 -0
- package/resources/ecc/commands/add-language-rules.md +39 -0
- package/resources/ecc/commands/database-migration.md +36 -0
- package/resources/ecc/commands/feature-development.md +38 -0
- package/resources/ecc/prompts/build-fix.prompt.md +47 -0
- package/resources/ecc/prompts/code-review.prompt.md +56 -0
- package/resources/ecc/prompts/plan.prompt.md +52 -0
- package/resources/ecc/prompts/refactor.prompt.md +50 -0
- package/resources/ecc/prompts/security-review.prompt.md +70 -0
- package/resources/ecc/prompts/tdd.prompt.md +47 -0
- package/resources/ecc/rules/common-agents.md +53 -0
- package/resources/ecc/rules/common-coding-style.md +52 -0
- package/resources/ecc/rules/common-development-workflow.md +33 -0
- package/resources/ecc/rules/common-git-workflow.md +28 -0
- package/resources/ecc/rules/common-hooks.md +34 -0
- package/resources/ecc/rules/common-patterns.md +35 -0
- package/resources/ecc/rules/common-performance.md +59 -0
- package/resources/ecc/rules/common-security.md +33 -0
- package/resources/ecc/rules/common-testing.md +33 -0
- package/resources/ecc/rules/golang-coding-style.md +31 -0
- package/resources/ecc/rules/golang-hooks.md +16 -0
- package/resources/ecc/rules/golang-patterns.md +44 -0
- package/resources/ecc/rules/golang-security.md +33 -0
- package/resources/ecc/rules/golang-testing.md +30 -0
- package/resources/ecc/rules/kotlin-coding-style.md +39 -0
- package/resources/ecc/rules/kotlin-hooks.md +16 -0
- package/resources/ecc/rules/kotlin-patterns.md +50 -0
- package/resources/ecc/rules/kotlin-security.md +58 -0
- package/resources/ecc/rules/kotlin-testing.md +38 -0
- package/resources/ecc/rules/php-coding-style.md +25 -0
- package/resources/ecc/rules/php-hooks.md +21 -0
- package/resources/ecc/rules/php-patterns.md +23 -0
- package/resources/ecc/rules/php-security.md +24 -0
- package/resources/ecc/rules/php-testing.md +26 -0
- package/resources/ecc/rules/python-coding-style.md +42 -0
- package/resources/ecc/rules/python-hooks.md +19 -0
- package/resources/ecc/rules/python-patterns.md +39 -0
- package/resources/ecc/rules/python-security.md +30 -0
- package/resources/ecc/rules/python-testing.md +38 -0
- package/resources/ecc/rules/swift-coding-style.md +47 -0
- package/resources/ecc/rules/swift-hooks.md +20 -0
- package/resources/ecc/rules/swift-patterns.md +66 -0
- package/resources/ecc/rules/swift-security.md +33 -0
- package/resources/ecc/rules/swift-testing.md +45 -0
- package/resources/ecc/rules/typescript-coding-style.md +63 -0
- package/resources/ecc/rules/typescript-hooks.md +20 -0
- package/resources/ecc/rules/typescript-patterns.md +50 -0
- package/resources/ecc/rules/typescript-security.md +26 -0
- package/resources/ecc/rules/typescript-testing.md +16 -0
- package/resources/ecc/skills/agent-introspection-debugging/SKILL.md +152 -0
- package/resources/ecc/skills/agent-introspection-debugging/agents/openai.yaml +7 -0
- package/resources/ecc/skills/agent-sort/SKILL.md +214 -0
- package/resources/ecc/skills/agent-sort/agents/openai.yaml +7 -0
- package/resources/ecc/skills/api-design/SKILL.md +522 -0
- package/resources/ecc/skills/api-design/agents/openai.yaml +7 -0
- package/resources/ecc/skills/article-writing/SKILL.md +78 -0
- package/resources/ecc/skills/article-writing/agents/openai.yaml +7 -0
- package/resources/ecc/skills/backend-patterns/SKILL.md +597 -0
- package/resources/ecc/skills/backend-patterns/agents/openai.yaml +7 -0
- package/resources/ecc/skills/brand-voice/SKILL.md +96 -0
- package/resources/ecc/skills/brand-voice/agents/openai.yaml +7 -0
- package/resources/ecc/skills/brand-voice/references/voice-profile-schema.md +55 -0
- package/resources/ecc/skills/bun-runtime/SKILL.md +83 -0
- package/resources/ecc/skills/bun-runtime/agents/openai.yaml +7 -0
- package/resources/ecc/skills/coding-standards/SKILL.md +548 -0
- package/resources/ecc/skills/coding-standards/agents/openai.yaml +7 -0
- package/resources/ecc/skills/content-engine/SKILL.md +130 -0
- package/resources/ecc/skills/content-engine/agents/openai.yaml +7 -0
- package/resources/ecc/skills/crosspost/SKILL.md +110 -0
- package/resources/ecc/skills/crosspost/agents/openai.yaml +7 -0
- package/resources/ecc/skills/deep-research/SKILL.md +154 -0
- package/resources/ecc/skills/deep-research/agents/openai.yaml +7 -0
- package/resources/ecc/skills/dmux-workflows/SKILL.md +143 -0
- package/resources/ecc/skills/dmux-workflows/agents/openai.yaml +7 -0
- package/resources/ecc/skills/documentation-lookup/SKILL.md +89 -0
- package/resources/ecc/skills/documentation-lookup/agents/openai.yaml +7 -0
- package/resources/ecc/skills/e2e-testing/SKILL.md +325 -0
- package/resources/ecc/skills/e2e-testing/agents/openai.yaml +7 -0
- package/resources/ecc/skills/eval-harness/SKILL.md +235 -0
- package/resources/ecc/skills/eval-harness/agents/openai.yaml +7 -0
- package/resources/ecc/skills/everything-claude-code/SKILL.md +442 -0
- package/resources/ecc/skills/everything-claude-code/agents/openai.yaml +7 -0
- package/resources/ecc/skills/exa-search/SKILL.md +169 -0
- package/resources/ecc/skills/exa-search/agents/openai.yaml +7 -0
- package/resources/ecc/skills/fal-ai-media/SKILL.md +276 -0
- package/resources/ecc/skills/fal-ai-media/agents/openai.yaml +7 -0
- package/resources/ecc/skills/frontend-patterns/SKILL.md +647 -0
- package/resources/ecc/skills/frontend-patterns/agents/openai.yaml +7 -0
- package/resources/ecc/skills/frontend-slides/SKILL.md +183 -0
- package/resources/ecc/skills/frontend-slides/STYLE_PRESETS.md +330 -0
- package/resources/ecc/skills/frontend-slides/agents/openai.yaml +7 -0
- package/resources/ecc/skills/investor-materials/SKILL.md +95 -0
- package/resources/ecc/skills/investor-materials/agents/openai.yaml +7 -0
- package/resources/ecc/skills/investor-outreach/SKILL.md +90 -0
- package/resources/ecc/skills/investor-outreach/agents/openai.yaml +7 -0
- package/resources/ecc/skills/market-research/SKILL.md +74 -0
- package/resources/ecc/skills/market-research/agents/openai.yaml +7 -0
- package/resources/ecc/skills/mcp-server-patterns/SKILL.md +66 -0
- package/resources/ecc/skills/mcp-server-patterns/agents/openai.yaml +7 -0
- package/resources/ecc/skills/mle-workflow/SKILL.md +346 -0
- package/resources/ecc/skills/mle-workflow/agents/openai.yaml +7 -0
- package/resources/ecc/skills/nextjs-turbopack/SKILL.md +43 -0
- package/resources/ecc/skills/nextjs-turbopack/agents/openai.yaml +7 -0
- package/resources/ecc/skills/product-capability/SKILL.md +140 -0
- package/resources/ecc/skills/product-capability/agents/openai.yaml +7 -0
- package/resources/ecc/skills/security-review/SKILL.md +494 -0
- package/resources/ecc/skills/security-review/agents/openai.yaml +7 -0
- package/resources/ecc/skills/strategic-compact/SKILL.md +102 -0
- package/resources/ecc/skills/strategic-compact/agents/openai.yaml +7 -0
- package/resources/ecc/skills/tdd-workflow/SKILL.md +409 -0
- package/resources/ecc/skills/tdd-workflow/agents/openai.yaml +7 -0
- package/resources/ecc/skills/verification-loop/SKILL.md +125 -0
- package/resources/ecc/skills/verification-loop/agents/openai.yaml +7 -0
- package/resources/ecc/skills/video-editing/SKILL.md +307 -0
- package/resources/ecc/skills/video-editing/agents/openai.yaml +7 -0
- package/resources/ecc/skills/x-api/SKILL.md +229 -0
- package/resources/ecc/skills/x-api/agents/openai.yaml +7 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tdd-guide
|
|
3
|
+
description: Test-Driven Development specialist enforcing write-tests-first methodology. Use PROACTIVELY when writing new features, fixing bugs, or refactoring code. Ensures 80%+ test coverage.
|
|
4
|
+
allowedTools:
|
|
5
|
+
- read
|
|
6
|
+
- write
|
|
7
|
+
- shell
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
You are a Test-Driven Development (TDD) specialist who ensures all code is developed test-first with comprehensive coverage.
|
|
11
|
+
|
|
12
|
+
## Your Role
|
|
13
|
+
|
|
14
|
+
- Enforce tests-before-code methodology
|
|
15
|
+
- Guide through Red-Green-Refactor cycle
|
|
16
|
+
- Ensure 80%+ test coverage
|
|
17
|
+
- Write comprehensive test suites (unit, integration, E2E)
|
|
18
|
+
- Catch edge cases before implementation
|
|
19
|
+
|
|
20
|
+
## TDD Workflow
|
|
21
|
+
|
|
22
|
+
### 1. Write Test First (RED)
|
|
23
|
+
Write a failing test that describes the expected behavior.
|
|
24
|
+
|
|
25
|
+
### 2. Run Test -- Verify it FAILS
|
|
26
|
+
```bash
|
|
27
|
+
npm test
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 3. Write Minimal Implementation (GREEN)
|
|
31
|
+
Only enough code to make the test pass.
|
|
32
|
+
|
|
33
|
+
### 4. Run Test -- Verify it PASSES
|
|
34
|
+
|
|
35
|
+
### 5. Refactor (IMPROVE)
|
|
36
|
+
Remove duplication, improve names, optimize -- tests must stay green.
|
|
37
|
+
|
|
38
|
+
### 6. Verify Coverage
|
|
39
|
+
```bash
|
|
40
|
+
npm run test:coverage
|
|
41
|
+
# Required: 80%+ branches, functions, lines, statements
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Test Types Required
|
|
45
|
+
|
|
46
|
+
| Type | What to Test | When |
|
|
47
|
+
|------|-------------|------|
|
|
48
|
+
| **Unit** | Individual functions in isolation | Always |
|
|
49
|
+
| **Integration** | API endpoints, database operations | Always |
|
|
50
|
+
| **E2E** | Critical user flows (Playwright) | Critical paths |
|
|
51
|
+
|
|
52
|
+
## Edge Cases You MUST Test
|
|
53
|
+
|
|
54
|
+
1. **Null/Undefined** input
|
|
55
|
+
2. **Empty** arrays/strings
|
|
56
|
+
3. **Invalid types** passed
|
|
57
|
+
4. **Boundary values** (min/max)
|
|
58
|
+
5. **Error paths** (network failures, DB errors)
|
|
59
|
+
6. **Race conditions** (concurrent operations)
|
|
60
|
+
7. **Large data** (performance with 10k+ items)
|
|
61
|
+
8. **Special characters** (Unicode, emojis, SQL chars)
|
|
62
|
+
|
|
63
|
+
## Test Anti-Patterns to Avoid
|
|
64
|
+
|
|
65
|
+
- Testing implementation details (internal state) instead of behavior
|
|
66
|
+
- Tests depending on each other (shared state)
|
|
67
|
+
- Asserting too little (passing tests that don't verify anything)
|
|
68
|
+
- Not mocking external dependencies (Supabase, Redis, OpenAI, etc.)
|
|
69
|
+
|
|
70
|
+
## Quality Checklist
|
|
71
|
+
|
|
72
|
+
- [ ] All public functions have unit tests
|
|
73
|
+
- [ ] All API endpoints have integration tests
|
|
74
|
+
- [ ] Critical user flows have E2E tests
|
|
75
|
+
- [ ] Edge cases covered (null, empty, invalid)
|
|
76
|
+
- [ ] Error paths tested (not just happy path)
|
|
77
|
+
- [ ] Mocks used for external dependencies
|
|
78
|
+
- [ ] Tests are independent (no shared state)
|
|
79
|
+
- [ ] Assertions are specific and meaningful
|
|
80
|
+
- [ ] Coverage is 80%+
|
|
81
|
+
|
|
82
|
+
For detailed mocking patterns and framework-specific examples, see `skill: tdd-workflow`.
|
|
83
|
+
|
|
84
|
+
## v1.8 Eval-Driven TDD Addendum
|
|
85
|
+
|
|
86
|
+
Integrate eval-driven development into TDD flow:
|
|
87
|
+
|
|
88
|
+
1. Define capability + regression evals before implementation.
|
|
89
|
+
2. Run baseline and capture failure signatures.
|
|
90
|
+
3. Implement minimum passing change.
|
|
91
|
+
4. Re-run tests and evals; report pass@1 and pass@3.
|
|
92
|
+
|
|
93
|
+
Release-critical paths should target pass^3 stability before merge.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: add-language-rules
|
|
3
|
+
description: Workflow command scaffold for add-language-rules in everything-claude-code.
|
|
4
|
+
allowed_tools: ["Bash", "Read", "Write", "Grep", "Glob"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /add-language-rules
|
|
8
|
+
|
|
9
|
+
Use this workflow when working on **add-language-rules** in `everything-claude-code`.
|
|
10
|
+
|
|
11
|
+
## Goal
|
|
12
|
+
|
|
13
|
+
Adds a new programming language to the rules system, including coding style, hooks, patterns, security, and testing guidelines.
|
|
14
|
+
|
|
15
|
+
## Common Files
|
|
16
|
+
|
|
17
|
+
- `rules/*/coding-style.md`
|
|
18
|
+
- `rules/*/hooks.md`
|
|
19
|
+
- `rules/*/patterns.md`
|
|
20
|
+
- `rules/*/security.md`
|
|
21
|
+
- `rules/*/testing.md`
|
|
22
|
+
|
|
23
|
+
## Suggested Sequence
|
|
24
|
+
|
|
25
|
+
1. Understand the current state and failure mode before editing.
|
|
26
|
+
2. Make the smallest coherent change that satisfies the workflow goal.
|
|
27
|
+
3. Run the most relevant verification for touched files.
|
|
28
|
+
4. Summarize what changed and what still needs review.
|
|
29
|
+
|
|
30
|
+
## Typical Commit Signals
|
|
31
|
+
|
|
32
|
+
- Create a new directory under rules/{language}/
|
|
33
|
+
- Add coding-style.md, hooks.md, patterns.md, security.md, and testing.md files with language-specific content
|
|
34
|
+
- Optionally reference or link to related skills
|
|
35
|
+
|
|
36
|
+
## Notes
|
|
37
|
+
|
|
38
|
+
- Treat this as a scaffold, not a hard-coded script.
|
|
39
|
+
- Update the command if the workflow evolves materially.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: database-migration
|
|
3
|
+
description: Workflow command scaffold for database-migration in everything-claude-code.
|
|
4
|
+
allowed_tools: ["Bash", "Read", "Write", "Grep", "Glob"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /database-migration
|
|
8
|
+
|
|
9
|
+
Use this workflow when working on **database-migration** in `everything-claude-code`.
|
|
10
|
+
|
|
11
|
+
## Goal
|
|
12
|
+
|
|
13
|
+
Database schema changes with migration files
|
|
14
|
+
|
|
15
|
+
## Common Files
|
|
16
|
+
|
|
17
|
+
- `**/schema.*`
|
|
18
|
+
- `migrations/*`
|
|
19
|
+
|
|
20
|
+
## Suggested Sequence
|
|
21
|
+
|
|
22
|
+
1. Understand the current state and failure mode before editing.
|
|
23
|
+
2. Make the smallest coherent change that satisfies the workflow goal.
|
|
24
|
+
3. Run the most relevant verification for touched files.
|
|
25
|
+
4. Summarize what changed and what still needs review.
|
|
26
|
+
|
|
27
|
+
## Typical Commit Signals
|
|
28
|
+
|
|
29
|
+
- Create migration file
|
|
30
|
+
- Update schema definitions
|
|
31
|
+
- Generate/update types
|
|
32
|
+
|
|
33
|
+
## Notes
|
|
34
|
+
|
|
35
|
+
- Treat this as a scaffold, not a hard-coded script.
|
|
36
|
+
- Update the command if the workflow evolves materially.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feature-development
|
|
3
|
+
description: Workflow command scaffold for feature-development in everything-claude-code.
|
|
4
|
+
allowed_tools: ["Bash", "Read", "Write", "Grep", "Glob"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /feature-development
|
|
8
|
+
|
|
9
|
+
Use this workflow when working on **feature-development** in `everything-claude-code`.
|
|
10
|
+
|
|
11
|
+
## Goal
|
|
12
|
+
|
|
13
|
+
Standard feature implementation workflow
|
|
14
|
+
|
|
15
|
+
## Common Files
|
|
16
|
+
|
|
17
|
+
- `manifests/*`
|
|
18
|
+
- `schemas/*`
|
|
19
|
+
- `**/*.test.*`
|
|
20
|
+
- `**/api/**`
|
|
21
|
+
|
|
22
|
+
## Suggested Sequence
|
|
23
|
+
|
|
24
|
+
1. Understand the current state and failure mode before editing.
|
|
25
|
+
2. Make the smallest coherent change that satisfies the workflow goal.
|
|
26
|
+
3. Run the most relevant verification for touched files.
|
|
27
|
+
4. Summarize what changed and what still needs review.
|
|
28
|
+
|
|
29
|
+
## Typical Commit Signals
|
|
30
|
+
|
|
31
|
+
- Add feature implementation
|
|
32
|
+
- Add tests for feature
|
|
33
|
+
- Update documentation
|
|
34
|
+
|
|
35
|
+
## Notes
|
|
36
|
+
|
|
37
|
+
- Treat this as a scaffold, not a hard-coded script.
|
|
38
|
+
- Update the command if the workflow evolves materially.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
agent: agent
|
|
3
|
+
description: Systematically diagnose and fix build errors, type errors, or failing CI
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Build Error Resolution
|
|
7
|
+
|
|
8
|
+
Work through the error systematically. Fix root causes — do not suppress warnings or skip checks.
|
|
9
|
+
|
|
10
|
+
## Process
|
|
11
|
+
|
|
12
|
+
### 1. Capture the full error
|
|
13
|
+
Paste or describe the complete error output (not just the last line). Include:
|
|
14
|
+
- Error message and stack trace
|
|
15
|
+
- File and line number if shown
|
|
16
|
+
- Build tool and command that failed
|
|
17
|
+
|
|
18
|
+
### 2. Categorize the error
|
|
19
|
+
|
|
20
|
+
| Category | Signals |
|
|
21
|
+
|----------|---------|
|
|
22
|
+
| **Type error** | `Type X is not assignable to Y`, `Property does not exist` |
|
|
23
|
+
| **Import/module** | `Cannot find module`, `does not provide an export` |
|
|
24
|
+
| **Syntax** | `Unexpected token`, `Expected ;` |
|
|
25
|
+
| **Dependency** | `peer dep conflict`, `missing package`, `version mismatch` |
|
|
26
|
+
| **Environment** | `command not found`, `ENOENT`, missing env var |
|
|
27
|
+
| **Test failure** | `expected X but received Y`, assertion failure |
|
|
28
|
+
| **Lint** | `ESLint`, `no-unused-vars`, `no-console` |
|
|
29
|
+
|
|
30
|
+
### 3. Fix strategy
|
|
31
|
+
|
|
32
|
+
- **Type errors** — fix the type, do not cast to `any` or `unknown` unless truly unavoidable.
|
|
33
|
+
- **Import errors** — verify the export exists; check for circular dependencies.
|
|
34
|
+
- **Dependency errors** — update lockfile, reconcile peer dep versions, do not delete `node_modules` as a first step.
|
|
35
|
+
- **Test failures** — fix the implementation if behavior is wrong; fix the test only if the test itself is incorrect.
|
|
36
|
+
- **Lint errors** — fix the code, do not add `// eslint-disable` unless the rule is genuinely inapplicable and you document why.
|
|
37
|
+
|
|
38
|
+
### 4. Verify the fix
|
|
39
|
+
After applying a fix, run the build/test command again. Confirm the specific error is resolved and no new errors were introduced.
|
|
40
|
+
|
|
41
|
+
### 5. Check for related issues
|
|
42
|
+
A single root cause often produces multiple error messages. After fixing, scan for similar patterns elsewhere in the codebase.
|
|
43
|
+
|
|
44
|
+
## Rules
|
|
45
|
+
- Never use `--no-verify` to skip hooks.
|
|
46
|
+
- Never suppress type errors with `@ts-ignore` without a comment explaining why.
|
|
47
|
+
- Never delete lock files without understanding why they are conflicting.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
agent: agent
|
|
3
|
+
description: Comprehensive code quality and security review of the selected code or recent changes
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Review
|
|
7
|
+
|
|
8
|
+
Review the selected code (or the current diff if nothing is selected) across four dimensions. Only report issues you are **confident about** — flag uncertainty explicitly rather than guessing.
|
|
9
|
+
|
|
10
|
+
## Dimensions
|
|
11
|
+
|
|
12
|
+
### 1. Security (CRITICAL — block ship if found)
|
|
13
|
+
- Hardcoded secrets, tokens, API keys, passwords
|
|
14
|
+
- Missing input validation or sanitization at system boundaries
|
|
15
|
+
- SQL/NoSQL injection risk (string interpolation in queries)
|
|
16
|
+
- XSS risk (unsanitized HTML output)
|
|
17
|
+
- Auth/authz checks missing or client-side only
|
|
18
|
+
- Sensitive data in logs or error messages exposed to clients
|
|
19
|
+
- Missing rate limiting on public endpoints
|
|
20
|
+
|
|
21
|
+
### 2. Code Quality (HIGH)
|
|
22
|
+
- Mutation of existing state instead of creating new objects
|
|
23
|
+
- Functions over 50 lines or files over 800 lines
|
|
24
|
+
- Nesting deeper than 4 levels
|
|
25
|
+
- Duplicated logic that should be extracted
|
|
26
|
+
- Misleading or non-descriptive names
|
|
27
|
+
|
|
28
|
+
### 3. Error Handling (HIGH)
|
|
29
|
+
- Silently swallowed errors (`catch {}`, empty catch blocks)
|
|
30
|
+
- Missing error handling at async boundaries
|
|
31
|
+
- Errors returned but not checked by callers
|
|
32
|
+
- User-facing error messages leaking internal details
|
|
33
|
+
|
|
34
|
+
### 4. Test Coverage (MEDIUM)
|
|
35
|
+
- Missing tests for new logic
|
|
36
|
+
- Tests that only test happy paths (missing error/edge cases)
|
|
37
|
+
- Assertions that always pass
|
|
38
|
+
|
|
39
|
+
## Output Format
|
|
40
|
+
|
|
41
|
+
For each issue found:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
**[CRITICAL|HIGH|MEDIUM|LOW]** — [File:Line if known]
|
|
45
|
+
Issue: [What is wrong]
|
|
46
|
+
Fix: [Concrete suggestion]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
End with a summary:
|
|
50
|
+
```
|
|
51
|
+
## Summary
|
|
52
|
+
- Critical: N
|
|
53
|
+
- High: N
|
|
54
|
+
- Medium: N
|
|
55
|
+
- Approved to ship: yes / no (fix CRITICAL and HIGH first)
|
|
56
|
+
```
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
agent: agent
|
|
3
|
+
description: Create a phased implementation plan before writing any code
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Implementation Planner
|
|
7
|
+
|
|
8
|
+
Before writing any code for this feature/task, produce a structured plan.
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
1. **Clarify the goal** — restate the requirement in one sentence; flag any ambiguities.
|
|
13
|
+
2. **Research first** — identify existing utilities, libraries, or patterns in the codebase that can be reused. Do not reinvent what already exists.
|
|
14
|
+
3. **Identify dependencies** — list external packages, APIs, environment variables, or database changes needed.
|
|
15
|
+
4. **Break into phases** — structure work as ordered phases, each independently shippable:
|
|
16
|
+
- Phase 1: Core data model / schema changes
|
|
17
|
+
- Phase 2: Business logic + unit tests
|
|
18
|
+
- Phase 3: API / integration layer + integration tests
|
|
19
|
+
- Phase 4: UI / consumer layer + E2E tests
|
|
20
|
+
5. **Identify risks** — note anything that could block progress or cause regressions.
|
|
21
|
+
6. **Define done** — list the exact acceptance criteria (tests passing, coverage ≥ 80%, no lint errors, docs updated).
|
|
22
|
+
|
|
23
|
+
## Output Format
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
## Goal
|
|
27
|
+
[One-sentence summary]
|
|
28
|
+
|
|
29
|
+
## Reuse Opportunities
|
|
30
|
+
- [Existing utility/pattern]
|
|
31
|
+
|
|
32
|
+
## Dependencies
|
|
33
|
+
- [Package / API / env var]
|
|
34
|
+
|
|
35
|
+
## Phases
|
|
36
|
+
### Phase 1 — [Name]
|
|
37
|
+
- [ ] Task A
|
|
38
|
+
- [ ] Task B
|
|
39
|
+
|
|
40
|
+
### Phase 2 — [Name]
|
|
41
|
+
...
|
|
42
|
+
|
|
43
|
+
## Risks
|
|
44
|
+
- [Risk and mitigation]
|
|
45
|
+
|
|
46
|
+
## Definition of Done
|
|
47
|
+
- [ ] All tests pass (≥80% coverage)
|
|
48
|
+
- [ ] No new lint errors
|
|
49
|
+
- [ ] Docs updated if public API changed
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Apply ECC coding standards throughout: immutable patterns, small focused files, explicit error handling.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
agent: agent
|
|
3
|
+
description: Clean up dead code, reduce duplication, and simplify structure without changing behavior
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Refactor & Cleanup
|
|
7
|
+
|
|
8
|
+
Improve the internal structure of the selected code without changing its observable behavior. All tests must pass before and after.
|
|
9
|
+
|
|
10
|
+
## Before Starting
|
|
11
|
+
- [ ] Confirm the test suite is passing.
|
|
12
|
+
- [ ] Note the current coverage baseline.
|
|
13
|
+
- [ ] Identify the scope: single function, file, or module?
|
|
14
|
+
|
|
15
|
+
## Refactoring Targets
|
|
16
|
+
|
|
17
|
+
### Dead Code Removal
|
|
18
|
+
- Unused variables, imports, functions, and exports
|
|
19
|
+
- Commented-out code blocks (delete, don't leave as comments)
|
|
20
|
+
- Feature flags that are permanently enabled/disabled
|
|
21
|
+
- Unreachable branches
|
|
22
|
+
|
|
23
|
+
### Duplication Reduction
|
|
24
|
+
- Repeated logic that can be extracted into a shared utility
|
|
25
|
+
- Copy-pasted blocks differing only in a parameter (extract with that parameter)
|
|
26
|
+
- Inline constants that appear in multiple places (extract to named constants)
|
|
27
|
+
|
|
28
|
+
### Structure Improvements
|
|
29
|
+
- Functions over 50 lines → break into smaller, named steps
|
|
30
|
+
- Files over 800 lines → extract cohesive sub-modules
|
|
31
|
+
- Nesting deeper than 4 levels → extract early-return guards or helper functions
|
|
32
|
+
- Mixed concerns in one function → split into focused single-responsibility functions
|
|
33
|
+
|
|
34
|
+
### Naming
|
|
35
|
+
- Rename variables/functions whose names don't match their behavior
|
|
36
|
+
- Replace magic numbers and strings with named constants
|
|
37
|
+
- Align naming with the domain language used elsewhere in the codebase
|
|
38
|
+
|
|
39
|
+
## Constraints
|
|
40
|
+
- **No behavior changes** — refactoring is purely structural.
|
|
41
|
+
- **One concern at a time** — do not mix refactoring with feature work or bug fixes.
|
|
42
|
+
- **Keep tests green** — run the suite after each meaningful change.
|
|
43
|
+
- **Don't add abstractions preemptively** — extract only what has already proven to be duplicated (rule of three).
|
|
44
|
+
|
|
45
|
+
## Output
|
|
46
|
+
After refactoring, summarize:
|
|
47
|
+
- What was removed (dead code, duplication)
|
|
48
|
+
- What was extracted (new utilities, constants)
|
|
49
|
+
- What was renamed and why
|
|
50
|
+
- Coverage before / after (should not decrease)
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
agent: agent
|
|
3
|
+
description: Deep security analysis — OWASP Top 10, secrets, auth, injection, and dependency risks
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Security Review
|
|
7
|
+
|
|
8
|
+
Perform a thorough security analysis of the selected code or current branch changes.
|
|
9
|
+
|
|
10
|
+
## Checklist
|
|
11
|
+
|
|
12
|
+
### Secrets & Configuration
|
|
13
|
+
- [ ] No hardcoded API keys, tokens, passwords, or private keys anywhere in source
|
|
14
|
+
- [ ] All secrets loaded from environment variables or a secret manager
|
|
15
|
+
- [ ] Required env vars validated at startup (fail fast if missing)
|
|
16
|
+
- [ ] `.env` files excluded from version control
|
|
17
|
+
|
|
18
|
+
### Input Validation & Injection
|
|
19
|
+
- [ ] All user inputs validated and sanitized before use
|
|
20
|
+
- [ ] Parameterized queries for every database operation (no string interpolation)
|
|
21
|
+
- [ ] HTML output escaped or sanitized (XSS prevention)
|
|
22
|
+
- [ ] File path inputs sanitized (path traversal prevention)
|
|
23
|
+
- [ ] Command inputs sanitized (command injection prevention)
|
|
24
|
+
|
|
25
|
+
### Authentication & Authorization
|
|
26
|
+
- [ ] Auth checks enforced server-side — never trust client-supplied user IDs or roles
|
|
27
|
+
- [ ] Session tokens are sufficiently random and expire appropriately
|
|
28
|
+
- [ ] Sensitive operations protected by authz checks, not just authn
|
|
29
|
+
- [ ] CSRF protection enabled for state-changing endpoints
|
|
30
|
+
|
|
31
|
+
### Data Exposure
|
|
32
|
+
- [ ] Error responses scrubbed of stack traces, internal paths, and sensitive data
|
|
33
|
+
- [ ] Logs do not contain PII, tokens, or passwords
|
|
34
|
+
- [ ] Sensitive fields excluded from API responses (no over-fetching)
|
|
35
|
+
- [ ] Appropriate HTTP security headers set
|
|
36
|
+
|
|
37
|
+
### Dependencies
|
|
38
|
+
- [ ] No known vulnerable packages (run `npm audit` / `pip-audit` / `cargo audit`)
|
|
39
|
+
- [ ] Dependency versions pinned or locked
|
|
40
|
+
- [ ] No unused dependencies that increase attack surface
|
|
41
|
+
|
|
42
|
+
### Infrastructure (if applicable)
|
|
43
|
+
- [ ] Rate limiting on all public endpoints
|
|
44
|
+
- [ ] HTTPS enforced; no HTTP fallback in production
|
|
45
|
+
- [ ] Principle of least privilege for service accounts and IAM roles
|
|
46
|
+
|
|
47
|
+
## Response Protocol
|
|
48
|
+
|
|
49
|
+
If a **CRITICAL** issue is found:
|
|
50
|
+
1. Stop and report immediately.
|
|
51
|
+
2. Do not ship until fixed.
|
|
52
|
+
3. Rotate any exposed secrets.
|
|
53
|
+
4. Scan the rest of the codebase for similar patterns.
|
|
54
|
+
|
|
55
|
+
## Output Format
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
## Findings
|
|
59
|
+
|
|
60
|
+
**[CRITICAL|HIGH|MEDIUM|LOW]** — [category]
|
|
61
|
+
Location: [file:line if known]
|
|
62
|
+
Issue: [what is wrong and why it is dangerous]
|
|
63
|
+
Fix: [concrete remediation]
|
|
64
|
+
|
|
65
|
+
## Summary
|
|
66
|
+
- Critical: N
|
|
67
|
+
- High: N
|
|
68
|
+
- Medium: N
|
|
69
|
+
- Safe to ship: yes / no
|
|
70
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
agent: agent
|
|
3
|
+
description: Test-driven development cycle — write the test first, then implement
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# TDD Workflow
|
|
7
|
+
|
|
8
|
+
Follow the RED → GREEN → IMPROVE cycle strictly. Do not write implementation code before a failing test exists.
|
|
9
|
+
|
|
10
|
+
## Cycle
|
|
11
|
+
|
|
12
|
+
### 1. RED — Write the failing test
|
|
13
|
+
- Write a test that describes the desired behavior.
|
|
14
|
+
- Run it. It **must fail** before continuing.
|
|
15
|
+
- Use Arrange-Act-Assert structure.
|
|
16
|
+
- Name tests descriptively: `returns empty array when no items match filter`, not `test itemFilter`.
|
|
17
|
+
|
|
18
|
+
### 2. GREEN — Minimal implementation
|
|
19
|
+
- Write the **minimum** code needed to make the test pass.
|
|
20
|
+
- Do not over-engineer at this stage.
|
|
21
|
+
- Run the test again — it **must pass**.
|
|
22
|
+
|
|
23
|
+
### 3. IMPROVE — Refactor
|
|
24
|
+
- Clean up duplication, naming, structure.
|
|
25
|
+
- Keep all tests passing after each change.
|
|
26
|
+
- Check coverage: target **≥ 80%**.
|
|
27
|
+
|
|
28
|
+
## Test Layer Checklist
|
|
29
|
+
|
|
30
|
+
- [ ] **Unit** — pure functions, utilities, isolated components
|
|
31
|
+
- [ ] **Integration** — API endpoints, database operations, service boundaries
|
|
32
|
+
- [ ] **E2E** — at least one critical user flow covered
|
|
33
|
+
|
|
34
|
+
## Quality Gates
|
|
35
|
+
|
|
36
|
+
Before marking the feature done:
|
|
37
|
+
- [ ] All tests pass
|
|
38
|
+
- [ ] Coverage ≥ 80%
|
|
39
|
+
- [ ] No skipped/commented-out tests
|
|
40
|
+
- [ ] Edge cases covered: empty input, nulls, boundary values, error paths
|
|
41
|
+
|
|
42
|
+
## Anti-patterns to Avoid
|
|
43
|
+
|
|
44
|
+
- Writing implementation before tests
|
|
45
|
+
- Testing implementation details instead of behavior
|
|
46
|
+
- Mocking too deeply (prefer integration tests over excessive mocks)
|
|
47
|
+
- Assertions that always pass (`expect(true).toBe(true)`)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Agent orchestration: available agents, parallel execution, multi-perspective analysis"
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
# Agent Orchestration
|
|
6
|
+
|
|
7
|
+
## Available Agents
|
|
8
|
+
|
|
9
|
+
Located in `~/.claude/agents/`:
|
|
10
|
+
|
|
11
|
+
| Agent | Purpose | When to Use |
|
|
12
|
+
|-------|---------|-------------|
|
|
13
|
+
| planner | Implementation planning | Complex features, refactoring |
|
|
14
|
+
| architect | System design | Architectural decisions |
|
|
15
|
+
| tdd-guide | Test-driven development | New features, bug fixes |
|
|
16
|
+
| code-reviewer | Code review | After writing code |
|
|
17
|
+
| security-reviewer | Security analysis | Before commits |
|
|
18
|
+
| build-error-resolver | Fix build errors | When build fails |
|
|
19
|
+
| e2e-runner | E2E testing | Critical user flows |
|
|
20
|
+
| refactor-cleaner | Dead code cleanup | Code maintenance |
|
|
21
|
+
| doc-updater | Documentation | Updating docs |
|
|
22
|
+
|
|
23
|
+
## Immediate Agent Usage
|
|
24
|
+
|
|
25
|
+
No user prompt needed:
|
|
26
|
+
1. Complex feature requests - Use **planner** agent
|
|
27
|
+
2. Code just written/modified - Use **code-reviewer** agent
|
|
28
|
+
3. Bug fix or new feature - Use **tdd-guide** agent
|
|
29
|
+
4. Architectural decision - Use **architect** agent
|
|
30
|
+
|
|
31
|
+
## Parallel Task Execution
|
|
32
|
+
|
|
33
|
+
ALWAYS use parallel Task execution for independent operations:
|
|
34
|
+
|
|
35
|
+
```markdown
|
|
36
|
+
# GOOD: Parallel execution
|
|
37
|
+
Launch 3 agents in parallel:
|
|
38
|
+
1. Agent 1: Security analysis of auth module
|
|
39
|
+
2. Agent 2: Performance review of cache system
|
|
40
|
+
3. Agent 3: Type checking of utilities
|
|
41
|
+
|
|
42
|
+
# BAD: Sequential when unnecessary
|
|
43
|
+
First agent 1, then agent 2, then agent 3
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Multi-Perspective Analysis
|
|
47
|
+
|
|
48
|
+
For complex problems, use split role sub-agents:
|
|
49
|
+
- Factual reviewer
|
|
50
|
+
- Senior engineer
|
|
51
|
+
- Security expert
|
|
52
|
+
- Consistency reviewer
|
|
53
|
+
- Redundancy checker
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "ECC coding style: immutability, file organization, error handling, validation"
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
# Coding Style
|
|
6
|
+
|
|
7
|
+
## Immutability (CRITICAL)
|
|
8
|
+
|
|
9
|
+
ALWAYS create new objects, NEVER mutate existing ones:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
// Pseudocode
|
|
13
|
+
WRONG: modify(original, field, value) → changes original in-place
|
|
14
|
+
CORRECT: update(original, field, value) → returns new copy with change
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Rationale: Immutable data prevents hidden side effects, makes debugging easier, and enables safe concurrency.
|
|
18
|
+
|
|
19
|
+
## File Organization
|
|
20
|
+
|
|
21
|
+
MANY SMALL FILES > FEW LARGE FILES:
|
|
22
|
+
- High cohesion, low coupling
|
|
23
|
+
- 200-400 lines typical, 800 max
|
|
24
|
+
- Extract utilities from large modules
|
|
25
|
+
- Organize by feature/domain, not by type
|
|
26
|
+
|
|
27
|
+
## Error Handling
|
|
28
|
+
|
|
29
|
+
ALWAYS handle errors comprehensively:
|
|
30
|
+
- Handle errors explicitly at every level
|
|
31
|
+
- Provide user-friendly error messages in UI-facing code
|
|
32
|
+
- Log detailed error context on the server side
|
|
33
|
+
- Never silently swallow errors
|
|
34
|
+
|
|
35
|
+
## Input Validation
|
|
36
|
+
|
|
37
|
+
ALWAYS validate at system boundaries:
|
|
38
|
+
- Validate all user input before processing
|
|
39
|
+
- Use schema-based validation where available
|
|
40
|
+
- Fail fast with clear error messages
|
|
41
|
+
- Never trust external data (API responses, user input, file content)
|
|
42
|
+
|
|
43
|
+
## Code Quality Checklist
|
|
44
|
+
|
|
45
|
+
Before marking work complete:
|
|
46
|
+
- [ ] Code is readable and well-named
|
|
47
|
+
- [ ] Functions are small (<50 lines)
|
|
48
|
+
- [ ] Files are focused (<800 lines)
|
|
49
|
+
- [ ] No deep nesting (>4 levels)
|
|
50
|
+
- [ ] Proper error handling
|
|
51
|
+
- [ ] No hardcoded values (use constants or config)
|
|
52
|
+
- [ ] No mutation (immutable patterns used)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Development workflow: plan, TDD, review, commit pipeline"
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
# Development Workflow
|
|
6
|
+
|
|
7
|
+
> This rule extends the git workflow rule with the full feature development process that happens before git operations.
|
|
8
|
+
|
|
9
|
+
The Feature Implementation Workflow describes the development pipeline: planning, TDD, code review, and then committing to git.
|
|
10
|
+
|
|
11
|
+
## Feature Implementation Workflow
|
|
12
|
+
|
|
13
|
+
1. **Plan First**
|
|
14
|
+
- Use **planner** agent to create implementation plan
|
|
15
|
+
- Identify dependencies and risks
|
|
16
|
+
- Break down into phases
|
|
17
|
+
|
|
18
|
+
2. **TDD Approach**
|
|
19
|
+
- Use **tdd-guide** agent
|
|
20
|
+
- Write tests first (RED)
|
|
21
|
+
- Implement to pass tests (GREEN)
|
|
22
|
+
- Refactor (IMPROVE)
|
|
23
|
+
- Verify 80%+ coverage
|
|
24
|
+
|
|
25
|
+
3. **Code Review**
|
|
26
|
+
- Use **code-reviewer** agent immediately after writing code
|
|
27
|
+
- Address CRITICAL and HIGH issues
|
|
28
|
+
- Fix MEDIUM issues when possible
|
|
29
|
+
|
|
30
|
+
4. **Commit & Push**
|
|
31
|
+
- Detailed commit messages
|
|
32
|
+
- Follow conventional commits format
|
|
33
|
+
- See the git workflow rule for commit message format and PR process
|