woc-extract-and-test
GitHub用于在ClaudeCraft项目中实施新功能、修复缺陷或重构代码。遵循模块优先和行为驱动测试原则,确保最小化边界和回归覆盖,支持从大文件提取逻辑或沿架构接缝移动代码。
Trigger Scenarios
Install
npx skills add levy-street/world-of-claudecraft --skill woc-extract-and-test -g -y
SKILL.md
Frontmatter
{
"name": "woc-extract-and-test",
"description": "Implement World of ClaudeCraft features, bug fixes, and focused refactors using module-first design and behavior-driven tests. Use when adding behavior, fixing a defect, extracting logic from a large file, or moving code behind an existing architectural seam."
}
Extract and Test
Implement the requested behavior with the smallest clean module boundary and direct regression coverage.
Load context
- Read the root
CLAUDE.mdin full. - Read the relevant local
CLAUDE.mdbefore opening or editing that area. - Run
git status --shortand preserve unrelated work. - Inspect the production path, its callers, and nearby tests before choosing a seam.
Apply canonical architecture rules to the concrete change without copying them here.
Before implementing database-backed behavior, invoke woc_database_performance for a
read-only checkpoint when the change can affect SQL or query call sites, schema or indexes,
query frequency or cardinality, pool configuration, lock scope, timeout policy, or stored-data
growth, including database driver/dependency upgrades and PostgreSQL
engine/resource/configuration/topology changes. Carry its concrete bounds and evidence
requirements into the test-first contract.
Choose the workflow
For a bug fix:
- Reproduce the defect through the real production path.
- Add a focused test that fails for the intended reason.
- Confirm the test is red before changing production code.
- Make the smallest coherent fix.
- Add nearby edge cases only when they protect the same contract.
For a feature or refactor:
- Identify the existing module, coordinator, state owner, or extension seam.
- Place behavior in a pure sibling module, current state owner, or thin adapter.
- Separate pure decisions from I/O, rendering, global state, and transport.
- Give the extracted unit direct tests and keep consumers thin.
- When relocating behavior, preserve semantics before redesigning anything.
Do not grow a monolith when a tested sibling is appropriate, introduce a framework for one call site, bypass existing seams to reach private state, or build parallel versions of the same rule. Preserve determinism, parity, localization, and persistence contracts. Do not commit unless explicitly asked.
Validate
Run focused tests while iterating, then:
npm run ci:changed
npx tsc --noEmit
Run domain guards for architecture, localization, persistence, parity, or security when
applicable. Re-run woc_database_performance on the finished diff when its database triggers
match. Before declaring the implementation ready, run npm run gate.
Report the selected seam, behavior covered, commands run, and remaining manual checks.
Version History
- 2edc3ac Current 2026-07-19 18:52


