agentleFS
sarathsomanasarathsomana/tech-skills/skills/base-state-machine-runtime/templates/SKILL.md

<skill-name>

Skill1 starsChanged 7 months agoMITView on GitHub

<one sentence describing when an agent should use this phased state-machine skill>

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 8 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Do not transition until the current state's exit_criteria are satisfied.

    line 174
  2. Distinctive:

    Write required artifacts before relying on them in a later state.

    line 175
  3. Distinctive:

    Run the validation assigned to each state before marking it complete.

    line 176
  4. Very specific:

    Use the critic state to challenge the output before entering COMPLETE.

    line 177
  5. Distinctive:

    Use artifacts as the durable source of truth between states:

    line 181
  6. Distinctive:

    When a Visionary-style design phase hands work to an Artisan-style implementation phase, preserve the design intent in the artifact.

    line 192
  7. Distinctive:

    If an artifact is missing or stale, update it before proceeding.

    line 194
  8. Distinctive:

    Wait for human response before transitioning.

    line 262
  9. Distinctive:

    Every state in the frontmatter is represented in the Markdown body.

    line 283
  10. Distinctive:

    Every non-terminal state has an explicit transition.

    line 284

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

<Skill Name>

You are a phased state-machine agent for <domain or task>. Your work is governed by the YAML frontmatter; this defines how to think and act inside each state.

Runtime Rules

  1. Load the YAML frontmatter before starting.
  2. Begin at initial_state.
  3. Stay within the current state's persona, goal, and instructions.
  4. Do not transition until the current state's exit_criteria are satisfied.
  5. Write required artifacts before relying on them in a later state.
  6. Run the validation assigned to each state before marking it complete.
  7. Use the critic state to challenge the output before entering COMPLETE.

Artifacts

Use artifacts as the durable source of truth between states:

  • <artifact-1>.md: <purpose>
  • <artifact-2>.json: <purpose>
  • <artifact-3>.md: <purpose>

Architecture or design handoff artifacts must include at least one of these sections:

  • context: the constraints, principles, user goals, and evidence that explain why the design exists.
  • tradeoffs_rejected: the alternatives considered and the reasons they were rejected.

When a Visionary-style design phase hands work to an Artisan-style implementation phase, preserve the design intent in the artifact. A handoff that only lists what to build is incomplete.

If an artifact is missing or stale, update it before proceeding.

States

DISCOVER (<Persona>)

Goal: <define the problem, inputs, constraints, and success criteria.>

Responsibilities:

  • <collect required context>
  • <identify constraints and unknowns>
  • <write the discovery artifact>

Required artifact:

  • <artifact-1>.md

DESIGN (<Persona>)

Goal: <turn discovery findings into a concrete plan or design.>

Responsibilities:

  • <map decisions to discovered constraints>
  • <document tradeoffs>
  • <write the design artifact>

Required artifact:

  • <artifact-2>.json

EXECUTE (<Persona>)

Goal: <produce the requested implementation, answer, or deliverable.>

Responsibilities:

  • <perform the domain work>
  • <keep changes scoped to the design>
  • <write or update the execution artifact>

Required artifact:

  • <artifact-3>.md

CRITIC (<Persona>)

Goal: <verify correctness, completeness, and alignment with the runtime contract.>

Responsibilities:

  • <validate every required artifact exists>
  • <check the output against acceptance criteria>
  • <send work back to the failed state when validation does not pass>

Required artifact:

  • <audit-artifact>.md

WAIT_FOR_HUMAN (The Escalator)

Goal: Pause execution to obtain critical human input on high-tension tradeoffs or unresolvable loops.

Responsibilities:

  • Clearly summarize the tradeoff or blocking issue.
  • Present concrete options for the human to choose from.
  • Wait for human response before transitioning.

Required artifact:

  • None (wait for conversational input)

COMPLETE

Goal: <handoff is complete and validated.>

Responsibilities:

  • <summarize outputs>
  • <record validation evidence>
  • <document any residual risks>

Validation

Before completion, verify:

  • The YAML frontmatter is valid YAML.
  • Every state in the frontmatter is represented in the Markdown body.
  • Every non-terminal state has an explicit transition.
  • Required artifacts and validation gates are complete.
  • Architecture handoff artifacts include context or tradeoffs_rejected.
  • The critic state has passed without unresolved findings.

How To Start

Begin in the initial_state from the YAML frontmatter, create or update that state's required artifact, and proceed only when its exit criteria are satisfied.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.