heal-workflow

heal-workflow is a command for Claude Code from marcusgoll/Spec-Flow. It costs 13 tokens per session (3,834 once invoked), scanned A, original, MIT.

A command that applies approved improvements to a software team's documented workflow after an audit. It reads recommendations from an audit report and applies selected changes.

In plain words
What is it for?
Use it after an audit to apply high-priority or other recommended workflow changes, either for a named project phase or automatically using the latest audit.
Why use it?
It removes the need to manually find audit recommendations and decide how to incorporate them into the workflow.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/marcusgoll/spec-flow/heal-workflow
Clone the repo
git clone --depth 1 https://github.com/marcusgoll/Spec-Flow

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for heal-workflow

README.md
[![agentmods](https://agentmods.dev/badge/commands/marcusgoll/spec-flow/heal-workflow.svg)](https://agentmods.dev/commands/marcusgoll/spec-flow/heal-workflow)
Your own site
<a href="https://agentmods.dev/commands/marcusgoll/spec-flow/heal-workflow"><img src="https://agentmods.dev/badge/commands/marcusgoll/spec-flow/heal-workflow.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,834 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00013 $0.03834
Opus 5 $0.00006 $0.01917
Sonnet 5 $0.00003 $0.00767
Haiku 4.5 $0.00001 $0.00383

Measured 4d ago against content hash 092204c60247, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

heal-workflow scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/infrastructure/heal-workflow.md · 551 lines

How it starts

The opening of the file, as written. The whole thing — 551 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/heal-workflow — Self-Healing Workflow Improvements

Purpose: Apply improvements to workflow system based on audit findings. Enables workflow to adapt and self-improve over time.

Command: /heal-workflow [epic-slug | auto]

When to use:

  • After /audit-workflow identifies improvement opportunities
  • Manual invocation to review and apply pending improvements
  • After pattern detection suggests custom tooling

Healing Workflow Process

Step 1: Load Audit Report

Locate most recent audit:

if [ -n "$ARGUMENTS" ] && [ "$ARGUMENTS" != "auto" ]; then
  EPIC_DIR="epics/$ARGUMENTS"
else
  # Find most recent epic with audit report
  EPIC_DIR=$(find epics -name "audit-report.xml" -printf '%T@ %p\n' | sort -rn | head -1 | cut -d' ' -f2- | xargs dirname)
fi

AUDIT_REPORT="$EPIC_DIR/audit-report.xml"

Validate audit exists:

test -f "$AUDIT_REPORT" || error "No audit report found. Run /audit-workflow first."

Step 2: Parse Improvement Recommendations

Extract actionable recommendations:

const audit = readXML(AUDIT_REPORT);

const improvements = {
  immediate: audit.recommendations.immediate.filter(r => r.priority === 'high'),
  short_term: audit.recommendations.short_term.filter(r => r.priority === 'medium'),
  long_term: audit.recommendations.long_term.filter(r => r.priority === 'low'),
  custom_tooling: audit.custom_tooling_suggestions
};

Categorize by type:

const improvementTypes = {
  phase_modifications: [],    // Change phase behavior
  gate_adjustments: [],        // Modify quality gates
  template_updates: [],        // Update XML templates
  skill_generation: [],        // Generate custom skills
  command_generation: [],      // Generate custom commands
  config_changes: []          // Update workflow configuration
};

Step 3: Present Improvement Options

Display recommendations with impact:

Workflow Healing: 001-auth-epic
─────────────────────────────────────────

Audit Score: 85/100 (B+)
Found 8 improvement opportunities

IMMEDIATE (High Priority - Apply Now)
══════════════════════════════════════════
[1] Reduce clarification phase overhead
    Type: phase_modification
    Current: Asks 6 questions regardless of clarity
    Proposed: Adaptive questioning (2-6 based on ambiguity)
    Impact: Save ~45min per epic
    Risk: Low
    Effort: 1 hour to update clarify.md

[2] Auto-skip preview for non-UI epics
    Type: gate_adjustment
    Current: Manual preview required for all epics
    Proposed: Auto-skip if no UI changes detected
    Impact: Save ~1.5h for backend-only epics (40% of epics)
    Risk: Low (AI pre-flight checks still run)
    Effort: 30min to update preview.md

SHORT-TERM (Medium Priority - Next 2-3 Epics)
══════════════════════════════════════════════
[3] Generate service boilerplate skill
    Type: skill_generation
    Pattern: Detected 3x (DI + Repository pattern)
    Impact: Save 30min per service, ensure consistency
    Effort: 2 hours to build skill

[4] Improve sprint estimation for frontend
    Type: config_changes
    Current: Frontend sprints underestimated by avg 80%
    Proposed: Increase frontend complexity multiplier 1.0x → 1.8x
    Impact: More accurate estimates, better planning
    Risk: Low
    Effort: 5min config update

LONG-TERM (Low Priority - Strategic)
══════════════════════════════════════════
[5] Contract-first workflow enforcement
    Type: phase_modification
    Proposed: Lock contracts before any implementation starts
    Impact: Prevent integration bugs proactively
    Risk: Medium (adds overhead to planning phase)
    Effort: 4 hours to build contract-locking mechanism

... (3 more)

Read the full file on GitHub · 551 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 551 lines · 13 tokens per session scan A 092204c60247

Subscribe to this mod's changes

heal-workflow is a command published in the GitHub repository marcusgoll/Spec-Flow (92 stars, last pushed 4mo ago), licensed MIT. It adds 13 tokens to every session and 3,834 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.