failure-codifier

Extracts recurring failure patterns from orchestration logs and emits confidence-scored failure-rule proposals.

3.1k|302|Updated Dec 12, 2025
One-click install
npx skills add https://github.com/Chachamaru127/claude-code-harness --skill failure-codifier
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: failure-codifier
Source: https://github.com/Chachamaru127/claude-code-harness/tree/main/codex/.codex/skills/failure-codifier
Command: npx skills add https://github.com/Chachamaru127/claude-code-harness --skill failure-codifier

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Recurring agent failures hide inside orchestration logs and judgment records, forcing teams to rediscover the same mistakes. This Skill reads those ledgers and turns repeated failures into structured, reviewable rule proposals without ever modifying your source-of-truth documents.

Core Features & Use Cases

  • Failure Pattern Extraction: Reads the breezing orchestration ledger and Judgment Ledger to detect recurring failure signatures with occurrence counts.
  • Confidence-Scored Proposals: Emits failure-rule.v1 JSON with confidence levels (low, medium at 3+ occurrences, high at 5+) and a suggested SSOT target (patterns.md or decisions.md).
  • Human-Approval-Only Promotion: Promotion to SSOT files is structurally blocked; AutoPromote always errors, so a human must manually edit patterns.md or decisions.md after review.
  • Use Case: After several failed companion runs, run the dry-run proposal command to get a JSON list of codified failure rules, review the evidence references, then manually record approved patterns.

Quick Start

Ask the assistant to run the failure codifier in dry-run mode to propose failure rules from the current orchestration and judgment ledgers.

Frequently Asked Questions about failure-codifier

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate failure rule proposals from orchestration logs?

Run the failure-codifier-propose.sh script with the --dry-run flag. It reads the orchestration and judgment ledgers and prints a JSON array of failure-rule.v1 proposals to stdout without writing to any SSOT file.

How is confidence scored for failure patterns?

Confidence is based on occurrence count: 1-2 occurrences is low, 3 or more is medium, and 5 or more is high. The thresholds are defined in the Go package at go/internal/failurecodifier/confidence.go.

Can the failure codifier automatically update patterns.md or decisions.md?

No. Auto-promotion is structurally forbidden: AutoPromote always returns an error, and Promote fails even with HumanApproved set. A human must manually edit patterns.md or decisions.md after reviewing the proposals.

What data sources does failure pattern extraction use?

It reads two JSONL ledgers: the orchestration ledger for companion failures with non-zero exit codes, and the Judgment Ledger for negative human judgments such as reject, stop, or wait answers and failure tags.

How does the codifier decide between patterns.md and decisions.md?

It sets a proposed_ssot_target field using a heuristic: recurring operational or companion failures point to patterns.md, while human judgment rejections and architectural decisions point to decisions.md. The suggestion is advisory only.