add-synthesis-fixture
暂无简介
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-02
- Stars
- ★ 8
- Forks
- 1
03 SKILL.md 正文
Before You Start
tests/fixtures/synthesis/output-docs.json— Pass 1 output (CLAUDE.md content)tests/fixtures/synthesis/output-tooling.json— Pass 2 output (skills, hooks, MCP)tests/fixtures/synthesis/output.json— derived merged file (DO NOT edit directly)schemas/synthesis-docs.jsonandschemas/synthesis-tooling.json— the output contractstests/unit/merge.bats— tests that read fromoutput.jsondirectly
Critical Rule
output.json is a derived file — it is the jq -s '.[0] * .[1]' merge of output-docs.json and output-tooling.json. Never edit output.json directly. After any change to either pass fixture, always re-merge.
Steps
1. Identify which pass owns the new field
- Pass 1 (
output-docs.json): CLAUDE.md root content, subdirectory CLAUDE.md files - Pass 2 (
output-tooling.json): skills, hooks, subagents, mcp_servers, settings_hooks
2. Edit the appropriate pass fixture
Skill entries in output-tooling.json must have:
- No angle brackets in description fields
namein kebab-case- Valid SKILL.md content as a JSON string (use
\nfor newlines)
Example skill entry:
{
"name": "my-skill",
"description": "Does something specific to this project. Use when...",
"content": "---\nname: my-skill\ndescription: >\n Does something specific. Use when...\n Do NOT use for...\n---\n\n## Before You Start\n..."
}
Hook entries must maintain the 1:1 hooks-to-settings_hooks relationship:
// In hooks[]
{"filename": "check.sh", "event": "PostToolUse", "description": "...", "content": "#!/usr/bin/env bash\n..."}
// Matching entry in settings_hooks[]
{"event": "PostToolUse", "matcher": "Write", "command": ".claude/hooks/check.sh"}
3. Re-merge output.json
After editing either pass fixture:
jq -s '.[0] * .[1]' \
tests/fixtures/synthesis/output-docs.json \
tests/fixtures/synthesis/output-tooling.json \
> tests/fixtures/synthesis/output.json
4. Verify no angle brackets in descriptions
grep -n '[<>]' tests/fixtures/synthesis/output-tooling.json | head -20
Angle brackets in skill/subagent descriptions will cause validate-skill.sh to fail, and postprocess_descriptions() in lib/synthesize.sh will silently replace them at runtime — meaning the fixture diverges from what production produces.
5. Update dependent test assertions
Check tests/unit/merge.bats and tests/integration/synthesize_phase.bats for assertions on skill count, specific field values, or hook count that may need updating.
6. Verify the claude_md padding in output-docs.json
The claude_md field contains deliberate padding lines to exceed the 100-line minimum for validate_claude_md checks. Do NOT trim it:
echo "$(jq -r '.claude_md' tests/fixtures/synthesis/output-docs.json | wc -l) lines"
# Must be >= 100
Verify
make test-unit
make test-integration
Common Mistakes
-
Editing
output.jsondirectly — it gets overwritten on the next merge. Always edit the pass fixture and re-merge. -
Using
make_claude_envelopeonoutput.json— unit tests copyoutput.jsonraw into$WORK_DIR/synthesis/; integration tests wrapoutput-docs.jsonandoutput-tooling.jsonwithmake_claude_envelope. Using the wrong combination causes silentnullextractions.
04 同仓库更多 Skills
valid-skill
Use when building or modifying API endpoints in src/api/. Covers route creation, middleware wiring, and request validation. Do NOT use for frontend components or static pages.
invalid-skill-no-desc
暂无简介
invalid-skill-angle-brackets
Use when working with <component> templates. Do NOT use for <other> things.
validate-generated-artifact
暂无简介
tune-synthesis-context
暂无简介
run-tests
暂无简介