Tier 0 Doctrine
This skill is a constant-extraction engine. Its purpose is to take a domain and extract
every constant until the remaining variable space is within operational tolerance. The
output is a skill package — a locked set of constants structured for LLM execution.
One Objective: Extract constants from the domain.
Five Elements: Every candidate constant must survive all five:
- C&V — The OBJECTIVE. Separate fixed from changing.
- IMO — The PROCESS. Does it hold regardless of what flows through?
- CTB — The HIERARCHY. Does it hold at every level?
- Hub-and-Spoke — The PHYSICAL MODEL. Is the rim/spoke/hub separation clean?
- Circle — The VALIDATION. Does it hold after a full feedback cycle?
Block Architecture: This skill is built from blocks. Each block is governed by one of
the five elements (C&V, IMO, CTB, Hub-and-Spoke, Circle). Every block — regardless of its
governing element — follows the same internal format defined by all five elements. The
number of blocks is determined by the domain. The format per block is the constant.
Block Format — The Constant
Every block in every skill follows this structure. This does not change.
BLOCK [N]: [Name]
Governed by: [C&V | IMO | CTB | Circle]
Constants: What is fixed in this block regardless of domain or invocation.
Variables: What changes per domain or invocation.
IMO:
Input: What this block receives from prior blocks or the user.
Middle: What this block does — the specific work governed by its element.
Output: What this block produces for downstream blocks.
CTB:
Trunk: The primary concept this block handles.
Branches: Supporting elements.
Leaves: Specific details or implementation items.
Circle:
Validation: How you know this block's output is correct.
Feedback: If wrong, which prior block receives the correction signal.
Go/No-Go: The gate. What must be true before proceeding to the next block.
Skill-Creator Blocks
BLOCK 1: Domain Scope
Governed by: C&V
Constants:
- Every skill has a single, unambiguous trigger condition.
- Every skill has a testable output (the swap test).
- The three-question entry: "What triggers this?", "How do we get it?", and "How does this skill validate its output?"
Variables:
- The specific domain being skilled.
- The specific examples and edge cases.
IMO:
- Input: User request — "I need a skill that does X."
- Middle: Apply C&V lens. What is fixed about this domain regardless of implementation?
What changes per invocation? Ask the three-question entry. If any question cannot be
answered, stop and ask the user.
- Output: Confirmed domain scope with initial constants and variables separated.
CTB:
- Trunk: The domain definition — what this skill IS.
- Branches: The trigger condition, the output definition.
- Leaves: Specific examples and edge cases.
Circle:
- Validation: Can you state in one sentence what triggers this skill and what it produces?
- Feedback: If no, return to user for clarification. Do not proceed with ambiguity.
Go/No-Go: Trigger and output are unambiguous. All three entry questions answered. Proceed.
BLOCK 2: Constant Extraction
Governed by: C&V
Constants:
- Constants first. Variables are a last resort.
- Every candidate constant must survive all five elements (C&V/IMO/CTB/Hub-and-Spoke/Circle).
- A constant that names a specific tool is not a constant — it is a mislabeled variable.
- Constants are structural truths. Variables are implementation details.
Variables:
- The specific constants discovered for this domain.
- The number of gates required (determined by domain complexity).
IMO:
- Input: Domain scope from Block 1.
- Middle: Run the gate mechanism. At each gate:
- Identify a candidate constant.
- Validate with C&V: Is this genuinely fixed, or a mislabeled variable?
- Validate with IMO: Does it hold regardless of what flows through?
- Validate with CTB: Does it hold at every level of the hierarchy?
- Validate with Hub-and-Spoke: Is the rim/spoke/hub separation clean?
- Validate with Circle: Does it hold after a full feedback cycle?
- If it survives all five, lock it. Move to next gate.
- Back-propagate: Does the new constant invalidate any prior constant?
- If prior constant breaks, reclassify it as variable and re-run that gate.
- Stop when no new constants found AND back-propagation clean.
- Output: Locked constants list. Isolated variable space. Gate count documented.
CTB:
- Trunk: The constants block of the target skill.
- Branches: Each individual constant, numbered and defined.
- Leaves: The validation evidence for each constant (which tests it passed).
Circle:
- Validation: Is the variable count low? A high variable count means the constants block
is incomplete. Variables are edge functions — if a skill has many, it has too many
moving parts. That is a design gap.
- Feedback: If variable count is high, return to gate mechanism and extract more constants.
Go/No-Go: Constants locked. Variable count minimized. Every constant has validation
evidence. Proceed.
BLOCK 3: Process Definition
Governed by: IMO
Constants:
- Every skill has exactly one IMO: one trigger, one processing description, one output.
- The IMO appears at the top of every skill before any other content.
- An LLM reading the skill must know what it is executing before it reads the instructions.
- A "state" in the skill is just identifying your position on the IMO.
Variables:
- The specific trigger for this skill.
- The specific processing steps.
- The specific output format and deliverable.
IMO:
- Input: Constants and variables from Block 2.
- Middle: Define the skill's IMO.
- Ingress: What triggers this skill? What is the input? Be specific — an LLM must be
able to recognize the trigger without human help.
- Middle: What processing does the skill perform? State it as operations on constants
and variables, not as prose descriptions.
- Egress: What does this skill produce? State the exact output — file, data structure,
decision, action. If the output is not testable, the IMO is incomplete.
- Output: The skill's IMO block — ready to drop into SKILL.md.
CTB:
- Trunk: The overall process (trigger → process → output).
- Branches: Ingress definition, Middle definition, Egress definition.
- Leaves: Specific trigger conditions, processing steps, output specs.
Circle:
- Validation: Can an LLM read just the IMO block and know what to do without reading
anything else? If no, the IMO is incomplete.
- Feedback: If IMO is unclear, return to Block 1 (domain scope may be ambiguous).
Go/No-Go: IMO is complete, testable, and self-contained. Proceed.
BLOCK 4: Workflow Design
Governed by: IMO
Constants:
- Every workflow phase is itself an IMO with its own input, middle, output.
- Every phase has a Go/No-Go gate.
- Phases do not call other phases directly — each completes and hands off to the hub.
- Silent retry is never the response to a phase failure.
- The three-field failure log is always produced: phase_failed, attempted_action, raw_output.
Variables:
- The number of phases (determined by domain complexity).
- The specific work each phase performs.
- The specific Go/No-Go criteria per phase.
IMO:
- Input: The skill's IMO from Block 3 + constants/variables from Block 2.
- Middle: Decompose the skill's Middle into execution phases. Each phase is a spoke
on the hub-and-spoke. Each phase has:
- Its own constants (what is fixed for this phase).
- Its own variables (what changes per invocation in this phase).
- Its own IMO (input to this phase, processing, output from this phase).
- Its own Go/No-Go gate.
For each phase, ask: "Is this the minimum number of steps to produce the output?"
If any phase can be eliminated by moving its work to constants, eliminate it.
- Output: Complete workflow with phases, each structured as an IMO with Go/No-Go gates.
CTB:
- Trunk: The overall workflow.
- Branches: Individual phases.
- Leaves: Phase-specific constants, variables, IMO, and gates.
Circle:
- Validation: Walk through the workflow mentally with a concrete example. Does each
phase produce what the next phase needs? Does every Go/No-Go gate have a clear
pass/fail criterion?
- Feedback: If a phase's output doesn't match the next phase's input, the interface
is broken. Fix the phase or add a missing phase.
Go/No-Go: Every phase has IMO + Go/No-Go. No phase calls another phase directly.
Concrete example walks through cleanly. Proceed.
BLOCK 5: Skill Organization
Governed by: CTB
Constants:
- SKILL.md structure is always: Tier 0 Doctrine → IMO → Constants → Variables →
Workflow → Rules → Reference Pointers.
- The frontmatter description field is the primary trigger mechanism.
- Every skill uses progressive disclosure: frontmatter → body → references as needed.
- Every skill earns its tokens — context is finite; every line justifies its presence.
- Never exceed 500 lines in SKILL.md. Move details to reference files.
- Information lives in one place only. No duplication between SKILL.md and references.
Variables:
- The domain-specific content of each section.
- Which reference files to create and when to load them.
IMO:
- Input: All outputs from Blocks 1-4 (scope, constants, variables, IMO, workflow).
- Middle: Assemble the skill as a CTB:
- Trunk: The SKILL.md file itself — the single source of truth.
- Branches: Major sections (IMO, Constants, Variables, Workflow, Rules, References).
- Leaves: Specific content within each section.
Write the skill so its structure demonstrates the framework. The document IS the
instruction, not a description of it. Every section should be a block following the
block format.
- Output: Assembled SKILL.md ready for validation.
CTB:
- Trunk: SKILL.md
- Branches: Each major section.
- Leaves: Content within sections + reference file pointers.
Circle:
- Validation: Does the skill read top-to-bottom without requiring the reader to jump
around? Does each section build on the previous? Is the progressive disclosure clean?
- Feedback: If the organization is confusing, the CTB is wrong — the trunk/branch/leaf
assignment needs rework. Return to this block and reorganize.
Go/No-Go: SKILL.md assembled. Under 500 lines. No duplication. Progressive disclosure
clean. Proceed.
BLOCK 6: Rules & Boundaries
Governed by: C&V
Constants:
- Every skill has a Rules section stating what it NEVER does.
- "Never" is a constant. Boundaries are the highest-value section of any skill.
- Rules prevent the most common failure modes before they happen.
- Rules are constraints expressed as constants — they reduce the variable space by
eliminating entire categories of behavior.
Variables:
- The specific rules for this domain.
- The specific failure modes being prevented.
IMO:
- Input: The assembled skill from Block 5 + real-world knowledge of failure modes.
- Middle: For each constant and each workflow phase, ask: "What is the most common way
an LLM will screw this up?" State the answer as a "Never" rule. Each rule is a
constant that eliminates a class of variables (failure modes).
Also add these universal rules that apply to every skill:
- Never put tool names in the Constants block.
- Never skip the Constants/Variables separation.
- Never write a skill that describes the framework without demonstrating it.
- Never deliver a skill that fails the swap test.
- Never let reference files duplicate SKILL.md content.
- Every skill must declare its audit mechanism. Ask: How does output from this skill
get validated? If the skill produces output that reaches a human or downstream system,
it must declare whether it uses self-check only, cross-check (different LLM), human
review, or a combination. This maps to OPERATOR_PROFILE.md Block 6 three-tier
enforcement. Not every skill needs all three tiers — but every skill must answer
the question.
- Output: Complete Rules section for the skill.
CTB:
- Trunk: The Rules section.
- Branches: Domain-specific rules + universal rules.
- Leaves: Individual "Never" statements.
Circle:
- Validation: For each rule, can you describe the specific failure it prevents? If you
cannot, the rule is vague — sharpen it or remove it.
- Feedback: If failures are occurring that no rule covers, add a rule. This block is
never truly finished — it grows with real usage.
Go/No-Go: Every rule prevents a specific, describable failure mode. Universal rules
included. Proceed.
BLOCK 7: Swap Test
Governed by: Circle
Constants:
- The swap test is always run on a fresh session with zero prior context.
- A mismatch in Constants is the highest-severity failure.
- The swap test has three comparison criteria: Constants match, Variables match, IMO match.
- The swap test is human-executed, not automated.
Variables:
- The specific example used for the test.
- The specific second LLM used for comparison.
- The specific results of the comparison.
IMO:
- Input: The complete assembled skill from Blocks 1-6.
- Middle: Execute the swap test:
- Send SKILL.md to a second LLM in a fresh session with zero context.
- Give it one concrete example and ask it to execute the skill.
- Compare output on three criteria:
- Constants match: Did the second LLM identify the same fixed elements?
- Variables match: Did it identify the same configurable elements?
- IMO match: Did it produce the same trigger/processing/output decomposition?
- Output: PASS (all three match) or FAIL (identify which criterion failed and which
block produced the deviation).
CTB:
- Trunk: The swap test verdict (PASS/FAIL).
- Branches: Each comparison criterion.
- Leaves: Specific matches or mismatches.
Circle:
- Validation: PASS means the skill is LLM-agnostic and context-independent. This is
the definition of "done."
- Feedback: FAIL routes correction to the specific block that produced the mismatch:
- Constants mismatch → return to Block 2 (constant extraction).
- Variables mismatch → return to Block 2 (variable identification).
- IMO mismatch → return to Block 3 (process definition).
- Workflow confusion → return to Block 4 (workflow design).
- Organizational confusion → return to Block 5 (skill organization).
- Missing rule → return to Block 6 (rules & boundaries).
Go/No-Go: PASS = proceed to validation. FAIL = return to identified block.
BLOCK 8: Automated Validation
Governed by: Circle
Constants:
- Validation is always run before delivery. No exceptions.
- A skill that fails validation is not delivered.
- Validation is automated via quick_validate.py.
Variables:
- The specific validation errors (if any).
IMO:
CTB:
- Trunk: Validation verdict (PASS/FAIL).
- Branches: Individual checks.
- Leaves: Specific pass/fail per check.
Circle:
- Validation: Automated — the script runs the checks.
- Feedback: If validation fails, fix errors and re-run. Do not deliver until clean.
Go/No-Go: quick_validate.py reports all checks passed. Proceed to delivery.
BLOCK 9: Delivery
Governed by: IMO
Constants:
- Delivery is the SKILL.md path plus confirmation of swap test and validation pass.
- The delivered skill must be executable by any LLM without prior context.
Variables:
IMO:
CTB:
- Trunk: The delivered skill package.
- Branches: SKILL.md + reference files + scripts (if any).
- Leaves: Individual files.
Circle:
- Validation: User confirms receipt.
- Feedback: Iteration begins — see Block 10.
Go/No-Go: Skill delivered. Move to iteration.
BLOCK 10: Iteration Protocol
Governed by: Circle
Constants:
- Every skill improves through real usage, not through speculation.
- Deviation from expected output signals a specific gap: missing constant, missing rule,
or missing workflow phase.
- High ERROR table volume means a workflow gate or Constants block entry is missing.
Fix the skill, not the error handler.
- The swap test remains the definition of "done" across all iterations.
Variables:
- The specific deviations observed in real usage.
- The specific fixes applied.
IMO:
- Input: Real-world usage data — where did the LLM deviate from expected output?
- Middle: Diagnose the deviation:
- Is it a Constants gap? → Return to Block 2, add the missing constant.
- Is it a Rules gap? → Return to Block 6, add the missing boundary.
- Is it a Workflow gap? → Return to Block 4, add or refine a phase.
- Is it an IMO gap? → Return to Block 3, clarify the process.
- Is it an Organization gap? → Return to Block 5, restructure.
- Is it unclassifiable (OTHER)? → Log to error table. Do not guess. Ask the user.
- Output: Specific correction routed to specific block. Re-run Blocks 7-9 after fix.
CTB:
- Trunk: The iteration cycle.
- Branches: Diagnosis categories (constants gap, rules gap, workflow gap, etc.).
- Leaves: Specific deviations and their fixes.
Circle:
- Validation: After fix, does the swap test still pass? If not, the fix broke something.
Back-propagate.
- Feedback: This block never closes. Every real-world use is an input to this block.
The skill is alive as long as it is in use.
Go/No-Go: N/A — this block runs continuously. The goal: a skill that produces
identical output regardless of which LLM executes it, in which session, with no prior
context. That is the swap test. That is done.
CTB Backbone Mapping
When a skill produces output that writes to a database:
- Confirmed, validated output → CANONICAL table write via registered promotion path.
- Unclassified or failed output → ERROR table write.
The skill's workflow IS the promotion path. Canonical = constants that survived. Error =
variables that didn't. Two altitudes, same architecture.
Reference Files
| File |
Contains |
Load When |
references/workflows.md |
Established multi-step process patterns |
Block 4 — designing workflow |
references/output-patterns.md |
Standard output format patterns |
Block 3 — defining IMO egress |
references/progressive-disclosure-patterns.md |
Context-efficient information layering |
Block 5 — organizing skill |
references/operators-checklist.md |
Step-by-step execution checklist |
Any time — operator's manual |
Do not duplicate reference file content in this SKILL.md. Load as needed.
The Constant-First Principle
Constants first. Variables are a last resort.
Every variable commits you to guard rails, conditional handling, and validation logic.
Every constant simplifies the skill and makes it more predictable. If you can make it a
constant, make it a constant. Only declare a variable when the value genuinely cannot be
known at design time.
The gate mechanism is a constant-reduction machine. Each gate eliminates a class of
unknowns. By the time the LLM reaches Block 9, the only things still open are the true
variables — the ones that cannot be resolved by design. Everything else has been
classified, locked, and exited cleanly by a prior block.
A variable is an edge function. High variable count means the Constants block is
incomplete. That is a design gap, not a feature.
1---2name: skill-creator3description: Creates validated, swap-testable skill packages for LLM execution. Trigger: User requests a new skill, or requests modification of an existing skill. Output: A validated skill package at skills/<skill-name>/SKILL.md that passes quick_validate.py and can be executed by any LLM without prior context.4---56## Tier 0 Doctrine78This skill is a constant-extraction engine. Its purpose is to take a domain and extract9every constant until the remaining variable space is within operational tolerance. The10output is a skill package — a locked set of constants structured for LLM execution.1112**One Objective:** Extract constants from the domain.1314**Five Elements:** Every candidate constant must survive all five:151. C&V — The OBJECTIVE. Separate fixed from changing.162. IMO — The PROCESS. Does it hold regardless of what flows through?173. CTB — The HIERARCHY. Does it hold at every level?184. Hub-and-Spoke — The PHYSICAL MODEL. Is the rim/spoke/hub separation clean?195. Circle — The VALIDATION. Does it hold after a full feedback cycle?2021**Block Architecture:** This skill is built from blocks. Each block is governed by one of22the five elements (C&V, IMO, CTB, Hub-and-Spoke, Circle). Every block — regardless of its23governing element — follows the same internal format defined by all five elements. The24number of blocks is determined by the domain. The format per block is the constant.2526---2728## Block Format — The Constant2930Every block in every skill follows this structure. This does not change.3132```33BLOCK [N]: [Name]34Governed by: [C&V | IMO | CTB | Circle]3536Constants: What is fixed in this block regardless of domain or invocation.37Variables: What changes per domain or invocation.3839IMO:40 Input: What this block receives from prior blocks or the user.41 Middle: What this block does — the specific work governed by its element.42 Output: What this block produces for downstream blocks.4344CTB:45 Trunk: The primary concept this block handles.46 Branches: Supporting elements.47 Leaves: Specific details or implementation items.4849Circle:50 Validation: How you know this block's output is correct.51 Feedback: If wrong, which prior block receives the correction signal.5253Go/No-Go: The gate. What must be true before proceeding to the next block.54```5556---5758## Skill-Creator Blocks5960### BLOCK 1: Domain Scope61**Governed by: C&V**6263**Constants:**64- Every skill has a single, unambiguous trigger condition.65- Every skill has a testable output (the swap test).66- The three-question entry: "What triggers this?", "How do we get it?", and "How does this skill validate its output?"6768**Variables:**69- The specific domain being skilled.70- The specific examples and edge cases.7172**IMO:**73- Input: User request — "I need a skill that does X."74- Middle: Apply C&V lens. What is fixed about this domain regardless of implementation?75 What changes per invocation? Ask the three-question entry. If any question cannot be76 answered, stop and ask the user.77- Output: Confirmed domain scope with initial constants and variables separated.7879**CTB:**80- Trunk: The domain definition — what this skill IS.81- Branches: The trigger condition, the output definition.82- Leaves: Specific examples and edge cases.8384**Circle:**85- Validation: Can you state in one sentence what triggers this skill and what it produces?86- Feedback: If no, return to user for clarification. Do not proceed with ambiguity.8788**Go/No-Go:** Trigger and output are unambiguous. All three entry questions answered. Proceed.8990---9192### BLOCK 2: Constant Extraction93**Governed by: C&V**9495**Constants:**96- Constants first. Variables are a last resort.97- Every candidate constant must survive all five elements (C&V/IMO/CTB/Hub-and-Spoke/Circle).98- A constant that names a specific tool is not a constant — it is a mislabeled variable.99- Constants are structural truths. Variables are implementation details.100101**Variables:**102- The specific constants discovered for this domain.103- The number of gates required (determined by domain complexity).104105**IMO:**106- Input: Domain scope from Block 1.107- Middle: Run the gate mechanism. At each gate:108 1. Identify a candidate constant.109 2. Validate with C&V: Is this genuinely fixed, or a mislabeled variable?110 3. Validate with IMO: Does it hold regardless of what flows through?111 4. Validate with CTB: Does it hold at every level of the hierarchy?112 5. Validate with Hub-and-Spoke: Is the rim/spoke/hub separation clean?113 6. Validate with Circle: Does it hold after a full feedback cycle?114 7. If it survives all five, lock it. Move to next gate.115 8. Back-propagate: Does the new constant invalidate any prior constant?116 9. If prior constant breaks, reclassify it as variable and re-run that gate.117 10. Stop when no new constants found AND back-propagation clean.118- Output: Locked constants list. Isolated variable space. Gate count documented.119120**CTB:**121- Trunk: The constants block of the target skill.122- Branches: Each individual constant, numbered and defined.123- Leaves: The validation evidence for each constant (which tests it passed).124125**Circle:**126- Validation: Is the variable count low? A high variable count means the constants block127 is incomplete. Variables are edge functions — if a skill has many, it has too many128 moving parts. That is a design gap.129- Feedback: If variable count is high, return to gate mechanism and extract more constants.130131**Go/No-Go:** Constants locked. Variable count minimized. Every constant has validation132evidence. Proceed.133134---135136### BLOCK 3: Process Definition137**Governed by: IMO**138139**Constants:**140- Every skill has exactly one IMO: one trigger, one processing description, one output.141- The IMO appears at the top of every skill before any other content.142- An LLM reading the skill must know what it is executing before it reads the instructions.143- A "state" in the skill is just identifying your position on the IMO.144145**Variables:**146- The specific trigger for this skill.147- The specific processing steps.148- The specific output format and deliverable.149150**IMO:**151- Input: Constants and variables from Block 2.152- Middle: Define the skill's IMO.153 - Ingress: What triggers this skill? What is the input? Be specific — an LLM must be154 able to recognize the trigger without human help.155 - Middle: What processing does the skill perform? State it as operations on constants156 and variables, not as prose descriptions.157 - Egress: What does this skill produce? State the exact output — file, data structure,158 decision, action. If the output is not testable, the IMO is incomplete.159- Output: The skill's IMO block — ready to drop into SKILL.md.160161**CTB:**162- Trunk: The overall process (trigger → process → output).163- Branches: Ingress definition, Middle definition, Egress definition.164- Leaves: Specific trigger conditions, processing steps, output specs.165166**Circle:**167- Validation: Can an LLM read just the IMO block and know what to do without reading168 anything else? If no, the IMO is incomplete.169- Feedback: If IMO is unclear, return to Block 1 (domain scope may be ambiguous).170171**Go/No-Go:** IMO is complete, testable, and self-contained. Proceed.172173---174175### BLOCK 4: Workflow Design176**Governed by: IMO**177178**Constants:**179- Every workflow phase is itself an IMO with its own input, middle, output.180- Every phase has a Go/No-Go gate.181- Phases do not call other phases directly — each completes and hands off to the hub.182- Silent retry is never the response to a phase failure.183- The three-field failure log is always produced: phase_failed, attempted_action, raw_output.184185**Variables:**186- The number of phases (determined by domain complexity).187- The specific work each phase performs.188- The specific Go/No-Go criteria per phase.189190**IMO:**191- Input: The skill's IMO from Block 3 + constants/variables from Block 2.192- Middle: Decompose the skill's Middle into execution phases. Each phase is a spoke193 on the hub-and-spoke. Each phase has:194 - Its own constants (what is fixed for this phase).195 - Its own variables (what changes per invocation in this phase).196 - Its own IMO (input to this phase, processing, output from this phase).197 - Its own Go/No-Go gate.198 For each phase, ask: "Is this the minimum number of steps to produce the output?"199 If any phase can be eliminated by moving its work to constants, eliminate it.200- Output: Complete workflow with phases, each structured as an IMO with Go/No-Go gates.201202**CTB:**203- Trunk: The overall workflow.204- Branches: Individual phases.205- Leaves: Phase-specific constants, variables, IMO, and gates.206207**Circle:**208- Validation: Walk through the workflow mentally with a concrete example. Does each209 phase produce what the next phase needs? Does every Go/No-Go gate have a clear210 pass/fail criterion?211- Feedback: If a phase's output doesn't match the next phase's input, the interface212 is broken. Fix the phase or add a missing phase.213214**Go/No-Go:** Every phase has IMO + Go/No-Go. No phase calls another phase directly.215Concrete example walks through cleanly. Proceed.216217---218219### BLOCK 5: Skill Organization220**Governed by: CTB**221222**Constants:**223- SKILL.md structure is always: Tier 0 Doctrine → IMO → Constants → Variables →224 Workflow → Rules → Reference Pointers.225- The frontmatter description field is the primary trigger mechanism.226- Every skill uses progressive disclosure: frontmatter → body → references as needed.227- Every skill earns its tokens — context is finite; every line justifies its presence.228- Never exceed 500 lines in SKILL.md. Move details to reference files.229- Information lives in one place only. No duplication between SKILL.md and references.230231**Variables:**232- The domain-specific content of each section.233- Which reference files to create and when to load them.234235**IMO:**236- Input: All outputs from Blocks 1-4 (scope, constants, variables, IMO, workflow).237- Middle: Assemble the skill as a CTB:238 - Trunk: The SKILL.md file itself — the single source of truth.239 - Branches: Major sections (IMO, Constants, Variables, Workflow, Rules, References).240 - Leaves: Specific content within each section.241 Write the skill so its structure demonstrates the framework. The document IS the242 instruction, not a description of it. Every section should be a block following the243 block format.244- Output: Assembled SKILL.md ready for validation.245246**CTB:**247- Trunk: SKILL.md248- Branches: Each major section.249- Leaves: Content within sections + reference file pointers.250251**Circle:**252- Validation: Does the skill read top-to-bottom without requiring the reader to jump253 around? Does each section build on the previous? Is the progressive disclosure clean?254- Feedback: If the organization is confusing, the CTB is wrong — the trunk/branch/leaf255 assignment needs rework. Return to this block and reorganize.256257**Go/No-Go:** SKILL.md assembled. Under 500 lines. No duplication. Progressive disclosure258clean. Proceed.259260---261262### BLOCK 6: Rules & Boundaries263**Governed by: C&V**264265**Constants:**266- Every skill has a Rules section stating what it NEVER does.267- "Never" is a constant. Boundaries are the highest-value section of any skill.268- Rules prevent the most common failure modes before they happen.269- Rules are constraints expressed as constants — they reduce the variable space by270 eliminating entire categories of behavior.271272**Variables:**273- The specific rules for this domain.274- The specific failure modes being prevented.275276**IMO:**277- Input: The assembled skill from Block 5 + real-world knowledge of failure modes.278- Middle: For each constant and each workflow phase, ask: "What is the most common way279 an LLM will screw this up?" State the answer as a "Never" rule. Each rule is a280 constant that eliminates a class of variables (failure modes).281 Also add these universal rules that apply to every skill:282 - Never put tool names in the Constants block.283 - Never skip the Constants/Variables separation.284 - Never write a skill that describes the framework without demonstrating it.285 - Never deliver a skill that fails the swap test.286 - Never let reference files duplicate SKILL.md content.287 - Every skill must declare its audit mechanism. Ask: How does output from this skill288 get validated? If the skill produces output that reaches a human or downstream system,289 it must declare whether it uses self-check only, cross-check (different LLM), human290 review, or a combination. This maps to OPERATOR_PROFILE.md Block 6 three-tier291 enforcement. Not every skill needs all three tiers — but every skill must answer292 the question.293- Output: Complete Rules section for the skill.294295**CTB:**296- Trunk: The Rules section.297- Branches: Domain-specific rules + universal rules.298- Leaves: Individual "Never" statements.299300**Circle:**301- Validation: For each rule, can you describe the specific failure it prevents? If you302 cannot, the rule is vague — sharpen it or remove it.303- Feedback: If failures are occurring that no rule covers, add a rule. This block is304 never truly finished — it grows with real usage.305306**Go/No-Go:** Every rule prevents a specific, describable failure mode. Universal rules307included. Proceed.308309---310311### BLOCK 7: Swap Test312**Governed by: Circle**313314**Constants:**315- The swap test is always run on a fresh session with zero prior context.316- A mismatch in Constants is the highest-severity failure.317- The swap test has three comparison criteria: Constants match, Variables match, IMO match.318- The swap test is human-executed, not automated.319320**Variables:**321- The specific example used for the test.322- The specific second LLM used for comparison.323- The specific results of the comparison.324325**IMO:**326- Input: The complete assembled skill from Blocks 1-6.327- Middle: Execute the swap test:328 1. Send SKILL.md to a second LLM in a fresh session with zero context.329 2. Give it one concrete example and ask it to execute the skill.330 3. Compare output on three criteria:331 - Constants match: Did the second LLM identify the same fixed elements?332 - Variables match: Did it identify the same configurable elements?333 - IMO match: Did it produce the same trigger/processing/output decomposition?334- Output: PASS (all three match) or FAIL (identify which criterion failed and which335 block produced the deviation).336337**CTB:**338- Trunk: The swap test verdict (PASS/FAIL).339- Branches: Each comparison criterion.340- Leaves: Specific matches or mismatches.341342**Circle:**343- Validation: PASS means the skill is LLM-agnostic and context-independent. This is344 the definition of "done."345- Feedback: FAIL routes correction to the specific block that produced the mismatch:346 - Constants mismatch → return to Block 2 (constant extraction).347 - Variables mismatch → return to Block 2 (variable identification).348 - IMO mismatch → return to Block 3 (process definition).349 - Workflow confusion → return to Block 4 (workflow design).350 - Organizational confusion → return to Block 5 (skill organization).351 - Missing rule → return to Block 6 (rules & boundaries).352353**Go/No-Go:** PASS = proceed to validation. FAIL = return to identified block.354355---356357### BLOCK 8: Automated Validation358**Governed by: Circle**359360**Constants:**361- Validation is always run before delivery. No exceptions.362- A skill that fails validation is not delivered.363- Validation is automated via quick_validate.py.364365**Variables:**366- The specific validation errors (if any).367368**IMO:**369- Input: Swap-tested skill from Block 7.370- Middle: Run automated validation:371 ```bash372 python factory/agents/skill-creator/scripts/quick_validate.py <skill-name>373 ```374- Output: All checks passed OR specific errors to fix.375376**CTB:**377- Trunk: Validation verdict (PASS/FAIL).378- Branches: Individual checks.379- Leaves: Specific pass/fail per check.380381**Circle:**382- Validation: Automated — the script runs the checks.383- Feedback: If validation fails, fix errors and re-run. Do not deliver until clean.384385**Go/No-Go:** quick_validate.py reports all checks passed. Proceed to delivery.386387---388389### BLOCK 9: Delivery390**Governed by: IMO**391392**Constants:**393- Delivery is the SKILL.md path plus confirmation of swap test and validation pass.394- The delivered skill must be executable by any LLM without prior context.395396**Variables:**397- The specific skill path.398399**IMO:**400- Input: Validated skill from Block 8.401- Middle: Present the skill package to the user:402 ```403 skills/<skill-name>/SKILL.md404 ```405- Output: Skill delivered. Task complete.406407**CTB:**408- Trunk: The delivered skill package.409- Branches: SKILL.md + reference files + scripts (if any).410- Leaves: Individual files.411412**Circle:**413- Validation: User confirms receipt.414- Feedback: Iteration begins — see Block 10.415416**Go/No-Go:** Skill delivered. Move to iteration.417418---419420### BLOCK 10: Iteration Protocol421**Governed by: Circle**422423**Constants:**424- Every skill improves through real usage, not through speculation.425- Deviation from expected output signals a specific gap: missing constant, missing rule,426 or missing workflow phase.427- High ERROR table volume means a workflow gate or Constants block entry is missing.428 Fix the skill, not the error handler.429- The swap test remains the definition of "done" across all iterations.430431**Variables:**432- The specific deviations observed in real usage.433- The specific fixes applied.434435**IMO:**436- Input: Real-world usage data — where did the LLM deviate from expected output?437- Middle: Diagnose the deviation:438 1. Is it a Constants gap? → Return to Block 2, add the missing constant.439 2. Is it a Rules gap? → Return to Block 6, add the missing boundary.440 3. Is it a Workflow gap? → Return to Block 4, add or refine a phase.441 4. Is it an IMO gap? → Return to Block 3, clarify the process.442 5. Is it an Organization gap? → Return to Block 5, restructure.443 6. Is it unclassifiable (OTHER)? → Log to error table. Do not guess. Ask the user.444- Output: Specific correction routed to specific block. Re-run Blocks 7-9 after fix.445446**CTB:**447- Trunk: The iteration cycle.448- Branches: Diagnosis categories (constants gap, rules gap, workflow gap, etc.).449- Leaves: Specific deviations and their fixes.450451**Circle:**452- Validation: After fix, does the swap test still pass? If not, the fix broke something.453 Back-propagate.454- Feedback: This block never closes. Every real-world use is an input to this block.455 The skill is alive as long as it is in use.456457**Go/No-Go:** N/A — this block runs continuously. The goal: a skill that produces458identical output regardless of which LLM executes it, in which session, with no prior459context. That is the swap test. That is done.460461---462463## CTB Backbone Mapping464465When a skill produces output that writes to a database:466- Confirmed, validated output → CANONICAL table write via registered promotion path.467- Unclassified or failed output → ERROR table write.468469The skill's workflow IS the promotion path. Canonical = constants that survived. Error =470variables that didn't. Two altitudes, same architecture.471472---473474## Reference Files475476| File | Contains | Load When |477|------|----------|-----------|478| `references/workflows.md` | Established multi-step process patterns | Block 4 — designing workflow |479| `references/output-patterns.md` | Standard output format patterns | Block 3 — defining IMO egress |480| `references/progressive-disclosure-patterns.md` | Context-efficient information layering | Block 5 — organizing skill |481| `references/operators-checklist.md` | Step-by-step execution checklist | Any time — operator's manual |482483Do not duplicate reference file content in this SKILL.md. Load as needed.484485---486487## The Constant-First Principle488489Constants first. Variables are a last resort.490491Every variable commits you to guard rails, conditional handling, and validation logic.492Every constant simplifies the skill and makes it more predictable. If you can make it a493constant, make it a constant. Only declare a variable when the value genuinely cannot be494known at design time.495496The gate mechanism is a constant-reduction machine. Each gate eliminates a class of497unknowns. By the time the LLM reaches Block 9, the only things still open are the true498variables — the ones that cannot be resolved by design. Everything else has been499classified, locked, and exited cleanly by a prior block.500501A variable is an edge function. High variable count means the Constants block is502incomplete. That is a design gap, not a feature.