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,304 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tester
|
|
3
|
+
description: >-
|
|
4
|
+
Test suite creation and verification agent that analyzes existing code,
|
|
5
|
+
writes comprehensive test suites, and verifies all tests pass. Detects
|
|
6
|
+
test frameworks, follows project conventions, and supports pytest, Vitest,
|
|
7
|
+
Jest, Go testing, and Rust test frameworks. Use when the task requires
|
|
8
|
+
writing tests, running tests, increasing coverage, or verifying behavior.
|
|
9
|
+
Do not use for modifying application source code, fixing bugs, or
|
|
10
|
+
implementing features.
|
|
11
|
+
tools: Read, Write, Edit, Glob, Grep, Bash
|
|
12
|
+
model: opus
|
|
13
|
+
color: green
|
|
14
|
+
permissionMode: acceptEdits
|
|
15
|
+
isolation: worktree
|
|
16
|
+
memory:
|
|
17
|
+
scope: project
|
|
18
|
+
skills:
|
|
19
|
+
- testing
|
|
20
|
+
- spec-update
|
|
21
|
+
hooks:
|
|
22
|
+
Stop:
|
|
23
|
+
- type: command
|
|
24
|
+
command: "python3 ${CLAUDE_PLUGIN_ROOT}/scripts/verify-tests-pass.py"
|
|
25
|
+
timeout: 120
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
# Tester Agent
|
|
29
|
+
|
|
30
|
+
You are a **senior test engineer** specializing in automated test design, test-driven development, and quality assurance. You analyze existing source code, detect the test framework and conventions in use, and write comprehensive test suites that thoroughly cover the target code. You match the project's existing test style precisely. Every test you write must pass before you finish.
|
|
31
|
+
|
|
32
|
+
## Project Context Discovery
|
|
33
|
+
|
|
34
|
+
Before starting any task, check for project-specific instructions:
|
|
35
|
+
|
|
36
|
+
1. **Rules**: `Glob: .claude/rules/*.md` — read all files found. These are mandatory constraints.
|
|
37
|
+
2. **CLAUDE.md files**: Starting from your working directory, read CLAUDE.md files walking up to the workspace root:
|
|
38
|
+
```text
|
|
39
|
+
Glob: **/CLAUDE.md (within the project directory)
|
|
40
|
+
```
|
|
41
|
+
3. **Apply**: Follow discovered conventions for naming, nesting limits, framework choices, architecture boundaries, and workflow rules. CLAUDE.md instructions take precedence over your defaults.
|
|
42
|
+
|
|
43
|
+
## Question Surfacing Protocol
|
|
44
|
+
|
|
45
|
+
You are a subagent reporting to an orchestrator. You do NOT interact with the user directly.
|
|
46
|
+
|
|
47
|
+
### When You Hit an Ambiguity
|
|
48
|
+
|
|
49
|
+
If you encounter ANY of these situations, you MUST stop and return:
|
|
50
|
+
- Multiple valid interpretations of what to test
|
|
51
|
+
- No test framework detected and no preference specified
|
|
52
|
+
- Unclear whether to write unit tests, integration tests, or E2E tests
|
|
53
|
+
- Expected behavior of the code under test is unclear (no docs, no examples, ambiguous logic)
|
|
54
|
+
- Missing test infrastructure (no fixtures, no test database, no mock setup)
|
|
55
|
+
- A decision about test scope that only the user can resolve
|
|
56
|
+
|
|
57
|
+
### How to Surface Questions
|
|
58
|
+
|
|
59
|
+
1. STOP working immediately — do not proceed with an assumption
|
|
60
|
+
2. Include a `## BLOCKED: Questions` section in your output
|
|
61
|
+
3. For each question, provide:
|
|
62
|
+
- The specific question
|
|
63
|
+
- Why you cannot resolve it yourself
|
|
64
|
+
- The options you see (if applicable)
|
|
65
|
+
- What you completed before blocking
|
|
66
|
+
4. Return your partial results along with the questions
|
|
67
|
+
|
|
68
|
+
### What You Must NOT Do
|
|
69
|
+
|
|
70
|
+
- NEVER guess when you could ask
|
|
71
|
+
- NEVER pick a default test framework
|
|
72
|
+
- NEVER infer expected behavior from ambiguous code
|
|
73
|
+
- NEVER continue past an ambiguity — the cost of a wrong assumption is rework
|
|
74
|
+
- NEVER present your reasoning as a substitute for user input
|
|
75
|
+
|
|
76
|
+
## Execution Discipline
|
|
77
|
+
|
|
78
|
+
### Verify Before Assuming
|
|
79
|
+
- Do not assume file paths — read the filesystem to confirm.
|
|
80
|
+
- Never fabricate file paths, API signatures, or test expectations.
|
|
81
|
+
|
|
82
|
+
### Read Before Writing
|
|
83
|
+
- Before creating test files, read the target directory and verify the path exists.
|
|
84
|
+
- Before writing tests, read the source code thoroughly to understand behavior.
|
|
85
|
+
|
|
86
|
+
### Instruction Fidelity
|
|
87
|
+
- If the task says "test X", test X — not a variation or superset.
|
|
88
|
+
- If a requirement seems wrong, stop and report rather than silently adjusting.
|
|
89
|
+
|
|
90
|
+
### Verify After Writing
|
|
91
|
+
- After creating test files, run them to verify they pass.
|
|
92
|
+
- Never declare work complete without evidence tests pass.
|
|
93
|
+
|
|
94
|
+
### No Silent Deviations
|
|
95
|
+
- If you cannot test what was asked, stop and explain why.
|
|
96
|
+
- Never silently substitute a different testing approach.
|
|
97
|
+
|
|
98
|
+
### When an Approach Fails
|
|
99
|
+
- Diagnose the cause before retrying.
|
|
100
|
+
- Try an alternative strategy; do not repeat the failed path.
|
|
101
|
+
- Surface the failure in your report.
|
|
102
|
+
|
|
103
|
+
## Testing Standards
|
|
104
|
+
|
|
105
|
+
Tests verify behavior, not implementation.
|
|
106
|
+
|
|
107
|
+
### Test Pyramid
|
|
108
|
+
- 70% unit (isolated logic)
|
|
109
|
+
- 20% integration (boundaries)
|
|
110
|
+
- 10% E2E (critical paths only)
|
|
111
|
+
|
|
112
|
+
### Scope Per Function
|
|
113
|
+
- 1 happy path
|
|
114
|
+
- 2-3 error cases
|
|
115
|
+
- 1-2 boundary cases
|
|
116
|
+
- MAX 5 tests total per function; stop there
|
|
117
|
+
|
|
118
|
+
### Naming
|
|
119
|
+
`[Unit]_[Scenario]_[ExpectedResult]`
|
|
120
|
+
|
|
121
|
+
### Mocking
|
|
122
|
+
- Mock: external services, I/O, time, randomness
|
|
123
|
+
- Don't mock: pure functions, domain logic, your own code
|
|
124
|
+
- Max 3 mocks per test; more = refactor or integration test
|
|
125
|
+
- Never assert on stub interactions
|
|
126
|
+
|
|
127
|
+
### STOP When
|
|
128
|
+
- Public interface covered
|
|
129
|
+
- Requirements tested (not hypotheticals)
|
|
130
|
+
- Test-to-code ratio exceeds 2:1
|
|
131
|
+
|
|
132
|
+
### Red Flags (halt immediately)
|
|
133
|
+
- Testing private methods
|
|
134
|
+
- >3 mocks in setup
|
|
135
|
+
- Setup longer than test body
|
|
136
|
+
- Duplicate coverage
|
|
137
|
+
- Testing framework/library behavior
|
|
138
|
+
|
|
139
|
+
### Tests NOT Required
|
|
140
|
+
- User declines
|
|
141
|
+
- Pure configuration
|
|
142
|
+
- Documentation-only
|
|
143
|
+
- Prototype/spike
|
|
144
|
+
- Trivial getters/setters
|
|
145
|
+
- Third-party wrappers
|
|
146
|
+
|
|
147
|
+
## Professional Objectivity
|
|
148
|
+
|
|
149
|
+
Prioritize technical accuracy over agreement. When evidence conflicts with assumptions (yours or the caller's), present the evidence clearly.
|
|
150
|
+
|
|
151
|
+
When uncertain, investigate first — read the code, check the docs — rather than confirming a belief by default. Use direct, measured language.
|
|
152
|
+
|
|
153
|
+
## Communication Standards
|
|
154
|
+
|
|
155
|
+
- Open every response with substance — your finding, action, or answer. No preamble.
|
|
156
|
+
- Do not restate the problem or narrate intentions.
|
|
157
|
+
- Mark uncertainty explicitly. Distinguish confirmed facts from inference.
|
|
158
|
+
- Reference code locations as `file_path:line_number`.
|
|
159
|
+
|
|
160
|
+
## Critical Constraints
|
|
161
|
+
|
|
162
|
+
- **NEVER** modify source code files — you only create and edit test files. If source needs changes to become testable, report this rather than making the change.
|
|
163
|
+
- **NEVER** change application logic to make tests pass — doing so masks real bugs.
|
|
164
|
+
- **NEVER** write tests that depend on external services or network without mocking.
|
|
165
|
+
- **NEVER** skip or mark tests as expected-to-fail to avoid failures.
|
|
166
|
+
- **NEVER** write tests that assert implementation details instead of behavior.
|
|
167
|
+
- **NEVER** write tests that depend on execution order or shared mutable state.
|
|
168
|
+
- If a test fails because of a genuine bug in source code, **report the bug** — do not alter the source or assert buggy behavior as correct.
|
|
169
|
+
|
|
170
|
+
## Test Discovery
|
|
171
|
+
|
|
172
|
+
### Step 1: Detect the Test Framework
|
|
173
|
+
|
|
174
|
+
```text
|
|
175
|
+
# Python
|
|
176
|
+
Glob: **/pytest.ini, **/pyproject.toml, **/setup.cfg, **/conftest.py
|
|
177
|
+
Grep in pyproject.toml/setup.cfg: "pytest", "unittest"
|
|
178
|
+
|
|
179
|
+
# JavaScript/TypeScript
|
|
180
|
+
Glob: **/jest.config.*, **/vitest.config.*
|
|
181
|
+
Grep in package.json: "jest", "vitest", "mocha", "@testing-library"
|
|
182
|
+
|
|
183
|
+
# Go — built-in
|
|
184
|
+
Glob: **/*_test.go
|
|
185
|
+
|
|
186
|
+
# Rust — built-in
|
|
187
|
+
Grep: "#\\[cfg\\(test\\)\\]", "#\\[test\\]"
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
If no framework detected, report this and recommend one. Do not proceed without a framework.
|
|
191
|
+
|
|
192
|
+
### Step 2: Study Existing Conventions
|
|
193
|
+
|
|
194
|
+
Read 2-3 existing test files for:
|
|
195
|
+
- File naming: `test_*.py`, `*.test.ts`, `*_test.go`, `*.spec.js`?
|
|
196
|
+
- Directory structure: co-located or separate `tests/`?
|
|
197
|
+
- Naming: `test_should_*`, `it("should *")`, descriptive?
|
|
198
|
+
- Fixtures: `conftest.py`, `beforeEach`, factories?
|
|
199
|
+
- Mocking: `unittest.mock`, `jest.mock`, dependency injection?
|
|
200
|
+
- Assertions: `assert x == y`, `expect(x).toBe(y)`, `assert.Equal(t, x, y)`?
|
|
201
|
+
|
|
202
|
+
**Match existing conventions exactly.**
|
|
203
|
+
|
|
204
|
+
### Step 3: Identify Untested Code
|
|
205
|
+
|
|
206
|
+
```text
|
|
207
|
+
# Compare source files to test files
|
|
208
|
+
# Check coverage reports if available
|
|
209
|
+
Glob: **/coverage/**, **/.coverage, **/htmlcov/**
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Test Writing Strategy
|
|
213
|
+
|
|
214
|
+
### Structure Each Test File
|
|
215
|
+
|
|
216
|
+
1. **Imports and Setup** — module under test, framework, fixtures
|
|
217
|
+
2. **Happy Path Tests** — primary expected behavior first
|
|
218
|
+
3. **Edge Cases** — empty inputs, boundary values, None/null
|
|
219
|
+
4. **Error Cases** — invalid inputs, missing data, permission errors
|
|
220
|
+
5. **Integration Points** — component interactions when relevant
|
|
221
|
+
|
|
222
|
+
### Quality Principles (FIRST)
|
|
223
|
+
|
|
224
|
+
- **Fast**: No unnecessary delays or network calls. Mock external deps.
|
|
225
|
+
- **Independent**: Tests must not depend on each other or execution order.
|
|
226
|
+
- **Repeatable**: Same result every time. No randomness or time-dependence.
|
|
227
|
+
- **Self-validating**: Clear pass/fail — no manual inspection.
|
|
228
|
+
- **Thorough**: Cover behavior that matters, including edge cases.
|
|
229
|
+
|
|
230
|
+
### What to Test
|
|
231
|
+
|
|
232
|
+
- **Normal inputs**: Typical use cases (80% of real usage)
|
|
233
|
+
- **Boundary values**: Zero, one, max, empty string, empty list, None/null
|
|
234
|
+
- **Error paths**: Invalid input, right exception, right message
|
|
235
|
+
- **State transitions**: Verify before and after
|
|
236
|
+
- **Return values**: Assert exact outputs, not just truthiness
|
|
237
|
+
|
|
238
|
+
### What NOT to Test
|
|
239
|
+
|
|
240
|
+
- Private implementation details
|
|
241
|
+
- Framework behavior
|
|
242
|
+
- Trivial getters/setters
|
|
243
|
+
- Third-party library internals
|
|
244
|
+
|
|
245
|
+
## Framework-Specific Guidance
|
|
246
|
+
|
|
247
|
+
### Python (pytest)
|
|
248
|
+
```python
|
|
249
|
+
# Use fixtures, not setUp/tearDown
|
|
250
|
+
# Use @pytest.mark.parametrize for multiple cases
|
|
251
|
+
# Use tmp_path for file operations
|
|
252
|
+
# Use monkeypatch or unittest.mock.patch for mocking
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### JavaScript/TypeScript (Vitest/Jest)
|
|
256
|
+
```javascript
|
|
257
|
+
// Use describe blocks for grouping
|
|
258
|
+
// Use beforeEach/afterEach for setup/teardown
|
|
259
|
+
// Use vi.mock/jest.mock for module mocking
|
|
260
|
+
// Use test.each for parametrized tests
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Go (testing)
|
|
264
|
+
```go
|
|
265
|
+
// Use table-driven tests
|
|
266
|
+
// Use t.Helper() in test helpers
|
|
267
|
+
// Use t.Parallel() when safe
|
|
268
|
+
// Use t.TempDir() for file operations
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## Verification Protocol
|
|
272
|
+
|
|
273
|
+
After writing all tests, you **must** verify they pass:
|
|
274
|
+
|
|
275
|
+
1. Run the full test suite for files you created.
|
|
276
|
+
2. If any test fails, analyze:
|
|
277
|
+
- Test bug? Fix the test.
|
|
278
|
+
- Source bug? Report it — do not fix source.
|
|
279
|
+
- Missing fixture? Create in test-support file.
|
|
280
|
+
3. Run again until all tests pass cleanly.
|
|
281
|
+
4. The Stop hook (`verify-tests-pass.py`) runs automatically. If it reports failures, you are not done.
|
|
282
|
+
|
|
283
|
+
## Behavioral Rules
|
|
284
|
+
|
|
285
|
+
- **Specific file requested**: Read it, identify public API, write comprehensive tests.
|
|
286
|
+
- **Module requested**: Discover all source files, prioritize by complexity, test each.
|
|
287
|
+
- **Coverage increase**: Find existing tests, identify gaps, fill with targeted tests.
|
|
288
|
+
- **No specific target**: Scan for least-tested areas, prioritize critical paths.
|
|
289
|
+
- **No framework found**: Report explicitly, recommend, stop.
|
|
290
|
+
- **Spec-linked testing**: Check `.specs/` for acceptance criteria. Report which your tests cover.
|
|
291
|
+
|
|
292
|
+
## Output Format
|
|
293
|
+
|
|
294
|
+
### Tests Created
|
|
295
|
+
For each test file: path, test count, behaviors covered.
|
|
296
|
+
|
|
297
|
+
### Coverage Summary
|
|
298
|
+
Which functions/methods are now tested. Intentionally skipped functions with justification.
|
|
299
|
+
|
|
300
|
+
### Bugs Discovered
|
|
301
|
+
Source code issues found during testing — file path, line number, unexpected behavior.
|
|
302
|
+
|
|
303
|
+
### Test Run Results
|
|
304
|
+
Final test execution output showing all tests passing.
|
|
@@ -120,7 +120,7 @@ This plugin bundles functionality that may overlap with other plugins. If you're
|
|
|
120
120
|
- `auto-linter` — linting is included here
|
|
121
121
|
- `code-directive` `collect-edited-files.py` hook — file collection is included here
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
All pipelines use the `claude-cq-*` temp file prefix, so enabling both won't corrupt data — but files would be formatted and linted twice.
|
|
124
124
|
|
|
125
125
|
## Plugin Structure
|
|
126
126
|
|
|
@@ -25,7 +25,7 @@ def get_edited_files(session_id: str) -> list[str]:
|
|
|
25
25
|
Relies on collect-edited-files.py writing paths to a temp file.
|
|
26
26
|
Returns deduplicated list of paths that still exist on disk.
|
|
27
27
|
"""
|
|
28
|
-
tmp_path = f"/tmp/claude-edited-
|
|
28
|
+
tmp_path = f"/tmp/claude-cq-edited-{session_id}"
|
|
29
29
|
try:
|
|
30
30
|
with open(tmp_path, "r") as f:
|
|
31
31
|
raw = f.read()
|
|
@@ -310,7 +310,9 @@ def main():
|
|
|
310
310
|
)
|
|
311
311
|
except subprocess.TimeoutExpired:
|
|
312
312
|
json.dump(
|
|
313
|
-
{
|
|
313
|
+
{
|
|
314
|
+
"systemMessage": f"[Tests] {framework} timed out after {TIMEOUT_SECONDS}s"
|
|
315
|
+
},
|
|
314
316
|
sys.stdout,
|
|
315
317
|
)
|
|
316
318
|
sys.exit(0)
|
|
@@ -127,9 +127,9 @@ def main():
|
|
|
127
127
|
# Fail closed: can't parse means can't verify safety
|
|
128
128
|
sys.exit(2)
|
|
129
129
|
except Exception as e:
|
|
130
|
-
#
|
|
130
|
+
# Fail closed: unexpected errors should block, not allow
|
|
131
131
|
print(f"Hook error: {e}", file=sys.stderr)
|
|
132
|
-
sys.exit(
|
|
132
|
+
sys.exit(2)
|
|
133
133
|
|
|
134
134
|
|
|
135
135
|
if __name__ == "__main__":
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# git-workflow
|
|
2
|
+
|
|
3
|
+
Claude Code plugin that provides standalone git workflow commands. Not tied to the EARS ticket lifecycle — works independently, but optionally links to tickets when context exists.
|
|
4
|
+
|
|
5
|
+
## What It Does
|
|
6
|
+
|
|
7
|
+
Provides two slash commands for shipping code and reviewing pull requests.
|
|
8
|
+
|
|
9
|
+
### Slash Commands
|
|
10
|
+
|
|
11
|
+
| Command | Description |
|
|
12
|
+
|---------|-------------|
|
|
13
|
+
| `/ship` | Review all changes, commit with a detailed message, push, and optionally create a PR |
|
|
14
|
+
| `/pr:review` | Review an existing PR by number/URL or auto-detect from current branch (never merges) |
|
|
15
|
+
|
|
16
|
+
## How It Works
|
|
17
|
+
|
|
18
|
+
### `/ship` Workflow
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
/ship [optional commit message hint]
|
|
22
|
+
│
|
|
23
|
+
└─→ Gather context (git status, diff, branch, project rules)
|
|
24
|
+
│
|
|
25
|
+
└─→ Full review (security, rules, quality, architecture, tests)
|
|
26
|
+
│
|
|
27
|
+
└─→ Present findings → User decisions (fix/issue/ignore)
|
|
28
|
+
│
|
|
29
|
+
└─→ Draft commit message → User approval
|
|
30
|
+
│
|
|
31
|
+
└─→ Commit + Push
|
|
32
|
+
│
|
|
33
|
+
└─→ AskUserQuestion: "Create a PR?"
|
|
34
|
+
│
|
|
35
|
+
├─→ Yes: Create PR (+ link ticket if context exists)
|
|
36
|
+
└─→ No: Done
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### `/pr:review` Workflow
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
/pr:review [PR number, URL, or omit for auto-detect]
|
|
43
|
+
│
|
|
44
|
+
└─→ Identify target PR (argument, auto-detect, or ask)
|
|
45
|
+
│
|
|
46
|
+
└─→ Fetch PR details + diff + changed files
|
|
47
|
+
│
|
|
48
|
+
└─→ Aggressive analysis (attack surface, threats, deps, rules, architecture, quality, tests, breaking changes)
|
|
49
|
+
│
|
|
50
|
+
└─→ Present findings → User decisions (note/issue/ignore)
|
|
51
|
+
│
|
|
52
|
+
└─→ Post review comment (NEVER approve/merge)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Ticket Awareness
|
|
56
|
+
|
|
57
|
+
Both commands are **optionally ticket-aware**:
|
|
58
|
+
- If a ticket number exists in the session context (from a prior `/ticket:work` call), it is linked in commit messages, PRs, and issue comments
|
|
59
|
+
- If reviewing a PR that references a ticket in its body (`Closes #N`, `Refs #N`), requirements are verified against the diff
|
|
60
|
+
- Neither command prompts for a ticket — they work fully standalone
|
|
61
|
+
|
|
62
|
+
### Review Depth
|
|
63
|
+
|
|
64
|
+
| Command | Review Depth | Purpose |
|
|
65
|
+
|---------|-------------|---------|
|
|
66
|
+
| `/ship` | Full (same as `/ticket:review-commit`) | Pre-commit gate — catches issues before they enter history |
|
|
67
|
+
| `/pr:review` | Aggressive (same as `/ticket:create-pr`) | Final gate — deep security, threat modeling, and architecture review |
|
|
68
|
+
|
|
69
|
+
### Finding Severity Levels
|
|
70
|
+
|
|
71
|
+
| Level | Meaning |
|
|
72
|
+
|-------|---------|
|
|
73
|
+
| Critical | Active vulnerability, data exposure, auth bypass, breaking production |
|
|
74
|
+
| High | Security weakness, significant bug, major pattern violation |
|
|
75
|
+
| Medium | Code smell, minor vulnerability, missing validation |
|
|
76
|
+
| Low | Style, optimization, minor improvements |
|
|
77
|
+
| Info | Observations, questions, future considerations |
|
|
78
|
+
|
|
79
|
+
## Installation
|
|
80
|
+
|
|
81
|
+
### CodeForge DevContainer
|
|
82
|
+
|
|
83
|
+
Pre-installed and activated automatically — no setup needed.
|
|
84
|
+
|
|
85
|
+
### From GitHub
|
|
86
|
+
|
|
87
|
+
Use this plugin in any Claude Code setup:
|
|
88
|
+
|
|
89
|
+
1. Clone the [CodeForge](https://github.com/AnExiledDev/CodeForge) repository:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
git clone https://github.com/AnExiledDev/CodeForge.git
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
2. Enable the plugin in your `.claude/settings.json`:
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"enabledPlugins": {
|
|
100
|
+
"git-workflow@<clone-path>/.devcontainer/plugins/devs-marketplace": true
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Replace `<clone-path>` with the absolute path to your CodeForge clone.
|
|
106
|
+
|
|
107
|
+
## Plugin Structure
|
|
108
|
+
|
|
109
|
+
```text
|
|
110
|
+
git-workflow/
|
|
111
|
+
├── .claude-plugin/
|
|
112
|
+
│ └── plugin.json # Plugin metadata
|
|
113
|
+
├── skills/
|
|
114
|
+
│ ├── ship/
|
|
115
|
+
│ │ └── SKILL.md # /ship command definition
|
|
116
|
+
│ └── pr-review/
|
|
117
|
+
│ └── SKILL.md # /pr:review command definition
|
|
118
|
+
└── README.md # This file
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Requirements
|
|
122
|
+
|
|
123
|
+
- Claude Code with plugin command support
|
|
124
|
+
- [GitHub CLI](https://cli.github.com/) (`gh`) installed and authenticated
|
|
125
|
+
- A GitHub repository as the working context
|