About swe-workflow
SWE Workflow is a skill that triages code tasks and selects lightweight or plan-based execution based on risk, scope, and coordination needs. It provides gates for planning, editing, verification, and resuming work across sessions.
Key features
- 01Triage tasks into workflow modes
- 02Require persisted plans for risky work
- 03Gate edits on active plan steps
- 04Guide verification and task status
- 05Support multi-session resumption
Use cases
- 01Handle a localized code change without a plan
- 02Plan a risky or cross-subsystem implementation
- 03Coordinate work across multiple sessions
- 04Verify changes before completing a task
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ ex-git/ swe-workflow --skill swe-workflowAfter installing, type/swe-workflowin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
AGENTS.mdREADME.md.gitignoreCHANGELOG.mdLICENSEpackage.jsonexamples/evaluation-prompts.mdplan-example.mdexamples/add-email-validation/README.mdcontext.mdexamples/add-email-validation/2024-11-04-add-email-validation/plan.mdexamples/add-email-validation/2024-11-04-add-email-validation/steps/step-1.mdstep-4.mdstep-3.mdstep-2.mdreferences/command-discovery.mdcheckpoint.mdcreate-plan.mdcode-quality.mddelegated-guards.mdexecute-step.mdglobal-reflection.mdrequire-clarification.mdproject-agents-template.mdrisk-classification.mdpersist-plan.mdstep-template.mdtask-overview-template.mdverify-step.mdscripts/validate.mjsDetails
From the project READMESWE Workflow
Every code task starts with workflow triage. Bounded work stays lightweight; risky or coordination-heavy implementation uses a persisted plan.
Contract
- Triage first. Start the first reply to a code-related task with one of these declarations:
Workflow mode: Lightweight — <reason>; success: <outcome>; plan: no.
If an exact machine-readable contract permits no extra text, follow that contract instead of adding a plain-text triage prefix. Include triage fields only when the schema permits them.Workflow mode: Full Reason: <one sentence> Success criteria: - <what done means> Plan needed: yes - Lightweight is the default for clear localized changes, bounded investigation, and read-only reviews or discovery—even when many files must be inspected. It uses the Behavioral Guards but no persisted plan.
- Full is required before implementation when work is risky or hard to reverse; changes API/schema/migration/security/configuration contracts; couples multiple subsystems; is a broad refactor/migration/cleanup; needs durable multi-session or multi-agent coordination; remains materially ambiguous after bounded discovery; or the user requests a plan. File count alone is a signal, not a trigger.
- Escalate before target-file edits. Lightweight discovery may gather evidence first. If Full criteria emerge, stop before mutating task files, declare Full mode, clarify decision-critical questions, create the plan, and then resume. If edits already began, preserve the verified state and escalate before expanding scope.
- Pre-edit gate (Full mode). Before mutating task target files: a plan directory must exist under
plans/<YYYY-MM-DD>-<slug>/, exactly one step file must have> Status: IN_PROGRESS, and the edit must map to that step. Read-only exploration and workflow-bookkeeping updates are allowed before this gate. - Plan file format. Copy
references/task-overview-template.mdtoplan.mdandreferences/step-template.mdto each step file. Every step has ten fields:Status,Goal,Prerequisites,Deliverables,Plan,Quality Checklist,Validation Checklist,Test Checklist,Implementation Notes,Files Changed. - Clarification gate (Full mode). Ask only decision-critical questions that repository evidence cannot answer. A valid plan has
Open Questions: None.; the plan approval is the sole routine pre-execution approval. - One writer step at a time. Exactly one step may authorize active-worktree writes. Independent read-only investigation or validation may run concurrently. Never mark
COMPLETEDwith known failures—fix through an authorized step or markBLOCKED.
Delegated Mode
When all of the following are true, skip triage/plan/pre-edit gate:
- Task assigned by another agent or orchestrator (not an open-ended user request)
- Explicit scope, success criteria, or acceptance contract received
- Operating in a focused role (implementer, reviewer, analyst, etc.)
In Delegated Mode: follow all Behavioral Guards and references/code-quality.md; report changed files, commands, validation evidence, and surprises; escalate unapproved design/architecture decisions; stay in scope.
Statuses
Plan-level (plan.md): DRAFT → ACTIVE → COMPLETED → ARCHIVED
Step-level (steps/step-N.md): PENDING → IN_PROGRESS → COMPLETED | BLOCKED
Only one writer step may be IN_PROGRESS at a time. The pre-edit gate checks step-level status. The plan remains ACTIVE after execution steps finish and becomes COMPLETED only after global reflection passes.
Reference Loading
Load only what the current phase needs:
- Planning:
references/create-plan.md,references/task-overview-template.md,references/step-template.md - Execution:
references/execute-step.md,references/code-quality.md - Verification:
references/verify-step.md - Command discovery:
references/command-discovery.md - Risk review:
references/risk-classification.md - Project setup:
references/project-agents-template.md
Behavioral Guards
Active for the entire session. Do not drift.
- Evidence first — read target files before editing; search callers/usages before changing shared behavior; distinguish
Verified/Assumption/Unknownwhen evidence status matters and cite key claims. - Anti-shortcut gate — before editing: target read ✓, impact search (or
N/A — isolated) ✓, validation command (or skipped reason) ✓. - Think in code — for aggregate analysis, prefer short scripts/commands that compute results over many raw file dumps. For noisy output, store in
/tmp, print bounded slice. - Minimalism ladder — before adding code, prefer: delete/skip if not needed → stdlib/native feature → existing dependency/helper → smallest safe implementation; never cut security, data safety, accessibility, or explicit requirements.
- Surgical changes — touch only needed files/lines; match existing formatting, naming, and conventions; do not copy degraded patterns.
- Implementation quality — follow local patterns and search for existing equivalents. Prefer the smallest complete change. Do not duplicate business rules or add speculative abstractions, options, dependencies, or refactors. For shared behavior, identify the regression surface and validate requested and preserved behavior. DRY does not justify premature abstraction or out-of-scope cleanup.
- Design discipline — do not make silent design choices. Surface decisions for user confirmation. Verify approach matches conventions or Design Decisions table.
- Goal-driven — define success before coding; verify via tests/lint/build/typecheck; add focused tests for new code and bug fixes; fix introduced issues or report blockers.
- STE-inspired writing (mandatory) — use this style in all agent-authored prose. Use short, direct sentences. Use one main idea per sentence. Use consistent terms. Name the referent when
it,this, or another reference could be ambiguous. Apply the rule to answers, handoffs, plans, reports, documentation, comments, and docstrings. Preserve the meaning of normal programming terms, identifiers, code, commands, paths, quotations, generated content, third-party content, and exact formats. Do not claim formal ASD-STE100 compliance. Do not rewrite unrelated prose only to apply this rule. - Answer first — after the required triage, lead with the answer or outcome. Include material evidence, validation, uncertainty, caveats, and residual risks. Remove repetition and unnecessary narration, but do not omit material findings. Use headings, lists, tables, and evidence labels only when they improve clarity. Preserve exact JSON and other machine-readable contracts.
Full Workflow Phases
- Clarify — resolve only decision-critical ambiguity that repository evidence cannot answer. See
references/require-clarification.md. - Plan — break into vertical-slice steps. See
references/create-plan.md. - Execute — one step at a time:
references/execute-step.md→references/verify-step.md→references/persist-plan.md. Every 2–3 steps:references/checkpoint.md. Before pausing: dump context. - Reflect — after all execution steps are done, keep the plan
ACTIVE;references/global-reflection.mdowns final plan completion.
Resume Protocol
New session → read plans/context.md → relevant plan.md → current step file. See references/resume-workflow.md.