Skip to content

Commit 7845227

Browse files
wkoutreclaude
andcommitted
fix(development-productivity): Opus 5 fixes for commands, skills, and test-writer
claude-init-plus: - added an explicit instruction against one-subagent-per-package fan-out. Its Hierarchy Deduplication rule requires knowing what was written at every other level, and a subagent cannot see what a sibling wrote -- so the fan-out breaks it silently, with every individual file still looking correct. - replaced the trailing 4-item verify checklist (and the block restating the same items as failure conditions) with the two conditions that are actually checkable after the fact. update-claude-md: - fixed a dangling sentence fragment at line 16 left by a bad edit. - dropped the Step 10 post-write re-read; deduplication and the no-TODO rule are constraints on the write, and the 200-line case is already in Error Handling. generate-tests: - gen-tests-guide required coverage: number, but its allowed-tools contain no Bash, so it cannot run a coverage tool. Now coverage | 'not_measured' with a coverageSource field. - SKILL.md claimed "Write test files with full coverage" with no Write tool and no Bash; now returns artifacts and names untested behaviors. - context-loader/security-analyzer/performance-analyzer/agent-orchestrator all live in development-codebase-tools; qualified every reference with the cross-plugin prefix, including in allowed-tools where a bare name would not resolve. - added a when-NOT-to-delegate note; the agent list is a menu, not a sequence. optimize-prompt: "GPT-4 best practices" replaced with provider-neutral guidance plus the concrete Anthropic parameter constraints. test-writer: 400-word cap on prose fields (test bodies and enumerated lists are data, not covered); added a coverage instruction for untested behaviors. CLAUDE.md: documented the inline-verification posture, the measured-inputs rule, and the sequential-generation constraint. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 161b0c3 commit 7845227

7 files changed

Lines changed: 83 additions & 38 deletions

File tree

packages/plugins/development-productivity/CLAUDE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ disclosure best practices for CLAUDE.md content:
5151
- Skills are the primary interface; agents are invoked via `Task(subagent_type:agent-name)`
5252
- `claude-init-plus` runs once (bootstraps); `update-claude-md` runs on each significant change
5353
- The `documentation-agent` consolidates doc-writer, claude-docs-manager, and fact-checker agents
54+
- **Documentation verification is inline, never a second-agent pass.** Both
55+
`documentation-agent` and `claude-docs-initializer-agent` verify claims against the repository
56+
as they write, and flag anything they could not confirm on an `unverified_claims` list. The
57+
initializer no longer emits `requires_verification: true`, and callers must not invoke
58+
`documentation-agent` as a fact-checker over another agent's output.
59+
- **Numbers in agent output require measured inputs.** No self-assigned quality scores, no
60+
coverage percentages against an unenumerable whole, no predicted improvement percentages for
61+
something that was never run. Report qualitatively, or emit an explicit `not_measured`.
62+
- `/claude-init-plus` generation is sequential — never one subagent per package. A subagent
63+
cannot see what a sibling wrote, which silently breaks Hierarchy Deduplication.
5464
- `generate-tests` supports: jest, vitest, pytest, cypress, playwright
5565

5666
## File Structure

packages/plugins/development-productivity/agents/test-writer.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ You are **test-writer-agent**, a specialized testing subagent with advanced test
2525

2626
**Output**
2727

28-
- `summary`: comprehensive testing strategy and rationale
28+
Prose fields (`summary`, `rationale[]`, `recommendations`) are capped at **400 words
29+
combined**. Test file bodies and enumerated scenario/edge-case lists are data, not prose, and
30+
are not covered by that cap. Cover the substance; cut restatement and any summary that repeats
31+
what the test names already say.
32+
33+
- `summary`: testing strategy and rationale
2934
- `suggestedTests[]`:
3035
- `file`: destination test path
3136
- `contents`: complete test file body
@@ -285,6 +290,8 @@ Each test recommendation includes:
285290

286291
## Quality Assurance
287292

293+
- Report every behavior you identified but did not write a test for, and why. Do not drop the
294+
uncertain or low-priority ones — an untested behavior nobody names is one nobody covers.
288295
- All generated tests must be deterministic and repeatable
289296
- Tests should fail for the right reasons (not flaky)
290297
- Mock external dependencies appropriately

packages/plugins/development-productivity/commands/claude-init-plus.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,20 @@ already exists in any ancestor CLAUDE.md. If it does, omit it from the subdirect
192192
When a convention applies only within a specific subtree, put it in the most specific
193193
CLAUDE.md that covers all relevant code, not in the root.
194194

195+
### Do not fan out one subagent per package
196+
197+
**Write every CLAUDE.md in this session, sequentially.** Do not dispatch a subagent per core
198+
node, per package, or per language group.
199+
200+
The reason is the deduplication rule directly above: it requires knowing what has already been
201+
written at every other level. A subagent cannot see what a sibling wrote — each one starts with
202+
its own context, decides in isolation that a repo-wide convention is worth stating, and writes
203+
it. The result is the exact duplication this section exists to prevent, and nothing in the run
204+
reports a failure, because every individual file looks correct on its own.
205+
206+
Discovery (Phase 1) is read-only and has no such constraint; parallelizing a large scan is fine.
207+
The generation phase is not.
208+
195209
## `.claude/rules/` Scaffolding
196210

