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,396 @@
1
+ ---
2
+ name: git
3
+ description: Commits, branching, and workflow discipline
4
+ version: 1.0.0
5
+ triggers:
6
+ - commit
7
+ - branch
8
+ - PR
9
+ - merge
10
+ - git
11
+ - push
12
+ ---
13
+
14
+ # Git Skill
15
+
16
+ Git workflow discipline for clean, atomic, reviewable history.
17
+
18
+ ## Quick Reference
19
+
20
+ ### Commit Discipline
21
+
22
+ | ID | Rule | Priority |
23
+ |----|------|----------|
24
+ | git-1 | Use conventional commits format | CRITICAL |
25
+ | git-2 | One logical change per commit | CRITICAL |
26
+ | git-3 | Never commit secrets or credentials | CRITICAL |
27
+ | git-4 | Write descriptive commit messages (why, not what) | HIGH |
28
+ | git-5 | Keep commits small and focused | HIGH |
29
+ | git-6 | Run tests before committing | HIGH |
30
+ | git-7 | Use imperative mood in commit messages | MEDIUM |
31
+
32
+ ### Branching
33
+
34
+ | ID | Rule | Priority |
35
+ |----|------|----------|
36
+ | branch-1 | Use feature branches for all changes | CRITICAL |
37
+ | branch-2 | Never push directly to main/master | CRITICAL |
38
+ | branch-3 | Keep branches short-lived (<1 week) | HIGH |
39
+ | branch-4 | Use consistent branch naming convention | HIGH |
40
+ | branch-5 | Delete branches after merge | MEDIUM |
41
+ | branch-6 | Rebase feature branches before PR | MEDIUM |
42
+
43
+ ### Pull Requests
44
+
45
+ | ID | Rule | Priority |
46
+ |----|------|----------|
47
+ | pr-1 | One feature per PR | CRITICAL |
48
+ | pr-2 | Write clear PR description | HIGH |
49
+ | pr-3 | Keep PRs small (<400 lines) | HIGH |
50
+ | pr-4 | Include test plan in PR | HIGH |
51
+ | pr-5 | Link PRs to issues/TODOs | MEDIUM |
52
+ | pr-6 | Request review from domain experts | MEDIUM |
53
+
54
+ ---
55
+
56
+ ## Commit Conventions
57
+
58
+ ### git-1: Conventional Commits
59
+
60
+ ```
61
+ type(scope): description
62
+
63
+ [optional body]
64
+
65
+ [optional footer]
66
+ ```
67
+
68
+ #### Types
69
+
70
+ ```
71
+ feat - New feature for users
72
+ fix - Bug fix for users
73
+ docs - Documentation changes only
74
+ style - Formatting, no code change
75
+ refactor - Code restructure, no behavior change
76
+ perf - Performance improvements
77
+ test - Adding or updating tests
78
+ chore - Build, CI, tooling changes
79
+ ```
80
+
81
+ #### Examples
82
+
83
+ ```bash
84
+ # Feature
85
+ feat(auth): implement password reset flow
86
+
87
+ Add forgot password endpoint and email service integration.
88
+ Includes rate limiting to prevent abuse.
89
+
90
+ Closes #123
91
+
92
+ # Bug fix
93
+ fix(cart): prevent duplicate items on rapid clicks
94
+
95
+ Debounce add-to-cart button and check for existing items
96
+ before adding to prevent quantity drift.
97
+
98
+ # Breaking change
99
+ feat(api)!: change user endpoint response format
100
+
101
+ BREAKING CHANGE: User endpoint now returns nested profile object
102
+ instead of flat structure. Update all clients to use user.profile.
103
+
104
+ # Multi-scope
105
+ feat(auth,api): add OAuth2 support
106
+
107
+ # No scope (project-wide)
108
+ chore: update dependencies to latest versions
109
+ ```
110
+
111
+ ### git-4: Commit Message Quality
112
+
113
+ ```bash
114
+ # BAD: What (obvious from diff)
115
+ fix: fixed the bug
116
+ feat: added feature
117
+ chore: updated code
118
+
119
+ # GOOD: Why (context not in diff)
120
+ fix(auth): prevent session fixation after password change
121
+
122
+ User sessions were persisting after password change, allowing
123
+ compromised tokens to remain valid. Now invalidates all sessions
124
+ except current on password update.
125
+
126
+ # GOOD: Context for future readers
127
+ refactor(db): extract connection pooling to dedicated module
128
+
129
+ Preparing for multi-tenant support. Pooling logic was embedded
130
+ in query builder, making it hard to configure per-tenant limits.
131
+ ```
132
+
133
+ ---
134
+
135
+ ## Branching Strategy
136
+
137
+ ### branch-4: Branch Naming
138
+
139
+ ```bash
140
+ # Format: type/scope-description
141
+
142
+ # Features
143
+ feature/auth-password-reset
144
+ feature/checkout-stripe-integration
145
+ feat/user-profile-page
146
+
147
+ # Bug fixes
148
+ fix/cart-quantity-overflow
149
+ bugfix/login-redirect-loop
150
+
151
+ # Chores
152
+ chore/upgrade-react-19
153
+ chore/ci-parallel-tests
154
+
155
+ # Hotfix (urgent production fix)
156
+ hotfix/payment-decimal-error
157
+
158
+ # Release
159
+ release/v2.1.0
160
+ ```
161
+
162
+ ### branch-6: Rebase Before PR
163
+
164
+ ```bash
165
+ # Update feature branch with latest main
166
+ git checkout feature/my-feature
167
+ git fetch origin
168
+ git rebase origin/main
169
+
170
+ # If conflicts:
171
+ # 1. Resolve conflicts in each file
172
+ # 2. git add <resolved-files>
173
+ # 3. git rebase --continue
174
+
175
+ # Force push rebased branch (safe for feature branches)
176
+ git push --force-with-lease origin feature/my-feature
177
+ ```
178
+
179
+ ---
180
+
181
+ ## Pull Request Guidelines
182
+
183
+ ### pr-2: PR Description Template
184
+
185
+ ```markdown
186
+ ## Summary
187
+ Brief description of what this PR does.
188
+
189
+ ## Changes
190
+ - Added X component for Y functionality
191
+ - Updated Z service to handle edge case
192
+ - Fixed bug where A caused B
193
+
194
+ ## Test Plan
195
+ - [ ] Unit tests pass
196
+ - [ ] Manual testing steps:
197
+ 1. Navigate to /feature
198
+ 2. Click button X
199
+ 3. Verify Y happens
200
+
201
+ ## Screenshots (if UI changes)
202
+ Before | After
203
+
204
+ ## Related
205
+ - Closes #123
206
+ - Related to #456
207
+ ```
208
+
209
+ ### pr-3: Keeping PRs Small
210
+
211
+ ```bash
212
+ # Break large features into incremental PRs:
213
+
214
+ # PR 1: Infrastructure
215
+ feat(db): add user_preferences table migration
216
+
217
+ # PR 2: Backend
218
+ feat(api): implement preferences CRUD endpoints
219
+
220
+ # PR 3: Frontend
221
+ feat(ui): create preferences settings page
222
+
223
+ # PR 4: Integration
224
+ feat(settings): wire preferences page to API
225
+
226
+ # Each PR is reviewable, testable, deployable
227
+ ```
228
+
229
+ ---
230
+
231
+ ## Git Workflow
232
+
233
+ ### Feature Development
234
+
235
+ ```bash
236
+ # 1. Start from updated main
237
+ git checkout main
238
+ git pull origin main
239
+
240
+ # 2. Create feature branch
241
+ git checkout -b feature/auth-login-form
242
+
243
+ # 3. Make changes with atomic commits
244
+ git add src/components/LoginForm.tsx
245
+ git commit -m "feat(auth): add login form component"
246
+
247
+ git add src/hooks/useAuth.ts
248
+ git commit -m "feat(auth): add useAuth hook for login state"
249
+
250
+ git add tests/auth.test.ts
251
+ git commit -m "test(auth): add login form tests"
252
+
253
+ # 4. Push and create PR
254
+ git push -u origin feature/auth-login-form
255
+ gh pr create --title "feat(auth): implement login form" --body "..."
256
+ ```
257
+
258
+ ### Handling Conflicts
259
+
260
+ ```bash
261
+ # Fetch and rebase onto main
262
+ git fetch origin
263
+ git rebase origin/main
264
+
265
+ # If conflicts occur:
266
+ # 1. Edit conflicted files (look for <<<<<<< markers)
267
+ # 2. Stage resolved files
268
+ git add <resolved-file>
269
+ # 3. Continue rebase
270
+ git rebase --continue
271
+
272
+ # If rebase gets messy, abort and try merge
273
+ git rebase --abort
274
+ git merge origin/main
275
+ ```
276
+
277
+ ### Amending Commits
278
+
279
+ ```bash
280
+ # Amend last commit (before push)
281
+ git add <forgotten-file>
282
+ git commit --amend --no-edit
283
+
284
+ # Amend last commit message
285
+ git commit --amend -m "feat(auth): better description"
286
+
287
+ # NEVER amend pushed commits on shared branches
288
+ ```
289
+
290
+ ### Interactive Rebase
291
+
292
+ ```bash
293
+ # Clean up last 3 commits before PR
294
+ git rebase -i HEAD~3
295
+
296
+ # In editor:
297
+ pick abc1234 feat(auth): add login form
298
+ squash def5678 fix typo
299
+ squash ghi9012 add missing test
300
+
301
+ # Results in single clean commit
302
+ ```
303
+
304
+ ---
305
+
306
+ ## Safety Rules
307
+
308
+ ### git-3: Never Commit Secrets
309
+
310
+ ```bash
311
+ # Add to .gitignore
312
+ .env
313
+ .env.*
314
+ *.pem
315
+ *.key
316
+ credentials.json
317
+ secrets/
318
+
319
+ # Check for secrets before commit
320
+ git diff --cached | grep -E "(password|secret|api_key|token)"
321
+
322
+ # If accidentally committed:
323
+ # 1. Remove from history (if not pushed)
324
+ git reset --soft HEAD~1
325
+ # 2. Add to .gitignore
326
+ echo "secrets.json" >> .gitignore
327
+ # 3. Recommit without secrets
328
+
329
+ # If pushed: rotate all exposed credentials immediately
330
+ ```
331
+
332
+ ### Dangerous Commands
333
+
334
+ ```bash
335
+ # AVOID unless absolutely necessary:
336
+ git push --force # Use --force-with-lease instead
337
+ git reset --hard # Loses uncommitted work
338
+ git clean -fd # Deletes untracked files
339
+ git checkout . # Discards all changes
340
+
341
+ # SAFE alternatives:
342
+ git push --force-with-lease # Fails if remote changed
343
+ git stash # Save work before reset
344
+ git stash -u # Include untracked files
345
+ ```
346
+
347
+ ---
348
+
349
+ ## Git Aliases (Productivity)
350
+
351
+ ```bash
352
+ # Add to ~/.gitconfig
353
+ [alias]
354
+ co = checkout
355
+ br = branch
356
+ ci = commit
357
+ st = status
358
+ unstage = reset HEAD --
359
+ last = log -1 HEAD
360
+ graph = log --oneline --graph --all
361
+
362
+ # Useful shortcuts
363
+ amend = commit --amend --no-edit
364
+ wip = commit -am "WIP"
365
+ undo = reset --soft HEAD~1
366
+
367
+ # Branch management
368
+ cleanup = "!git branch --merged | grep -v main | xargs git branch -d"
369
+ ```
370
+
371
+ ---
372
+
373
+ ## Pre-commit Hooks
374
+
375
+ ```bash
376
+ # .husky/pre-commit
377
+ #!/bin/sh
378
+ npm run lint-staged
379
+
380
+ # lint-staged.config.js
381
+ module.exports = {
382
+ '*.{ts,tsx}': ['eslint --fix', 'prettier --write'],
383
+ '*.{json,md}': ['prettier --write'],
384
+ };
385
+ ```
386
+
387
+ ```bash
388
+ # .husky/commit-msg
389
+ #!/bin/sh
390
+ npx commitlint --edit $1
391
+
392
+ # commitlint.config.js
393
+ module.exports = {
394
+ extends: ['@commitlint/config-conventional'],
395
+ };
396
+ ```
@@ -0,0 +1,36 @@
1
+ # Skills Index
2
+ # Loaded at startup (~100 tokens)
3
+ # Full skills loaded on-demand when triggers match
4
+
5
+ version: '1.0.0'
6
+
7
+ skills:
8
+ typescript:
9
+ description: TypeScript strict patterns and type safety
10
+ triggers: ['*.ts', '*.tsx', 'types', 'strict', 'zod', 'typescript']
11
+ rules_count: 15
12
+
13
+ frontend:
14
+ description: React, accessibility, and performance patterns
15
+ triggers: ['react', 'component', '*.tsx', 'accessibility', 'a11y', 'UI', 'CSS', 'tailwind']
16
+ rules_count: 40
17
+
18
+ backend:
19
+ description: API design, database, and security patterns
20
+ triggers: ['api', 'endpoint', 'database', 'SQL', 'auth', 'server', 'REST', 'tRPC', 'postgres', 'postgresql', 'mongo', 'mongodb', 'prisma', 'drizzle']
21
+ rules_count: 51
22
+
23
+ testing:
24
+ description: TDD workflow, unit, integration, and E2E testing
25
+ triggers: ['test', 'TDD', 'vitest', 'jest', 'playwright', 'spec', 'mock']
26
+ rules_count: 25
27
+
28
+ git:
29
+ description: Commits, branching, and workflow discipline
30
+ triggers: ['commit', 'branch', 'PR', 'merge', 'git', 'push']
31
+ rules_count: 19
32
+
33
+ # Loading strategy:
34
+ # 1. This index always loaded (~100 tokens)
35
+ # 2. When trigger matches, load skill SKILL.md summary (~300-500 tokens)
36
+ # 3. When applying rule, read specific rule file (~100-200 tokens)