Get started
Authoring & Customizing Skills
How to design, customize, and verify reactive skills — moving from starter scaffold templates to domain states, isolated prompt slices, deterministic guards, and event-sourced deliverables.
Recommended: skill-manager
The canonical method to scaffold, modify, and migrate reactive skills is the skill-manager agent skill. Instead of writing YAML manifests manually, install skill-manager and ask your AI agent what you want to create.
Step 1: install skill-manager.
npx skills add Reactive-Skills/skills --skill skill-managerStep 2: ask your agent:
Use skill-manager to create a reactive skill named my-workflowTerminal scaffolding
For quick command-line scaffolding, you can also use the AXI CLI. It scaffolds the modular file layout in skills/<skill-name>/.
npx -y @reactive-skills/axi init <skill-name>Beyond the basic scaffold
Running axi init generates a runnable skeleton containing runtime verification (INIT, SETUP_MCP), a generic START state, and execution boundaries (BYPASS_DETECTED). However, production skills represent domain workflows with custom macro-phases, deterministic gating, and scoped prompt slices.
Scaffold as foundation
The scaffold establishes the directory layout and runtime contract. Customization is the process of mapping your domain tasks into an explicit state machine, replacing the default placeholder states with verified execution gates.
Anatomy of a reactive skill
A customized reactive skill is organized into isolated, single-responsibility files under skills/<skill-name>/:
| File / Directory | Role & Responsibility | Customization Purpose |
|---|---|---|
| skill.yaml | State machine manifest (v2.1.0) | Defines states, valid transition paths, deterministic guard rules, and allowed tools. |
| SKILL.md | Host entry point & bootloader | Contains the strict execution preamble instructing agents to operate via AXI or MCP. |
| STATECHART.md | Mermaid state diagram | Provides a visual stateDiagram-v2 representation matching skill.yaml topology. |
| states/*.md | Scoped prompt slices | Isolated instructions for each state. Agents receive only the active slice. |
| guards/ | Custom guard functions (optional) | JavaScript modules evaluating complex boolean criteria and invariants. |
| templates/*.hbs | Read-model templates (optional) | Handlebars templates that project deliverable summaries from the event ledger. |
| skill-release.json | Package metadata | Tracks schema version and distribution channel. |
Two customization workflows
You can customize reactive skills either through an interactive agent session or by editing the manifest and state slices directly.
- 1
Agent-Guided Discovery (Recommended)
Invoke an agent with the skill-manager or reactive-skill-creator skill. The agent conducts a Socratic interview to extract domain phases, guard conditions, and projections, then synthesizes and tests the complete statechart.
- 2
Direct CLI & File Customization
Run npx -y @reactive-skills/axi init <name>, then edit skill.yaml to define domain states, author corresponding prompt files under states/, wire guard expressions, and inspect with axi inspect.
1. The Agent-Guided workflow (Recommended)
When designing a skill with an agent, the agent runs a five-dimension discovery interview to prevent underspecified states or brittle transitions:
- Workflow Identity & Context: Defines the single objective and required initial variables (e.g. repo_path, branch, pr_id).
- State Taxonomy: Identifies chronological macro-phases (e.g. INTAKE → PLAN → EXECUTE → VERIFY → COMPLETE).
- Transition Signals & Guards: Names the signals that trigger progress and the exact facts required to advance.
- Failure Modes & Rollbacks: Maps where execution returns if tests fail, builds break, or invariants reject.
- Deliverable Sinks: Specifies the Handlebars templates folded from event history into .docs/ reports.
Why use agent authoring
Agents ensure that states remain strictly isolated, guard expressions follow JavaScript syntax, and STATECHART.md stays synchronized with skill.yaml.
2. Customizing skill.yaml (Topology & Guards)
Replace the default START state in skill.yaml with your domain workflow phases. Each state declares its prompt template, tool restrictions, and valid transition paths.
# skills/tdd-flow/skill.yaml
schema_version: "2.1.0"
name: "tdd-flow"
description: "Red-Green-Refactor test-driven development workflow"
initial_state: "INIT"
strict_execution: true
runtime_requirements:
required_capabilities: ["judgment.probability_thresholds"]
context_keys: ["target_module", "test_file"]
states:
INIT:
prompt_template: "states/init.md"
transitions:
RUNTIME_READY: { target: "RED_SPEC" }
RED_SPEC:
description: "Write failing test specification"
prompt_template: "states/red_spec.md"
model:
tier: "fast"
suggested: "gemini-2.5-flash / haiku"
tools: ["view_file", "write_to_file", "run_command"]
transitions:
TEST_RAN:
target: "GREEN_CODE"
guard: "payload.exit_code != 0"
GREEN_CODE:
description: "Implement minimal code to pass test"
prompt_template: "states/green_code.md"
model:
tier: "balanced"
suggested: "claude-3-7-sonnet"
tools: ["view_file", "replace_file_content", "run_command"]
transitions:
TEST_RAN:
target: "REFACTOR"
guard: "payload.exit_code == 0"
REFACTOR:
description: "Clean implementation while tests stay green"
prompt_template: "states/refactor.md"
model:
tier: "reasoning"
suggested: "claude-3-7-sonnet / o3-mini"
tools: ["view_file", "replace_file_content", "run_command"]
transitions:
TEST_RAN:
target: "COMPLETE"
guard: "payload.exit_code == 0"
judgment:
type: "predicate"
criterion: "Did the refactoring maintain public APIs without introducing regressions?"
min_probability: 0.85
fallback_target: "GREEN_CODE"
REGRESSION:
target: "GREEN_CODE"
guard: "payload.exit_code != 0"
COMPLETE:
description: "TDD cycle verified and closed"
prompt_template: "states/complete.md"3. Authoring scoped state prompt slices (states/*.md)
Each state prompt file contains instructions strictly relevant to that state. Do not include instructions for previous or future phases. The agent receives only the active slice when entering the state.
<!-- skills/tdd-flow/states/red_spec.md -->
# TDD Flow — RED_SPEC
Write a failing test specification for `{{context.target_module}}`.
## Current Objective
1. Inspect `{{context.target_module}}` using `view_file`.
2. Author unit test cases in `{{context.test_file}}`.
3. Run test runner using `run_command`.
## Stop Criteria & Signal Contract
When the test suite runs and fails as expected (failing assertion, not compilation crash):
- Emit signal: `TEST_RAN`
- Payload facts: `{"exit_code": 1, "failing_tests": 1}`
Do NOT attempt to write application logic or make the test pass in this state.Prompt isolation invariant
Never assume context from earlier turns unless declared in context_keys or passed in signal payloads. Isolated prompts prevent attention drift.
4. Checks and generated deliverables
A transition can check facts before the workflow advances. Use a JavaScript guard for an exact condition, such as a passing test exit code. Use a semantic judgment when the condition needs interpretation.
TEST_RAN:
target: COMPLETE
guard: "payload.exit_code == 0"The guard blocks this transition when the reported exit code is nonzero. A skill can also declare deliverable projections: templates that turn recorded run data into files such as reports.
For adapter selection, probability thresholds, context sharing, model failures, human approval, custom guard files and projection configuration, see the Guards, judgments and deliverables reference.
5. Judgment probability thresholds
For probability bands, the complete YAML example and the confidence conversion table, see Thresholds and migration.
6. Inspect and verify your customized skill
After updating your manifest and state prompt files, verify the skill topology and transition paths before executing:
npx -y @reactive-skills/axi inspect skills/tdd-flowExpected output: skill: tdd-flow
initial: INIT
states:
INIT → [RUNTIME_READY] → RED_SPEC
RED_SPEC → [TEST_RAN (guard: payload.exit_code != 0)] → GREEN_CODE
GREEN_CODE → [TEST_RAN (guard: payload.exit_code == 0)] → REFACTOR
REFACTOR → [TEST_RAN (guard: payload.exit_code == 0)] → COMPLETE
REFACTOR → [REGRESSION (guard: payload.exit_code != 0)] → GREEN_CODE7. Distribute to agent satellites with axi sync
Once your skill validates cleanly, synchronize it across all local agent harnesses (Claude, Gemini, Codex, Devin, Cline, Copilot) using zero-drift directory junctions:
npx -y @reactive-skills/axi sync tdd-flowZero-drift linking
Directory junctions link ~/.agents/skills/ directly to the authoring repository, ensuring external tools access updated prompt slices without physical file copies.