197211
When initializing a project that has clear cross-cutting concerns, offer to create
@@ -248,21 +262,17 @@ content into `.claude/rules/<topic>.md` and reference it from the CLAUDE.md inst
248262
1. Sections marked: `<!-- AUTO-GENERATED - DO NOT EDIT -->`
249263
2. Content that exactly matches a generated template with no user modification
250264

251-
## Success Criteria and Verification
252-
253-
**After generation, verify (required):**
265+
## Failure Conditions
254266

255-
1. **File validity**: File created/updated, not empty, has required sections
256-
2. **Content quality**: No `[TODO]` placeholders, conventions are specific and actionable
257-
3. **Length**: Each file is under 200 lines
258-
4. **Deduplication**: No content duplicated from ancestor CLAUDE.md files
267+
Report the run as failed, naming the affected files, if:
259268

260-
**Mark as failure if:**
269+
- Any Write/Edit operation returned an error
270+
- A generated file exceeds 200 lines (see Length Constraint — factor into
271+
`.claude/rules/<topic>.md` instead)
261272

262-
- Any Write/Edit operation failed
263-
- File size is 0 bytes or exceeds 200 lines
264-
- Required sections are missing
265-
- `[TODO]` placeholder entries are present in the output
273+
Content quality (no `[TODO]` placeholders, specific and actionable conventions) and
274+
deduplication against ancestor files are constraints on how you write each file, applied as you
275+
write it — not a re-read pass afterward.
266276

267277
## Error Handling
268278

packages/plugins/development-productivity/commands/update-claude-md.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Update CLAUDE.md files based on staged git changes. The goal is to capture **con
1313
gotchas, and team preferences** that Claude cannot infer by reading code — not to inventory
1414
files or list dependencies. Run this **before committing** whenever staged changes reveal a non-obvious
1515
pattern, constraint, or workflow decision.
16-
constraint, or workflow decision.
1716

1817
## Usage
1918

@@ -199,11 +198,9 @@ In **automated mode**, skip confirmation and apply only if the proposed update p
199198
Write the updated CLAUDE.md content. For new `.claude/rules/` files, create them at the
200199
nearest `.claude/` directory in the ancestry tree (or at the repository root if none exists).
201200

202-
After writing, verify:
203-
204-
- Line count is under 200 for each modified CLAUDE.md
205-
- No content duplicated from ancestor CLAUDE.md files
206-
- No `[TODO]` placeholder entries
201+
Deduplication (Step 6) and the no-`[TODO]` rule are constraints on what you write, applied
202+
before the write — not a re-read pass afterward. The 200-line overflow case is handled under
203+
Error Handling below.
207204

208205
### Step 11: Show Completion
209206

packages/plugins/development-productivity/skills/generate-tests/SKILL.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Generate comprehensive tests for code. Use when user says "write tests for this function", "add unit tests to this file", "generate integration tests for the API", "I need test coverage for this module", or "create e2e tests for the checkout flow".
3-
allowed-tools: Read, Grep, Glob, Task(subagent_type:test-writer-agent), Task(subagent_type:context-loader-agent), Task(subagent_type:security-analyzer-agent)
3+
allowed-tools: Read, Grep, Glob, Task(subagent_type:test-writer-agent), Task(subagent_type:development-codebase-tools:context-loader-agent), Task(subagent_type:development-codebase-tools:security-analyzer-agent)
44
model: sonnet
55
---
66

@@ -22,7 +22,9 @@ Generate comprehensive tests with advanced testing strategies, scenario generati
2222
2. **Select Strategy**: Choose testing approach based on code type
2323
3. **Generate Tests**: Create tests with appropriate framework
2424
4. **Identify Edge Cases**: Boundary conditions and error handling
25-
5. **Output Files**: Write test files with full coverage
25+
5. **Return Files**: Return the test file contents as artifacts. This skill has no Write tool
26+
and no Bash, so it cannot write to disk or measure coverage — do not claim a coverage
27+
figure, and name the behaviors you did not write a test for.
2628

2729
## Options
2830

@@ -58,7 +60,11 @@ Invoke **test-writer-agent** agent with:
5860
- `testType`: Testing strategy
5961
- `requirements`: User stories (if provided)
6062

61-
For complex scenarios, coordinate with **context-loader-agent** and **security-analyzer-agent**.
63+
For a single file or a few files in one module, invoke `test-writer-agent` directly — that is
64+
the common case. Only for work spanning several areas, coordinate with
65+
**development-codebase-tools:context-loader-agent** and
66+
**development-codebase-tools:security-analyzer-agent** (both live in another plugin, hence the
67+
prefix).
6268

6369
## Examples
6470

