Agent skill

Flowguard Task Guard

by majiayu000 in majiayu000/spellbook

Single entry point that routes long or ambiguous agent tasks, checks live state, bounds autonomous loops and leaves a resumable handoff.

MITAuto-check passedAgent Workflows

Install Flowguard Task Guard

skills CLI
$ npx skills add majiayu000/spellbook --skill flowguard -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install majiayu000/spellbook flowguard --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/majiayu000/spellbook.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/flowguard .claude/skills/flowguard && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
flowguard
GitHub stars
287
Token cost
~2.1k tokens
SKILL.md length
1,040 words
Files
4 (incl. scripts, references)
Skills in repo
97
Repo updated
First seen
Licence
MIT

At a glance

Single entry point that routes long or ambiguous agent tasks, checks live state, bounds autonomous loops and leaves a resumable handoff.

  • Works in 3 steps: Search first for existing files, skills,… → Load every applicable AGENTS.md for… → Run the state snapshot when working in a…
  • Continuing a multi-session task from a previous summary or handoff
  • SKILL.md covers Overview, Operating Contract, Route First and Startup, plus 9 more sections
  • Runs Shell scripts from its folder; calls cargo, go and npx

What it does

Flowguard is meant for work likely to drift, lose context or get expensive: multi-step tasks, autonomous loops, bug fixes, pull request readiness checks, compaction handoffs and resumes. It coordinates other skills, such as systematic-debugging and comprehensive-testing, rather than replacing them. The agent first picks a route: `execute_direct` for clear, small or cheaply verified work, `plan_first` for work spanning many files, sessions or risky sequencing, and `clarify_first` when the goal or permissions are unclear.

An operating contract sets the limits. No long loop starts before route, scope and stop conditions are explicit, remembered summaries are not trusted until the repo, git and runtime state are checked, and completion needs fresh evidence from the current session. The agent restates its objective and a plan of at most five steps before major phase changes, and it asks for explicit human approval, via `review-gate` or an equivalent review pack, before commit, push, PR or merge. A state-contract reference and a snapshot script support handoffs.

When your agent uses it

  • Continuing a multi-session task from a previous summary or handoff
  • Running a bounded autonomous loop with explicit scope and stop conditions
  • Checking whether a change is ready for a pull request before anything is pushed

Example prompts

  • “Resume the migration work from yesterday, but verify the repo state before trusting the notes.”
  • “Fix the flaky upload test in a bounded loop and stop for my approval before any commit.”
  • “Run a PR readiness check on this branch and write a handoff for the next session.”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Search first for existing files, skills, plans, or prior artifacts that may already cover the task.
  2. Load every applicable AGENTS.md for files that may be edited.
  3. Run the state snapshot when working in a repo or resuming. Resolve it from the installed Flowguard skill directory, not from the target repo

What it can do on your machine

Read from SKILL.md and the folder at commit ed52af7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • cargo
    • go
    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Flowguard Task Guard loads about 2.1k tokens when it runs, and up to ~3.1k if it reads all its reference files. Until then it costs about 89 tokens; SKILL.md has 1,040 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~89
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from majiayu000/spellbook at commit ed52af7, republished under its MIT licence (© majiayu000). 1,040 words, ~2,057 tokens.

Download SKILL.mdSave it as .claude/skills/flowguard/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
flowguard
description
Guard long, ambiguous, or stateful AI-agent work from drift. Use when the user asks to run or continue a multi-step task, autonomous loop, bug fix, repo change, PR readiness check, compaction handoff, resume from previous context, cost-control checkpoint, or any task likely to span many tool calls, files, sessions, agents, or verification gates.

Flowguard

Overview

Use this skill as the single lifecycle entrypoint for agent work that can drift, lose context, or become expensive. It routes the task, verifies current state, runs bounded execution loops, and leaves a resumable handoff.

This skill coordinates other skills; it does not replace them. Use task-specific skills such as systematic-debugging, comprehensive-testing, codex-retrospective, or vibeguard only when their trigger is clearly met.

