codeforge-dev 1.14.2 → 2.0.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/{.devcontainer/config/defaults → .codeforge/config}/ccstatusline-settings.json +44 -6
- package/{.devcontainer/config/defaults → .codeforge/config}/main-system-prompt.md +14 -6
- package/.codeforge/config/orchestrator-system-prompt.md +333 -0
- package/{.devcontainer/config/defaults → .codeforge/config}/settings.json +3 -1
- package/{.devcontainer/config → .codeforge}/file-manifest.json +15 -9
- package/{.devcontainer → .codeforge/scripts}/connect-external-terminal.sh +3 -1
- package/.devcontainer/.env.example +5 -5
- package/.devcontainer/.secrets.example +3 -0
- package/.devcontainer/CHANGELOG.md +242 -0
- package/.devcontainer/CLAUDE.md +129 -22
- package/.devcontainer/README.md +34 -19
- package/.devcontainer/devcontainer.json +28 -10
- package/.devcontainer/features/agent-browser/install.sh +2 -0
- package/.devcontainer/features/ast-grep/install.sh +2 -0
- package/.devcontainer/features/biome/install.sh +2 -0
- package/.devcontainer/features/ccburn/install.sh +2 -0
- package/.devcontainer/features/ccms/install.sh +2 -0
- package/.devcontainer/features/ccstatusline/README.md +7 -6
- package/.devcontainer/features/ccstatusline/install.sh +9 -4
- package/.devcontainer/features/ccusage/install.sh +2 -0
- package/.devcontainer/features/chromaterm/chromaterm.yml +2 -2
- package/.devcontainer/features/chromaterm/install.sh +2 -0
- package/.devcontainer/features/claude-code-native/README.md +47 -0
- package/.devcontainer/features/claude-code-native/devcontainer-feature.json +29 -0
- package/.devcontainer/features/claude-code-native/install.sh +131 -0
- package/.devcontainer/features/claude-monitor/install.sh +2 -0
- package/.devcontainer/features/claude-session-dashboard/README.md +2 -2
- package/.devcontainer/features/claude-session-dashboard/install.sh +2 -0
- package/.devcontainer/features/dprint/install.sh +2 -0
- package/.devcontainer/features/hadolint/install.sh +2 -0
- package/.devcontainer/features/kitty-terminfo/README.md +3 -1
- package/.devcontainer/features/kitty-terminfo/install.sh +2 -0
- package/.devcontainer/features/lsp-servers/install.sh +2 -0
- package/.devcontainer/features/mcp-qdrant/CHANGES.md +3 -3
- package/.devcontainer/features/mcp-qdrant/README.md +1 -0
- package/.devcontainer/features/mcp-qdrant/devcontainer-feature.json +1 -1
- package/.devcontainer/features/mcp-qdrant/install.sh +9 -2
- package/.devcontainer/features/mcp-qdrant/poststart-hook.sh +9 -2
- package/.devcontainer/features/notify-hook/devcontainer-feature.json +1 -1
- package/.devcontainer/features/notify-hook/install.sh +2 -0
- package/.devcontainer/features/ruff/install.sh +2 -0
- package/.devcontainer/features/shellcheck/install.sh +2 -0
- package/.devcontainer/features/shfmt/install.sh +2 -0
- package/.devcontainer/features/tmux/README.md +3 -3
- package/.devcontainer/features/tmux/install.sh +3 -1
- package/.devcontainer/features/tree-sitter/install.sh +2 -0
- package/.devcontainer/plugins/devs-marketplace/.claude-plugin/marketplace.json +27 -11
- package/.devcontainer/plugins/devs-marketplace/plugins/agent-system/README.md +23 -4
- package/.devcontainer/plugins/devs-marketplace/plugins/agent-system/agents/claude-guide.md +4 -4
- package/.devcontainer/plugins/devs-marketplace/plugins/agent-system/agents/documenter.md +254 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/agent-system/agents/implementer.md +260 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/agent-system/agents/investigator.md +255 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/agent-system/agents/tester.md +304 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-code-quality/README.md +1 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-code-quality/scripts/advisory-test-runner.py +4 -2
- package/.devcontainer/plugins/devs-marketplace/plugins/dangerous-command-blocker/scripts/block-dangerous.py +2 -2
- package/.devcontainer/plugins/devs-marketplace/plugins/git-workflow/.claude-plugin/plugin.json +7 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/git-workflow/README.md +125 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/git-workflow/skills/pr-review/SKILL.md +325 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/git-workflow/skills/ship/SKILL.md +314 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/prompt-snippets/.claude-plugin/plugin.json +5 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/prompt-snippets/README.md +52 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/prompt-snippets/skills/ps/SKILL.md +37 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/protected-files-guard/scripts/guard-protected-bash.py +1 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/protected-files-guard/scripts/guard-protected.py +1 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/session-context/README.md +30 -14
- package/.devcontainer/plugins/devs-marketplace/plugins/session-context/hooks/hooks.json +13 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/session-context/scripts/collect-session-edits.py +44 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/session-context/scripts/commit-reminder.py +89 -10
- package/.devcontainer/plugins/devs-marketplace/plugins/skill-engine/.claude-plugin/plugin.json +1 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/skill-engine/README.md +19 -11
- package/.devcontainer/plugins/devs-marketplace/plugins/skill-engine/scripts/skill-suggester.py +476 -282
- package/.devcontainer/plugins/devs-marketplace/plugins/skill-engine/skills/worktree/SKILL.md +227 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/skill-engine/skills/worktree/references/manual-worktree-commands.md +238 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/skill-engine/skills/worktree/references/parallel-workflow-patterns.md +228 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/ticket-workflow/scripts/ticket-linker.py +2 -2
- package/.devcontainer/plugins/devs-marketplace/plugins/workspace-scope-guard/README.md +1 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/workspace-scope-guard/scripts/guard-workspace-scope.py +3 -2
- package/.devcontainer/scripts/check-setup.sh +5 -3
- package/.devcontainer/scripts/preflight.sh +113 -0
- package/.devcontainer/scripts/setup-aliases.sh +13 -8
- package/.devcontainer/scripts/setup-auth.sh +46 -0
- package/.devcontainer/scripts/setup-config.sh +29 -10
- package/.devcontainer/scripts/setup-migrate-claude.sh +80 -0
- package/.devcontainer/scripts/setup-migrate-codeforge.sh +60 -0
- package/.devcontainer/scripts/setup-plugins.sh +3 -1
- package/.devcontainer/scripts/setup-projects.sh +3 -1
- package/.devcontainer/scripts/setup-terminal.sh +3 -1
- package/.devcontainer/scripts/setup-update-claude.sh +22 -27
- package/.devcontainer/scripts/setup.sh +57 -5
- package/LICENSE.txt +14 -0
- package/README.md +79 -5
- package/package.json +2 -1
- package/setup.js +392 -21
- package/.devcontainer/docs/configuration-reference.md +0 -93
- package/.devcontainer/docs/keybindings.md +0 -100
- package/.devcontainer/docs/optional-features.md +0 -64
- package/.devcontainer/docs/plugins.md +0 -176
- package/.devcontainer/docs/troubleshooting.md +0 -128
- package/.devcontainer/scripts/setup-symlink-claude.sh +0 -36
- /package/{.devcontainer/config/defaults → .codeforge/config}/keybindings.json +0 -0
- /package/{.devcontainer/config/defaults → .codeforge/config}/rules/session-search.md +0 -0
- /package/{.devcontainer/config/defaults → .codeforge/config}/rules/spec-workflow.md +0 -0
- /package/{.devcontainer/config/defaults → .codeforge/config}/rules/workspace-scope.md +0 -0
- /package/{.devcontainer/config/defaults → .codeforge/config}/writing-system-prompt.md +0 -0
- /package/{.devcontainer → .codeforge/scripts}/connect-external-terminal.ps1 +0 -0
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Review an existing pull request without merging — post findings as PR comment
|
|
3
|
+
argument-hint: [PR number, URL, or omit for current branch]
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
allowed-tools: Bash(gh:*), Bash(git:*), Read, Grep, Glob, AskUserQuestion
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /pr:review - Review Existing PR
|
|
9
|
+
|
|
10
|
+
Review an existing pull request and post findings as a PR comment. NEVER approve or merge.
|
|
11
|
+
|
|
12
|
+
## Input
|
|
13
|
+
|
|
14
|
+
`$ARGUMENTS` - PR number (e.g., `42`), URL (e.g., `https://github.com/owner/repo/pull/42`), or empty to auto-detect from current branch.
|
|
15
|
+
|
|
16
|
+
## Process
|
|
17
|
+
|
|
18
|
+
### Phase 1: Identify Target PR
|
|
19
|
+
|
|
20
|
+
**With argument:**
|
|
21
|
+
```bash
|
|
22
|
+
gh pr view $1 --json number,title,body,baseRefName,headRefName,additions,deletions,commits,files
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Without argument (auto-detect):**
|
|
26
|
+
```bash
|
|
27
|
+
gh pr view --json number,title,body,baseRefName,headRefName,additions,deletions,commits,files
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**If both fail:** Use AskUserQuestion to prompt for PR number.
|
|
31
|
+
|
|
32
|
+
Capture PR number for subsequent operations.
|
|
33
|
+
|
|
34
|
+
Fetch the full diff:
|
|
35
|
+
```bash
|
|
36
|
+
gh pr diff $PR
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Phase 2: Gather Additional Context
|
|
40
|
+
|
|
41
|
+
- Read changed files in full (not just diff) for deeper understanding of surrounding code
|
|
42
|
+
- Discover project rules:
|
|
43
|
+
```bash
|
|
44
|
+
ls -la CLAUDE.md .claude/CLAUDE.md CLAUDE.local.md 2>/dev/null
|
|
45
|
+
ls -la .claude/rules/*.md 2>/dev/null
|
|
46
|
+
```
|
|
47
|
+
- Check if PR body references a ticket (parse for `#N`, `Closes #N`, `Refs #N`, `Fixes #N`)
|
|
48
|
+
- If ticket found, fetch it for requirements verification:
|
|
49
|
+
```bash
|
|
50
|
+
gh issue view $TICKET --json number,title,body
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Phase 3: Aggressive Analysis
|
|
54
|
+
|
|
55
|
+
This review is DEEPER than a commit review — it is the final gate before merge.
|
|
56
|
+
|
|
57
|
+
#### Attack Surface Analysis
|
|
58
|
+
|
|
59
|
+
| Check | Look For |
|
|
60
|
+
|-------|----------|
|
|
61
|
+
| New Endpoints | Every new route/handler exposed |
|
|
62
|
+
| New Inputs | Every new user input vector |
|
|
63
|
+
| Permission Changes | Any auth/authz modifications |
|
|
64
|
+
| Data Flow | How data moves through new code |
|
|
65
|
+
| External Integrations | New API calls, webhooks, services |
|
|
66
|
+
|
|
67
|
+
#### Threat Modeling (per feature)
|
|
68
|
+
|
|
69
|
+
For each significant feature in the PR:
|
|
70
|
+
- What could an attacker exploit?
|
|
71
|
+
- What data could be exfiltrated?
|
|
72
|
+
- What operations could be abused?
|
|
73
|
+
- What rate limiting is needed?
|
|
74
|
+
- What audit logging is needed?
|
|
75
|
+
|
|
76
|
+
#### Dependency Security
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Check for new dependencies (adapt patterns to project)
|
|
80
|
+
gh pr diff $PR | grep -E '^\+.*"(dependencies|devDependencies)"' -A 50
|
|
81
|
+
gh pr diff $PR | grep -E '^\+' | grep -E 'requirements.*\.txt|package.*\.json|Cargo\.toml|go\.mod|Gemfile'
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
| Check | Look For |
|
|
85
|
+
|-------|----------|
|
|
86
|
+
| New Dependencies | List all new packages + versions |
|
|
87
|
+
| Known CVEs | Check against vulnerability databases |
|
|
88
|
+
| Supply Chain | Typosquatting, maintainer reputation |
|
|
89
|
+
| License Compliance | License compatibility issues |
|
|
90
|
+
|
|
91
|
+
#### Project Rules Adherence
|
|
92
|
+
|
|
93
|
+
Check compliance with project-specific rules (deeper than commit review):
|
|
94
|
+
|
|
95
|
+
1. **Discover rules**:
|
|
96
|
+
- Read `CLAUDE.md` or `.claude/CLAUDE.md` if present
|
|
97
|
+
- Read all files in `.claude/rules/*.md`
|
|
98
|
+
- Check `CLAUDE.local.md` for user-specific rules
|
|
99
|
+
|
|
100
|
+
2. **Full diff review for compliance**:
|
|
101
|
+
- Check EVERY change against stated rules
|
|
102
|
+
- Note architectural patterns that should be followed
|
|
103
|
+
- Flag ALL deviations from documented conventions
|
|
104
|
+
|
|
105
|
+
| Rule Source | Compliance | Notes |
|
|
106
|
+
|-------------|------------|-------|
|
|
107
|
+
| CLAUDE.md | OK / VIOLATION | [specifics] |
|
|
108
|
+
| rules/[name].md | OK / VIOLATION | [specifics] |
|
|
109
|
+
|
|
110
|
+
#### Architecture Deep Dive
|
|
111
|
+
|
|
112
|
+
| Check | Look For |
|
|
113
|
+
|-------|----------|
|
|
114
|
+
| Pattern Compliance | Full diff against established patterns |
|
|
115
|
+
| Coupling Analysis | New dependencies between modules |
|
|
116
|
+
| Scalability | O(n) analysis, potential bottlenecks |
|
|
117
|
+
| Error Propagation | How errors flow through new code |
|
|
118
|
+
| Recovery Strategies | Graceful degradation, retry logic |
|
|
119
|
+
| State Management | Race conditions, consistency issues |
|
|
120
|
+
|
|
121
|
+
#### Code Quality Review
|
|
122
|
+
|
|
123
|
+
| Check | Look For |
|
|
124
|
+
|-------|----------|
|
|
125
|
+
| Complexity | Nesting depth > 3, high cyclomatic complexity |
|
|
126
|
+
| Duplication | Copy-paste code, extractable shared logic |
|
|
127
|
+
| Naming | Unclear names, inconsistent conventions |
|
|
128
|
+
| Error Handling | Missing boundaries, generic catches, no recovery |
|
|
129
|
+
| SOLID Violations | God classes, tight coupling, leaky abstractions |
|
|
130
|
+
| Dead Code | Unreachable code, unused imports/variables |
|
|
131
|
+
|
|
132
|
+
#### Test Analysis
|
|
133
|
+
|
|
134
|
+
Evaluate against testing standards:
|
|
135
|
+
|
|
136
|
+
| Check | Assess |
|
|
137
|
+
|-------|--------|
|
|
138
|
+
| Behavior Coverage | Are key behaviors tested? (not line count) |
|
|
139
|
+
| Test Quality | Do tests verify outcomes, not implementation? |
|
|
140
|
+
| Brittleness | Any tests that will break on refactor? |
|
|
141
|
+
| Over-testing | Trivial code with unnecessary tests? |
|
|
142
|
+
| Under-testing | Critical paths without tests? |
|
|
143
|
+
| Manual Test Plan | What cannot be automated |
|
|
144
|
+
|
|
145
|
+
**AI testing pitfalls to flag**:
|
|
146
|
+
- Tests for trivial getters/setters
|
|
147
|
+
- Excessive edge cases (>5 per function)
|
|
148
|
+
- Tests asserting on implementation details
|
|
149
|
+
- Over-mocked tests that verify nothing
|
|
150
|
+
|
|
151
|
+
#### Breaking Changes
|
|
152
|
+
|
|
153
|
+
| Check | Look For |
|
|
154
|
+
|-------|----------|
|
|
155
|
+
| API Contracts | Changed request/response schemas |
|
|
156
|
+
| Database Schema | Migration requirements |
|
|
157
|
+
| Configuration | New env vars, changed defaults |
|
|
158
|
+
| Dependencies | Version bumps affecting consumers |
|
|
159
|
+
|
|
160
|
+
#### Requirements Verification (if ticket found)
|
|
161
|
+
|
|
162
|
+
Cross-reference each requirement from the linked ticket:
|
|
163
|
+
|
|
164
|
+
| Requirement | Status | Evidence |
|
|
165
|
+
|-------------|--------|----------|
|
|
166
|
+
| [REQ text] | SATISFIED / PARTIAL / NOT MET | [file:line or explanation] |
|
|
167
|
+
|
|
168
|
+
All acceptance criteria must be verified.
|
|
169
|
+
|
|
170
|
+
### Phase 4: Present Findings
|
|
171
|
+
|
|
172
|
+
Organize by severity:
|
|
173
|
+
|
|
174
|
+
```markdown
|
|
175
|
+
## PR Review Findings
|
|
176
|
+
|
|
177
|
+
### Critical (Must Fix Before Merge)
|
|
178
|
+
- [Finding]: [file:line] - [Impact]
|
|
179
|
+
|
|
180
|
+
### High (Should Fix Before Merge)
|
|
181
|
+
- [Finding]: [file:line] - [Impact]
|
|
182
|
+
|
|
183
|
+
### Medium (Fix Soon)
|
|
184
|
+
- [Finding]: [file:line] - [Impact]
|
|
185
|
+
|
|
186
|
+
### Low (Nice to Have)
|
|
187
|
+
- [Finding]: [file:line] - [Impact]
|
|
188
|
+
|
|
189
|
+
### Info (Observations)
|
|
190
|
+
- [Observation]
|
|
191
|
+
|
|
192
|
+
### Project Rules Compliance
|
|
193
|
+
| Rule Source | Status | Details |
|
|
194
|
+
|-------------|--------|---------|
|
|
195
|
+
| ... | ... | ... |
|
|
196
|
+
|
|
197
|
+
### Requirements Status (if ticket linked)
|
|
198
|
+
| Requirement | Status | Evidence |
|
|
199
|
+
|-------------|--------|----------|
|
|
200
|
+
| ... | ... | ... |
|
|
201
|
+
|
|
202
|
+
### Threat Model Summary
|
|
203
|
+
| Feature | Primary Risks | Mitigations Present |
|
|
204
|
+
|---------|---------------|---------------------|
|
|
205
|
+
| ... | ... | ... |
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
If no findings in a severity level, omit that section.
|
|
209
|
+
|
|
210
|
+
### Phase 5: User Decisions
|
|
211
|
+
|
|
212
|
+
Use AskUserQuestion:
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
For each finding, select handling:
|
|
216
|
+
- NOTE: Include in PR review comment
|
|
217
|
+
- ISSUE: Create separate GitHub issue
|
|
218
|
+
- IGNORE: Don't include in review
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Phase 6: Create Issues (if selected)
|
|
222
|
+
|
|
223
|
+
Group by category, include:
|
|
224
|
+
- PR number
|
|
225
|
+
- Branch name
|
|
226
|
+
- Link to original ticket (if found)
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
gh issue create --title "[Category] findings from PR #[PR]" --body "$(cat <<'EOF'
|
|
230
|
+
## [Category] Findings from PR #[PR]
|
|
231
|
+
|
|
232
|
+
**PR**: #[PR_NUMBER]
|
|
233
|
+
**Branch**: [branch]
|
|
234
|
+
[**Related Ticket**: #[TICKET] — only if ticket found]
|
|
235
|
+
|
|
236
|
+
### Findings
|
|
237
|
+
|
|
238
|
+
- [ ] [Finding 1] - `file:line`
|
|
239
|
+
- [ ] [Finding 2] - `file:line`
|
|
240
|
+
|
|
241
|
+
### Context
|
|
242
|
+
|
|
243
|
+
[Brief context about the PR's purpose]
|
|
244
|
+
EOF
|
|
245
|
+
)"
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### Phase 7: Post Review Comment (NEVER APPROVE)
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
gh pr review $PR --comment --body "$(cat <<'EOF'
|
|
252
|
+
## Automated Review
|
|
253
|
+
|
|
254
|
+
**Status**: Requires human approval
|
|
255
|
+
|
|
256
|
+
### Summary
|
|
257
|
+
|
|
258
|
+
[Overall assessment - 2-3 sentences]
|
|
259
|
+
|
|
260
|
+
### Critical Issues (Must Address)
|
|
261
|
+
- [Issue with file:line]
|
|
262
|
+
|
|
263
|
+
### Required Changes
|
|
264
|
+
- [Specific change needed]
|
|
265
|
+
|
|
266
|
+
### Suggestions
|
|
267
|
+
- [Nice-to-have improvements]
|
|
268
|
+
|
|
269
|
+
### Project Rules Compliance
|
|
270
|
+
- [Summary of rules adherence]
|
|
271
|
+
|
|
272
|
+
### Security Considerations
|
|
273
|
+
- [Key security points for human reviewer]
|
|
274
|
+
|
|
275
|
+
### Test Coverage
|
|
276
|
+
- [Coverage assessment]
|
|
277
|
+
- [Manual test recommendations if applicable]
|
|
278
|
+
|
|
279
|
+
### Requirements Status (if ticket linked)
|
|
280
|
+
| Requirement | Status |
|
|
281
|
+
|-------------|--------|
|
|
282
|
+
| ... | ... |
|
|
283
|
+
|
|
284
|
+
### Related Issues Created
|
|
285
|
+
- #[N]: [Description]
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
*Automated review by Claude. Human approval required before merge.*
|
|
289
|
+
EOF
|
|
290
|
+
)"
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Phase 8: Report
|
|
294
|
+
|
|
295
|
+
Output summary:
|
|
296
|
+
|
|
297
|
+
```markdown
|
|
298
|
+
## Review Summary
|
|
299
|
+
|
|
300
|
+
- **PR**: #[N] — [title]
|
|
301
|
+
- **Findings**: [Critical: N, High: N, Medium: N, Low: N, Info: N]
|
|
302
|
+
- **Review**: Posted as comment
|
|
303
|
+
- **Issues Created**: #[N]: [category] — or "None"
|
|
304
|
+
- **Ticket**: #[TICKET] requirements verified — or "No linked ticket"
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## Rules
|
|
308
|
+
|
|
309
|
+
- **NEVER approve or merge** — post review as comment only
|
|
310
|
+
- **Deeper than commit review** — this is the final gate before merge
|
|
311
|
+
- **Active threat modeling** required for each significant feature
|
|
312
|
+
- **All findings** categorized by severity with `file:line` references
|
|
313
|
+
- **User decides** what goes in the review comment
|
|
314
|
+
- **Check project rules** (CLAUDE.md, .claude/rules/*.md) thoroughly
|
|
315
|
+
- **Auto-detect ticket** from PR body if possible — never prompt for one
|
|
316
|
+
- **Read full files** for changed code, not just the diff
|
|
317
|
+
- Batch all GitHub operations
|
|
318
|
+
|
|
319
|
+
## Severity Guide
|
|
320
|
+
|
|
321
|
+
**Critical**: Active vulnerability, data exposure, auth bypass, breaking production
|
|
322
|
+
**High**: Security weakness, significant bug, major pattern violation
|
|
323
|
+
**Medium**: Code smell, minor vulnerability, missing validation
|
|
324
|
+
**Low**: Style, optimization, minor improvements
|
|
325
|
+
**Info**: Observations, questions, future considerations
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Review changes, commit with detailed message, push, and optionally create pull request
|
|
3
|
+
argument-hint: [commit message hint]
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
allowed-tools: Bash(gh:*), Bash(git:*), Read, Grep, Glob, Edit, Write, AskUserQuestion
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /ship - Review, Commit, Push & Optional PR
|
|
9
|
+
|
|
10
|
+
Review all changes, commit with a detailed message, push, and optionally create a pull request. Optionally links to tickets if context exists from `/ticket:work`.
|
|
11
|
+
|
|
12
|
+
## Input
|
|
13
|
+
|
|
14
|
+
`$ARGUMENTS` - Optional commit message hint or summary of changes. May be empty.
|
|
15
|
+
|
|
16
|
+
## Process
|
|
17
|
+
|
|
18
|
+
### Phase 1: Gather Context
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Working tree state
|
|
22
|
+
git status
|
|
23
|
+
git diff HEAD
|
|
24
|
+
git diff --staged
|
|
25
|
+
|
|
26
|
+
# Branch info
|
|
27
|
+
git branch --show-current
|
|
28
|
+
git log main..HEAD --oneline
|
|
29
|
+
git diff main...HEAD --stat
|
|
30
|
+
|
|
31
|
+
# Discover project rules
|
|
32
|
+
ls -la CLAUDE.md .claude/CLAUDE.md CLAUDE.local.md 2>/dev/null
|
|
33
|
+
ls -la .claude/rules/*.md 2>/dev/null
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Check for ticket context in the current session. If a ticket number is available from a prior `/ticket:work` call, note it for linking in later phases. Do NOT prompt for a ticket — this command works standalone.
|
|
37
|
+
|
|
38
|
+
### Phase 2: Full Review
|
|
39
|
+
|
|
40
|
+
Review ALL changes (staged + unstaged) with `file:line` references.
|
|
41
|
+
|
|
42
|
+
#### Security Review
|
|
43
|
+
|
|
44
|
+
| Check | Look For |
|
|
45
|
+
|-------|----------|
|
|
46
|
+
| Secrets | API keys, passwords, tokens, connection strings in code |
|
|
47
|
+
| Injection | SQL injection, command injection, XSS, CSRF |
|
|
48
|
+
| Auth/Authz | Missing auth checks, privilege escalation paths |
|
|
49
|
+
| Data Exposure | PII in logs, sensitive data in error messages |
|
|
50
|
+
| Dependencies | New dependencies with known vulnerabilities |
|
|
51
|
+
| Input Validation | Unvalidated user input, missing sanitization |
|
|
52
|
+
|
|
53
|
+
#### Project Rules Adherence
|
|
54
|
+
|
|
55
|
+
Check compliance with project-specific rules:
|
|
56
|
+
|
|
57
|
+
1. **Discover rules**:
|
|
58
|
+
- Read `CLAUDE.md` or `.claude/CLAUDE.md` if present
|
|
59
|
+
- Read all files in `.claude/rules/*.md`
|
|
60
|
+
- Check `CLAUDE.local.md` for user-specific rules
|
|
61
|
+
|
|
62
|
+
2. **Review for compliance**:
|
|
63
|
+
- Check if changes violate any stated rules
|
|
64
|
+
- Note architectural patterns that should be followed
|
|
65
|
+
- Flag deviations from documented conventions
|
|
66
|
+
|
|
67
|
+
| Rule Source | Compliance | Notes |
|
|
68
|
+
|-------------|------------|-------|
|
|
69
|
+
| CLAUDE.md | OK / VIOLATION | [specifics] |
|
|
70
|
+
| rules/[name].md | OK / VIOLATION | [specifics] |
|
|
71
|
+
|
|
72
|
+
#### Code Quality Review
|
|
73
|
+
|
|
74
|
+
| Check | Look For |
|
|
75
|
+
|-------|----------|
|
|
76
|
+
| Complexity | Nesting depth > 3, high cyclomatic complexity |
|
|
77
|
+
| Duplication | Copy-paste code, extractable shared logic |
|
|
78
|
+
| Naming | Unclear names, inconsistent conventions |
|
|
79
|
+
| Error Handling | Missing boundaries, generic catches, no recovery |
|
|
80
|
+
| SOLID Violations | God classes, tight coupling, leaky abstractions |
|
|
81
|
+
| Dead Code | Unreachable code, unused imports/variables |
|
|
82
|
+
|
|
83
|
+
#### Architecture Review
|
|
84
|
+
|
|
85
|
+
| Check | Look For |
|
|
86
|
+
|-------|----------|
|
|
87
|
+
| Pattern Compliance | Deviations from established patterns |
|
|
88
|
+
| Coupling | Inappropriate dependencies, circular imports |
|
|
89
|
+
| API Contracts | Breaking changes, missing versioning |
|
|
90
|
+
| Cohesion | Mixed responsibilities, scattered logic |
|
|
91
|
+
|
|
92
|
+
#### Test Review
|
|
93
|
+
|
|
94
|
+
**Note**: If user indicates tests are not applicable or opts out, skip this section entirely and note "Tests: Skipped per user preference."
|
|
95
|
+
|
|
96
|
+
| Check | Assess |
|
|
97
|
+
|-------|--------|
|
|
98
|
+
| Behavior Coverage | Are key behaviors tested? (not line count) |
|
|
99
|
+
| Test Quality | Do tests verify outcomes, not implementation? |
|
|
100
|
+
| Brittleness | Any tests that will break on refactor? |
|
|
101
|
+
| Over-testing | Trivial code with unnecessary tests? |
|
|
102
|
+
| Under-testing | Critical paths without tests? |
|
|
103
|
+
|
|
104
|
+
### Phase 3: Present Findings
|
|
105
|
+
|
|
106
|
+
Organize ALL findings by severity:
|
|
107
|
+
|
|
108
|
+
```markdown
|
|
109
|
+
## Review Findings
|
|
110
|
+
|
|
111
|
+
### Critical (Must Fix Before Commit)
|
|
112
|
+
- [Finding]: [file:line] - [Impact]
|
|
113
|
+
|
|
114
|
+
### High (Should Fix Before Commit)
|
|
115
|
+
- [Finding]: [file:line] - [Impact]
|
|
116
|
+
|
|
117
|
+
### Medium (Fix Soon)
|
|
118
|
+
- [Finding]: [file:line] - [Impact]
|
|
119
|
+
|
|
120
|
+
### Low (Nice to Have)
|
|
121
|
+
- [Finding]: [file:line] - [Impact]
|
|
122
|
+
|
|
123
|
+
### Info (Observations)
|
|
124
|
+
- [Observation]
|
|
125
|
+
|
|
126
|
+
### Project Rules Compliance
|
|
127
|
+
| Rule Source | Status | Details |
|
|
128
|
+
|-------------|--------|---------|
|
|
129
|
+
| ... | ... | ... |
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
If no findings in a severity level, omit that section.
|
|
133
|
+
|
|
134
|
+
### Phase 4: User Decisions on Findings
|
|
135
|
+
|
|
136
|
+
Use AskUserQuestion to batch decisions:
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
For each category of findings, select handling:
|
|
140
|
+
- FIX: Address before commit
|
|
141
|
+
- ISSUE: Create GitHub issue for later
|
|
142
|
+
- IGNORE: Acknowledge and proceed
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Allow multi-select within categories.
|
|
146
|
+
|
|
147
|
+
### Phase 5: Fix Selected Items
|
|
148
|
+
|
|
149
|
+
Address all items marked FIX. Re-run relevant checks after fixes.
|
|
150
|
+
|
|
151
|
+
### Phase 6: Create Issues (if selected)
|
|
152
|
+
|
|
153
|
+
For findings marked ISSUE, group by category:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
gh issue create --title "[Category] findings from [branch]" --body "$(cat <<'EOF'
|
|
157
|
+
## [Category] Findings
|
|
158
|
+
|
|
159
|
+
**Source**: Branch `[branch]`, commit `[hash]`
|
|
160
|
+
[**Related Ticket**: #[TICKET] — only if ticket context exists]
|
|
161
|
+
|
|
162
|
+
### Findings
|
|
163
|
+
|
|
164
|
+
- [ ] [Finding 1] - `file:line`
|
|
165
|
+
- [ ] [Finding 2] - `file:line`
|
|
166
|
+
|
|
167
|
+
### Context
|
|
168
|
+
|
|
169
|
+
[Brief context about what was being implemented]
|
|
170
|
+
EOF
|
|
171
|
+
)"
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Link to ticket if context exists.
|
|
175
|
+
|
|
176
|
+
### Phase 7: Draft Commit Message
|
|
177
|
+
|
|
178
|
+
```markdown
|
|
179
|
+
<type>(<scope>): <summary>
|
|
180
|
+
|
|
181
|
+
<Business context>
|
|
182
|
+
- [Change description]
|
|
183
|
+
- [User-facing impact]
|
|
184
|
+
|
|
185
|
+
<Technical changes>
|
|
186
|
+
- [File/component changed]
|
|
187
|
+
- [Pattern used]
|
|
188
|
+
|
|
189
|
+
<Review findings>
|
|
190
|
+
- Addressed: [list]
|
|
191
|
+
- Deferred to #[issue]: [list]
|
|
192
|
+
- Acknowledged: [list]
|
|
193
|
+
|
|
194
|
+
Closes #[TICKET] (if completing all requirements — only if ticket context)
|
|
195
|
+
Refs #[TICKET] (if partial — only if ticket context)
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Types: `feat`, `fix`, `refactor`, `test`, `docs`, `chore`
|
|
199
|
+
|
|
200
|
+
If `$ARGUMENTS` provided a commit message hint, use it to inform the summary line.
|
|
201
|
+
|
|
202
|
+
### Phase 8: User Sign-Off on Commit Message
|
|
203
|
+
|
|
204
|
+
Present commit message for approval via AskUserQuestion. Allow edits. Do not proceed without explicit approval.
|
|
205
|
+
|
|
206
|
+
### Phase 9: Commit & Push
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
git add [specific files — never git add -A]
|
|
210
|
+
git commit -m "$(cat <<'EOF'
|
|
211
|
+
[approved message]
|
|
212
|
+
EOF
|
|
213
|
+
)"
|
|
214
|
+
git push -u origin $(git branch --show-current)
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Stage specific files by name. Never use `git add .` or `git add -A`.
|
|
218
|
+
|
|
219
|
+
### Phase 10: Ask About PR
|
|
220
|
+
|
|
221
|
+
Use AskUserQuestion:
|
|
222
|
+
|
|
223
|
+
```
|
|
224
|
+
Changes committed and pushed to [branch].
|
|
225
|
+
|
|
226
|
+
Would you like to create a pull request?
|
|
227
|
+
- Yes: Create PR targeting main
|
|
228
|
+
- No: Done — just commit and push
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
If **No** → skip to Phase 12.
|
|
232
|
+
|
|
233
|
+
### Phase 11: Create PR (conditional)
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
gh pr create --title "<type>(<scope>): <summary>" --body "$(cat <<'EOF'
|
|
237
|
+
## Summary
|
|
238
|
+
|
|
239
|
+
- [1-3 bullet points of what this PR accomplishes]
|
|
240
|
+
|
|
241
|
+
## Related Issue
|
|
242
|
+
|
|
243
|
+
[Closes #TICKET / Refs #TICKET — only if ticket context exists]
|
|
244
|
+
|
|
245
|
+
## Changes
|
|
246
|
+
|
|
247
|
+
- [Component]: [What changed]
|
|
248
|
+
|
|
249
|
+
## Testing
|
|
250
|
+
|
|
251
|
+
- [ ] [How to test each change]
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
*PR created by Claude. Awaiting human review.*
|
|
255
|
+
EOF
|
|
256
|
+
)"
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Capture PR number.
|
|
260
|
+
|
|
261
|
+
If ticket context exists, post comment to the original issue:
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
gh issue comment $TICKET --body "$(cat <<'EOF'
|
|
265
|
+
## Pull Request Created
|
|
266
|
+
|
|
267
|
+
**PR**: #[PR_NUMBER]
|
|
268
|
+
**Branch**: [branch]
|
|
269
|
+
|
|
270
|
+
### Status
|
|
271
|
+
- [x] PR created
|
|
272
|
+
- [ ] Human review pending
|
|
273
|
+
- [ ] Approved and merged
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
*PR created by Claude.*
|
|
277
|
+
EOF
|
|
278
|
+
)"
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Phase 12: Report
|
|
282
|
+
|
|
283
|
+
Output summary:
|
|
284
|
+
|
|
285
|
+
```markdown
|
|
286
|
+
## Ship Summary
|
|
287
|
+
|
|
288
|
+
- **Commit**: [hash] on `[branch]`
|
|
289
|
+
- **Push**: [branch] → origin/[branch]
|
|
290
|
+
- **PR**: #[N] ([URL]) — or "Not created"
|
|
291
|
+
- **Issues Created**: #[N]: [category] — or "None"
|
|
292
|
+
- **Ticket**: #[TICKET] linked — or "Standalone (no ticket context)"
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
## Rules
|
|
296
|
+
|
|
297
|
+
- **Full review is mandatory** — no skipping phases 2-3
|
|
298
|
+
- **User MUST approve** commit message before committing
|
|
299
|
+
- **AskUserQuestion MUST confirm** before PR creation — never auto-create
|
|
300
|
+
- **NEVER auto-approve** PRs
|
|
301
|
+
- **Stage specific files** — never `git add .` or `git add -A`
|
|
302
|
+
- **Optionally ticket-aware** — link to ticket if context exists, never prompt for one
|
|
303
|
+
- **Batch** all GitHub operations
|
|
304
|
+
- **Check project rules** (CLAUDE.md, .claude/rules/*.md) thoroughly
|
|
305
|
+
- Present findings FIRST, then get decisions
|
|
306
|
+
- Fix selected items BEFORE drafting commit
|
|
307
|
+
|
|
308
|
+
## Finding Severity Guide
|
|
309
|
+
|
|
310
|
+
**Critical**: Security vulnerability, data loss risk, breaking production
|
|
311
|
+
**High**: Significant bug, major pattern violation, auth issue
|
|
312
|
+
**Medium**: Code smell, minor bug, missing validation
|
|
313
|
+
**Low**: Style issue, minor optimization, documentation gap
|
|
314
|
+
**Info**: Observations, questions, future considerations
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Prompt Snippets Plugin
|
|
2
|
+
|
|
3
|
+
Quick behavioral mode switches via a single `/ps` slash command.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
/ps [snippet-name]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Type `/ps` followed by a snippet name to inject a behavioral directive for the remainder of the conversation.
|
|
12
|
+
|
|
13
|
+
### Available Snippets
|
|
14
|
+
|
|
15
|
+
| Snippet | What it does |
|
|
16
|
+
|---------|-------------|
|
|
17
|
+
| `noaction` | Investigate and report only — no edits, no commands |
|
|
18
|
+
| `brief` | Concise answers, no filler |
|
|
19
|
+
| `plan` | Plan first, don't implement until approved |
|
|
20
|
+
| `go` | Proceed without confirmation prompts |
|
|
21
|
+
| `review` | Audit only — report findings, don't modify |
|
|
22
|
+
| `ship` | Commit, push, and create a PR |
|
|
23
|
+
| `deep` | Thorough investigation, leave no stone unturned |
|
|
24
|
+
| `hold` | Do the work but don't commit or push |
|
|
25
|
+
| `recall` | Search session history with ccms for prior context |
|
|
26
|
+
| `wait` | When done, stop — no suggestions or follow-ups |
|
|
27
|
+
|
|
28
|
+
### Composing
|
|
29
|
+
|
|
30
|
+
Combine snippets by listing multiple names:
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
/ps noaction brief
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Design
|
|
37
|
+
|
|
38
|
+
This plugin contains a single skill (`/ps`) that uses `$ARGUMENTS` as a lookup key into a snippet table. It is:
|
|
39
|
+
|
|
40
|
+
- **Not auto-suggested** — `disable-model-invocation: true` keeps it out of the skill engine's auto-suggestion system
|
|
41
|
+
- **Independently toggleable** — disable via `enabledPlugins` in `settings.json` without affecting other skills
|
|
42
|
+
- **Extensible** — add a row to the table in `skills/ps/SKILL.md` to create new snippets
|
|
43
|
+
|
|
44
|
+
## Adding Custom Snippets
|
|
45
|
+
|
|
46
|
+
Edit `skills/ps/SKILL.md` and add a row to the "Available Snippets" table:
|
|
47
|
+
|
|
48
|
+
```markdown
|
|
49
|
+
| `mysnippet` | Your custom instruction here. |
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
No other files need to change.
|