codeforge-dev 1.14.1 → 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 +251 -3
- 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/devcontainer-feature.json +0 -5
- 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/devcontainer-feature.json +0 -5
- 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/devcontainer-feature.json +0 -5
- 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/devcontainer-feature.json +1 -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 -7
- 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/devcontainer-feature.json +0 -6
- 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,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.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ps
|
|
3
|
+
description: Inject a behavioral prompt snippet by name.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: "[snippet-name]"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /ps — Prompt Snippets
|
|
9
|
+
|
|
10
|
+
Apply the prompt snippet matching `$ARGUMENTS` from the table below. Follow its instruction for the **remainder of this conversation** unless the user explicitly overrides it.
|
|
11
|
+
|
|
12
|
+
If `$ARGUMENTS` does not match any snippet name, list all available snippets and ask the user to pick one.
|
|
13
|
+
|
|
14
|
+
## Available Snippets
|
|
15
|
+
|
|
16
|
+
| Snippet | Instruction |
|
|
17
|
+
|---------|-------------|
|
|
18
|
+
| `noaction` | Investigate and report only. Take no action — no edits, no commands, no file writes. |
|
|
19
|
+
| `brief` | Be concise. Short answers, no filler, no preamble. Answer the question and stop. |
|
|
20
|
+
| `plan` | Build a plan before taking any action. Do not implement until the plan is explicitly approved. |
|
|
21
|
+
| `go` | Proceed without asking for confirmation. Use your best judgment on all decisions. |
|
|
22
|
+
| `review` | Review and audit only. Report findings with specific file paths and line numbers. Do not modify anything. |
|
|
23
|
+
| `ship` | Commit all staged changes, push to remote, and create a pull request. |
|
|
24
|
+
| `deep` | Be thorough and comprehensive. Investigate in depth, consider edge cases, leave no stone unturned. |
|
|
25
|
+
| `hold` | Complete the current task but do not commit, push, or publish. Await my review before any git operations. |
|
|
26
|
+
| `recall` | Search past session history with `ccms --no-color --project "$(pwd)"` to find prior decisions, discussions, and context relevant to the current task. Summarize what you find before proceeding. |
|
|
27
|
+
| `wait` | When done, stop. Do not suggest next steps, ask follow-up questions, or continue with related work. Await further instructions. |
|
|
28
|
+
|
|
29
|
+
## Composing Snippets
|
|
30
|
+
|
|
31
|
+
Multiple snippets can be applied in one invocation by separating names with spaces:
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
/ps noaction brief
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Apply all matching snippets. If instructions conflict, the **last snippet wins** for that specific behavior.
|
|
@@ -36,7 +36,7 @@ PROTECTED_PATTERNS = [
|
|
|
36
36
|
(r"\.crt$", "Blocked: .crt certificate files should not be edited directly"),
|
|
37
37
|
(r"\.p12$", "Blocked: .p12 files contain sensitive cryptographic material"),
|
|
38
38
|
(r"\.pfx$", "Blocked: .pfx files contain sensitive cryptographic material"),
|
|
39
|
-
(r"(^|/)credentials\.json$", "Blocked: credentials.json contains secrets"),
|
|
39
|
+
(r"(^|/)\.?credentials\.json$", "Blocked: credentials.json contains secrets"),
|
|
40
40
|
(r"(^|/)secrets\.yaml$", "Blocked: secrets.yaml contains secrets"),
|
|
41
41
|
(r"(^|/)secrets\.yml$", "Blocked: secrets.yml contains secrets"),
|
|
42
42
|
(r"(^|/)secrets\.json$", "Blocked: secrets.json contains secrets"),
|
|
@@ -40,7 +40,7 @@ PROTECTED_PATTERNS = [
|
|
|
40
40
|
(r"\.p12$", "Blocked: .p12 files contain sensitive cryptographic material"),
|
|
41
41
|
(r"\.pfx$", "Blocked: .pfx files contain sensitive cryptographic material"),
|
|
42
42
|
# Credential files
|
|
43
|
-
(r"(^|/)credentials\.json$", "Blocked: credentials.json contains secrets"),
|
|
43
|
+
(r"(^|/)\.?credentials\.json$", "Blocked: credentials.json contains secrets"),
|
|
44
44
|
(r"(^|/)secrets\.yaml$", "Blocked: secrets.yaml contains secrets"),
|
|
45
45
|
(r"(^|/)secrets\.yml$", "Blocked: secrets.yml contains secrets"),
|
|
46
46
|
(r"(^|/)secrets\.json$", "Blocked: secrets.json contains secrets"),
|
|
@@ -4,13 +4,14 @@ Claude Code plugin that injects contextual information at session boundaries. Pr
|
|
|
4
4
|
|
|
5
5
|
## What It Does
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Four hooks that run automatically at session lifecycle boundaries:
|
|
8
8
|
|
|
9
9
|
| Phase | Script | What It Injects |
|
|
10
10
|
|-------|--------|-----------------|
|
|
11
11
|
| Session start | `git-state-injector.py` | Current branch, status, recent commits, uncommitted changes |
|
|
12
12
|
| Session start | `todo-harvester.py` | Count and top 10 TODO/FIXME/HACK/XXX markers in the codebase |
|
|
13
|
-
|
|
|
13
|
+
| PostToolUse (Edit/Write) | `collect-session-edits.py` | Tracks which files the session modified (tmp file) |
|
|
14
|
+
| Stop | `commit-reminder.py` | Advisory about uncommitted changes (only if session edited files) |
|
|
14
15
|
|
|
15
16
|
All hooks are non-blocking and cap their output to prevent context bloat.
|
|
16
17
|
|
|
@@ -31,12 +32,19 @@ Scans source files for tech debt markers and injects a summary:
|
|
|
31
32
|
- Shows total count plus top 10 items
|
|
32
33
|
- Output capped at 800 characters
|
|
33
34
|
|
|
35
|
+
### Edit Tracking
|
|
36
|
+
|
|
37
|
+
Lightweight PostToolUse hook on Edit/Write that records file paths to `/tmp/claude-session-edits-{session_id}`. Used by the commit reminder to determine if this session actually modified files.
|
|
38
|
+
|
|
34
39
|
### Commit Reminder
|
|
35
40
|
|
|
36
|
-
Fires when Claude stops responding
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
41
|
+
Fires when Claude stops responding, using tiered logic based on change significance:
|
|
42
|
+
- Checks the session edit tracker — skips entirely if session was read-only
|
|
43
|
+
- **Meaningful changes** (3+ files, 2+ source files, or test files): suggests committing via advisory `systemMessage`
|
|
44
|
+
- **Small changes** (1-2 non-source files): silent, no output
|
|
45
|
+
- Output wrapped in `<system-reminder>` tags — advisory only, never blocks
|
|
46
|
+
- Instructs Claude not to commit without explicit user approval
|
|
47
|
+
- Uses a guard flag to prevent infinite loops
|
|
40
48
|
|
|
41
49
|
## How It Works
|
|
42
50
|
|
|
@@ -58,6 +66,12 @@ Session starts
|
|
|
58
66
|
| +-> Injects count + top 10 as additionalContext
|
|
59
67
|
|
|
|
60
68
|
| ... Claude works ...
|
|
69
|
+
| |
|
|
70
|
+
| +-> PostToolUse (Edit|Write) fires
|
|
71
|
+
| |
|
|
72
|
+
| +-> collect-session-edits.py
|
|
73
|
+
| |
|
|
74
|
+
| +-> Appends file path to /tmp/claude-session-edits-{session_id}
|
|
61
75
|
|
|
|
62
76
|
Claude stops responding
|
|
63
77
|
|
|
|
@@ -65,14 +79,14 @@ Claude stops responding
|
|
|
65
79
|
|
|
|
66
80
|
+-> commit-reminder.py
|
|
67
81
|
|
|
|
68
|
-
+->
|
|
69
|
-
+->
|
|
70
|
-
+->
|
|
82
|
+
+-> Session edited files? (checks tmp file)
|
|
83
|
+
+-> No edits this session? -> Silent (no output)
|
|
84
|
+
+-> Has edits + uncommitted changes? -> Inject advisory systemMessage
|
|
71
85
|
```
|
|
72
86
|
|
|
73
87
|
### Exit Code Behavior
|
|
74
88
|
|
|
75
|
-
All
|
|
89
|
+
All four scripts exit 0 (advisory only). They never block operations.
|
|
76
90
|
|
|
77
91
|
### Error Handling
|
|
78
92
|
|
|
@@ -88,6 +102,7 @@ All three scripts exit 0 (advisory only). They never block operations.
|
|
|
88
102
|
|------|---------|
|
|
89
103
|
| Git state injection | 10s |
|
|
90
104
|
| TODO harvesting | 8s |
|
|
105
|
+
| Edit tracking | 3s |
|
|
91
106
|
| Commit reminder | 8s |
|
|
92
107
|
|
|
93
108
|
## Installation
|
|
@@ -125,11 +140,12 @@ session-context/
|
|
|
125
140
|
+-- .claude-plugin/
|
|
126
141
|
| +-- plugin.json # Plugin metadata
|
|
127
142
|
+-- hooks/
|
|
128
|
-
| +-- hooks.json
|
|
143
|
+
| +-- hooks.json # Hook registrations (SessionStart + PostToolUse + Stop)
|
|
129
144
|
+-- scripts/
|
|
130
|
-
| +-- git-state-injector.py
|
|
131
|
-
| +-- todo-harvester.py
|
|
132
|
-
| +--
|
|
145
|
+
| +-- git-state-injector.py # Git state context (SessionStart)
|
|
146
|
+
| +-- todo-harvester.py # Tech debt markers (SessionStart)
|
|
147
|
+
| +-- collect-session-edits.py # Edit tracking (PostToolUse)
|
|
148
|
+
| +-- commit-reminder.py # Uncommitted changes advisory (Stop)
|
|
133
149
|
+-- README.md # This file
|
|
134
150
|
```
|
|
135
151
|
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
"description": "Context injection at session boundaries: git state, TODO harvesting, commit reminders",
|
|
2
|
+
"description": "Context injection at session boundaries: git state, TODO harvesting, edit tracking, commit reminders",
|
|
3
3
|
"hooks": {
|
|
4
|
+
"PostToolUse": [
|
|
5
|
+
{
|
|
6
|
+
"matcher": "Edit|Write",
|
|
7
|
+
"hooks": [
|
|
8
|
+
{
|
|
9
|
+
"type": "command",
|
|
10
|
+
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/scripts/collect-session-edits.py",
|
|
11
|
+
"timeout": 3
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
],
|
|
4
16
|
"SessionStart": [
|
|
5
17
|
{
|
|
6
18
|
"matcher": "",
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Collect edited file paths for session-aware Stop hooks.
|
|
4
|
+
|
|
5
|
+
Lightweight PostToolUse hook that appends the edited file path
|
|
6
|
+
to a session-scoped temp file. The commit-reminder Stop hook
|
|
7
|
+
reads this file to determine if the session modified any files.
|
|
8
|
+
|
|
9
|
+
Non-blocking: always exits 0. Runs in <10ms.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
import json
|
|
13
|
+
import os
|
|
14
|
+
import sys
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def main():
|
|
18
|
+
try:
|
|
19
|
+
input_data = json.load(sys.stdin)
|
|
20
|
+
except (json.JSONDecodeError, ValueError):
|
|
21
|
+
sys.exit(0)
|
|
22
|
+
|
|
23
|
+
session_id = input_data.get("session_id", "")
|
|
24
|
+
tool_input = input_data.get("tool_input", {})
|
|
25
|
+
file_path = tool_input.get("file_path", "")
|
|
26
|
+
|
|
27
|
+
if not file_path or not session_id:
|
|
28
|
+
sys.exit(0)
|
|
29
|
+
|
|
30
|
+
if not os.path.isfile(file_path):
|
|
31
|
+
sys.exit(0)
|
|
32
|
+
|
|
33
|
+
tmp_path = f"/tmp/claude-session-edits-{session_id}"
|
|
34
|
+
try:
|
|
35
|
+
with open(tmp_path, "a") as f:
|
|
36
|
+
f.write(file_path + "\n")
|
|
37
|
+
except OSError:
|
|
38
|
+
pass # non-critical, don't block Claude
|
|
39
|
+
|
|
40
|
+
sys.exit(0)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
if __name__ == "__main__":
|
|
44
|
+
main()
|