/instruction-placement:realign [finding-id ...]from instruction-placement
Applies instruction-placement audit findings one at a time with per-item human approval. Executes accepted findings from the audit artifact without re-judging. Use when told to apply placement findings, do migration, or execute specific findings like IP-004.
Ships in instruction-placement. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Arguments. [finding-id ...]. Default: every finding awaiting a decision, in ranked order
!"${CLAUDE_PLUGIN_ROOT}/scripts/precompute.sh" realign 2>/dev/null || echo "- Orientation unavailable"
Execute what the audit found, one finding at a time, with the operator deciding each one. This is
the mutating surface for audit findings (/instruction-placement:migrate is the other mutating
skill, and it owns a repository's move to AGENTS.md), and the per-item gate below is the entire
reason it is safe to point at a repository nobody has reviewed.
What makes these edits unusual is their target: every file this skill touches is a file that steers the agent's own behavior. A bad code edit fails a test. A bad instruction edit quietly changes what the agent does in every future session, and nothing goes red.
Not restated here. A paraphrase inside a proposal is a drift seed.
| Read | For |
|---|---|
../../context/findings-artifact.md | The artifact's location, fields, status vocabulary, merge rules, and the finding-id constituents a suppression entry is keyed by |
../../reference/consumer-config.md | The suppression surface a decline is recorded on: its layers, its per-key merge, and the offered-never-taken rule |
../../context/routing-rubric.md | The hard-deny classes and what each destination means |
../../context/verified-mechanics.md | When the shim is what makes a nested AGENTS.md load, and why the index exists |
context/apply-recipes.md | The exact edit sequence per destination, and the verification each one owes |
Nothing mutates without an explicit acceptance of that finding, from the operator, at the moment it is presented. Say so in the run's opening line, then hold it literally.
paths: glob
with its validated match count, what leaves the always-loaded budget, and the cost: that the
content is not inherited by a subagent and announces itself nowhere, and post-compaction behavior
for that destination. Then the deciding sentence of each record its Mechanics field names, with
this run's quote-check result and label (below).declined into the artifact and move on. A declined
finding is not re-proposed by a later audit.The artifact is memory tier: branch-keyed, invisible from every other worktree, and gone with the memory root. A decline written only there is a judgment the next checkout never sees, and the operator is asked again. So a decline has two writes, and the second is what makes it durable.
declined into the findings artifact. Unchanged, and still the record this branch's run
reads.${CLAUDE_PROJECT_DIR}/.claude/instruction-placement.md.
Git carries that file to every checkout whose branch holds the commit, which is the only mechanism
that crosses checkouts at all.The entry's five required keys, its finding_id, and the layer rules are owned by the two documents
in the table above. Do not invent a format here. Four rules bind the write:
check, claim, sites, the reason
in the operator's own words, date), and write it only on an explicit yes. Declining a finding
and agreeing to never be asked again are two decisions, and the second silences a future report.declined in the artifact only and say the decline will not survive this checkout.${CLAUDE_PROJECT_DIR}/.claude/instruction-placement.md, never
~/.claude/** and never the .local.md personal override: a personal-layer entry the team layer does not
carry is reported personal-only, not applied and suppresses nothing, so writing one would look
like recording a decision while recording none.The audit priced each finding on the docs records its Mechanics field names, and a page can change
between that audit and this run. So the first command of a run, before the artifact is read, is:
"${CLAUDE_PLUGIN_ROOT}/scripts/quote-check.sh"
It takes no arguments and fetches only the pages ${CLAUDE_PLUGIN_ROOT}/context/mechanics-sources.tsv lists. It prints
one line per record: verified <id>; drift <id> <url>, with the stored and fetched sentences on
the next two lines; or unverified <id> as of <date> when the page could not be read fresh. It
exits 0 whatever the results, so a run with no network still completes. Its grant names the script
with no * (how such a rule matches:
https://code.claude.com/docs/en/permissions#wildcard-patterns).
drift result: the record id, its section
URL, the stored wording and the fetched one. A finding whose Mechanics field names a drifted
record is not applied on either wording: present it with both wordings and the unverified label
below, say that it looks wrong until re-audited, and offer the re-audit.Mechanics field names, from the
record's quote column, with this run's result beside it.unverified or a drifted record is
presented labeled "unverified as of ": the date the unverified line printed, or for a
drifted record its as_of in the list. For an unverified record the operator still decides.Mechanics field came from an audit that predates the check. Say so when it
is presented and offer a re-audit. Leave its records unnamed: naming them here would re-judge it.Read the artifact from the home findings-artifact.md "Where it lives" defines.
If it is absent, say no audit has been run for this branch and offer to run one. Do not fall back to another path or another branch's artifact: findings cite line ranges, and a range derived elsewhere points at different text here. Name such a file a leftover and run a fresh audit instead.
Then, before the first finding is presented, resolve .claude/instruction-placement.md across
its three layers and drop every finding the merged surface covers, reporting each as suppressed with
its reason, date, and contributing layer. Match on the finding_id the artifact's Suppression key
already carries; do not derive one here. This skill has no detector stream, and a second
derivation is a second heading parse whose disagreement produces a decline nothing ever matches.
The ordering is the point, and the case it protects is ordinary. This checkout's artifact is memory
tier: whatever the last local audit left behind, knowing nothing about a decline another checkout
recorded and committed since, which arrives here when that commit does. Present first and consult
the surface later, and the operator is asked to re-judge what their team already settled, which is
the rubber-stamping this gate exists to prevent. A suppressed finding is never presented, never
accepted, never applied.
Then four checks before the first edit, because acting on a stale artifact edits the wrong lines:
branch: frontmatter against the current branch. On a mismatch,
stop and re-audit. The directory a file sits in never proves which branch it describes.accepted and whose
source changed is not applied: the acceptance was for text that is gone, so it returns to
pending and is presented again.claude_code_version against the running one. On a material
difference, re-verify the mechanics before trusting destination choices that depend on them.Per accepted finding, in ranked order, following the recipe for its destination:
Re-validate the glob immediately before writing it. The repository may have changed since the audit, and a glob that now matches nothing must not be committed.
Perform the move: create the destination, then excise the source. In that order, so an interruption leaves content duplicated rather than deleted.
Regenerate the index:
"${CLAUDE_PLUGIN_ROOT}/scripts/render-index.sh" write --file <index-file>
Verify statically: the destination file's frontmatter parses, its glob resolves, the index is in sync and its target is reachable, and the source no longer carries the moved content.
Verify empirically when the operator wants proof, or when the destination is one you are unsure of:
"${CLAUDE_PLUGIN_ROOT}/scripts/verify-load.sh" \
--trigger <a file the new surface covers> --expect <the new surface>
This drives the real CLI with an InstructionsLoaded hook and reports what actually loaded,
the only check in this plugin that observes Claude Code rather than reasoning about it, and the
one that catches a surface passing every static gate while never entering context. It costs a
model call, so it earns its place on the first move of a migration and on anything unusual, not
on every finding. VERDICT UNKNOWN means the probe could not run: that is never a pass, and
never grounds for marking the finding applied.
Record applied in the artifact, with the destination path.
One finding is one reviewable unit of work. Do not batch several findings into one edit sweep even when they share a destination file. A reviewer needs to see which change came from which accepted proposal.
AGENTS.md. A CLAUDE.md on the file's own path, the
repository root's included, is read instead of the AGENTS.md beside it, so in a repository
that has one, a nested AGENTS.md written without its CLAUDE.md shim silently reaches nothing.
That is measured, not inferred. Write the shim wherever render-index.sh wiring would report the
file UNWIRED; where it reports NATIVE, nothing blocks the file and the shim is not what makes
it load there, though it stays the cover for sessions that cannot read AGENTS.md at all.blocked. Do not
proceed to the next finding on a broken tree.The context/ files write the plugin's root directory as <plugin-root>, which is
${CLAUDE_PLUGIN_ROOT}. Put that path in place of the placeholder before running a command or
writing it into a brief. Those files arrive through the Read tool as plain bytes, so a ${…} token
in them would reach the Bash tool unsubstituted, and the Bash tool's environment has no
CLAUDE_PLUGIN_ROOT to expand it from. Basis: the plugins reference,
https://code.claude.com/docs/en/plugins/manifest-reference#where-each-variable-resolves.
Observed failure modes. Every one leaves a repository that looks migrated and is not.
AGENTS.md without the CLAUDE.md shim, in a repository whose root carries
a CLAUDE.md. The most likely mistake in this whole plugin, because the result reviews as
correct: a well-written conventions file, in the right directory, that Claude Code never loads,
because the CLAUDE.md above it is read instead. Measured, not inferred.../../context/verified-mechanics.md), and
nothing tells any agent the rule exists until then. In a delegation-heavy repo a worker briefed
to create or change files under that glob can act before the rule arrives. The index is part
of the move, not a follow-up task.declined status is a decision, not a gap to be filled on
the next run. Resurrecting it trains the operator to stop reading carefully, which is how a
per-item gate degrades into a rubber stamp.applied. A linter or skill routing has no destination this skill
builds. blocked there means "executed elsewhere", and recording it as applied hides work that
still needs doing.What SKILL.md sets; muted values are Claude Code's defaults
bash6 skills in this plugin
/auditPre-computed contextRead-only sweep for instruction content on the wrong surface: demote always-loaded conventions that belong on one file type or subtree; promote stranded docs conventions. Safety rails are hard-denied from demotion. Use when: 'my CLAUDE.md is too long', 'convert this to rules', 'what should be a path-scoped rule', 'move conventions to .claude/rules', 'find conventions in our docs', 'nested CLAUDE.md candidates', 'audit instruction placement'. Sibling realign applies accepted findings./checkPre-computed contextPass/fail gate over path-scoped instruction surfaces: every .claude/rules/ glob must resolve, and the always-loaded rules index must match disk. Failures are SILENT in Claude Code. Use when: 'check my rules', 'are my path-scoped rules actually firing', 'is the rules index stale', 'validate paths frontmatter', 'why is my rule not loading', 'CI gate for .claude/rules', or after a change to a rule's paths: or the rules tree. Read-only; sibling realign applies fixes./deltaPre-computed contextRe-run the placement audit and report only what MOVED since the last run, above a noise budget. Declined findings stay declined. Use when: 'what changed since the last placement audit', 'placement delta', 're-run the instruction-placement audit', 'anything new to move', 'did any rule glob break', 'weekly instruction-placement check', or from a scheduled lane. Read-only. Realign still owns every change.npx claudepluginhub melodic-software/claude-code-plugins --plugin instruction-placementOther plugins' skills for the same job