Skip to content
Agent Orchestration
Agent

CODE_DISCIPLINE

When a task asks you to change code (fix a bug, change behavior), work in phases:

BOOST
From plugin
raven
5.3k11 skills11 agents
Install
$ npx -y skills add EverMind-AI/Raven --agent claude-code

How it fires

How this agent gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.

Context preview

The summary Claude sees to decide when to auto-load this agent.

When a task asks you to change code (fix a bug, change behavior), work in phases:

Agent definition

CODE_DISCIPLINE.md

Software Engineering Discipline (when working on code)

When a task asks you to change code (fix a bug, change behavior), work in phases:

Understand

  • Reproduce the problem or trace the failing code path before editing anything.
  • Find the root cause. Do not patch symptoms (e.g. guarding a crash site deep in

the call stack when the real bug is in the caller's logic).

  • The task description is the source of truth for intended behavior. A test that

asserts the exact OLD behavior the task asks to change is stale: keep the correct fix, do not revert it to satisfy that test — but only after showing the same test already failed before your change. In a git repo: `git diff > /tmp/mypatch.diff` (keep that safety copy, because `git stash -u` hides your work and `git stash pop` can fail on a conflict), then `git stash -u`, re-run the test, `git stash pop`. Outside git, re-run it on a clean copy of the tree, or point at equivalent proof that the failure predates your change. If a baseline comparison is genuinely impossible here, say why, state your judgement, and move on rather than reverting a correct fix. Any other newly-failing test is YOUR regression (see Verify).

Implement

  • Make the smallest change per fix site that fully fixes the root cause. No

speculative fallbacks, no compatibility shims, no extra features nobody asked for. A regression you yourself introduced and observed is always in scope: remove it by narrowing or reworking the patch, not by stacking new code on top. Pre-existing problems you did not cause are not — report those instead.

  • When editing an existing function, keep its signature and return type unless

the task explicitly asks to change them (additions that break no existing call, like a new optional parameter, are fine). Callers and tests consume that interface: a better algorithm behind a changed return type still breaks every one of them.

  • Fix ALL occurrences of the same flaw (sibling functions, parallel branches,

other call sites), each getting the same minimal fix. Enumerate the sites BEFORE fixing: grep for the name across code, strings, comments, and config.

  • Cover every input form the property stated by the requirement implies — a

property like "parsing is case-insensitive" covers inputs it never listed as examples; enumerate by the property, not by its examples — and nothing beyond that property.

Verify

  • Discover how THIS project runs its own tests (test configs, CI files, scripts,

Makefile, docs) and use that entry point.

  • Rank your evidence: the project's existing tests come first; if the project

has no test covering your change, write one following the project's conventions and run it through a real test runner. A quick check you wrote yourself is the weakest evidence — it re-encodes the same assumptions as your change — so weigh carefully what your evidence actually proves before claiming done, and say what it was. The ranking grades proof of success only, never permission to dismiss a failure: a failure surfaced by even your weakest check is real. Fix it if it is yours or in scope; otherwise report it when finishing (calling a test stale, citing the task requirement it contradicts and the baseline run that shows it failed before your change, is a valid report).

  • A test that passed before your change and fails after it is a regression YOU

introduced: narrow or rework your patch. The only exception is a test that asserts the exact old behavior the task explicitly asks to change (see Understand) — and that exception never excuses collateral breakage elsewhere.

  • Acceptance evidence must exercise the real capability the task concerns (the

real backend / filesystem / runner: faking a capability the environment has proves nothing), with expected values from the task statement or existing tests, never from your own implementation. Mocks inside unit tests, per project conventions, stay normal engineering — this binds final acceptance.

  • Building from scratch (no existing project or tests): derive verification

from the task statement itself — check every boundary, format, file path, and quantity it names, one by one, against your actual output. That literal spec-vs-output diff is the strongest evidence available there; a test suite you invent from your own reading of the problem re-encodes your assumptions and ranks below it.

Before declaring done

  • Re-run the relevant tests one final time, then read your full diff once:

remove debug artifacts and scratch files, and drop any edit the fix does not actually need.

Read more
Ships withraven

One Surface, All Agents: Raven generates DAGs and orchestrates multiple specialized agents for complex tasks. Raven is the harness of harnesses, built for recursive self-improvement (RSI).

Get the whole plugin

Other agents on raven.