agentleFS
synaptiaisynaptiai/agent-capability-standard/skills/transition/SKILL.md

transition

Skill6 starsChanged 14 days agoApache-2.0View on GitHub

Define how state changes over time through rules, triggers, and effects. Use when modeling state machines, defining workflows, specifying event handlers, or documenting system dynamics.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 7 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Document required state for transition

    line 49
  2. Distinctive:

    Specify effects: Document what changes during transition

    line 53
  3. Distinctive:

    Validate completeness: Check for missing transitions

    line 58
  4. Distinctive:

    Ground rules: Document evidence for each transition rule

    line 63
  5. Distinctive:

    Verification tools: Read (to verify code references)

    line 321
  6. Distinctive:

    Do not execute transitions while modeling

    line 334
  7. Very specific:

    Never use transition to execute changes (use mutate)

    line 349
  8. Distinctive:

    Avoid modeling transitions without state model first

    line 350

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Intent

Define the rules governing how a system's state changes over time. This capability captures state machine semantics: what triggers transitions, what preconditions must hold, and what effects occur.

Success criteria:

  • Transition rules clearly specified
  • Preconditions and effects documented
  • Triggers identified with evidence
  • State machine is deterministic (or non-determinism noted)

Compatible schemas:

  • schemas/output_schema.yaml

Inputs

ParameterRequiredTypeDescription
from_stateYesobjectInitial state or state pattern
to_stateNoobjectTarget state (optional for discovery mode)
triggersNoarrayEvents or conditions that cause transition

Inputs not listed here are outside the capability's contract: a workflow step that binds them gets W604 (STANDARD v1.1 §5.5).

Procedure

  1. Identify state variables: Determine what can change
    • Extract mutable properties from state model
    • Identify discrete vs continuous variables
    • Note invariants (what cannot change)
  2. Discover triggers: Find what causes state changes
    • Identify events (user actions, system events)
    • Find conditions (thresholds, timeouts)
    • Note external inputs that affect state
  3. Define preconditions: Specify when transitions can occur
    • Document required state for transition
    • Identify guards and conditions
    • Note blocking conditions
  4. Specify effects: Document what changes during transition
    • List state variable changes
    • Note side effects (events emitted, actions taken)
    • Capture ordering constraints
  5. Validate completeness: Check for missing transitions
    • Identify unreachable states
    • Find states with no outgoing transitions
    • Note non-deterministic cases
  6. Ground rules: Document evidence for each transition rule
    • Reference code, configuration, or documentation
    • Note confidence in each rule

Output Contract

Return a structured object:

rules:
  - id: string  # Unique rule identifier
    name: string  # Human-readable name
    from: object  # Source state pattern
    to: object  # Target state pattern
    trigger:
      type: string  # event, condition, timeout
      specification: any  # Trigger details
    preconditions: array[string]  # Required conditions
    effects: array[string]  # State changes
    priority: number  # Resolution priority for conflicts
preconditions:  # Required conditions of the rules that apply from `from_state`
  - rule: string  # Rule ID
    condition: string
effects:  # State changes those rules make
  - rule: string  # Rule ID
    change: string
analysis:
  reachability: object  # Which states are reachable
  completeness: number  # Coverage estimate
  non_determinism: array  # Ambiguous transitions
confidence: 0..1
evidence_anchors: ["file:line", "doc:section"]
assumptions: []

Field Definitions

FieldTypeDescription
rulesarrayTransition rules
rules[].fromobjectSource state pattern
rules[].toobjectTarget state pattern
rules[].triggerobjectWhat causes the transition
rules[].preconditionsarrayConditions that must hold
rules[].effectsarrayChanges caused by transition
preconditionsarray<object>Conditions required by the rules that apply from from_state, each tagged with its rule
effectsarray<object>State changes those rules make, each tagged with its rule
analysisobjectState machine analysis results
confidencenumber0.0-1.0 confidence the rules are complete and correct
evidence_anchorsarrayReferences to where each rule is defined
assumptionsarrayAssumptions about the state machine

Examples

Example 1: Order State Transitions

Input:

from_state:
  entity: "order"
  status: "*"

Output:

rules:
  - id: "order-create"
    name: "Create Order"
    from: { status: null }
    to: { status: "pending" }
    trigger:
      type: "event"
      specification: "OrderCreated"
    preconditions:
      - "cart is not empty"
      - "user is authenticated"
    effects:
      - "order.status = 'pending'"
      - "order.created_at = now()"
      - "emit OrderCreatedEvent"
    priority: 1
  - id: "order-confirm"
    name: "Confirm Order"
    from: { status: "pending" }
    to: { status: "confirmed" }
    trigger:
      type: "event"
      specification: "PaymentReceived"
    preconditions:
      - "payment.amount >= order.total"
      - "inventory available"
    effects:
      - "order.status = 'confirmed'"
      - "order.confirmed_at = now()"
      - "reserve inventory"
      - "emit OrderConfirmedEvent"
    priority: 1
  - id: "order-cancel"
    name: "Cancel Order"
    from: { status: ["pending", "confirmed"] }
    to: { status: "cancelled" }
    trigger:
      type: "event"
      specification: "CancelRequested"
    preconditions:
      - "order.status != 'shipped'"
    effects:
      - "order.status = 'cancelled'"
      - "release inventory"
      - "emit OrderCancelledEvent"
    priority: 2
