codingbuddy-rules 4.5.0 → 5.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/.ai-rules/adapters/aider.md +374 -0
  2. package/.ai-rules/adapters/antigravity.md +6 -6
  3. package/.ai-rules/adapters/claude-code.md +68 -4
  4. package/.ai-rules/adapters/codex.md +5 -5
  5. package/.ai-rules/adapters/cursor.md +2 -2
  6. package/.ai-rules/adapters/kiro.md +8 -8
  7. package/.ai-rules/adapters/opencode.md +7 -7
  8. package/.ai-rules/adapters/q.md +2 -2
  9. package/.ai-rules/adapters/windsurf.md +395 -0
  10. package/.ai-rules/agents/README.md +66 -16
  11. package/.ai-rules/agents/accessibility-specialist.json +8 -1
  12. package/.ai-rules/agents/act-mode.json +8 -1
  13. package/.ai-rules/agents/agent-architect.json +14 -7
  14. package/.ai-rules/agents/ai-ml-engineer.json +7 -0
  15. package/.ai-rules/agents/architecture-specialist.json +7 -0
  16. package/.ai-rules/agents/auto-mode.json +10 -2
  17. package/.ai-rules/agents/backend-developer.json +7 -0
  18. package/.ai-rules/agents/code-quality-specialist.json +7 -0
  19. package/.ai-rules/agents/code-reviewer.json +86 -64
  20. package/.ai-rules/agents/data-engineer.json +14 -7
  21. package/.ai-rules/agents/data-scientist.json +16 -9
  22. package/.ai-rules/agents/devops-engineer.json +7 -0
  23. package/.ai-rules/agents/documentation-specialist.json +7 -0
  24. package/.ai-rules/agents/eval-mode.json +30 -19
  25. package/.ai-rules/agents/event-architecture-specialist.json +7 -0
  26. package/.ai-rules/agents/frontend-developer.json +7 -0
  27. package/.ai-rules/agents/i18n-specialist.json +8 -1
  28. package/.ai-rules/agents/integration-specialist.json +7 -0
  29. package/.ai-rules/agents/migration-specialist.json +7 -0
  30. package/.ai-rules/agents/mobile-developer.json +8 -10
  31. package/.ai-rules/agents/observability-specialist.json +7 -0
  32. package/.ai-rules/agents/parallel-orchestrator.json +352 -0
  33. package/.ai-rules/agents/performance-specialist.json +7 -0
  34. package/.ai-rules/agents/plan-mode.json +9 -1
  35. package/.ai-rules/agents/plan-reviewer.json +211 -0
  36. package/.ai-rules/agents/platform-engineer.json +7 -0
  37. package/.ai-rules/agents/security-engineer.json +15 -8
  38. package/.ai-rules/agents/security-specialist.json +8 -1
  39. package/.ai-rules/agents/seo-specialist.json +7 -0
  40. package/.ai-rules/agents/software-engineer.json +7 -0
  41. package/.ai-rules/agents/solution-architect.json +17 -10
  42. package/.ai-rules/agents/systems-developer.json +15 -8
  43. package/.ai-rules/agents/technical-planner.json +17 -10
  44. package/.ai-rules/agents/test-engineer.json +13 -6
  45. package/.ai-rules/agents/test-strategy-specialist.json +7 -0
  46. package/.ai-rules/agents/tooling-engineer.json +10 -3
  47. package/.ai-rules/agents/ui-ux-designer.json +7 -0
  48. package/.ai-rules/keyword-modes.json +4 -4
  49. package/.ai-rules/rules/clarification-guide.md +14 -14
  50. package/.ai-rules/rules/core.md +73 -0
  51. package/.ai-rules/rules/parallel-execution.md +217 -0
  52. package/.ai-rules/schemas/agent.schema.json +38 -0
  53. package/.ai-rules/skills/README.md +29 -1
  54. package/.ai-rules/skills/agent-design/SKILL.md +5 -0
  55. package/.ai-rules/skills/agent-design/examples/agent-template.json +55 -0
  56. package/.ai-rules/skills/agent-design/references/expertise-guidelines.md +112 -0
  57. package/.ai-rules/skills/agent-discussion/SKILL.md +199 -0
  58. package/.ai-rules/skills/agent-discussion-panel/SKILL.md +448 -0
  59. package/.ai-rules/skills/api-design/SKILL.md +5 -0
  60. package/.ai-rules/skills/api-design/examples/error-response.json +159 -0
  61. package/.ai-rules/skills/api-design/examples/openapi-template.yaml +393 -0
  62. package/.ai-rules/skills/build-fix/SKILL.md +234 -0
  63. package/.ai-rules/skills/code-explanation/SKILL.md +4 -0
  64. package/.ai-rules/skills/context-management/SKILL.md +1 -0
  65. package/.ai-rules/skills/cost-budget/SKILL.md +348 -0
  66. package/.ai-rules/skills/cross-repo-issues/SKILL.md +257 -0
  67. package/.ai-rules/skills/database-migration/SKILL.md +1 -0
  68. package/.ai-rules/skills/deepsearch/SKILL.md +214 -0
  69. package/.ai-rules/skills/deployment-checklist/SKILL.md +1 -0
  70. package/.ai-rules/skills/error-analysis/SKILL.md +1 -0
  71. package/.ai-rules/skills/finishing-a-development-branch/SKILL.md +281 -0
  72. package/.ai-rules/skills/frontend-design/SKILL.md +5 -0
  73. package/.ai-rules/skills/frontend-design/examples/component-template.tsx +203 -0
  74. package/.ai-rules/skills/frontend-design/references/css-patterns.md +243 -0
  75. package/.ai-rules/skills/git-master/SKILL.md +358 -0
  76. package/.ai-rules/skills/incident-response/SKILL.md +1 -0
  77. package/.ai-rules/skills/legacy-modernization/SKILL.md +1 -0
  78. package/.ai-rules/skills/mcp-builder/SKILL.md +7 -0
  79. package/.ai-rules/skills/mcp-builder/examples/resource-example.ts +233 -0
  80. package/.ai-rules/skills/mcp-builder/examples/tool-example.ts +198 -0
  81. package/.ai-rules/skills/mcp-builder/references/protocol-spec.md +215 -0
  82. package/.ai-rules/skills/onboard/SKILL.md +150 -0
  83. package/.ai-rules/skills/performance-optimization/SKILL.md +3 -0
  84. package/.ai-rules/skills/plan-and-review/SKILL.md +115 -0
  85. package/.ai-rules/skills/plan-to-issues/SKILL.md +318 -0
  86. package/.ai-rules/skills/pr-all-in-one/SKILL.md +15 -13
  87. package/.ai-rules/skills/pr-all-in-one/configuration-guide.md +7 -7
  88. package/.ai-rules/skills/pr-all-in-one/pr-templates.md +10 -10
  89. package/.ai-rules/skills/pr-review/SKILL.md +4 -0
  90. package/.ai-rules/skills/receiving-code-review/SKILL.md +347 -0
  91. package/.ai-rules/skills/refactoring/SKILL.md +1 -0
  92. package/.ai-rules/skills/requesting-code-review/SKILL.md +348 -0
  93. package/.ai-rules/skills/retrospective/SKILL.md +192 -0
  94. package/.ai-rules/skills/rule-authoring/SKILL.md +5 -0
  95. package/.ai-rules/skills/rule-authoring/examples/rule-template.md +142 -0
  96. package/.ai-rules/skills/rule-authoring/examples/trigger-patterns.md +126 -0
  97. package/.ai-rules/skills/security-audit/SKILL.md +4 -0
  98. package/.ai-rules/skills/ship/SKILL.md +242 -0
  99. package/.ai-rules/skills/skill-creator/SKILL.md +461 -0
  100. package/.ai-rules/skills/skill-creator/agents/analyzer.md +206 -0
  101. package/.ai-rules/skills/skill-creator/agents/comparator.md +167 -0
  102. package/.ai-rules/skills/skill-creator/agents/grader.md +152 -0
  103. package/.ai-rules/skills/skill-creator/assets/eval_review.html +568 -0
  104. package/.ai-rules/skills/skill-creator/assets/skill-template.md +43 -0
  105. package/.ai-rules/skills/skill-creator/eval-viewer/generate_review.py +496 -0
  106. package/.ai-rules/skills/skill-creator/references/frontmatter-guide.md +632 -0
  107. package/.ai-rules/skills/skill-creator/references/multi-tool-compat.md +480 -0
  108. package/.ai-rules/skills/skill-creator/references/schemas.md +784 -0
  109. package/.ai-rules/skills/skill-creator/scripts/aggregate_benchmark.py +302 -0
  110. package/.ai-rules/skills/skill-creator/scripts/init_skill.sh +196 -0
  111. package/.ai-rules/skills/skill-creator/scripts/run_loop.py +327 -0
  112. package/.ai-rules/skills/systematic-debugging/SKILL.md +1 -0
  113. package/.ai-rules/skills/tech-debt/SKILL.md +1 -0
  114. package/.ai-rules/skills/test-coverage-gate/SKILL.md +303 -0
  115. package/.ai-rules/skills/tmux-master/SKILL.md +491 -0
  116. package/.ai-rules/skills/using-git-worktrees/SKILL.md +368 -0
  117. package/.ai-rules/skills/verification-before-completion/SKILL.md +234 -0
  118. package/.ai-rules/skills/widget-slot-architecture/SKILL.md +6 -0
  119. package/.ai-rules/skills/widget-slot-architecture/examples/parallel-route-setup.tsx +206 -0
  120. package/.ai-rules/skills/widget-slot-architecture/examples/widget-component.tsx +250 -0
  121. package/.ai-rules/skills/writing-plans/SKILL.md +78 -0
  122. package/bin/cli.js +170 -0
  123. package/lib/init/detect-stack.js +162 -0
  124. package/lib/init/generate-config.js +31 -0
  125. package/lib/init/index.js +86 -0
  126. package/lib/init/prompt.js +60 -0
  127. package/lib/init/scaffold.js +67 -0
  128. package/lib/init/suggest-agent.js +57 -0
  129. package/package.json +10 -2
