Generates Claude Code skills from requirements using adaptive interview, complexity classification, and iterative validation. Use when creating new skills, scaffolding skill structure, or generating skills with sub-agent orchestration.
Instalaciรณn
Instalar con Codex o Claude Copia este prompt, pรฉgalo en Codex, Claude u otro asistente, y deja que revise la pรกgina de la skill y la instale por ti.
Generates Claude Code skills from requirements using adaptive interview, complexity classification, and iterative validation. Use when creating new skills, scaffolding skill structure, or generating skills with sub-agent orchestration.
Generates a complete Claude Code skill from a description or requirements document. Conducts an adaptive interview to understand the skill's purpose, classifies it into one of 7 archetypes (Generator, Tool Wrapper, Pipeline, Research, Script-driven, Reviewer, Inversion), surfaces candidate sub-patterns for the chosen archetype, spawns a Sonnet sub-agent to generate the files, validates with anthropic-validator, and presents the scaffold with architectural decisions.
When to Use This Skill
Load this skill when the user request matches ANY of these patterns:
Trigger Pattern
Example User Request
Skill creation
"Create a new skill", "Make a skill for X"
Scaffolding
"Scaffold a skill", "Set up a new skill"
Generation
"Generate a skill that does X"
Skill design
"Design a skill for X", "I need a skill that does X"
scripts/grade.ts returns SKIPPED for fuzzy assertions and emits a manual-invoke directive pointing at this agent. The orchestrator (or a future automation step) invokes the grader against evidence_paths to complete grading.
Eval comparator agent
agents/skill-eval-comparator.md
Bundled (no external load)
Blind A/B comparison of two grading runs. Invoked manually with two grading-<timestamp>.json paths; not auto-spawned by grade.ts.
Fallback behavior:
If a template file is missing: Use the closest available template, note mismatch in diagnostics
If content-guidance is missing: Proceed without it, note in diagnostics (output quality will be lower)
Runtime Prerequisites
The eval framework (Layer 2 infrastructure shipped in scripts/run-loop.ts + scripts/grade.ts) requires the bun runtime on PATH. Invocation via just eval-skill <path>.
Interim contract (until P10.11 ships): users must install bun manually. See bun.sh/install. Bulwark's scaffold/init flow does not auto-install bun yet โ formal installer scoped as P10.11 (plans/task-briefs/P10.11-bun-runtime-installer.md).
If you are scaffolding a skill into an environment without bun, generated evals/ data still ships, but just eval-skill will fail until bun is installed.
<description-or-name> โ Free-text description of the desired skill, or a skill name to start from
--doc <path> โ Path to a requirements document. Extracts interview answers from it instead of asking fresh.
--from-template <archetype> <skill-name> โ Fast path for experienced authors. Skips the Stage 0 interview and uses archetype defaults. Valid archetypes: Generator, Tool Wrapper, Pipeline, Research, Reviewer, Script-driven, Inversion. Stage 1 (classification confirmation), Stage 2 (generation), and Stage 3 (validation) all still run.
Examples:
/create-skill a skill that audits dependency versions โ Start from description
/create-skill --doc plans/task-briefs/P5.4-create-skill.md โ Start from requirements doc
/create-skill changelog-generator โ Start from a name
/create-skill --from-template Generator slug-from-title โ Skip interview, use Generator defaults
Mandatory Execution Checklist (BINDING)
Every item below is mandatory. No deviations. No substitutions. No skipping.
This skill uses a 6-stage pipeline. You are the orchestrator. Follow every item in order. Do NOT return to the user until all applicable items are checked.
Stage 1 โ Classify: Primary archetype determined per decision-framework.md (1 of 7) + context mode
Stage 1 โ Classify: Candidate sub-patterns for the archetype looked up; default-ON sub-patterns pre-checked
Stage 1 โ Classify: Default grading_mode resolved per archetype (objective for Generator/Tool Wrapper/Pipeline/Reviewer/Script-driven; subjective for Research/Inversion); author may override at Stage 1 confirmation
Stage 1 โ Classify: bundles_scripts resolved (true for Script-driven canonical; ask follow-up for non-Script-driven archetypes; default false)
Stage 1 โ Classify: Classification (archetype + selected sub-patterns + context + grading_mode + bundles_scripts) presented to user and confirmed via AskUserQuestion
Stage 2 โ Generate: Sonnet sub-agent spawned via Task tool (you do NOT generate the files yourself)
Stage 2 โ Generate: Generated files verified to exist in working directory
Stage 2 โ Generate: evals/evals.json and evals/triggers.json scaffolded per references/eval-scaffolding.md (always)
Stage 2 โ Generate: evals/compliance.json scaffolded if grading_mode = subjective (Research, Inversion, or override)
Stage 2 โ Generate: scripts/.gitkeep scaffolded if bundles_scripts = true; SKILL.md documents ${CLAUDE_PLUGIN_ROOT} invocation convention per references/scripts-conventions.md
Stage 2 โ Generate: If Pipeline archetype โ sub-agent files generated in {working-directory}/agents/
Stage 3 โ Validate: just check-description {working-directory}/SKILL.md invoked via Bash (E.1 description quality gate โ exits 1 on multi-line / over-length)
Stage 3 โ Validate: just check-skill-size {working-directory}/SKILL.md invoked via Bash (E.3 tiered cap enforcement โ exits 1 on hard cap with refactor proposal)
Stage 3 โ Validate: /anthropic-validator invoked via Skill tool (manual review is NOT a substitute)
Stage 3 โ Validate: If Pipeline archetype โ /anthropic-validator invoked on each sub-agent file
Stage 3 โ Validate: Validator output read and findings counted
Stage 3 โ Validate: Cross-file consistency check completed โ if skill bundles templates/, references/, or scripts/, scan SKILL.md for content that mirrors or references those files; verify both sides agree on rules, schemas, character sets, error conditions (per references/content-guidance.md โ Cross-File Consistency)
Stage 3 โ Validate: Sub-pattern review soft prompt presented to user IF (sub-patterns selected at Stage 1 > 0) OR (archetype has default-ON sub-patterns that were opted out โ Research, Inversion). SKIP entirely for Generator/Tool Wrapper/Reviewer/Script-driven/Pipeline when 0 sub-patterns selected (per references/content-guidance.md โ Sub-Pattern Catalog)
Stage 4 โ Refine: If validation found critical/high issues, Sonnet sub-agent spawned to fix (max 2 retries)
Stage 5 โ Deploy & Present: Skill files deployed from working directory to target directory
Stage 5 โ Deploy & Present: If Pipeline archetype โ sub-agent files deployed to .claude/agents/
Stage 5 โ Deploy & Present: Working directory cleaned up
Stage 0: Pre-Flight
โโโ Parse arguments (description, name, --doc path, or --from-template <archetype> <name>)
โโโ Load references/decision-framework.md
โโโ Load references/content-guidance.md
โโโ Load subagent-prompting skill
โโโ If --from-template provided (E.2 escape hatch):
โ โโโ Validate <archetype> against the 7-set (Generator, Tool Wrapper, Pipeline,
โ โ Research, Reviewer, Script-driven, Inversion). Case-insensitive match;
โ โ normalize to canonical form
โ โโโ If invalid: print valid options + exit (do NOT scaffold)
โ โโโ Skip interview entirely
โ โโโ Load classification with archetype defaults:
โ โ โโโ primary_archetype = <archetype>
โ โ โโโ selected_sub_patterns = default-ON only (Research โ reviewer-validated;
โ โ โ Inversion โ generator-coupled; others โ empty)
โ โ โโโ context_mode = fork if archetype โ {Pipeline, Research} else inline
โ โ โโโ grading_mode = archetype default per references/eval-scaffolding.md
โ โ โโโ bundles_scripts = (archetype = Script-driven)
โ โโโ Stage 1 still runs (classification confirmation prompt presented to user)
โโโ Elif --doc provided:
โ โโโ Read the requirements document
โ โโโ Extract answers to Q1-Q5 from the document
โ โโโ Present extracted answers to user for confirmation via AskUserQuestion
โโโ If no --doc and no --from-template:
โ โโโ AskUserQuestion: Present all 5 core questions from decision-framework.md
โ โโโ Q1: What does this skill do? (2-3 concrete invocation examples)
โ โโโ Q2: Primary action? (Audit / Create / Document / Orchestrate / Wrap script โ routes to archetype)
โ โโโ Q3: If creating: CLI/state inputs OR AskUserQuestion-driven? (Generator vs Inversion)
โ โโโ Q4: If orchestrating: sequential stages OR parallel viewpoints? (Pipeline vs Research)
โ โโโ Q5: Needs conversation history, or can run in isolation? (context: inline vs fork)
โโโ If sub-pattern disambiguation needed (Round 2):
โ โโโ AskUserQuestion: Follow-up questions per decision-framework.md
โ โโโ Q6: Reviewer sub-pattern? (standalone / pipeline-stage / multi-source)
โ โโโ Q7: Generator sub-pattern? (single-template / multi-template / configuration-emitting)
โ โโโ Q8: Tool Wrapper sub-pattern? (context-injected / schema-convention / methodology / pattern-catalog / curated-data-library)
โ โโโ Q9: Pipeline sub-pattern? (reviewer-orchestrating / research-orchestrating / generator-orchestrating)
โ โโโ Q10: Research โ reviewer-validated default ON; opt out?
โ โโโ Q11: Script-driven โ hook-orchestrated?
โโโ Determine target directory for generated skill
โ โโโ Default: skills/{skill-name}/ (or user-specified path)
โโโ Set working directory: tmp/create-skill/{skill-name}/
โ โโโ All generation and refinement happens here to avoid .claude/ edit approval storms
โ Files are deployed to the target directory only after validation passes (Stage 5)
โโโ Token budget check (warn if >30% consumed)
Interview behavior: Maximum 2 AskUserQuestion rounds. Present Q1-Q5 together in round 1. Follow-ups (if needed) in round 2. Do NOT ask questions one at a time.
Stage 1: Classify (Orchestrator)
Apply the archetype classification from references/decision-framework.md:
Stage 1: Classify
โโโ Decision: Primary archetype (1 of 7) โ per Decision Tree โ Primary Archetype in decision-framework.md
โ โโโ Q2 = Audit/score โ Reviewer
โ โโโ Q2 = Document conventions โ Tool Wrapper
โ โโโ Q2 = Wrap external script โ Script-driven
โ โโโ Q2 = Create + Q3 = CLI/state โ Generator
โ โโโ Q2 = Create + Q3 = AskUserQuestion โ Inversion
โ โโโ Q2 = Orchestrate + Q4 = sequential โ Pipeline
โ โโโ Q2 = Orchestrate + Q4 = parallel viewpoints โ Research
โโโ Decision: Context mode (orthogonal to archetype)
โ โโโ Q5 = needs conversation โ inline (no fork)
โ โโโ Q5 = isolation OK + (Pipeline OR Research) โ context: fork (recommended for orchestrators)
โ โโโ Otherwise โ inline (warn if fork requested for non-orchestrator)
โโโ Lookup: Candidate sub-patterns for chosen archetype (per decision-framework.md โ Sub-Pattern Lookup)
โ โโโ Default-ON: Research โ reviewer-validated; Inversion โ generator-coupled
โ โโโ Pre-check default-ON sub-patterns in user prompt; user may opt out
โโโ Decision: Default `grading_mode` for evals scaffolding (per references/eval-scaffolding.md โ Default grading_mode Per Archetype)
โ โโโ objective: Generator, Tool Wrapper, Pipeline, Reviewer, Script-driven
โ โโโ subjective: Research, Inversion
โ โโโ Author may override at the classification confirmation prompt below (rare โ typical override is Pipeline โ subjective when synthesis-quality grading is wanted)
โโโ Decision: `bundles_scripts` for scripts/ scaffolding (per references/scripts-conventions.md โ When a Skill Bundles Scripts)
โ โโโ true: Archetype = Script-driven (canonical โ always bundles a script)
โ โโโ ask: Archetype โ {Generator, Tool Wrapper, Pipeline, Reviewer, Research, Inversion}
โ โ โโโ AskUserQuestion: "Will this skill bundle executable scripts (TypeScript via bun, or shell scripts)? [Yes / No]"
โ โ โโโ Answer = bundles_scripts (default No if unanswered or ambiguous)
โ โโโ If true and archetype โ {Script-driven}, note "non-canonical scripts bundling" in diagnostics for review
โโโ Map archetype โ template (1 of 7 from decision-framework.md โ Archetype โ Template Mapping)
โโโ Present classification to user via AskUserQuestion:
โโโ "Primary archetype: {archetype} โ {one-line reason from Q2}"
โโโ "Template: {template-name}"
โโโ "Context: {inline/fork} โ {reason}"
โโโ "Default grading_mode: {objective/subjective} โ {reason from archetype default}"
โโโ "Bundles scripts: {Yes/No} โ {reason}"
โโโ "Candidate sub-patterns for {archetype}:"
โ โโโ For each: "{sub-pattern}: {one-line definition from content-guidance.md โ Sub-Pattern Catalog}"
โโโ "Which sub-patterns apply? (Select 0-N โ default-ON pre-checked)"
โโโ "Proceed with generation? [Yes / Adjust grading_mode / Adjust bundles_scripts / Adjust sub-patterns / Adjust]"
MANDATORY: Wait for user confirmation before proceeding to Stage 2. If user selects "Adjust", re-classify with their feedback. Selected sub-patterns + final grading_mode are passed to Stage 2 generator as CONSTRAINTS โ generator MUST document each selected sub-pattern in the generated SKILL.md and emit eval data per the resolved grading_mode.
Stage 2: Generate (Sonnet sub-agent)
Stage 2: Generate
โโโ Read the selected template from references/template-{type}.md
โโโ Construct prompt using 4-part template (GOAL/CONSTRAINTS/CONTEXT/OUTPUT):
โ โโโ GOAL: Generate a complete, structurally correct skill matching the
โ โ classification. The skill must activate reliably and instruct clearly.
โ โโโ CONSTRAINTS:
โ โ โโโ Follow the template structure exactly
โ โ โโโ Description MUST be a single line (multi-line breaks discovery)
โ โ โโโ Description MUST be โค250 chars (over-length silently truncates per Issue #881)
โ โ โโโ Description MUST use "Use when..." trigger framing
โ โ โโโ Frontmatter MUST include `version: 1.0.0` for the new skill (E.4 โ semver-flavored;
โ โ โ patch=typo/wording, minor=new feature, major=breaking. Migration guidance in
โ โ โ references/content-guidance.md โ "Skill version + migration checklist")
โ โ โโโ Frontmatter MUST include `author:` field. Default to `"Ashay Kubal @ Qball Inc."`
โ โ โ for first-party Bulwark generation; prompt the user during interview if
โ โ โ generating in an external repo.
โ โ โโโ Include "When to Use" table with โฅ3 trigger patterns
โ โ โโโ Include "DO NOT use for" section with โฅ2 anti-triggers
โ โ โโโ MUST include "## Mandatory Execution Checklist (BINDING)" at top of
โ โ โ SKILL.md with SC1-SC3 reference โ bottom checklists are advisory and
โ โ โ ignored (see references/content-guidance.md โ "Top-of-File Execution
โ โ โ Checklist" pattern)
โ โ โโโ Checklist placement: after frontmatter โ overview โ When-to-Use โ
โ โ โ Dependencies โ optional Usage, BEFORE Pipeline/Stages body
โ โ โโโ If skill has sub-agents: include subagent-prompting in skills: dependency
โ โ โโโ Do NOT add unnecessary files (no README, CHANGELOG, LICENSE)
โ โ โโโ Do NOT use emojis in generated content
โ โ โโโ Keep total SKILL.md under target line count for the archetype:
โ โ โ โโโ Tool Wrapper: 150, Generator: 200, Reviewer: 250
โ โ โ โโโ Inversion: 350, Pipeline: 400, Research: 400, Script-driven: 400
โ โ โ โโโ Tiered enforcement (memo D8 amended S107):
โ โ โ โโโ 200 lines = Advisory โ emit a soft note in return summary suggesting modularization
โ โ โ โโโ 500 lines = Strong warn โ emit a loud warning recommending split into references/
โ โ โ โโโ 600 lines = HARD CAP โ STOP. Do NOT emit a single SKILL.md exceeding 600 lines.
โ โ โ Return a refactor proposal listing which sections should move to
โ โ โ references/{name}.md or examples/{name}.md, then await user direction.
โ โ โโโ Cross-file consistency (memo D11, S107):
โ โ โ If the skill bundles templates/, references/, or scripts/, any rules,
โ โ โ algorithms, schemas, or validation logic in those files MUST agree with rules
โ โ โ stated in SKILL.md. Before returning, scan for cross-file claims (character sets,
โ โ โ error conditions, output formats, validation rules) and confirm both sides agree.
โ โ โ Disagreements are HIGH-severity functional bugs. Canonical example: a slug
โ โ โ algorithm in templates/ that preserves Unicode while SKILL.md validation accepts
โ โ โ only ASCII โ both files individually compile clean; together they fail silently
โ โ โ on non-ASCII input. Fix BEFORE returning, do not defer to validation.
โ โ โโโ For each selected sub-pattern, include a documented section in the generated SKILL.md:
โ โ โ โโโ Quote the canonical definition from references/template-{archetype}.md โ ## Common Sub-Patterns
โ โ โ โโโ Apply the sub-pattern's shape directives (e.g., context-injected โ user-invocable: false + hook setup docs)
โ โ โโโ Eval scaffolding (Layer 1 DATA โ per references/eval-scaffolding.md):
โ โ โ โโโ ALWAYS emit {working-directory}/evals/evals.json + {working-directory}/evals/triggers.json
โ โ โ โโโ If grading_mode = subjective โ ALSO emit {working-directory}/evals/compliance.json
โ โ โ โโโ grading_mode follows the archetype default unless explicitly overridden in CONTEXT
โ โ โ โโโ Use the matching archetype section in eval-scaffolding.md as the JSON shape
โ โ โ โโโ Substitute placeholders (<<SKILL_NAME>>, <<SKILL_PATH>>, <<INVOCATION_EXAMPLE_1>>, etc.)
โ โ โ โ from the classification + interview state โ see eval-scaffolding.md โ Placeholder Substitution Guide
โ โ โ โโโ Seed at least ONE concrete starter test in evals.json from Q1 examples
โ โ โ โโโ Seed 3-5 should-trigger and 3-5 should-not-trigger queries in triggers.json from Q1;
โ โ โ โ leave remaining slots as explicit <<TODO>> placeholders for the user
โ โ โ โโโ For subjective: seed compliance.json stage_id entries from the SKILL.md pipeline
โ โ โ โ (one stage_id per declared pipeline stage); deterministic evidence preferred
โ โ โ โโโ Apply sub-pattern ร eval impact additions per eval-scaffolding.md โ Sub-Pattern ร Eval Impact
โ โ โโโ Scripts scaffolding (per references/scripts-conventions.md):
โ โ โโโ If bundles_scripts = true โ emit {working-directory}/scripts/.gitkeep (empty file)
โ โ โโโ If bundles_scripts = true โ SKILL.md MUST document the `${CLAUDE_PLUGIN_ROOT}/skills/<name>/scripts/`
โ โ โ invocation convention (do NOT use `$CLAUDE_PLUGIN_DIR` โ non-existent latent bug source)
โ โ โโโ If bundles_scripts = true and any script is TS-via-bun โ SKILL.md MUST include a "Runtime Prerequisites" section
โ โ โ noting bun on PATH (cross-link to P10.11 bun installer brief)
โ โ โโโ If bundles_scripts = true โ SKILL.md MUST include a "Permissions Setup" section
โ โ โ listing required Bash(bun:*), Bash(bash:*), Bash(just:*) entries per scripts-conventions.md
โ โ โโโ If bundles_scripts = true and SKILL.md emits Justfile recipe examples โ quote `${CLAUDE_PLUGIN_ROOT}`
โ โ โ AND all parameters per SEC-008 (unquoted opens command-injection vectors when invoked from automation)
โ โ โโโ Do NOT generate concrete script files โ only .gitkeep. Script content is author-supplied
โ โ (generate-and-customize contract; refer to existing skills for starter patterns)
โ โโโ CONTEXT:
โ โ โโโ Classification from Stage 1 (primary archetype + selected sub-patterns + context mode + template + grading_mode + bundles_scripts)
โ โ โโโ User's interview answers (concrete examples from Q1)
โ โ โโโ Selected template: references/template-{archetype}.md
โ โ โโโ Content guidance: references/content-guidance.md (incl. Sub-Pattern Catalog)
โ โ โโโ Eval scaffolding guide: references/eval-scaffolding.md (per-archetype evals/ emission)
โ โ โโโ Eval schema lock: references/eval-shape.md (when in doubt about field shapes)
โ โ โโโ If bundles_scripts = true: references/scripts-conventions.md (scripts/ scaffolding + invocation convention + Justfile recipe pattern + bun runtime prerequisite)
โ โ โโโ Selected sub-patterns: explicit list passed from Stage 1 (0-N โ generator MUST document each)
โ โ โโโ Sub-pattern definitions: references/template-{archetype}.md โ ## Common Sub-Patterns
โ โ โโโ If Pipeline archetype: references/agent-template.md (sub-agent file structure)
โ โ โโโ If Pipeline archetype: references/agent-conventions.md (system-prompt register, frontmatter)
โ โ โโโ Instruction: "Read 1-2 existing skills of the same archetype from the
โ โ โ codebase for structural reference (use Glob to find skills/*/SKILL.md)"
โ โ โโโ If Pipeline archetype: "Read 1-2 existing agents from .claude/agents/*.md
โ โ โ for sub-agent structural reference"
โ โ โโโ Target output directory (final deployment location)
โ โ โโโ Working directory: tmp/create-skill/{skill-name}/
โ โโโ OUTPUT:
โ โโโ Write SKILL.md to {working-directory}/SKILL.md
โ โโโ Write reference files to {working-directory}/references/ (if applicable)
โ โโโ Write template files to {working-directory}/templates/ (if applicable)
โ โโโ Write script files to {working-directory}/scripts/ (if applicable)
โ โโโ Write {working-directory}/evals/evals.json (always โ per eval-scaffolding.md archetype section)
โ โโโ Write {working-directory}/evals/triggers.json (always โ 20-query format)
โ โโโ If grading_mode = subjective: Write {working-directory}/evals/compliance.json (stage execution checks)
โ โโโ If bundles_scripts = true: Write {working-directory}/scripts/.gitkeep (empty file โ preserves directory in git)
โ โโโ If Pipeline archetype: Write sub-agent files to {working-directory}/agents/
โ โ โโโ One .md file per pipeline stage: {skill-name}-{stage-name}.md
โ โ โโโ Each sub-agent follows agent-template.md structure
โ โ โโโ Each sub-agent uses system-prompt register (agent-conventions.md)
โ โ โโโ Orchestrating SKILL.md references sub-agents by Task(subagent_type="{name}")
โ โโโ Return summary: list of files created with line counts (include evals/* paths)
โโโ Spawn: Task(description="Generate skill files", subagent_type="general-purpose",
โ model="sonnet", prompt=...)
โโโ Read generator output (file list + summary)
โโโ Verify files were created (Glob for {working-directory}/**)
Stage 3: Validate (Orchestrator)
Stage 3: Validate
โโโ PRE-FLIGHT scripts (E.1 + E.3 deterministic gates โ run BEFORE anthropic-validator):
โ โโโ Bash: `just check-description {working-directory}/SKILL.md`
โ โ โโโ Exit 0 โ continue
โ โ โโโ Exit 1 โ BLOCK; route to Stage 4 with the FAIL findings as directives
โ โ โโโ Exit 2 โ infrastructure error; surface to user
โ โโโ Bash: `just check-skill-size {working-directory}/SKILL.md`
โ โโโ Exit 0 โ continue (advisory / strong-warn notes captured for Stage 5 summary)
โ โโโ Exit 1 (HARD CAP) โ BLOCK; route to Stage 4 with the refactor proposal as directive
โโโ FIRST: Invoke /anthropic-validator (this is the PRIMARY validation โ NOT optional)
โ โโโ Use the Skill tool: Skill(skill="anthropic-validator", args="{working-directory}/")
โ โโโ Do NOT substitute manual review for this step
โ โโโ Do NOT proceed past this node until the Skill tool has been invoked
โโโ If Pipeline archetype: Also validate each sub-agent file in {working-directory}/agents/
โ โโโ Run /anthropic-validator on each {skill-name}-{stage-name}.md
โโโ Read validator output
โโโ Check for critical/high findings:
โ โโโ 0 critical AND 0 high โ proceed to Stage 5 (skip Stage 4)
โ โโโ Any critical or high โ proceed to Stage 4 (refine)
โโโ THEN: Manual checks (these supplement the validator, they do NOT replace it)
โ โโโ Check description is single-line (read SKILL.md, verify no multiline description)
โ โโโ If Pipeline archetype: Check each sub-agent uses system-prompt register
โ โโโ Check no unnecessary files (no README.md, CHANGELOG.md, etc.)
โ โโโ Check evals/evals.json exists and parses as valid JSON with the resolved grading_mode
โ โโโ Check evals/triggers.json exists and parses as valid JSON
โ โโโ If grading_mode = subjective: Check evals/compliance.json exists and parses as valid JSON
โ โโโ Check evals/* placeholder substitutions: no leftover <<SKILL_NAME>>, <<SKILL_PATH>>,
โ โ <<SKILL_VERSION>>, <<GRADING_MODE>>, or <<INVOCATION_EXAMPLE_*>> markers (literal <<TODO>>
โ โ slots are permitted โ they are explicit user-fill placeholders for additional tests/queries)
โ โโโ If bundles_scripts = true: Check scripts/.gitkeep exists
โ โโโ If bundles_scripts = true: Check SKILL.md documents `${CLAUDE_PLUGIN_ROOT}` invocation convention
โ (grep for `${CLAUDE_PLUGIN_ROOT}`; ensure no `$CLAUDE_PLUGIN_DIR` references โ non-existent var, latent bug)
โโโ THEN: Cross-file consistency check (memo D11, S107 โ defense-in-depth for Stage 2 CONSTRAINT)
โ โโโ If skill bundles templates/, references/, or scripts/:
โ โ Scan SKILL.md for content that mirrors or references those files.
โ โ For each mirror (validation rules, character sets, error conditions, output schemas,
โ โ algorithm descriptions), verify SKILL.md and the referenced file agree.
โ โ Canonical disagreement shape: Unicode-preserving algorithm + ASCII-only validation
โ โ step (S107 slug-from-title probe). Read references/content-guidance.md โ
โ โ Cross-File Consistency for the full pattern catalog.
โ โโโ If a disagreement is found: Treat as HIGH finding. Route to Stage 4 refinement
โ โ with directive to align both files. Do NOT proceed to Stage 5.
โ โโโ If no supporting files OR no disagreements: Note "no cross-file claims" in diagnostics, proceed.
โโโ THEN: Sub-pattern review soft prompt (B.6 โ Path A โ conditional per memo D12, S107)
โ โโโ DECISION TREE:
โ โ โโโ If sub-patterns selected at Stage 1 > 0:
โ โ โ Present full prompt โ "Your skill is archetype {archetype}. Selected sub-patterns
โ โ โ at Stage 1: {list}. Common sub-patterns for this archetype that were NOT
โ โ โ selected: {remaining_list}. Review the generated SKILL.md โ should any
โ โ โ additional sub-pattern apply?"
โ โ โโโ Elif 0 sub-patterns selected AND archetype has default-ON sub-patterns
โ โ โ that were opted out (Research โ reviewer-validated; Inversion โ generator-coupled):
โ โ โ Present LIGHT confirmation only โ "You opted out of {default-ON list}. Confirm
โ โ โ exclusion intentional? [Yes / Re-enable]". Do NOT re-present the full sub-pattern
โ โ โ catalog.
โ โ โโโ Else (0 selected AND no default-ON in archetype โ Generator, Tool Wrapper,
โ โ Reviewer, Script-driven, Pipeline):
โ โ SKIP the soft prompt entirely. The 0-selection at Stage 1 already represents
โ โ an explicit user choice; re-asking adds friction without surfacing new info.
โ โ Note "soft prompt skipped โ 0 sub-patterns selected for non-default-ON archetype"
โ โ in diagnostics.
โ โโโ If user identifies a missed sub-pattern OR re-enables a default-ON: trigger Stage 4
โ โ with directive to add the documentation
โ โโโ If user confirms (or skip path triggers): proceed to Stage 5
โ โโโ Reference: content-guidance.md โ ## Sub-Pattern Catalog for full definitions
โโโ Stage 3 exit gate:
โโโ [ ] `just check-description` exited 0 (or all FAIL findings routed to Stage 4 and resolved)
โโโ [ ] `just check-skill-size` exited 0 (HARD CAP refactor proposal, if any, applied via Stage 4)
โโโ [ ] /anthropic-validator was invoked via the Skill tool (not manual review)
โโโ [ ] Validator output was read and findings counted
โโโ [ ] Cross-file consistency check completed (or N/A if no supporting files)
โโโ [ ] Sub-pattern review soft prompt presented OR skipped per D12 decision tree (with diagnostic note)
โโโ [ ] evals/evals.json exists and parses as valid JSON with the resolved grading_mode
โโโ [ ] evals/triggers.json exists and parses as valid JSON
โโโ [ ] If grading_mode = subjective: evals/compliance.json exists and parses as valid JSON
โโโ [ ] No leftover non-TODO placeholders in evals/* (<<SKILL_NAME>>, <<SKILL_PATH>>, <<SKILL_VERSION>>, <<GRADING_MODE>>, <<INVOCATION_EXAMPLE_*>> all substituted)
โโโ [ ] If bundles_scripts = true: scripts/.gitkeep exists
โโโ [ ] If bundles_scripts = true: SKILL.md uses `${CLAUDE_PLUGIN_ROOT}` (not `$CLAUDE_PLUGIN_DIR`) for script invocation paths
โโโ If any is unchecked, Stage 3 is NOT complete โ go back and complete the missing step
Stage 4: Refine (Sonnet sub-agent, conditional, max 2 retries)
This stage only runs if Stage 3 found critical or high issues.
Stage 4: Refine (attempt {N} of 2)
โโโ Construct prompt using 4-part template:
โ โโโ GOAL: Fix all critical and high findings from anthropic-validator
โ โโโ CONSTRAINTS:
โ โ โโโ Only fix the specific issues identified โ do not restructure
โ โ โโโ Preserve the existing skill content and structure
โ โ โโโ Description must remain single-line
โ โโโ CONTEXT:
โ โ โโโ Validator findings (critical and high items with descriptions)
โ โ โโโ Current generated files (read from working directory)
โ โ โโโ Content guidance: references/content-guidance.md
โ โโโ OUTPUT: Edit files in {working-directory}/ to fix findings
โโโ Spawn: Task(description="Fix validator findings", subagent_type="general-purpose",
โ model="sonnet", prompt=...)
โโโ Re-run Stage 3 (validate)
โโโ If still failing after 2 retries:
โ โโโ Proceed to Stage 5 with caveats noted
โโโ Token budget check
Stage 5: Deploy & Present (Orchestrator)
Stage 5: Deploy & Present
โโโ Deploy skill: Move skill files from {working-directory}/ to {target-directory}/
โ โโโ Copy directory tree preserving structure (SKILL.md, references/, templates/, scripts/, evals/)
โ โโโ This is the ONLY point where skill files are written to the final location
โโโ If Pipeline archetype: Deploy sub-agents
โ โโโ Move {working-directory}/agents/*.md to .claude/agents/
โ โโโ Each sub-agent file: .claude/agents/{skill-name}-{stage-name}.md
โโโ Clean up: Remove {working-directory}/ after successful copy
โโโ Read all generated files for summary
โโโ Present to user:
โ โโโ "Generated skill at: {target-directory}/"
โ โโโ If pipeline: "Generated sub-agents at: .claude/agents/"
โ โโโ "Files created:"
โ โ โโโ List each file with line count (skill files + evals/* + sub-agent files)
โ โโโ "Architectural decisions:"
โ โ โโโ "Context: {fork/inline} โ {reason}"
โ โ โโโ "Sub-agents: {none/sequential/parallel/AT} โ {reason}"
โ โ โโโ "grading_mode: {objective/subjective} โ {reason}"
โ โ โโโ "Bundles scripts: {Yes/No} โ {reason}"
โ โ โโโ "Supporting files: {list} โ {reason}"
โ โโโ "Skill type: {template used}"
โ โโโ "Validation: {pass/fail with details}"
โ โโโ If caveats: "Unresolved issues: {list}"
โ โโโ If pipeline: "Sub-agent permissions to configure:"
โ โ โโโ {List tool permissions for each sub-agent that must be added to settings.json}
โ โโโ "Next steps:"
โ โโโ "1. Review and customize the generated instructions"
โ โโโ "2. Test activation by asking Claude to invoke it"
โ โโโ "3. Iterate on trigger patterns until activation is reliable"
โ โโโ "4. Add domain-specific content to reference files"
โ โโโ "5. Fill in evals/ <<TODO>> placeholders with concrete test prompts and trigger queries"
โ โโโ "6. Run `just eval-skill {target-directory}` to baseline behavior (requires bun on PATH)"
โ โโโ If pipeline: "7. Configure tool permissions for sub-agents in .claude/settings.json"
โโโ Note: This is a scaffold, not production-ready output (generate-and-customize contract). evals/ ships with one starter test + 3-5 seeded triggers; user fills the rest.
Stage 6: Diagnostics (REQUIRED)
MANDATORY: Write diagnostic output after every invocation. This cannot be skipped.
Stage 6: Diagnostics
โโโ Write to: $PROJECT_DIR/logs/diagnostics/create-skill-{YYYYMMDD-HHMMSS}.yaml
โ โโโ Use templates/diagnostic-output.yaml schema
โโโ Include:
โโโ Input: description/name/doc path
โโโ Interview: questions asked, rounds completed
โโโ Classification: all three decisions + template selected
โโโ Generation: files created, line counts, model used
โโโ Validation: pass/fail, findings count, retry count
โโโ Outcome: success/partial/failure
Error Handling
Scenario
Action
Generator sub-agent returns empty output
Re-spawn once with reinforced instructions. If still empty, STOP: "Generation failed. Please try with a more detailed description."
anthropic-validator finds critical issues
Stage 4 retry (max 2). After 2 retries, present with caveats.
anthropic-validator unavailable
Skip validation, note in diagnostics, warn user: "Validation skipped โ run /anthropic-validator manually."