Index of every page on this site: llms.txt
All skills
nnennandukwe avatar

/workflow-invariants

@6837c5b
Run it yourself

Design, enforce, and test workflow state-machine invariants for multi-stage pipelines. Use when workflow bugs involve stale stage selection, invalid transitions, missing guards, failed-run reuse, or downstream actions starting before upstream approvals complete.

Use this Skill: https://skilld.dev/gh/nnennandukwe/skills/workflow-invariants

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈71 tokens for metadata: the name and description. ≈414 when used: this file. ≈66 more on demand in 1 file.

Description uses 3.5% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈284 characters, or 3.5%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Workflow Invariants

Model workflow behavior as explicit states and allowed transitions, then enforce it in code and tests.

Do This First

  1. Identify the canonical state object and transition points.
  2. Enumerate valid transitions and reject everything else.
  3. Identify cross-workflow gates that must block downstream commands.

Use this template:

state: awaiting_review
allowed: approve -> awaiting_resume
blocked: social, prep, publish
error: "Draft is awaiting final_output approval."
recovery: "Run draft approve + draft resume."

Implementation Pattern

  1. Put transition logic in one place.
  2. Return structured failure payloads for invalid transitions.
  3. Carry recovery instructions in all blocked-path errors.
  4. Remove stale artifacts when moving into blocked states.
  5. Emit an event on every transition for traceability.

Test Pattern

  1. Add one positive-path test per transition.
  2. Add one negative-path test per blocked transition.
  3. Add regression tests for known stale-selection bugs.
  4. Assert both behavior and operator-facing message text.

Invariant Checklist

  • A failed run never becomes the active run.
  • A run from another week never drives current guidance.
  • Downstream flows are blocked for quality_blocked and awaiting_final_output_review.
  • Final artifacts do not exist before approval+resume completes.
  • Help text and guidance reference the same transition names.

Output Format

When reporting work, include:

  • Transition table added/updated
  • Guards added
  • Tests added
  • Residual risk
<!-- Source: https://github.com/nnennandukwe/skills · Author: Nnenna Ndukwe · Apache-2.0 -->

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts3mo3 checks · Risk SAFE
  • Gen Agent Trust Hub3mo

    This skill provides a conceptual framework and templates for designing and testing workflow state-machine invariants. It is purely instructional and contains no executable code or security risks.

  • Socket3mo

    No alerts

  • Snyk3mo

    Risk: LOW · No issues

Signed by skilld at 6837c5b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 4 months ago

README badge

README badge for nnennandukwe/skills/workflow-invariants