preconditions:
  - rule: "order-create"
    condition: "cart is not empty"
  - rule: "order-create"
    condition: "user is authenticated"
  - rule: "order-confirm"
    condition: "payment.amount >= order.total"
  - rule: "order-confirm"
    condition: "inventory available"
  - rule: "order-cancel"
    condition: "order.status != 'shipped'"
effects:
  - rule: "order-create"
    change: "order.status = 'pending'"
  - rule: "order-create"
    change: "order.created_at = now()"
  - rule: "order-create"
    change: "emit OrderCreatedEvent"
  - rule: "order-confirm"
    change: "order.status = 'confirmed'"
  - rule: "order-confirm"
    change: "order.confirmed_at = now()"
  - rule: "order-confirm"
    change: "reserve inventory"
  - rule: "order-confirm"
    change: "emit OrderConfirmedEvent"
  - rule: "order-cancel"
    change: "order.status = 'cancelled'"
  - rule: "order-cancel"
    change: "release inventory"
  - rule: "order-cancel"
    change: "emit OrderCancelledEvent"
analysis:
  reachability:
    pending: ["confirmed", "cancelled"]
    confirmed: ["shipped", "cancelled"]
    shipped: ["delivered"]
    delivered: []
    cancelled: []
  completeness: 0.9
  non_determinism: []
confidence: 0.85
evidence_anchors:
  - "app/models/order.rb:45-120"
  - "app/services/order_service.rb:15-80"
assumptions:
  - "State machine defined in Order model"
  - "All transitions go through OrderService"

Example 2: Authentication State Transitions

Input:

from_state:
  entity: "user_session"
  status: "unauthenticated"

Output:

rules:
  - id: "login-success"
    name: "Successful Login"
    from: { authenticated: false }
    to: { authenticated: true }
    trigger:
      type: "event"
      specification: "CredentialsValidated"
    preconditions:
      - "credentials.valid == true"
      - "user.locked == false"
      - "failed_attempts < max_attempts"
    effects:
      - "session.authenticated = true"
      - "session.user_id = user.id"
      - "session.expires_at = now() + 24h"
      - "reset failed_attempts"
    priority: 1
  - id: "login-failure"
    name: "Failed Login Attempt"
    from: { authenticated: false }
    to: { authenticated: false, failed_attempts: "+1" }
    trigger:
      type: "event"
      specification: "CredentialsRejected"
    preconditions: []
    effects:
      - "increment failed_attempts"
      - "if failed_attempts >= max_attempts: lock user"
    priority: 1
  - id: "logout"
    name: "Logout"
    from: { authenticated: true }
    to: { authenticated: false }
    trigger:
      type: "event"
      specification: "LogoutRequested"
    preconditions: []
    effects:
      - "session.authenticated = false"
      - "session.destroy()"
    priority: 1
preconditions:
  - rule: "login-success"
    condition: "credentials.valid == true"
  - rule: "login-success"
    condition: "user.locked == false"
  - rule: "login-success"
    condition: "failed_attempts < max_attempts"
effects:
  - rule: "login-success"
    change: "session.authenticated = true"
  - rule: "login-success"
    change: "session.user_id = user.id"
  - rule: "login-success"
    change: "session.expires_at = now() + 24h"
  - rule: "login-success"
    change: "reset failed_attempts"
  - rule: "login-failure"
    change: "increment failed_attempts"
  - rule: "login-failure"
    change: "if failed_attempts >= max_attempts: lock user"
analysis:
  reachability:
    unauthenticated: ["authenticated", "locked"]
    authenticated: ["unauthenticated"]
    locked: ["unauthenticated"]
  completeness: 0.95
  non_determinism: []
confidence: 0.9
evidence_anchors:
  - "app/controllers/sessions_controller.rb:10-50"
  - "app/models/user.rb:80-95"
assumptions:
  - "Session timeout handled by middleware"
  - "Lock mechanism implemented in User model"

Verification

  • Each rule has from and to state patterns
  • Triggers are specified for each rule
  • Preconditions are testable
  • Effects are specific and verifiable
  • Reachability analysis covers all known states

Verification tools: Read (to verify code references)

Safety Constraints

  • mutation: false
  • requires_checkpoint: false
  • requires_approval: false
  • risk: low

Capability-specific rules:

  • Document non-determinism explicitly
  • Flag missing transitions for terminal states
  • Note when transitions have side effects
  • Do not execute transitions while modeling

Composition Patterns

Commonly follows:

  • state - State model provides basis for transitions
  • observe - Observations reveal transition patterns
  • discover - Discovery finds unknown transitions

Commonly precedes:

  • simulate - Transitions drive simulation
  • plan - Transitions inform action planning
  • verify - Transitions specify expected behavior

Anti-patterns:

  • Never use transition to execute changes (use mutate)
  • Avoid modeling transitions without state model first

Workflow references:

  • See reference/workflow_catalog.yaml#world_model_build for transitions in world modeling
  • See reference/workflow_catalog.yaml#digital_twin_sync_loop for transition application

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.