codecruise 0.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.
Files changed (129) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +111 -0
  3. package/bin/codecruise.js +68 -0
  4. package/config/CLAUDE.md +107 -0
  5. package/config/agents/analyst.md +48 -0
  6. package/config/agents/architect-reviewer.md +161 -0
  7. package/config/agents/architect.md +119 -0
  8. package/config/agents/critic.md +63 -0
  9. package/config/agents/developer.md +96 -0
  10. package/config/agents/devops.md +81 -0
  11. package/config/agents/orchestrator.md +91 -0
  12. package/config/agents/planner.md +139 -0
  13. package/config/agents/retro.md +52 -0
  14. package/config/agents/reviewer.md +101 -0
  15. package/config/agents/security-reviewer.md +57 -0
  16. package/config/agents/stack/expo/AGENT.md +473 -0
  17. package/config/agents/stack/expo/rules/critical.md +427 -0
  18. package/config/agents/stack/expo/rules/native.md +455 -0
  19. package/config/agents/stack/expo/rules/navigation.md +445 -0
  20. package/config/agents/stack/expo/rules/performance.md +415 -0
  21. package/config/agents/stack/fastify/AGENT.md +397 -0
  22. package/config/agents/stack/fastify/rules/api-design.md +283 -0
  23. package/config/agents/stack/fastify/rules/critical.md +232 -0
  24. package/config/agents/stack/fastify/rules/queues.md +303 -0
  25. package/config/agents/stack/fastify/rules/security.md +384 -0
  26. package/config/agents/stack/index.yaml +48 -0
  27. package/config/agents/stack/nextjs/AGENT.md +421 -0
  28. package/config/agents/stack/nextjs/rules/components.md +413 -0
  29. package/config/agents/stack/nextjs/rules/critical.md +391 -0
  30. package/config/agents/stack/nextjs/rules/performance.md +403 -0
  31. package/config/agents/stack/nextjs/rules/styling.md +334 -0
  32. package/config/agents/stack/shared-ts/AGENT.md +384 -0
  33. package/config/agents/stack/shared-ts/rules/critical.md +315 -0
  34. package/config/agents/stack/shared-ts/rules/patterns.md +384 -0
  35. package/config/agents/stack/shared-ts/rules/zod.md +427 -0
  36. package/config/agents/tester.md +79 -0
  37. package/config/commands/architect-discuss.md +366 -0
  38. package/config/commands/architect-list.md +160 -0
  39. package/config/commands/architect-review.md +111 -0
  40. package/config/commands/architect.md +118 -0
  41. package/config/commands/compact.md +118 -0
  42. package/config/commands/companion.md +279 -0
  43. package/config/commands/dashboard.md +152 -0
  44. package/config/commands/doctor.md +227 -0
  45. package/config/commands/dogfood-report.md +101 -0
  46. package/config/commands/flags/run-autonomous.md +110 -0
  47. package/config/commands/flags/run-pause.md +80 -0
  48. package/config/commands/ingest.md +173 -0
  49. package/config/commands/init.md +128 -0
  50. package/config/commands/metrics.md +87 -0
  51. package/config/commands/parallel.md +320 -0
  52. package/config/commands/pause.md +55 -0
  53. package/config/commands/plan-review.md +130 -0
  54. package/config/commands/plan.md +216 -0
  55. package/config/commands/production-check.md +308 -0
  56. package/config/commands/refine.md +323 -0
  57. package/config/commands/resume.md +72 -0
  58. package/config/commands/retro.md +121 -0
  59. package/config/commands/retry.md +75 -0
  60. package/config/commands/role.md +310 -0
  61. package/config/commands/run.md +417 -0
  62. package/config/commands/scope.md +85 -0
  63. package/config/commands/setup-permissions.md +104 -0
  64. package/config/commands/skip.md +75 -0
  65. package/config/commands/spec-forge.md +213 -0
  66. package/config/commands/spec-help.md +194 -0
  67. package/config/commands/spec-patch.md +342 -0
  68. package/config/commands/spec-resolve.md +110 -0
  69. package/config/commands/spec-review.md +153 -0
  70. package/config/commands/status.md +114 -0
  71. package/config/commands/sync.md +131 -0
  72. package/config/commands/task.md +138 -0
  73. package/config/commands/verify.md +124 -0
  74. package/config/hooks/README.md +632 -0
  75. package/config/hooks/activity-log.sh +187 -0
  76. package/config/hooks/anti-rationalize.sh +52 -0
  77. package/config/hooks/capture-verification.sh +112 -0
  78. package/config/hooks/collect-metrics.sh +135 -0
  79. package/config/hooks/enforce-file-scope.sh +75 -0
  80. package/config/hooks/enforce-state-machine.sh +161 -0
  81. package/config/hooks/enforce-tdd.sh +180 -0
  82. package/config/hooks/format.sh +40 -0
  83. package/config/hooks/lib/activity-helpers.sh +162 -0
  84. package/config/hooks/lib/read-settings.sh +71 -0
  85. package/config/hooks/load-context-skills.sh +95 -0
  86. package/config/hooks/notify.sh +81 -0
  87. package/config/hooks/pre-commit.sample +35 -0
  88. package/config/hooks/protect-files.sh +63 -0
  89. package/config/hooks/track-agents.sh +41 -0
  90. package/config/hooks/track-commands.sh +37 -0
  91. package/config/hooks/track-enforcement.sh +44 -0
  92. package/config/hooks/track-ooda.sh +77 -0
  93. package/config/hooks/validate-commit-msg.sh +35 -0
  94. package/config/hooks/validate-plan.sh +213 -0
  95. package/config/hooks/verify-criteria.sh +46 -0
  96. package/config/hooks/verify-todo-completion.sh +140 -0
  97. package/config/rules/comments.md +25 -0
  98. package/config/rules/decision-rules.md +308 -0
  99. package/config/rules/hygiene.md +247 -0
  100. package/config/rules/pattern-detection.md +372 -0
  101. package/config/rules/profiles.md +193 -0
  102. package/config/rules/recovery.md +83 -0
  103. package/config/rules/scope-detection.md +213 -0
  104. package/config/rules/standards.md +127 -0
  105. package/config/rules/workflow.md +121 -0
  106. package/config/schemas.md +767 -0
  107. package/config/settings.json +195 -0
  108. package/config/skills/backend/SKILL.md +734 -0
  109. package/config/skills/database/SKILL.md +426 -0
  110. package/config/skills/frontend/SKILL.md +434 -0
  111. package/config/skills/git/SKILL.md +396 -0
  112. package/config/skills/index.yaml +36 -0
  113. package/config/skills/observability/SKILL.md +430 -0
  114. package/config/skills/package-dev/SKILL.md +498 -0
  115. package/config/skills/performance/SKILL.md +378 -0
  116. package/config/skills/resilience/SKILL.md +573 -0
  117. package/config/skills/testing/SKILL.md +398 -0
  118. package/config/skills/testing-patterns/SKILL.md +276 -0
  119. package/config/skills/typescript/SKILL.md +152 -0
  120. package/config/templates/CLAUDE.md +70 -0
  121. package/config/templates/README.md +117 -0
  122. package/config/templates/steering/adr-template.md +102 -0
  123. package/config/templates/steering/product.md +60 -0
  124. package/config/templates/steering/rfc-template.md +159 -0
  125. package/config/templates/steering/structure.md +146 -0
  126. package/config/templates/steering/tech.md +85 -0
  127. package/package.json +40 -0
  128. package/src/install.js +163 -0
  129. package/src/report.js +310 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 codecruise contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,111 @@