Operating Contract

  • Do not start a long autonomous loop until route, scope, and stop conditions are explicit.
  • Do not treat memory, summaries, or handoffs as current truth until repo, git, files, runtime, or remote state is verified.
  • Do not claim completion without fresh verification evidence from the current session.
  • Do not expand scope, touch destructive surfaces, or cross file-ownership lanes without stopping to re-route.
  • Re-state the primary objective and a plan of no more than five steps before major phase changes.
  • Prefer one controlling checkpoint over many specialized workflow fragments when the task risk is context loss, drift, or compounding errors.
  • Before commit, push, PR, merge, or applying agent-generated changes outside the already-approved scope, call review-gate or produce the same review pack and wait for explicit human approval.

Route First

Choose one route before editing files or running a long loop:

RouteUse WhenAction
execute_directGoal, context, constraints, and done-when are clear; scope is small or verification is cheap.Work directly with short checkpoints.
plan_firstWork spans many files, sessions, agents, architecture decisions, migrations, or risky sequencing.Create a brief execution plan or use the relevant planning skill before edits.
clarify_firstGoal, target files, constraints, done-when, destructive permission, production impact, or ownership is unclear.Ask the smallest blocking question before continuing.

Do not hide ambiguity inside assumptions. If a wrong assumption would cause large rewrites, production risk, data loss, credential exposure, or wasted long-loop cost, use clarify_first.

Startup

  1. Search first for existing files, skills, plans, or prior artifacts that may already cover the task.
  2. Load every applicable AGENTS.md for files that may be edited.
  3. Run the state snapshot when working in a repo or resuming. Resolve it from the installed Flowguard skill directory, not from the target repo:
bash
# From the installed flowguard skill directory, the directory containing this SKILL.md:
scripts/workflow_state_snapshot.sh /path/to/target/repo

When already in the target repo, pass . as the target to the installed script, for example /path/to/installed/flowguard/scripts/workflow_state_snapshot.sh ..

  1. If the task continues previous work, treat memory and summaries as hints only. Verify cwd, git branch, dirty files, relevant artifacts, and runtime state before relying on them.
  2. Capture the four task elements: goal, context, constraints, and done-when. If one is missing and risky, clarify.

Preflight Contract

Before substantial work, write or state the compact preflight:

text
route:
goal:
context:
constraints:
done_when:
out_of_scope:
verification_commands:
stop_conditions:
handoff_location:
objective_restatement:
plan_5_steps_or_less:

For short direct tasks, this can be one concise paragraph. For long tasks, make it explicit and keep it available for compaction or resume.

Execution Loop

Use a step-test-update loop:

  1. Select one current step with owned files and an expected check.
  2. Re-state how the step supports the primary objective.
  3. Announce the edit boundary before changing files.
  4. Make the smallest useful change.
  5. Run focused verification for that step when feasible.
  6. Record a checkpoint with changed files, command results, decisions, blockers, context audit, and next step.

Stop and re-evaluate when any condition occurs:

  • The same fix fails 3 times.
  • Scope expands beyond the preflight.
  • Required data is missing or stale.
  • A tool result conflicts with the plan.
  • Tests or builds fail for reasons unrelated to the current hypothesis.
  • The user sends a newer instruction that changes priority.
  • Token, tool-call, wall-time, or external-cost budget is exceeded.
Show full SKILL.md (460 more words)Show less

Failure Modes

  • Assumption drift: the route says execute_direct, but new evidence shows missing goal, constraints, or done-when. Stop and re-route.
  • Summary-of-summary loss: compaction or handoff omits modified files, decisions, or verification commands. Rebuild state from local truth before editing.
  • Stale memory: remembered project facts conflict with current files, git, runtime, or GitHub state. Use current evidence.
  • Silent tool failure: an empty, partial, or "close enough" tool result becomes input for later steps. Mark it as a blocker or rerun with a narrower check.
  • Parallel merge risk: two lanes need the same writable file. Collapse to one integration owner before continuing.

Verification Gate

Do not claim completion from expectation or older output. Report fresh evidence from this session.

Pick checks from the repo, AGENTS.md, and changed surface. Common defaults:

StackBefore CompletionBefore Submission
Rustcargo checkcargo test
TypeScriptnpx tsc --noEmitproject test command
Gogo build ./...go test ./...
Pythonfocused import/type/lint check if presentpytest

If a check cannot run, say why and name the nearest useful fallback that did run.

Review Gate

Before landing agent-generated changes, produce a concise review pack or use the review-gate skill. The pack must include intent, diff summary, changed files, risks, verification, open questions, and the exact action needing approval. Human approval for one action does not automatically authorize a different action such as merge.

