From engine
A skill that creates or enhances `.claude/skills/harness-<domain>-<name>.md` harness skills tailored to the user's work domain. The main agent handles decisions and user interaction, while sub-agents perform domain research and harness generation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/engine:harness-engineThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The purpose of this skill is to set up harness skills in `.claude/skills/harness-<domain>-<name>.md` that Claude can repeatedly reference for the user's work domain.
references/GENERATION.mdreferences/INTERSECTION.mdreferences/OUTPUT_CONTRACT.mdreferences/TASK_INTAKE.mdreferences/VALIDATION.mdreferences/adapters/bootstrap.mdreferences/adapters/design-doc.mdreferences/adapters/frontend.mdreferences/adapters/marketing.mdreferences/adapters/operator-stack.mdreferences/adapters/research.mdreferences/adapters/source-analysis.mdreferences/common/BOOTSTRAP_PHASE.mdreferences/common/RESEARCH_PHASE.mdreferences/examples/frontend/ANTI_GOOD_REFERENCE.mdreferences/examples/frontend/README.mdreferences/examples/frontend/VALIDATION_REFERENCE.mdreferences/examples/research/ANTI_GOOD_REFERENCE.mdreferences/examples/research/README.mdreferences/examples/research/VALIDATION_REFERENCE.mdThe purpose of this skill is to set up harness skills in .claude/skills/harness-<domain>-<name>.md that Claude can repeatedly reference for the user's work domain.
The main agent handles decisions, user interaction, and session management, while harness generation and validation are delegated to sub-agents.
This skill is neither a fully static rule engine nor a fully dynamic engine that researches from scratch each time. The basic structure is:
references/common/RESEARCH_PHASE.mdreferences/adapters/<task_type>.mdcontract packetreferences/examples/<task_type>/*.claude/skills/harness-<domain>-* skills are too weak to use as practical work standardstask_type from the representative classification set..claude/skills/harness-<domain>-* skills exist.project-harness generation or engine-asset bootstrap.
6a. Determine harness file splitting strategy. Follow "Harness File Splitting Strategy" in references/OUTPUT_CONTRACT.md to decide how many files to split this domain's harness into. Present the split proposal and grouping to the user for confirmation.
6.5. Perform Intersection Scan. If 1+ existing harnesses exist, detect intersections using the 3-step heuristic in references/INTERSECTION.md. If intersections are found, confirm authority assignment with the user and record in the contract packet's Intersection Map.research phase first. Simultaneously perform Potential Intersection Discovery to investigate ungenerated domains with high intersection probability with the current domain, and suggest to the user.contract packet in the session path. Include Intersection Map and Potential Intersection Domains sections.intersection_map and intersection_directives additionally..claude/skills/use-repo-skills.md. (Skip this step if the file doesn't exist — suggest-harness.sh directly scans individual harness-*.md files, so the central catalog is optional.)AGENTS.md (or CLAUDE.md if absent) has been read./tmp prohibition).CLAUDE.md.harness-<domain>-<name>.md) the final output will be.references/OUTPUT_CONTRACT.md. Default is concern-group splitting; present grouping proposal to the user for confirmation.portable core / project adapter / local evidence pack separation principle.learning-mode in parallel.references/common/RESEARCH_PHASE.md first.common + thin adapter + contract packet.references/examples/<task_type>/ is read as reference-only evidence; do not copy as portable core rules.reusable if it does not meet the following minimum contract:
Read references/TASK_INTAKE.md and first determine:
task_type it isReview the representative classification set as default first.
If there are 2+ practical candidates, do not auto-confirm — present options to the user and wait.
After task_type determination, first assess existing harness quality, then perform the common research phase and load the domain's thin adapter.
If existing .claude/skills/harness-<domain>-* skills exist, first check:
If any of the above is no, the existing harness is judged as exists but not reusable and switches to reinforcement mode.
Performed when the target project has 1+ existing .claude/skills/harness-*.md files. If no existing harness exists, record intersection_map: none and skip.
Read references/INTERSECTION.md and perform:
Intersection Metadata sections of existing harness files. If no metadata exists, dynamically extract concept_keywords from frontmatter (matchPatterns), rule titles, and Anti/Good case names.All task_types first apply references/common/RESEARCH_PHASE.md.
The common research phase first organizes recommended patterns based on official documentation/standards. Current project code analysis is supplementary for identifying deviations from official standards.
At this stage, close at minimum:
known_intersections hints and project stack. Record results in the contract packet's Potential Intersection Domains and suggest to the user: "These domains have high intersection probability. Would you like to generate them together?" This step is a recommendation (SHOULD), not a HARD GATE.Even if research is the final task_type, perform this phase first, then additionally apply references/adapters/research.md.
If references/adapters/<task_type>.md exists, load it.
Adapters provide only minimum contracts. Project-specific stack/library/quality criteria are recorded in the session path's contract packet.
If optional example packs exist, check:
README.mdANTI_GOOD_REFERENCE.mdVALIDATION_REFERENCE.mdThese 3 are reference-only evidence, not hard gates. However, if they exist, verify they don't conflict with the adapter contract.
All generation/reinforcement work creates a project-specific contract packet in the session path before proceeding.
.claude/sessions/<session_id>/notes/contracts/<task_type>-contract.mdtemps/contracts/<task_type>-contract.mdThe contract packet must contain at minimum:
intersection_map: none if no intersections)potential_intersections: none if none)If 2 or more of the following apply, run bootstrap supplementation:
Run references/common/BOOTSTRAP_PHASE.md in supplementation mode. The main agent performs user verification (human-in-the-loop), and reflects the confirmed Coverage Contract in the contract packet.
engine-asset bootstrap and close the thin adapter, contract packet, and necessary stack seed assets together.references/common/BOOTSTRAP_PHASE.md in new mode. The main agent performs Role-Goal-Backstory definition and user verification, then passes confirmed content as input to the contract packet and project-harness generation path. Do not promote to representative classification without a separate decision.If the adapter has a stack branching section, check references/stacks/<stack>.md.
engine-asset bootstrap, generate seed doc in the same turn.project-harness generation, reflect necessary rules in the current project harness and contract packet, and leave engine asset absence as engine_followup_required: yes.Before creating or reinforcing a harness, first determine where to place the content to be added:
portable core
project adapter
local evidence pack
Rules:
local evidence pack by default..claude/sessions/<session_id>/notes/.Once user interaction is complete and all decisions are confirmed, run the harness generation sub-agent.
Agent tool call:
description: "harness generation for {domain}"
subagent_type: general-purpose
isolation: worktree
run_in_background: false (foreground)
prompt: (see prompt composition below)
If custom agent .claude/agents/harness-researcher/ exists, Claude Code may auto-delegate via description matching. If auto-delegation doesn't work, use the general-purpose settings above.
Read the following files and generate harness outputs.
1. Generation guidelines: .claude/skills/harness-engine/references/GENERATION.md
2. Output rules: .claude/skills/harness-engine/references/OUTPUT_CONTRACT.md
Note: Temporary files must be recorded under notes/ within the session_path. /tmp usage prohibited.
Work information:
- task_type: {task_type}
- execution_path: {project-harness generation | engine-asset bootstrap}
- common_research_path: {.claude/skills/harness-engine/references/common/RESEARCH_PHASE.md}
- adapter_path: {adapter_path or "none"}
- contract_packet_path: {.claude/sessions/<session_id>/notes/contracts/<task_type>-contract.md or temps/contracts/...}
- example_pack_path: {references/examples/<task_type>/ or "none"}
- bootstrap_phase_path: {common bootstrap phase path or "N/A"}
- bootstrap_mode: {new/supplement/none}
- coverage_contract: {coverage_contract content}
- user_decisions: {user-confirmed decisions}
- existing_harness_path: {existing harness path or "none"}
- session_path: {resolved literal path — main agent must resolve before dispatch}
- stack: {stack info or "N/A"}
- stack_reference_path: {references/stacks/<stack>.md or "none"}
- stack_required_checks: {stack required checks reflected in contract packet}
- engine_followup_required: {yes/no}
- coverage_manifest: {Source Coverage Manifest content in contract packet}
- cross_cutting_distribution: {Cross-Cutting Distribution content in contract packet or "none"}
- intersection_map: {Intersection Map content in contract packet or "none"}
- intersection_directives: {Intersection Map Resolution Directives content or "none"}
- splitting_strategy: {concern-group | consolidated | per-library}
- target_files: [{harness-<domain>-<name1>.md: content summary}, {harness-<domain>-<name2>.md: content summary}]
The main agent must fill in session_path before dispatching the sub-agent.
## Session State context (e.g., file paths in Snapshots containing .claude/sessions/<uuid>/), use ittemps/<date>/<scope>/ instead (per project convention)uuidgen, mktemp, $RANDOM, or similar — this creates orphan directories that the Stop hook cannot managels -td .claude/sessions/*/ to guess — in concurrent sessions it may return a different session's directoryInformation returned by the sub-agent:
engine_followup_requiredReview results; if there are unfulfilled items, report to the user and decide on response.
Do not start implementation tickets unless the verdict is pass.
After the harness generation sub-agent completes, run the validation sub-agent.
Agent tool call:
description: "harness validation for {domain}"
subagent_type: general-purpose
isolation: none (no worktree — read-only)
run_in_background: false (foreground)
prompt: (see validation prompt below)
Read only the harness document at the following path and perform validation.
Harness path: {worktree_path}/.claude/skills/harness-{domain}-{name}.md
Validation criteria: .claude/skills/harness-engine/references/VALIDATION.md
Temporary file rules: Record only in temps/ under session_path. /tmp usage prohibited.
session_path: {resolved literal path — main agent must resolve before dispatch}
Common research phase: {.claude/skills/harness-engine/references/common/RESEARCH_PHASE.md}
Task adapter: {adapter_path or "none"}
Project contract packet: {contract_packet_path}
Example pack: {example_pack_path or "none"}
Bootstrap phase: {bootstrap_phase_path or "N/A"}
Execution path: {project-harness generation | engine-asset bootstrap}
Stack seed reference: {stack_reference_path or "none"}
Validation method:
1. Read only the harness document and related engine references, then perform the following virtual task: {virtual task scenario}
2. Report missing information, ambiguous instructions, and conflicting rules in the harness.
3. Determine pass/fail for each item against VALIDATION.md minimum checklist, contract packet compliance, and stack-specific checks.
Report format:
- Missing items: [list]
- Ambiguous points: [list]
- Conflicting rules: [list]
- Checklist pass status: [per item]
- engine follow-up required: [yes/no]
- Overall verdict: [pass/needs reinforcement]
- Implementation start allowed: [yes/no]
After validation sub-agent (Step 14) passes, the main agent compares the newly generated harness against all existing harnesses in the project.
.claude/skills/harness-*.md file list in the project (excluding newly generated harness).references/INTERSECTION.md:
Pending Harness Update directives (saved in session notes).Sub-agents do not update session files. The main agent handles:
.claude/sessions/<session_id>/notes/contracts/ or temps/contracts/.claude/sessions/<session_id>/notes/validation/ or temps/validation/.claude/skills/use-repo-skills.md: Update domain harness list when new harness skill is created (only if file exists)engine_followup_required and stack required checks are left in the validation artifact..claude/skills/harness-<domain>-* skills, do not create new skills..claude/skills/use-repo-skills.md exists, update the domain harness list. (Since suggest-harness.sh directly scans individual files, catalog non-update doesn't block discovery.)uuidgen, mktemp, $RANDOM) — creates orphan directories the Stop hook cannot managetask_type determinationtemps/ and terminatingpassreferences/TASK_INTAKE.mdreferences/GENERATION.mdreferences/OUTPUT_CONTRACT.mdreferences/VALIDATION.mdreferences/INTERSECTION.mdreferences/common/RESEARCH_PHASE.mdreferences/adapters/<task_type>.mdreferences/common/BOOTSTRAP_PHASE.mdreferences/stacks/<stack>.mdreferences/examples/<task_type>/*.claude/sessions/<session_id>/notes/contracts/.Provides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.
npx claudepluginhub nwleedev/engine