@@ -0,0 +1,126 @@
1
+ # Rule Trigger Patterns
2
+
3
+ Patterns for writing clear, unambiguous trigger conditions in AI coding rules. A trigger defines **when** a rule activates — ambiguous triggers cause inconsistent AI behavior.
4
+
5
+ ## Trigger Anatomy
6
+
7
+ ```
8
+ **When:** <scope> + <condition> + <qualifier (optional)>
9
+ ```
10
+
11
+ | Part | Purpose | Example |
12
+ |------|---------|---------|
13
+ | Scope | What code area | "In TypeScript files" |
14
+ | Condition | What is happening | "writing a new function" |
15
+ | Qualifier | Narrows further | "that is exported" |
16
+
17
+ ## Pattern Catalog
18
+
19
+ ### File-Scoped Triggers
20
+
21
+ ```markdown
22
+ **When:** Creating or modifying a TypeScript file (.ts, .tsx)
23
+ **When:** Adding a new test file
24
+ **When:** Editing files in the `src/api/` directory
25
+ **When:** Working with migration files (`*.migration.ts`)
26
+ ```
27
+
28
+ ### Action-Scoped Triggers
29
+
30
+ ```markdown
31
+ **When:** Writing a new function or method
32
+ **When:** Adding a dependency to package.json
33
+ **When:** Creating a new React component
34
+ **When:** Defining an API endpoint
35
+ **When:** Writing a database query
36
+ ```
37
+
38
+ ### Context-Scoped Triggers
39
+
40
+ ```markdown
41
+ **When:** Implementing a feature that handles user input
42
+ **When:** Adding authentication or authorization logic
43
+ **When:** Modifying shared utility code used by 3+ modules
44
+ **When:** Changing code that runs in a CI/CD pipeline
45
+ ```
46
+
47
+ ### Negation Triggers (When NOT to Apply)
48
+
49
+ ```markdown
50
+ **When:** NOT applicable:
51
+ - Prototype or spike code (marked with `// SPIKE:`)
52
+ - Generated code (auto-generated files)
53
+ - Third-party type definitions (`.d.ts`)
54
+ ```
55
+
56
+ ## Ambiguity Antipatterns
57
+
58
+ | Ambiguous Trigger | Problem | Fixed Trigger |
59
+ |-------------------|---------|---------------|
60
+ | "When appropriate" | Who decides? | "When the function has > 3 parameters" |
61
+ | "When necessary" | Always unclear | "When the module is imported by 2+ files" |
62
+ | "When writing code" | Too broad | "When writing exported functions" |
63
+ | "When dealing with errors" | Vague scope | "When implementing catch blocks in async functions" |
64
+ | "When it makes sense" | Subjective | "When the function performs I/O operations" |
65
+ | "In complex scenarios" | Undefined threshold | "When cyclomatic complexity exceeds 10" |
66
+
67
+ ## Combining Triggers
68
+
69
+ ### AND (all conditions must be true)
70
+
71
+ ```markdown
72
+ **When:** Writing a new API endpoint AND the endpoint accepts user input
73
+ ```
74
+
75
+ ### OR (any condition activates)
76
+
77
+ ```markdown
78
+ **When:** Creating a new module OR modifying a module's public API (exported types/functions)
79
+ ```
80
+
81
+ ### Conditional (if-then)
82
+
83
+ ```markdown
84
+ **When:** Adding a new dependency
85
+ - IF the dependency has no TypeScript types → also add `@types/<pkg>`
86
+ - IF the dependency is > 50KB → document the size justification
87
+ ```
88
+
89
+ ## Trigger Strength Vocabulary
90
+
91
+ | Keyword | Strength | Meaning |
92
+ |---------|----------|---------|
93
+ | ALWAYS / MUST | Mandatory | No exceptions — rule fires every time |
94
+ | SHOULD / PREFER | Default | Rule fires unless there's a documented reason not to |
95
+ | CONSIDER / MAY | Advisory | Rule is a suggestion, not a requirement |
96
+ | NEVER / MUST NOT | Prohibition | Rule prevents an action unconditionally |
97
+
98
+ ### Using Strength in Context
99
+
100
+ ```markdown
101
+ ### Input Validation
102
+
103
+ **When:** Writing a function that accepts external input (API request, form data, URL params)
104
+
105
+ **Do:** ALWAYS validate and sanitize input before processing.
106
+
107
+ **When:** Writing internal utility functions called only by trusted code
108
+
109
+ **Do:** CONSIDER adding input validation for defense-in-depth.
110
+ ```
111
+
112
+ ## Testing Your Triggers
113
+
114
+ For each trigger, ask:
115
+
116
+ 1. **Can I give 3 concrete examples where this trigger fires?**
117
+ - If not, the trigger is too vague.
118
+
119
+ 2. **Can I give 3 concrete examples where this trigger does NOT fire?**
120
+ - If not, the trigger is too broad.
121
+
122
+ 3. **Would two different AI tools interpret this the same way?**
123
+ - If not, add more specificity.
124
+
125
+ 4. **Is the trigger observable from the code?**
126
+ - Triggers based on intent ("when optimizing") are weaker than triggers based on observable state ("when the file contains a database query").
@@ -1,6 +1,10 @@
1
1
  ---
2
2
  name: security-audit
3
3
  description: Use when reviewing code for security vulnerabilities, before shipping features, or conducting security assessments. Covers OWASP Top 10, secrets exposure, authentication, and authorization flaws.
4
+ context: fork
5
+ agent: general-purpose
6
+ allowed-tools: Read, Grep, Glob, Bash(git:*)
7
+ argument-hint: [scope-or-path]
4
8
  ---
5
9
 
6
10
  # Security Audit
@@ -0,0 +1,242 @@
1
+ ---
2
+ name: ship
3
+ description: "Run local CI checks and ship changes — create branch, commit, push, and PR. Optionally link to a GitHub issue. Use when changes are ready to ship."
4
+ ---
5
+
6
+ # Ship Changes
7
+
8
+ Run local CI checks, then create branch, commit, push, and PR in one workflow.
9
+
10
+ Follow every step in order. Stop and report if any step fails.
11
+
12
+ ## Step 1: Determine Issue Context
13
+
14
+ Check if `$ARGUMENTS` is provided:
15
+
16
+ - **With issue** (`/ship 613` or `/ship https://github.com/.../issues/613`):
17
+ ```bash
18
+ gh issue view <number> --json title,body,labels
19
+ ```
20
+ Use the issue title and labels to inform branch name, commit message, and PR description.
21
+
22
+ - **Without issue** (`/ship`):
23
+ Skip issue fetch. Derive context entirely from the changed files and `git diff`. The user will be asked to confirm the commit message and PR title before proceeding.
24
+
25
+ ## Step 2: Check Working Tree
26
+
27
+ ```bash
28
+ git status
29
+ git diff --stat
30
+ ```
31
+
32
+ If there are no changes to ship, stop and inform the user.
33
+
34
+ ## Step 3: Detect Project Structure
35
+
36
+ Detect whether the project is a **monorepo** or **single-repo** by checking for configuration:
37
+
38
+ ### Option A: Configured via `codingbuddy.config.json`
39
+
40
+ If `codingbuddy.config.json` exists and contains `custom.ship`, use it:
41
+
42
+ ```jsonc
43
+ // codingbuddy.config.json
44
+ {
45
+ "custom": {
46
+ "ship": {
47
+ "packageManager": "yarn", // "yarn" | "npm" | "pnpm" | "bun"
48
+ "structure": "monorepo", // "monorepo" | "single"
49
+ "workspaces": [
50
+ {
51
+ "name": "my-app",
52
+ "paths": ["apps/my-app/**"],
53
+ "checks": ["lint", "format:check", "typecheck", "test:coverage", "build"]
54
+ },
55
+ {
56
+ "name": "my-lib",
57
+ "paths": ["packages/my-lib/**"],
58
+ "checks": ["lint", "typecheck", "test"]
59
+ }
60
+ ],
61
+ "globalChecks": [
62
+ {
63
+ "name": "schema-validation",
64
+ "command": "npx ajv-cli validate -s schema.json -d 'data/*.json'"
65
+ },
66
+ {
67
+ "name": "markdown-lint",
68
+ "command": "npx markdownlint-cli2 '**/*.md'"
69
+ }
70
+ ],
71
+ "skipPaths": ["docs/**", "*.md", ".github/**"]
72
+ }
73
+ }
74
+ }
75
+ ```
76
+
77
+ ### Option B: Auto-detection (no config)
78
+
79
+ If no `custom.ship` config exists, auto-detect:
80
+
81
+ 1. **Package manager**: Check for lock files in order: `bun.lock` → `pnpm-lock.yaml` → `yarn.lock` → `package-lock.json`. Default to `npm`.
82
+ 2. **Structure**: Check `package.json` for `workspaces` field. If present → monorepo; otherwise → single-repo.
83
+ 3. **Workspaces** (monorepo): Parse `workspaces` from `package.json`, resolve glob patterns against `git diff --name-only` to find affected workspaces.
84
+ 4. **Checks** (auto): Run standard checks for each affected workspace:
85
+ ```bash
86
+ <pm> [workspace <name>] lint
87
+ <pm> [workspace <name>] typecheck
88
+ <pm> [workspace <name>] test
89
+ <pm> [workspace <name>] build
90
+ ```
91
+ Where `<pm>` is the detected package manager and `workspace <name>` is included only for monorepos.
92
+
93
+ ## Step 4: Classify Changed Files
94
+
95
+ Run `git diff --name-only` (include both staged and unstaged) and classify into workspaces.
96
+
97
+ **Monorepo**: Match changed file paths against workspace `paths` patterns to find affected workspaces.
98
+
99
+ **Single-repo**: All changes belong to the single workspace.
100
+
101
+ If changed files match only `skipPaths` (or don't match any workspace in auto-detect), skip CI checks entirely and proceed to Step 6.
102
+
103
+ ## Step 5: Run Local CI Checks
104
+
105
+ ### Workspace checks
106
+
107
+ Run checks **only for affected workspaces**. Execute checks sequentially within each workspace. Stop at first failure.
108
+
109
+ **Configured** (from `custom.ship.workspaces`):
110
+ ```bash
111
+ # For each affected workspace, run each check:
112
+ <pm> workspace <workspace-name> <check>
113
+ ```
114
+
115
+ **Auto-detected**:
116
+ ```bash
117
+ # Monorepo — run for each affected workspace:
118
+ <pm> workspace <workspace-name> lint
119
+ <pm> workspace <workspace-name> typecheck
120
+ <pm> workspace <workspace-name> test
121
+ <pm> workspace <workspace-name> build
122
+
123
+ # Single-repo — run at project root:
124
+ <pm> run lint
125
+ <pm> run typecheck
126
+ <pm> run test
127
+ <pm> run build
128
+ ```
129
+
130
+ Skip any script that does not exist in the workspace's `package.json` — check with `<pm> run --json` or by reading `package.json` scripts.
131
+
132
+ ### Global checks
133
+
134
+ If `custom.ship.globalChecks` is configured, run each global check command after workspace checks pass:
135
+
136
+ ```bash
137
+ <command> # executed from project root
138
+ ```
139
+
140
+ If ANY check fails, stop and report the failure. Do NOT proceed to shipping.
141
+
142
+ ## Step 6: Check Commit Convention
143
+
144
+ ```bash
145
+ git log --oneline -10
146
+ ```
147
+
148
+ Identify the commit message convention from recent history. Common conventions:
149
+ - `type(scope): description` (Conventional Commits)
150
+ - `type: description`
151
+ - Free-form
152
+
153
+ ## Step 7: Create Branch and Commit
154
+
155
+ ### Branch naming
156
+
157
+ - **With issue:** `<type>/<short-description>-<issue-number>` (e.g., `feat/add-auth-613`)
158
+ - **Without issue:** `<type>/<short-description>` (e.g., `fix/login-redirect`)
159
+
160
+ ### Commit
161
+
162
+ ```bash
163
+ git checkout -b <branch-name>
164
+
165
+ # Stage relevant files (never use git add -A)
166
+ git add <specific-files>
167
+
168
+ # Exclude task artifacts from staging
169
+ git reset HEAD RESULT.json TASK.md 2>/dev/null || true
170
+
171
+ # Commit with convention — use HEREDOC for message
172
+ git commit -m "$(cat <<'EOF'
173
+ type(scope): concise description
174
+
175
+ - Detail 1
176
+ - Detail 2
177
+
178
+ Closes #<issue-number> ← only if issue provided
179
+ EOF
180
+ )"
181
+ ```
182
+
183
+ **Rules:**
184
+ - Write commit message in **English**
185
+ - Do NOT include author information
186
+ - Follow the detected convention from Step 6
187
+ - Use specific file paths in `git add` (never `git add -A` or `git add .`)
188
+ - Only include `Closes #<number>` if an issue was provided
189
+
190
+ ## Step 8: Push and Create PR
191
+
192
+ ```bash
193
+ git push -u origin <branch-name>
194
+ ```
195
+
196
+ Create PR using `gh pr create`:
197
+
198
+ ### With issue
199
+
200
+ ```bash
201
+ gh pr create --title "<type>(scope): description" --label "<labels>" --body "$(cat <<'EOF'
202
+ ## Summary
203
+ <bullet points summarizing changes>
204
+
205
+ ## Test plan
206
+ <verification steps>
207
+
208
+ Closes #<issue-number>
209
+ EOF
210
+ )"
211
+ ```
212
+
213
+ - Labels: detect from issue labels, add relevant ones
214
+
215
+ ### Without issue
216
+
217
+ ```bash
218
+ gh pr create --title "<type>(scope): description" --label "<labels>" --body "$(cat <<'EOF'
219
+ ## Summary
220
+ <bullet points summarizing changes>
221
+
222
+ ## Test plan
223
+ <verification steps>
224
+ EOF
225
+ )"
226
+ ```
227
+
228
+ - Labels: infer from change type (e.g., `enhancement` for feat, `bug` for fix)
229
+
230
+ **PR Rules:**
231
+ - Title: under 70 characters, English, follows commit convention
232
+ - Body: English, include Summary + Test plan sections
233
+ - Do NOT include author information
234
+
235
+ ## Step 9: Report Result
236
+
237
+ Print the PR URL and a summary of:
238
+ - Which CI checks were run and passed (or "skipped — no matching workspace")
239
+ - Branch name
240
+ - Commit hash
241
+ - PR URL
242
+ - Linked issue (or "none")