codingbuddy-rules 5.0.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.
- package/.ai-rules/adapters/aider.md +374 -0
- package/.ai-rules/adapters/windsurf.md +395 -0
- package/.ai-rules/agents/accessibility-specialist.json +6 -0
- package/.ai-rules/agents/act-mode.json +6 -0
- package/.ai-rules/agents/agent-architect.json +6 -0
- package/.ai-rules/agents/ai-ml-engineer.json +6 -0
- package/.ai-rules/agents/architecture-specialist.json +6 -0
- package/.ai-rules/agents/auto-mode.json +6 -0
- package/.ai-rules/agents/backend-developer.json +6 -0
- package/.ai-rules/agents/code-quality-specialist.json +6 -0
- package/.ai-rules/agents/code-reviewer.json +25 -4
- package/.ai-rules/agents/data-engineer.json +6 -0
- package/.ai-rules/agents/data-scientist.json +6 -0
- package/.ai-rules/agents/devops-engineer.json +6 -0
- package/.ai-rules/agents/documentation-specialist.json +6 -0
- package/.ai-rules/agents/eval-mode.json +11 -1
- package/.ai-rules/agents/event-architecture-specialist.json +6 -0
- package/.ai-rules/agents/frontend-developer.json +6 -0
- package/.ai-rules/agents/i18n-specialist.json +6 -0
- package/.ai-rules/agents/integration-specialist.json +6 -0
- package/.ai-rules/agents/migration-specialist.json +6 -0
- package/.ai-rules/agents/mobile-developer.json +7 -10
- package/.ai-rules/agents/observability-specialist.json +6 -0
- package/.ai-rules/agents/parallel-orchestrator.json +6 -0
- package/.ai-rules/agents/performance-specialist.json +6 -0
- package/.ai-rules/agents/plan-mode.json +6 -0
- package/.ai-rules/agents/plan-reviewer.json +7 -4
- package/.ai-rules/agents/platform-engineer.json +6 -0
- package/.ai-rules/agents/security-engineer.json +6 -0
- package/.ai-rules/agents/security-specialist.json +6 -0
- package/.ai-rules/agents/seo-specialist.json +6 -0
- package/.ai-rules/agents/software-engineer.json +6 -0
- package/.ai-rules/agents/solution-architect.json +6 -0
- package/.ai-rules/agents/systems-developer.json +6 -0
- package/.ai-rules/agents/technical-planner.json +6 -0
- package/.ai-rules/agents/test-engineer.json +6 -0
- package/.ai-rules/agents/test-strategy-specialist.json +6 -0
- package/.ai-rules/agents/tooling-engineer.json +6 -0
- package/.ai-rules/agents/ui-ux-designer.json +6 -0
- package/.ai-rules/schemas/agent.schema.json +38 -0
- package/.ai-rules/skills/README.md +6 -0
- package/.ai-rules/skills/agent-design/examples/agent-template.json +1 -4
- package/.ai-rules/skills/mcp-builder/examples/tool-example.ts +8 -13
- package/.ai-rules/skills/onboard/SKILL.md +150 -0
- package/.ai-rules/skills/plan-to-issues/SKILL.md +318 -0
- package/.ai-rules/skills/retrospective/SKILL.md +192 -0
- package/.ai-rules/skills/ship/SKILL.md +242 -0
- package/.ai-rules/skills/skill-creator/assets/eval_review.html +539 -260
- package/bin/cli.js +11 -19
- package/lib/init/detect-stack.js +18 -4
- package/lib/init/prompt.js +2 -2
- package/lib/init/suggest-agent.js +13 -2
- package/package.json +1 -1
|
@@ -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")
|