Skip to content

Workflow guard (dsh-guard)

DSH-native replacement for Super Cursor runner.sh gates — bash + pnpm scripts, no Cordis plugin required.

Implementation: scripts/dsh-guard.sh sources scripts/plan-parse.sh for plan HTML meta and TASK table parsing.

Commands

CommandRole
pnpm run gate-checkHard gate before run (PLANNING / PLAN_APPROVED)
pnpm run plan-checkHandoff structure warnings (ACTIVE, 执行顺序, VERIFY, …)
pnpm run task-verifyRun ACTIVE task acceptance (or heuristic fallback)
pnpm run next-taskNext pending TASK ID from 执行顺序 / table
pnpm run guardStatus summary (dsh-guard.sh status)
pnpm run verifyFull structural verify (verify-planrun.sh)

Direct CLI:

sh
bash scripts/dsh-guard.sh gate-check
bash scripts/dsh-guard.sh task-verify TASK-001

Plan file resolution

Priority:

  1. DSH_GROWTH_PLAN — explicit path
  2. Walk up from current working directory for .dsh/growth/plan.md or .cursorGrowth/plan.md
  3. Fallback: PlanRun repo root (when scripts/ live in the planrun checkout)

Target projects: run install-planrun.sh to copy guard scripts to scripts/ and merge npm scripts into package.json.

HTML metadata (SSOT)

Guard reads HTML comments at the top of plan.md:

KeyPurpose
PLANNINGtrue → block run (planning only)
PLAN_APPROVEDDate string — required for gate-check
SPRINTSprint id (e.g. SPRINT-04)
SPRINT_STATUSactive | closed
ACTIVECurrent TASK id
NEXTSuggested next TASK
LAST_DONELast completed TASK
AUTONOMOUStrue → same-session Sprint chain
VERIFYFull verify command (default ./scripts/verify-planrun.sh)
MAX_LOOPSAutonomy loop cap (default 15)

Template: templates/growth/plan.md

TASK table

Super Cursor–compatible columns:

| ID | Task | Priority | Status | Acceptance | Target |

  • Status: · 🔧 · (growth template also maps ACTIVE/TODO/DONE)
  • Acceptance: executable command preferred (pnpm run verify, bash scripts/...)
  • Descriptive acceptance → heuristic fallback (DSH_GUARD_FALLBACK_VERIFY, default ./scripts/verify-planrun.sh)

Environment

VariableDefaultMeaning
DSH_GROWTH_PLANOverride plan path
DSH_GUARD_HEURISTICStrueFallback when acceptance is descriptive
DSH_GUARD_FALLBACK_VERIFY./scripts/verify-planrun.shFallback script

vs Super Cursor

Super CursorPlanRun guard
.cursor/bin/runner.shscripts/dsh-guard.sh
.cursor/config/workflow.jsonenv + plan HTML meta
.cursorGrowth/plan.md.dsh/growth/plan.md (+ mother .cursorGrowth/)
release-tagrelease skill (not in guard MVP)

Future: @planrun/workflow Cordis plugin injects session hooks; guard scripts remain the portable baseline when the plugin is not mounted.

Skills

  • sprint-plan — write plan + metadata before run
  • runpnpm run gate-check before coding; task-verify before ✅

See mapping-from-super-cursor.md.

MIT License