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
@@ -0,0 +1,131 @@
1
+ ---
2
+ name: sync
3
+ description: Rebuild .codecruise/progress.yaml from roadmap source of truth
4
+ model: haiku
5
+ tools: Read, Write, Glob, Grep
6
+ ---
7
+
8
+ # /sync — State Synchronization
9
+
10
+ Rebuild `.codecruise/progress.yaml` from `.codecruise/roadmap/*.yaml` source of truth.
11
+
12
+ ## When to Use
13
+
14
+ | Situation | Use /sync? |
15
+ |-----------|------------|
16
+ | Manually edited roadmap files | ✅ Yes |
17
+ | TODOs added/removed outside workflow | ✅ Yes |
18
+ | .codecruise/progress.yaml corrupted | ✅ Yes |
19
+ | Normal execution | ❌ Use /run |
20
+ | Schema migration | ❌ Use /init --upgrade-schema |
21
+
22
+ ## Usage
23
+
24
+ ```bash
25
+ /sync # Rebuild queues from roadmap
26
+ /sync --dry-run # Preview changes without writing
27
+ /sync --reset # Full reset (clear completed, start fresh)
28
+ /sync --preserve-stats # Keep session stats, rebuild queues only
29
+ ```
30
+
31
+ ## What It Does
32
+
33
+ 1. **Scan Roadmap**: Read all `.codecruise/roadmap/*.yaml` files
34
+ 2. **Extract TODOs**: Build complete TODO list with dependencies
35
+ 3. **Topological Sort**: Order by dependencies
36
+ 4. **Rebuild Queues**:
37
+ - `pending`: All TODOs not marked done/skipped
38
+ - `completed`: TODOs with status=done
39
+ - `skipped`: TODOs with status=skipped
40
+ - `failed`: Clear (requires fresh attempt)
41
+ 5. **Validate**: Check for orphans, circular deps
42
+ 6. **Write**: Update .codecruise/progress.yaml
43
+
44
+ ## Preservation Rules
45
+
46
+ | Field | Default | With --reset |
47
+ |-------|---------|--------------|
48
+ | `queue.completed` | Preserve | Clear |
49
+ | `queue.pending` | Rebuild | Rebuild |
50
+ | `queue.skipped` | Preserve | Clear |
51
+ | `execution_state` | Preserve | Reset to defaults |
52
+ | `ooda` | Preserve | Reset |
53
+ | `guardrails` | Preserve | Preserve |
54
+ | `blockers` | Preserve | Preserve |
55
+ | `notes` | Preserve | Preserve |
56
+
57
+ ## Conflict Resolution
58
+
59
+ | Conflict | Resolution |
60
+ |----------|------------|
61
+ | TODO in completed but removed from roadmap | Keep in completed (historical) |
62
+ | TODO in pending but removed from roadmap | Remove from pending |
63
+ | TODO in roadmap but not in queues | Add to pending |
64
+ | TODO marked done in roadmap, not in completed | Add to completed |
65
+ | Circular dependency detected | Error, list cycle, abort |
66
+
67
+ ## Output
68
+
69
+ ```
70
+ ✓ Sync complete
71
+
72
+ Roadmap scanned:
73
+ - Phases: 3
74
+ - Features: 12
75
+ - TODOs: 47
76
+
77
+ Queue changes:
78
+ - Added to pending: 5 (new in roadmap)
79
+ - Removed from pending: 2 (deleted from roadmap)
80
+ - Moved to completed: 1 (status=done in roadmap)
81
+ - No changes: 39
82
+
83
+ Validation:
84
+ ✓ No orphans
85
+ ✓ No circular dependencies
86
+ ✓ All depends_on references valid
87
+
88
+ .codecruise/progress.yaml updated.
89
+ ```
90
+
91
+ ## Dry Run Output
92
+
93
+ ```
94
+ 🔍 Sync dry run
95
+
96
+ Would change:
97
+ + Add to pending: todo-2.1a-003, todo-2.1a-004, ...
98
+ - Remove from pending: todo-1.2b-007 (deleted from roadmap)
99
+ → Move to completed: todo-1.1a-005 (status=done)
100
+
101
+ Validation:
102
+ ✓ No issues
103
+
104
+ Run without --dry-run to apply.
105
+ ```
106
+
107
+ ## Error Cases
108
+
109
+ ```
110
+ ✗ Sync failed
111
+
112
+ Circular dependency detected:
113
+ todo-1.2a-001 → todo-1.2a-003 → todo-1.2a-001
114
+
115
+ Fix: Remove cycle in roadmap/phase-01.yaml, then re-run /sync.
116
+ ```
117
+
118
+ ## Integration
119
+
120
+ | Command | Relationship |
121
+ |---------|--------------|
122
+ | `/doctor` | Run `/doctor` after sync to validate |
123
+ | `/init` | `/init` calls `/sync` internally for new projects |
124
+ | `/run` | `/sync` before `/run` if roadmap changed |
125
+
126
+ ## Quality Bar
127
+
128
+ - Idempotent: Running twice = same result
129
+ - Non-destructive: Preserves completed work by default
130
+ - Fast: < 2 seconds for typical projects
131
+ - Validates before writing
@@ -0,0 +1,138 @@
1
+ ---
2
+ name: task
3
+ description: Execute current TODO using strict TDD (repo-safe)
4
+ disable-model-invocation: true
5
+ tools: Bash, Read, Write, Edit, Glob, Grep
6
+ model: sonnet
7
+ ---
8
+
9
+ # /task Command
10
+
11
+ Execute the current TODO using strict TDD and the workflow rules.
12
+
13
+ ## Read First
14
+
15
+ 1. `~/.claude/rules/workflow.md`
16
+ 2. `~/.claude/rules/standards.md`
17
+ 3. Project `CLAUDE.md` (quality_command + stack guidance)
18
+ 4. Relevant skills from `~/.claude/skills/` (only if needed)
19
+
20
+ ## Process
21
+
22
+ ### 1. Load Current Task
23
+
24
+ Read `progress.yaml` to identify:
25
+
26
+ - `current_todo`
27
+ - `current_feature`
28
+ - `current_phase`
29
+
30
+ If no current TODO:
31
+
32
+ - Find next pending TODO from roadmap
33
+ - Update `progress.yaml` with new current
34
+
35
+ ### 2. Read TODO Spec (YAML source of truth)
36
+
37
+ From the relevant phase/feature YAML, extract:
38
+
39
+ - id, description, owner, status
40
+ - owned files list (scope boundary)
41
+ - acceptance criteria
42
+ - required tests (if listed)
43
+
44
+ Rule: If required changes exceed owned files → STOP and ask human.
45
+
46
+ ### 3. Switch Branch
47
+
48
+ Use the correct feature/subfeature branch per workflow rules:
49
+
50
+ - checkout existing, or create from the correct parent branch
51
+ - if branch mismatch with progress.yaml → STOP and report
52
+
53
+ ### 4. TDD Cycle
54
+
55
+ #### RED Phase
56
+
57
+ - Write failing test(s) covering acceptance criteria
58
+ - Run tests → MUST fail for the right reason
59
+ - If it passes → fix the test (it is wrong)
60
+ - Commit: `test(scope): add tests for {todo}`
61
+
62
+ #### GREEN Phase
63
+
64
+ - Implement minimal code to pass
65
+ - Run tests → MUST pass
66
+
67
+ #### REFACTOR Phase (optional)
68
+
69
+ - Small cleanup only after green
70
+ - Run tests again → MUST still pass
71
+ - Commit: `feat(scope): implement {todo}`
72
+
73
+ ### 5. Verify Quality
74
+
75
+ - Read CLAUDE.md → find quality_command
76
+ - Run it via Bash
77
+ - Must pass (tests/lint/typecheck as applicable)
78
+ - If failing: attempt fix (max 3 tries), else STOP
79
+
80
+ ### 6. Update State (YAML only)
81
+
82
+ - Update TODO status in phase/feature YAML: `done` (or `blocked` with reason)
83
+ - Update `progress.yaml`:
84
+ - mark completion
85
+ - set next current_todo (or null)
86
+ - update last_updated timestamp
87
+
88
+ Note: Pre-commit hook runs quality checks automatically.
89
+
90
+ Tip: Run `/dashboard` after completing TODO to update progress visuals.
91
+
92
+ ### 7. Commit Changes
93
+
94
+ - Ensure all changes committed (no WIP)
95
+ - Commit implementation: `feat(scope): implement {todo}`
96
+ - Commit state update: `chore(progress): complete {todo_id}`
97
+
98
+ ## Output Format
99
+
100
+ ```
101
+ ✓ TODO complete: {todo_id}
102
+
103
+ Branch: {branch_name}
104
+
105
+ Files modified:
106
+ - {file1}
107
+ - {file2}
108
+
109
+ Tests added:
110
+ - {test1}
111
+ - {test2}
112
+
113
+ Quality: ✓ PASS
114
+
115
+ Commits:
116
+ - test(auth): add login validation tests
117
+ - feat(auth): implement login validation
118
+
119
+ Next: {next_todo_id} or "Phase complete!"
120
+ ```
121
+
122
+ ## On Failure
123
+
124
+ If tests fail or quality check fails:
125
+
126
+ 1. Report the failure clearly
127
+ 2. Show relevant error output
128
+ 3. Attempt fix (max 3 tries)
129
+ 4. If still failing, stop and ask for help
130
+
131
+ ## Stop Conditions
132
+
133
+ Immediately stop and ask human if:
134
+
135
+ - Files outside TODO scope need changes
136
+ - Security concern identified
137
+ - Architectural decision needed
138
+ - Stuck after 3 attempts
@@ -0,0 +1,124 @@
1
+ ---
2
+ name: verify
3
+ description: Run project quality checks (tests, lint, typecheck)
4
+ disable-model-invocation: true
5
+ tools: Read, Write, Bash, Glob
6
+ model: haiku
7
+ ---
8
+
9
+ # /verify Command
10
+
11
+ Run the project's quality checks.
12
+
13
+ ## Read First
14
+
15
+ 1. `~/.claude/rules/workflow.md`
16
+ 2. Project `CLAUDE.md`
17
+
18
+ ## Process
19
+
20
+ ### 1. Find Quality Command
21
+
22
+ Look for `quality_command` in project `CLAUDE.md`:
23
+
24
+ ```markdown
25
+ ## Commands
26
+ quality_command: npm run test && npm run lint && npm run typecheck
27
+ ```
28
+
29
+ ### 2. If Not Found
30
+
31
+ Ask user:
32
+
33
+ ```
34
+ No quality_command found in project CLAUDE.md.
35
+
36
+ What command runs your tests, lint, and type checks?
37
+ Example: npm run test && npm run lint
38
+
39
+ I'll save this to your project CLAUDE.md for future use.
40
+ ```
41
+
42
+ Save response to project `CLAUDE.md`.
43
+
44
+ ### 3. Capture Baseline
45
+
46
+ On first run in a session, capture baseline metrics:
47
+
48
+ ```yaml
49
+ baseline_debt:
50
+ lint_errors: {count}
51
+ test_failures: {count}
52
+ type_errors: {count}
53
+ ```
54
+
55
+ Store in `progress.yaml`.
56
+
57
+ ### 4. Run Quality Command
58
+
59
+ ```bash
60
+ {quality_command}
61
+ ```
62
+
63
+ Capture output for each step.
64
+
65
+ ### 5. Compare to Baseline
66
+
67
+ - No new errors introduced? ✓ PASS
68
+ - New errors introduced? ✗ FAIL (list new issues)
69
+ - Errors fixed? ✓ IMPROVEMENT
70
+
71
+ ### 6. Report Results
72
+
73
+ #### On Pass
74
+ ```
75
+ ✓ Quality Check PASS
76
+
77
+ Tests: 45 passed
78
+ Lint: 0 errors
79
+ Types: 0 errors
80
+
81
+ No new issues introduced.
82
+ ```
83
+
84
+ #### On Fail
85
+ ```
86
+ ✗ Quality Check FAIL
87
+
88
+ New issues introduced:
89
+
90
+ Lint (2 new):
91
+ - src/auth/login.ts:15 - 'user' is defined but never used
92
+ - src/auth/login.ts:23 - Missing return type
93
+
94
+ Tests (1 failing):
95
+ - auth/login.test.ts > should validate email format
96
+
97
+ Fix these issues before committing.
98
+ ```
99
+
100
+ #### On Improvement
101
+ ```
102
+ ✓ Quality Check PASS (with improvements!)
103
+
104
+ Tests: 47 passed (+2)
105
+ Lint: 0 errors (-3 fixed)
106
+ Types: 0 errors
107
+
108
+ Baseline updated.
109
+ ```
110
+
111
+ ## Quick Verify
112
+
113
+ For rapid iteration, support:
114
+
115
+ ```
116
+ /verify --quick
117
+ ```
118
+
119
+ Runs only tests related to changed files (if framework supports it).
120
+
121
+ ## Integration
122
+
123
+ This command is automatically called by `/task` after implementation.
124
+ Can also be run standalone to check current state.