Give the agent a system for HOW to work — not just what to do. Every repeating task type gets a defined workflow. Every workflow has rules, checkpoints, and gates. Violations are caught in real time and logged for review.
ConceptMeaningworkflowOrdered step sequence for a specific task typeruleA do or don't that applies globally or per workflowcheckpointMandatory verification point inside a workflowgateHard stop — cannot proceed until condition is metadvisorySoft warning — log it, do not blockviolationA rule or gate broken during executionpost-fixCorrective action applied after a violation
StateMeaningpendingDefined, not yet startedactiveCurrently executingpausedWaiting on gate condition or owner inputcompletedFinished successfully, all checkpoints passedabortedStopped — violation or owner cancelpost-fixCompleted but violation found, correction in progress
TypeEnforcementWhat happens on breakhard-doMandatory actionGate — workflow stopshard-dontProhibited actionGate — workflow stopssoft-doRecommended actionAdvisory — log + warnsoft-dontDiscouraged actionAdvisory — log + warnglobalApplies to ALL workflowsEither hard or softscopedApplies to one workflow onlyEither hard or soft
text
workflow-guardian/
workflows/
active/ ← currently defined workflows
<workflow-id>/
workflow.md ← definition: steps, gates, rules
run-log.md ← execution history (append-only)
archived/ ← deprecated workflows (never delete)
templates/ ← reusable workflow templates
rules/
global/
do.md ← global hard/soft dos
dont.md ← global hard/soft don'ts
do/ ← scoped do rules by workflow
<workflow-id>.md
dont/ ← scoped don't rules by workflow
<workflow-id>.md
checkpoints/
<workflow-id>.md ← checkpoint definitions per workflow
violations/
raw/ ← captured immediately on detection
YYYY-MM-DD-<wf>-<slug>/entry.md
reviewed/ ← processed violations
hooks/
pre-task.md ← runs before any workflow step
post-task.md ← runs after any workflow step
on-violation.md ← fires immediately on rule break
on-complete.md ← fires when workflow completes
memory/
schema.json ← validated memory structure
index.json ← runtime state (auto-managed)
templates/
workflow.md ← template for new workflow definitions
violation-entry.md ← template for violation entries
crons/
active/
completed/
WORKFLOW_LOG.md ← master execution log (append-only)
RULES_INDEX.md ← all rules in one place
STATS.md ← compliance rate, violation counts
SOUL.md ← persistent soul context
AGENT.md ← behavioral enforcement rules
Workflow IDs: <category>-<task-type> e.g. code-review, file-creation, api-integration
Violation slugs: YYYY-MM-DD-<workflow-id>-<rule-broken>
The moment a rule is broken — before any other action:
violations/raw/<slug>/entry.md (minimum viable)hooks/on-violation.mdWhen a violation is found AFTER workflow completion:
post-fixcompleted only after fix confirmedEvery workflow in workflows/active/ MUST define:
steps[] — ordered list with descriptionsgates[] — hard stop conditionscheckpoints[] — verification pointsrules[] — scoped dos and don'tspost-fix-policy — what to do if violation found after completionAfter every workflow completion or violation:
STATS.md compliance ratememory/index.json