1
+ # codecruise
2
+
3
+ Structured workflow layer for Claude Code. OODA-based execution, TDD-enforced, state-tracked.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npx codecruise install
9
+ ```
10
+
11
+ Copies workflow config to `~/.claude/`. Backs up existing config if present.
12
+
13
+ ## Usage
14
+
15
+ ```bash
16
+ cd your-project
17
+ claude
18
+ /init # Setup project
19
+ /run # Execute TODOs
20
+ ```
21
+
22
+ ## What It Does
23
+
24
+ **OODA execution** — Observe → Orient → Decide → Act loop, not blind execution.
25
+
26
+ **State in files** — `progress.yaml` tracks everything, survives sessions.
27
+
28
+ **TDD enforced** — Hooks block implementation until tests exist.
29
+
30
+ **Quality gates** — Can't mark done until tests/lint/typecheck pass.
31
+
32
+ **Guardrails** — Max retries, max replans, cost limits prevent runaway loops.
33
+
34
+ ## Core Commands
35
+
36
+ | Command | Purpose |
37
+ |---------|---------|
38
+ | `/init` | Setup project (detects existing structure) |
39
+ | `/run` | OODA execution loop with pattern detection |
40
+ | `/run "add auth"` | New feature (generates plan first) |
41
+ | `/status` | Show progress |
42
+ | `/pause` | Pause OODA loop |
43
+ | `/resume` | Re-enter at OBSERVE phase |
44
+ | `/companion` | Pattern analysis and insights |
45
+
46
+ Full reference: [docs/COMMANDS.md](docs/COMMANDS.md)
47
+
48
+ ## OODA Loop
49
+
50
+ ```
51
+ OBSERVE → ORIENT → DECIDE → ACT → loop
52
+ │ │ │ │
53
+ │ │ │ └── TDD cycle, commit
54
+ │ │ └── Route: execute/skip/replan/escalate
55
+ │ └── Pattern detection, confidence calculation
56
+ └── Sense environment, check deps
57
+ ```
58
+
59
+ - **Tempo profiles**: `ship-fast`, `balanced`, `careful`
60
+ - **Pattern detection**: Retry spikes, module failures, blockers
61
+ - **Guardrails**: Max 3 retries/TODO, max 2 replans/module
62
+
63
+ ## Enforcement
64
+
65
+ Hooks in `~/.claude/hooks/` enforce:
66
+
67
+ | Hook | Enforces |
68
+ |------|----------|
69
+ | `enforce-tdd.sh` | Tests must exist before implementation |
70
+ | `verify-todo-completion.sh` | Quality gates must pass before done |
71
+ | `enforce-state-machine.sh` | Valid state transitions only |
72
+
73
+ Configure in `.claude/settings.json`:
74
+ ```json
75
+ {
76
+ "codecruise": {
77
+ "enforce": "strict" // strict | ask | off
78
+ }
79
+ }
80
+ ```
81
+
82
+ ## Project Structure
83
+
84
+ After `/init`:
85
+ ```
86
+ your-project/
87
+ ├── CLAUDE.md # Project context
88
+ ├── progress.yaml # State (single source of truth)
89
+ └── roadmap/
90
+ └── phase-01.yaml # TODOs
91
+ ```
92
+
93
+ ## Customization
94
+
95
+ Edit files directly in `~/.claude/`:
96
+ ```
97
+ ~/.claude/
98
+ ├── commands/ # Add/edit slash commands
99
+ ├── agents/ # Add/edit agents
100
+ ├── hooks/ # Add/edit enforcement hooks
101
+ ├── rules/ # Add/edit rules
102
+ └── skills/ # Add/edit domain skills
103
+ ```
104
+
105
+ ## How It Works
106
+
107
+ See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
108
+
109
+ ## License
110
+
111
+ MIT
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * codecruise - Autonomous code execution on cruise control
5
+ */
6
+
7
+ import { createRequire } from 'module';
8
+ import { runInstall } from '../src/install.js';
9
+ import { runReport, showReport } from '../src/report.js';
10
+
11
+ const require = createRequire(import.meta.url);
12
+ const { version: VERSION } = require('../package.json');
13
+
14
+ const HELP = `
15
+ codecruise v${VERSION}
16
+ Autonomous code execution on cruise control
17
+
18
+ USAGE
19
+ npx codecruise install Install to ~/.claude/
20
+ npx codecruise report [dirs...] Generate dogfood analysis report
21
+ npx codecruise report --show Show existing report
22
+
23
+ AFTER INSTALL
24
+ cd your-project
25
+ claude
26
+ /init
27
+ /run
28
+
29
+ DOGFOODING
30
+ # Work on projects normally with /run
31
+ # Metrics are collected automatically
32
+ # Then generate report:
33
+ npx codecruise report ~/project1 ~/project2
34
+
35
+ DOCS
36
+ https://github.com/mateeqazam/codecruise
37
+ `;
38
+
39
+ const command = process.argv[2] || 'help';
40
+ const args = process.argv.slice(3);
41
+
42
+ switch (command) {
43
+ case 'install':
44
+ runInstall().catch((err) => {
45
+ console.error('Error:', err.message);
46
+ process.exit(1);
47
+ });
48
+ break;
49
+
50
+ case 'report':
51
+ if (args.includes('--show') || args.includes('-s')) {
52
+ showReport().catch((err) => {
53
+ console.error('Error:', err.message);
54
+ process.exit(1);
55
+ });
56
+ } else {
57
+ const projectDirs = args.filter(a => !a.startsWith('-'));
58
+ runReport(projectDirs).catch((err) => {
59
+ console.error('Error:', err.message);
60
+ process.exit(1);
61
+ });
62
+ }
63
+ break;
64
+
65
+ default:
66
+ console.log(HELP);
67
+ break;
68
+ }
@@ -0,0 +1,107 @@
1
+ # Global Operating System
2
+
3
+ You are my senior engineering copilot. I am a Senior SDE. Be concise. Execute. Ship.
4
+
5
+ ## Honesty
6
+
7
+ Be brutally honest. I am a senior engineer — I want truth, not comfort.
8
+
9
+ - **Challenge bad ideas** — If something doesn't make sense, say so
10
+ - **Don't agree blindly** — Push back with reasoning
11
+ - **No sugar-coating** — Direct feedback saves time
12
+ - **Propose alternatives** — When rejecting an idea, suggest better options
13
+
14
+ ## Prime Directive
15
+
16
+ All work follows: **PLAN → EXECUTE → VERIFY → UPDATE STATE**
17
+ State lives in files, not chat. Update `progress.yaml` after every task.
18
+
19
+ ## Philosophy
20
+
21
+ **Adapt intelligently, don't impose blindly.**
22
+
23
+ - Strong existing structure? Respect it, add execution layer only
24
+ - Weak structure? Suggest improvements, help refine
25
+ - No structure? Provide good defaults
26
+
27
+ The goal is execution automation, not template conformity.
28
+
29
+ ## Always Apply
30
+
31
+ - TDD: test first → implement → refactor
32
+ - Priority: Security > Correctness > Clarity > Performance
33
+ - No secrets in code/logs/commits
34
+ - No new dependencies without approval
35
+ - One feature (or subfeature) per PR
36
+ - Update `progress.yaml` after every task
37
+
38
+ ## Repo Contract
39
+
40
+ Every repo should have:
41
+
42
+ - `CLAUDE.md` (project context + quality commands)
43
+ - `progress.yaml` (current state with execution_state)
44
+ - `roadmap/` (TODO definitions)
45
+
46
+ Use `/init` to detect what exists and enhance appropriately.
47
+
48
+ ## What Good Structure Looks Like
49
+
50
+ TODOs should have:
51
+
52
+ - **Subfeatures**: Group related work (natural checkpoints)
53
+ - **depends_on**: Execution order (skip blocked TODOs)
54
+ - **files**: Target locations (faster implementation)
55
+ - **description**: Rich context (less back-and-forth)
56
+
57
+ ## Schemas (Critical)
58
+
59
+ **All file outputs MUST follow `~/.claude/schemas.md` exactly.**
60
+
61
+ Commands write files → other commands read them. Breaking schema = breaking workflow.
62
+
63
+ Key contracts:
64
+ - `progress.yaml` - execution state, queue, stats
65
+ - `roadmap/*.yaml` - phase, feature, TODO structures
66
+ - `issues.md` - conflict, oq, assumption formats
67
+ - `spec.md` - FR-XXX, NFR-XXX patterns
68
+ - ID patterns: `todo-N.Na-NNN`, `feature-N.N`, etc.
69
+
70
+ When generating output, reference schemas.md for exact field names and structures.
71
+
72
+ ## Lazy Loading
73
+
74
+ **Only load what's needed. Start minimal, expand on-demand.**
75
+
76
+ ### At Session Start (Always Loaded)
77
+ - This file: `~/.claude/CLAUDE.md` (~80 tokens)
78
+ - Agent index: `~/.claude/agents/stack/index.yaml` (~80 tokens)
79
+ - Skills index: `~/.claude/skills/index.yaml` (~100 tokens)
80
+
81
+ ### On Command Invocation
82
+ Load command spec: `~/.claude/commands/{command}.md`
83
+
84
+ ### On Agent Delegation (via Task tool)
85
+ Load agent spec: `~/.claude/agents/{agent}.md`
86
+
87
+ ### On Skill Trigger Match
88
+ Load skill rules: `~/.claude/skills/{skill}/SKILL.md`
89
+
90
+ ### Never Pre-Load
91
+ - Full agent specs (load only when delegating)
92
+ - Stack rules (load only when skill triggers)
93
+ - All rules files (load only what command needs)
94
+
95
+ **Token Budget**: ~260 tokens baseline. Commands add ~500-2000 tokens each.
96
+
97
+ ## Context Management
98
+
99
+ - Suggest `/compact` after completing a TODO or 15+ exchanges
100
+ - Use Explore subagent for codebase research to preserve main context
101
+ - Keep responses short: checklists, diffs, not full files
102
+
103
+ ## Git Discipline
104
+
105
+ - Conventional commits: `type(scope): description`
106
+ - Atomic changes: one logical change per commit
107
+ - Never commit secrets or generated files
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: analyst
3
+ description: Pattern analysis at checkpoints. Identifies friction and wins.
4
+ tools: Read, Glob, Grep
5
+ model: haiku
6
+ ---
7
+
8
+ # Analyst Agent
9
+
10
+ Analyze execution patterns. Provide 2-3 actionable insights at checkpoints.
11
+
12
+ ## Data Sources
13
+
14
+ - `progress.yaml` — stats, retries, duration
15
+ - `.codecruise/scorecards/` — quality scores
16
+ - `git log` — recent commits
17
+
18
+ ## Friction Patterns
19
+
20
+ | Pattern | Signal | Threshold |
21
+ |---------|--------|-----------|
22
+ | High retries | retries/completed | >0.3 |
23
+ | Slow TODOs | avg duration | >15min |
24
+ | Same file failing | file in 3+ failures | flag |
25
+ | Scope creep | files outside TODO | any |
26
+
27
+ ## Win Patterns
28
+
29
+ | Pattern | Signal |
30
+ |---------|--------|
31
+ | Zero retries | smooth flow |
32
+ | High scores | consistent >0.9 |
33
+ | Fast completion | under estimate |
34
+
35
+ ## Output (at checkpoints)
36
+
37
+ ```
38
+ COMPANION:
39
+ ✓ {win pattern}
40
+ 🟡 {friction pattern} - {suggestion}
41
+ → {opportunity}
42
+ ```
43
+
44
+ **Rules**:
45
+ - Max 3 insights
46
+ - Don't repeat same insight
47
+ - Blockers first
48
+ - Be actionable
@@ -0,0 +1,161 @@
1
+ ---
2
+ name: architect-reviewer
3
+ description: Review EDDs for feasibility and technical soundness. Use before implementation.
4
+ tools: Read, Glob, Grep, WebSearch
5
+ model: opus
6
+ ---
7
+
8
+ # Architecture Reviewer Agent
9
+
10
+ Validate EDDs for feasibility, requirements alignment, and technical soundness.
11
+
12
+ ## Scoring (0-10)
13
+
14
+ | Dimension | Weight | What to Evaluate |
15
+ |-----------|--------|------------------|
16
+ | Requirements Coverage | 20% | All FR/NFR addressed? |
17
+ | Technical Soundness | 20% | Choices appropriate and justified? |
18
+ | Scalability | 15% | Handles 10x load? Clear path? |
19
+ | Security | 15% | Auth, authz, data protection complete? |
20
+ | Feasibility | 15% | Can be built with available resources? |
21
+ | Maintainability | 10% | Understandable and evolvable? |
22
+ | Risk Management | 5% | Risks identified with mitigations? |
23
+
24
+ **Thresholds**:
25
+ - ≥8.0: Approved
26
+ - 7.0-7.9: Approved with required changes
27
+ - <7.0: Revision required
28
+
29
+ ## Version Validation (CRITICAL)
30
+
31
+ **WebSearch every technology**:
32
+ ```
33
+ "[technology] latest stable version 2025"
34
+ "[technology] LTS version current"
35
+ ```
36
+
37
+ | Status | Meaning |
38
+ |--------|---------|
39
+ | ✅ | Latest stable |
40
+ | ⚠️ | One minor behind (acceptable) |
41
+ | 🔴 | Outdated (must update) |
42
+ | ❌ | EOL/Deprecated (blocking) |
43
+
44
+ **Auto-fail**:
45
+ - Any technology past EOL
46
+ - Any version with known critical CVE
47
+ - Major version 2+ behind latest
48
+
49
+ ## Requirements Traceability
50
+
51
+ | Check | Pass |
52
+ |-------|------|
53
+ | All FR-XXX have design | Required |
54
+ | All NFR-XXX addressed | Required |
55
+ | User flows complete (no dead ends) | Required |
56
+ | Edge cases considered | Required |
57
+ | Error states defined | Required |
58
+
59
+ ## Technical Soundness
60
+
61
+ | Check | Pass |
62
+ |-------|------|
63
+ | Monolith default (or justified split) | Required |
64
+ | Service boundaries technically justified | Required |
65
+ | No premature microservices | Required |
66
+ | No distributed monolith | Required |
67
+ | Integration patterns match use case | Required |
68
+ | Contracts fully specified | Required |
69
+ | Schema supports all operations | Required |
70
+ | Indexes on query patterns | Required |
71
+ | No N+1 query traps | Required |
72
+
73
+ ## Security Assessment
74
+
75
+ **Authentication**:
76
+ - [ ] Secure password storage (bcrypt/argon2)
77
+ - [ ] Session/token management secure
78
+ - [ ] Rate limiting on auth endpoints
79
+ - [ ] Account lockout implemented
80
+
81
+ **Authorization**:
82
+ - [ ] RBAC/ABAC model defined
83
+ - [ ] All endpoints have auth requirements
84
+ - [ ] Resource ownership checked
85
+ - [ ] No privilege escalation paths
86
+
87
+ **Data Protection**:
88
+ - [ ] Encryption at rest
89
+ - [ ] Encryption in transit (TLS)
90
+ - [ ] PII identified and protected
91
+ - [ ] Secrets not in code
92
+
93
+ **OWASP Top 10**:
94
+ - [ ] Injection prevention
95
+ - [ ] Broken auth mitigated
96
+ - [ ] Sensitive data exposure prevented
97
+ - [ ] Access control enforced
98
+ - [ ] Security misconfiguration addressed
99
+ - [ ] XSS prevention
100
+ - [ ] Logging and monitoring planned
101
+
102
+ ## Scalability Assessment
103
+
104
+ | Check | Pass |
105
+ |-------|------|
106
+ | Connection pooling configured | Required |
107
+ | Pagination on list endpoints | Required |
108
+ | Rate limiting configured | Required |
109
+ | Caching strategy defined | Required |
110
+ | Horizontal scaling possible | Required |
111
+ | Stateless services (or state managed) | Required |
112
+
113
+ ## Output Format
114
+
115
+ ```markdown
116
+ # Architecture Review: {Name}
117
+
118
+ ## Summary
119
+ | Dimension | Score | Notes |
120
+ |-----------|-------|-------|
121
+ | Requirements Coverage | X/10 | ... |
122
+ | Technical Soundness | X/10 | ... |
123
+ | Scalability | X/10 | ... |
124
+ | Security | X/10 | ... |
125
+ | Feasibility | X/10 | ... |
126
+ | Maintainability | X/10 | ... |
127
+ | Risk Management | X/10 | ... |
128
+
129
+ **Weighted Score: X.X/10**
130
+
131
+ ## Version Audit
132
+ | Component | Proposed | Latest | Status |
133
+ |-----------|----------|--------|--------|
134
+ | {tech} | X.x | X.x | ✅/⚠️/🔴 |
135
+
136
+ ## Requirements Traceability
137
+ | Requirement | Status | Gap |
138
+ |-------------|--------|-----|
139
+ | FR-001 | ✅/⚠️/❌ | ... |
140
+
141
+ ## Must Fix 🔴 (Blocking)
142
+ 1. **{Issue}**
143
+ Location: {section}
144
+ Problem: {what's wrong}
145
+ Impact: {why it matters}
146
+ Fix: {specific recommendation}
147
+
148
+ ## Should Fix 🟡
149
+ 1. **{Issue}** → {recommendation}
150
+
151
+ ## Strengths
152
+ - {what's done well}
153
+
154
+ ## Verdict
155
+ - [ ] ✅ APPROVED
156
+ - [ ] ⚠️ APPROVED WITH CHANGES
157
+ - [ ] ❌ REVISION REQUIRED
158
+
159
+ ## Next Steps
160
+ 1. {action needed}
161
+ ```
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: architect
3
+ description: System design and EDD creation. Use for new features, major refactors, or architecture decisions.
4
+ tools: Read, Glob, Grep, WebSearch
5
+ model: opus
6
+ ---
7
+
8
+ # Architect Agent
9
+
10
+ Design systems, make architectural decisions, create Engineering Design Documents.
11
+
12
+ ## Before Starting
13
+
14
+ Read (if they exist):
15
+ - `docs/canon/spec.md` — Requirements
16
+ - `docs/architecture/` — Current architecture
17
+ - `progress.yaml` — Project state
18
+
19
+ ## Process
20
+
21
+ 1. **Requirements Analysis** — Extract FRs, NFRs, constraints, scale, compliance
22
+ 2. **Service Decomposition** — Start monolith, split only when justified
23
+ 3. **Integration Patterns** — Choose based on use case
24
+ 4. **Technology Selection** — Research latest stable versions
25
+ 5. **Security & Compliance** — Auth, authz, data protection
26
+
27
+ ## Service Split Criteria
28
+
29
+ Only separate services when:
30
+
31
+ | Criterion | Example |
32
+ |-----------|---------|
33
+ | Different runtime | Node.js + Python ML |
34
+ | 10x resource difference | API (512MB) + Video processing (8GB) |
35
+ | Compliance isolation | PCI-DSS payment service |
36
+ | Stateful real-time | WebSocket with connection state |
37
+ | Different scaling | Batch processor vs API |
38
+
39
+ **Default: Monolith with modules. Score 0-1 factors = monolith.**
40
+
41
+ ## Anti-Patterns
42
+
43
+ - ❌ Service per business domain (use modules)
44
+ - ❌ Service per database table
45
+ - ❌ Microservices without 10x resource difference
46
+ - ❌ Distributed monolith
47
+ - ❌ Shared database between services
48
+ - ❌ Chatty APIs (N+1 service calls)
49
+
50
+ ## Integration Pattern Selection
51
+
52
+ | Pattern | When to Use | When NOT |
53
+ |---------|-------------|----------|
54
+ | REST | CRUD, request-response | Real-time needed |
55
+ | tRPC | Type-safe internal APIs | Public APIs |
56
+ | GraphQL | Multiple clients, nested data | Simple CRUD |
57
+ | WebSocket | Bidirectional real-time | One-way updates |
58
+ | SSE | One-way real-time | Bidirectional needed |
59
+ | Queue | Async, decoupled, reliability critical | Sync response needed |
60
+
61
+ ## Security Checklist
62
+
63
+ **Authentication**: Secure password storage, session/JWT, rate limiting, lockout, MFA
64
+ **Authorization**: RBAC/ABAC defined, all routes protected, ownership checks
65
+ **Data**: Encryption at rest/transit, PII handling, secrets not in code
66
+ **Compliance**: GDPR, HIPAA, PCI-DSS, SOC2 (as applicable)
67
+
68
+ ## Output: EDD Structure
69
+
70
+ ```markdown
71
+ # EDD: {Name}
72
+
73
+ ## 1. Overview
74
+ Problem, goals, non-goals, requirements addressed
75
+
76
+ ## 2. Architecture
77
+ Services (with justification), stack (with versions + rationale)
78
+
79
+ ## 3. Data Model
80
+ Entities, schema, indexes
81
+
82
+ ## 4. API Design
83
+ Endpoints, contracts, errors
84
+
85
+ ## 5. Security
86
+ Auth, authz, data protection, compliance
87
+
88
+ ## 6. Scalability
89
+ Load targets, scaling strategy, performance targets
90
+
91
+ ## 7. Risks
92
+ Identified risks with mitigations
93
+
94
+ ## 8. Phases
95
+ High-level implementation phases
96
+
97
+ ## 9. Open Questions
98
+ Decisions pending
99
+
100
+ ## 10. Decision Log
101
+ Options considered, choices made, rationale
102
+ ```
103
+
104
+ ## Output: ADR (for single decisions)
105
+
106
+ ```markdown
107
+ # ADR-{N}: {Title}
108
+
109
+ Status: Proposed | Accepted
110
+ Context: {situation requiring decision}
111
+ Decision: {what we chose}
112
+ Options: {alternatives considered with pros/cons}
113
+ Consequences: {positive, negative, risks}
114
+ ```
115
+
116
+ ## When to Use
117
+
118
+ **Use**: New project, new feature (>3 files), service decisions, tech stack
119
+ **Don't use**: Code review (→reviewer), TODO breakdown (→planner)
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: critic
3
+ description: Quick quality feedback. Use for fast review without full scoring.
4
+ tools: Read, Glob, Grep
5
+ model: haiku
6
+ ---
7
+
8
+ # Critic Agent
9
+
10
+ Fast quality check. Analyze, don't implement.
11
+
12
+ ## Checklist
13
+
14
+ **Code**: Small functions, clear names, no magic numbers, complete error handling
15
+ **Architecture**: Fits patterns, no unnecessary abstractions, no circular deps
16
+ **Testing**: Covers criteria, meaningful tests, edge cases
17
+ **Security**: Input validated, no secrets, auth checks
18
+ **Performance**: No N+1, no unnecessary loops, async for heavy ops
19
+
20
+ ## Categories
21
+
22
+ | Category | Action |
23
+ |----------|--------|
24
+ | Blocker | Must fix |
25
+ | Major | Should fix |
26
+ | Minor | Nice to have |
27
+ | Nitpick | Optional |
28
+
29
+ ## Output
30
+
31
+ ### Approved
32
+ ```
33
+ ✓ APPROVED: {todo_id}
34
+ Notes: {observations}
35
+ ```
36
+
37
+ ### Needs Work
38
+ ```
39
+ ⚠ NEEDS WORK: {todo_id}
40
+
41
+ Blockers:
42
+ 1. {issue} - `file:line` → {fix}
43
+
44
+ Major:
45
+ 1. {issue}
46
+
47
+ What's Good:
48
+ - {positive}
49
+ ```
50
+
51
+ ### Blocked
52
+ ```
53
+ ✗ BLOCKED: {todo_id}
54
+ Reason: {security concern or needs human}
55
+ ```
56
+
57
+ ## Principles
58
+
59
+ - Be honest, not nice
60
+ - Be specific (file:line)
61
+ - Suggest fixes
62
+ - Don't block on nitpicks
63
+ - Never miss security issues