Handoff And Resume

Read references/state-contract.md when asked to create a handoff, resume after compaction, continue a previous task, or prepare automation.

Required handoff fields:

  • modified files
  • constraint set or SPEC
  • verification command and result
  • key decisions
  • current priority
  • L1-L7 rule summary when VibeGuard applies
  • context audit: keep, externalize, discard, and stale/conflicting inputs
  • review gate decision when changes are ready to land
  • blockers and next action

Resume must start by comparing the handoff with current local truth. If cwd, branch, files, tests, or user priority changed, update the plan before editing.

Multi-Agent Rule

Use parallel agents only when file ownership is disjoint and merge ownership is explicit. A delegation must name:

  • agent or lane
  • writable files or directories
  • read-only context
  • expected output artifact
  • verification owner
  • merge owner
  • stop conditions

If two agents need to write the same file, do not run them in parallel.

Automation Boundary

Skill workflows are manual first. Automate only after the workflow has been manually validated on real tasks. Scheduled automation should start as read-only: state scans, handoff drafts, stale-worktree reports, or verification summaries. Code edits, deploys, credential changes, or PR submissions require explicit user intent unless a separate trusted automation contract exists.

Resources

  • scripts/workflow_state_snapshot.sh <path>: read-only snapshot for cwd, git state, nearby agent instructions, dirty files, and likely verification commands.
  • references/state-contract.md: templates for preflight, checkpoints, handoff, resume, loop guards, and automation readiness.
  • review-gate: review pack and explicit human approval before landing agent-generated diffs.

© majiayu000, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts, references) in skills/flowguard of majiayu000/spellbook.

  • SKILL.md
  • agents/openai.yaml
  • references/state-contract.md
  • scripts/workflow_state_snapshot.sh

Open the folder on GitHubat commit ed52af7

Compare with similar skills

Flowguard Task Guard next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Flowguard Task Guard compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Flowguard Task Guard this skillmajiayu000/spellbook287—~2.1kAutomated safety check: PassMIT
PUA Looptanweai/pua20k—~1.1kAutomated safety check: PassMIT
Show Me Your Work Decision Logcursor/plugins11k8 repos~1.6kAutomated safety check: PassNone
Harness Engineering10xChengTu/harness-engineering1021 repos~1kAutomated safety check: PassNone
Ultragoal Multi-Goal LedgerYeachan-Heo/gajae-code2.9k—~8.4kAutomated safety check: PassMIT
Requirement Ledger Workflowadand-91/gpt-6-astra-skill125—~6.3kAutomated safety check: PassMIT

Similar skills

  • PUA Loop

    tanweai/pua

    Runs an unattended iterate-until-verified loop in which a user-set verify command, not the agent's own claim, decides when the task is finished.

    20k GitHub stars~1.1k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • Official

    Keeps a TSV decision log for long or unattended agent runs, one row per decision with what, why, evidence and result, so a reviewer can check the work later.

    11k GitHub starsUsed in 8 repos~1.6k tokens
    Agent WorkflowsAuto-check passed
  • Harness Engineering

    10xChengTu/harness-engineering

    Set up and improve harness engineering (AGENTS.md, docs/, lint rules, eval systems, project-level prompt engineering) for AI-agent-friendly codebases.

    102 GitHub starsUsed in 1 repo~1k tokens
    Agent WorkflowsAuto-check passed
  • Ultragoal Multi-Goal Ledger

    Yeachan-Heo/gajae-code

    Breaks a brief into ordered goals, keeps a durable ledger under .omc/ultragoal and prints handoff text so a Claude /goal run survives session restarts.

    2.9k GitHub stars~8.4k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Requirement Ledger Workflow

    adand-91/gpt-6-astra-skill

    Takes over one selected project on request, reports progress in a fixed Chinese-language format, and runs bounded reviews, handoffs and verifications from explicit sources.

    125 GitHub stars~6.3k tokensUpdated 24 days ago
    Agent WorkflowsAuto-check passed
  • Loop Until Verified

    jtaroreh/agystack

    Runs an iterative verification loop on Google Antigravity: make one edit, run a test command, and reschedule until the command passes or the iteration budget runs out.

    112 GitHub stars~607 tokensUpdated 8 days ago
    Agent WorkflowsAuto-check passed