packages/plugins/development-productivity/skills/generate-tests/gen-tests-guide.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Generate comprehensive tests with advanced testing strategies, scenario generation, and edge case identification using the enhanced test-writer agent.
33
argument-hint: [paths...] [--framework jest|vitest|pytest|cypress|playwright] [--type unit|integration|e2e|all] [--strategy standard|scenario|property|mutation|accessibility] [--requirements "user stories"]
4-
allowed-tools: Read(*), Grep(*), Task(subagent_type:test-writer-agent), Task(subagent_type:context-loader-agent)
4+
allowed-tools: Read(*), Grep(*), Task(subagent_type:test-writer-agent), Task(subagent_type:development-codebase-tools:context-loader-agent)
55
---
66

77
## Inputs
@@ -52,10 +52,14 @@ For complex test generation (multiple files or --type all), use orchestration:
5252
- **security-analyzer-agent** for security test cases (if applicable)
5353

5454
3. **Quality Assurance Phase**:
55-
- Validate test coverage completeness
55+
- Name the behaviors you did NOT write a test for, and why
5656
- Check for test anti-patterns
5757
- Ensure proper mocking strategies
5858

59+
**When to skip the orchestration above:** a single file, or a handful of files in one module,
60+
is faster and more accurate done directly. The agent list below is a menu of what is available,
61+
not a set of steps to work through — invoke only the agents the specific task needs.
62+
5963
## Delegation
6064

6165
### Simple Case (single file, unit tests)
@@ -71,22 +75,25 @@ Invoke **test-writer-agent** with:
7175

7276
### Complex Case (multiple files or integration/e2e)
7377

74-
**If agent-orchestrator-agent is available** (from development-codebase-tools plugin):
78+
The orchestrator and the loader/analyzer agents live in the **development-codebase-tools**
79+
plugin, so dispatch them with the cross-plugin form
80+
`Task(subagent_type: development-codebase-tools:<agent-name>)`. `test-writer-agent` is in this
81+
plugin and needs no prefix.
7582

76-
Invoke it to coordinate:
83+
**If `development-codebase-tools:agent-orchestrator-agent` is available**, invoke it to coordinate:
7784

78-
- **context-loader-agent**: Build comprehensive understanding
85+
- **development-codebase-tools:context-loader-agent**: Build comprehensive understanding
7986
- **test-writer-agent**: Generate test scenarios and implementations
80-
- **security-analyzer-agent**: Add security test cases (for APIs)
81-
- **performance-analyzer-agent**: Add performance benchmarks (for critical paths)
87+
- **development-codebase-tools:security-analyzer-agent**: Add security test cases (for APIs)
88+
- **development-codebase-tools:performance-analyzer-agent**: Add performance benchmarks (for critical paths)
8289

83-
**Fallback (if agent-orchestrator-agent is not available)**:
90+
**Fallback (if the orchestrator is not available)**:
8491

8592
Execute agents sequentially:
8693

87-
1. First invoke **context-loader-agent** to gather context
94+
1. First invoke **development-codebase-tools:context-loader-agent** to gather context
8895
2. Then invoke **test-writer-agent** with the gathered context
89-
3. Optionally invoke **security-analyzer-agent** for API endpoints
96+
3. Optionally invoke **development-codebase-tools:security-analyzer-agent** for API endpoints
9097
4. Aggregate results manually
9198

9299
## Output Format
@@ -96,9 +103,15 @@ Execute agents sequentially:
96103
summary: string; // Overview of test generation strategy
97104
testStrategy: {
98105
approach: string; // Selected testing approach
99-
coverage: number; // Estimated coverage percentage
100-
edgeCasesIdentified: number;
101-
scenariosGenerated: number;
106+
// Coverage is only reported when a coverage tool actually ran and produced a
107+
// number. This skill's allowed-tools include no Bash, so it cannot run one --
108+
// in that case emit 'not_measured' and say which command the user should run.
109+
// Never estimate a coverage percentage; a guessed number reads as a
110+
// measurement and is not one.
111+
coverage: number | 'not_measured';
112+
coverageSource?: string; // Command whose output produced the number
113+
edgeCasesIdentified: number; // Count of edge cases you actually enumerated below
114+
scenariosGenerated: number; // Count of scenarios you actually generated below
102115
};
103116
suggestedTests: Array<{
104117
file: string; // Test file path

packages/plugins/development-productivity/skills/optimize-prompt/SKILL.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ Optimize prompts for better AI model performance using engineering techniques.
4444

4545
### 4. Model-Specific Optimization
4646

47-
- GPT-4 best practices
48-
- Claude optimization techniques
47+
- Techniques for the target model family, checked against its current API rather than recalled
4948
- Prompt chaining strategies
50-
- Temperature/parameter tuning
49+
- Sampling parameter tuning — parameters are provider-specific. `frequency_penalty` and
50+
`presence_penalty` are OpenAI-only and are rejected by the Anthropic Messages API. On the
51+
Claude 5 family, `temperature` is rejected when extended thinking is enabled, and
52+
`budget_tokens` is not accepted (use `thinking: {type: "adaptive"}`).
5153
- Token budget management
5254

5355
### 5. RAG Integration

0 commit comments

Comments
 (0)