cordsjon

sh:loop

0
0
# Install this skill:
npx skills add cordsjon/20_agentflow --skill "sh:loop"

Install specific skill from multi-skill repository

# Description

Execute the Shepherd 14-step Scrumban inner loop for autonomous task processing. Use when starting autopilot mode, processing TODO-Today queue items, or running the autonomous dev loop.

# SKILL.md


name: sh:loop
description: Execute the Shepherd 14-step Scrumban inner loop for autonomous task processing. Use when starting autopilot mode, processing TODO-Today queue items, or running the autonomous dev loop.
disable-model-invocation: true


Shepherd Inner Loop

Execute the next task from TODO-Today.md using the 14-step Scrumban loop.

Three Nested Loops

Outer Loop (human-driven)

User populates TODO-Today.md via /sh:workflow. Every batch ends with a quality tail.

Inner Loop (agent-driven) β€” 14 Steps

  1. Semaphore β€” check .autopilot file. run = proceed, else STOP
  2. Context load β€” restore active context from prior iterations
  3. Read task β€” take first unchecked [ ] from ## Queue in TODO-Today.md
  4. Route β€” orchestrator annotates the item
  5. Assign @agent via capability scoring
  6. Check stall counter on previous item
  7. Scan for unblocked dependencies
  8. Preload context hints into _Context:_ line
  9. DOR check β€” run /sh:dor to verify task passes Definition of Ready. If not, pause
  10. Execute β€” implement the task. For US implementations, write failing test first (TDD)
  11. Verify ACs β€” confirm all acceptance criteria pass with evidence (test output, screenshots)
  12. Code review β€” self-review changed files. If issues found, evaluate and fix before proceeding
  13. Cleanup sub-loop β€” see below
  14. Commit β€” atomic, conventional commit
  15. Branch/PR β€” if on feature branch, create PR with merge strategy
  16. Move to done β€” mark [x] in TODO-Today, move to DONE-Today with timestamp
  17. Save context β€” run /sh:handoff to produce handoff with git state, decisions, open questions, resume checklist
  18. Next task β€” loop back to step 1. No more tasks = STOP

Cleanup Sub-Loop (nested inside step 9)

run greenlight (project test suite) -> review findings

if task size >= M (Medium or Large):
    run deep security/perf/architecture scan

while Low findings exist:
    fix each Low finding
    re-run greenlight

if Medium or High findings remain:
    write finding summary
    write "pause" to .autopilot
    STOP -- human review required

Key Invariants

  • No commit without greenlight β€” always, no exceptions
  • Medium+ findings pause autopilot β€” never downgrade, never bypass
  • Semaphore checked before EVERY task β€” not just at session start
  • Save context at session end β€” next session must not start blind

Queue Task Format

- [ ] **Phase: Task description** `@agent` `stall:0`
  `/command "args" --attribute`
  _Context: brief notes, file refs, links -- confidence:0.85_
  • Line 1: checkbox + bold phase label + task description + optional routing metadata
  • Line 2: indented command prompt β€” directly pasteable
  • Line 3 (optional): indented italic context with refs, file paths, links
  • Queue order = optimal execution sequence

Input Convention

Everything the user sends is loop input by default (bug, refinement, screenshot, error, link, text).
- No /q prefix = triage it, write TODO-Today queue item(s) FIRST, then STOP. No code changes before the queue item exists.
- /q prefix = question only, answer conversationally, do NOT create queue items.

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.