More from majiayu000/spellbook

All 97 skills in this repo
  • Skill Ecosystem Doctor

    majiayu000/spellbook

    Audits and repairs how coding-agent Skills are owned, copied and exposed across runtimes, from canonical sources to quarantine and retirement.

    287 GitHub stars~3k tokensUpdated 2 days ago
    Auto-check passed
  • AGENTS.md Scaffold

    majiayu000/spellbook

    Scans a repository for real evidence and proposes, or on request writes, a small stack of root and scoped AGENTS.md files with validation commands and generated-file boundaries.

    287 GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check passed
  • Product Demo Builder

    majiayu000/spellbook

    Plans, produces or diagnoses evidence-backed product demo videos: script, capture plan, pacing checks and verified final media built on real product behavior.

    287 GitHub stars~3.3k tokensUpdated 2 days ago
    Auto-check passed
  • npm Supply Chain Check

    majiayu000/spellbook

    Scans a repository, its lockfiles and node_modules for known malicious npm package versions and install-time indicators, using a read-only Python scanner.

    287 GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check passed
  • Product Manager Toolkit

    majiayu000/spellbook

    Product management helpers: a RICE scoring script, an interview transcript analyzer and PRD templates for prioritizing features, synthesizing research and writing requirements.

    287 GitHub stars~2.2k tokensUpdated 2 days ago
    Auto-check passed
  • Repo Agent Context Audit

    majiayu000/spellbook

    Audits a repository's agent-readable context, from AGENTS.md and CLAUDE.md to skills and PRODUCT or TECH specs, and recommends the smallest useful improvements.

    287 GitHub stars~1.9k tokensUpdated 2 days ago
    Auto-check passed

Questions about Flowguard Task Guard

What does Flowguard Task Guard do?

Single entry point that routes long or ambiguous agent tasks, checks live state, bounds autonomous loops and leaves a resumable handoff. Flowguard is meant for work likely to drift, lose context or get expensive: multi-step tasks, autonomous loops, bug fixes, pull request readiness checks, compaction handoffs and resumes. It coordinates other skills, such as systematic-debugging and comprehensive-testing, rather than replacing them.

When should I use Flowguard Task Guard?

Flowguard Task Guard fits situations like: continuing a multi-session task from a previous summary or handoff; running a bounded autonomous loop with explicit scope and stop conditions; checking whether a change is ready for a pull request before anything is pushed.

How do I install Flowguard Task Guard in Claude Code?

Run `npx skills add majiayu000/spellbook --skill flowguard -a claude-code`. Or copy the skill folder (skills/flowguard in majiayu000/spellbook) into .claude/skills/flowguard in your project. Claude Code loads it when a task matches its description.

How do I install Flowguard Task Guard in Codex?

Run `npx skills add majiayu000/spellbook --skill flowguard -a codex`. Or copy the skill folder (skills/flowguard in majiayu000/spellbook) into .agents/skills/flowguard in your project. Codex loads it when a task matches its description.

Can I use Flowguard Task Guard in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add majiayu000/spellbook --skill flowguard -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/flowguard, .gemini/skills/flowguard, .github/skills/flowguard and .opencode/skills/flowguard in your project.

What does Flowguard Task Guard need to run?

Going by SKILL.md and its folder, Flowguard Task Guard needs a shell for the scripts in its folder and the command-line tools its instructions call (cargo, go and npx).

Does Flowguard Task Guard access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Flowguard Task Guard safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Flowguard Task Guard use?

Flowguard Task Guard is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Flowguard Task Guard use?

About 2.1k tokens (SKILL.md is roughly 8.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.1k tokens, read only when the agent opens those files.

What are the alternatives to Flowguard Task Guard?

Skills that share tags, products or a category with Flowguard Task Guard: PUA Loop (tanweai/pua, 20k stars), Show Me Your Work Decision Log (cursor/plugins, 11k stars), Harness Engineering (10xChengTu/harness-engineering, 102 stars) and Ultragoal Multi-Goal Ledger (Yeachan-Heo/gajae-code, 2.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Flowguard Task Guard?

majiayu000 (a GitHub user) maintains it in majiayu000/spellbook, which has 287 GitHub stars. The repository holds 97 skills in this directory. The repository was last updated on October 8, 2026.

Source: majiayu000/spellbook on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.