Checks whether a project's state structure conforms to the Metaproject standard. It observes first: it lists what conforms and what deviates, and changes nothing while doing so. Then, only if the user wants, it fixes the deviations the user approves, one by one (see Fixing, at the end).
Verifies that all expected files exist:
state/
├── handoff.md
├── setup.md
├── router.md
├── agents.md
├── conventions.md
├── todo.md
├── pending-tasks.md (inbox file: present only when work is pending)
├── framework-feedback.md (inbox file: present only when feedback is pending)
├── interim-vN.md (inbox file: present only in an interim packaging)
├── closing/
│ └── readme.md (startup file)
├── handoffs/
│ └── handoff-*.md
└── skills/
├── core/ (distributed, metaproject's own)
│ └── *.md
├── personal/ (not distributed, optional)
│ └── *.md
├── *.md (optional: imported from external collections)
└── subdir/ (optional: imported skills with a subrouter)
└── *.md
Reports missing files and unexpected files (those not part of the
standard). Note the inbox files
(pending-tasks.md, framework-feedback.md,
interim-vN.md): these exist only when something is pending,
so their absence is normal and never a deviation. Their
presence is expected and must not be reported as an unexpected
file.
Before auditing the project, verify that Metaproject (its zip or a clone of its repository) is internally coherent about its own version. Three sources must agree:
max(M) among the upgradeN-M.md files.templates/setup-standalone.md.templates/setup-external.md.If any of the three diverges, stop and report — the Metaproject itself is broken and there is no well-defined current standard to audit against. Fix Metaproject before running audit.
When the three agree, that number is the current standard and audit proceeds.
*Metaproject standard: vN.* near the top)? If absent, the
state predates versioning and is treated as v1.upgrade.md is the protocol to bring it
current.pending-tasks.md (inward-facing: propose and execute
here) and framework-feedback.md (outward-facing: report but
do not empty). A setup still carrying only the v3 Pending tasks
section is on an older version — report it and point to
upgrade.md. At v5 the family also includes
interim-vN.md, with its rescue protocol.closing/readme.md?closing/readme.md and the inbox files
(pending-tasks.md, framework-feedback.md,
interim-vN.md)?upgrade.md.mkdir -p of the output
directory, the check that the outgoing zip keeps every archived handoff,
delivering with the environment's file-sending tool when there is one,
and delivering closing/readme.md loose? Does it say that a
session closes only when the user asks, and that a pause is not a close?
In an external project, does it make sure at close that the session's
work on the project has left the session — every change committed and
pushed, in a repository; the files Project setup names
delivered with the state zip, from a read-only source such as a
download, under names that cannot be taken for a state zip or an interim
zip? Does Project setup say how the work leaves? A protocol
that still says "archiving means moving" is on an older version.closing/readme.md exist, with the project's slug
in the find patterns of its guard, and does that
find search the three upload folders with
find -H (an upload folder may itself be a symbolic link)?
Does its list of startup reads match the What to read on
startup section of setup.md? In an external project,
is it free of project-zip lines (a stray project zip must not be
unpacked over the project)?handoff.md have the expected sections
(what's been done, what's left)?handoff-YYYYMMDD-vN.md)?handoff-…-vK.md titled # Handoff vK — lost —
is a gap the user has already confirmed; it is not a deviation.)handoffs/ hold anything other than handoffs (and
tombstones, and -recovered copies)? A
handoffs/readme.md is a file the standard dropped in
release 5.7: it restated the mechanics of setup.md and
could drift from them, its name clashed with the startup file, and it
sorted after the handoffs. Report it (Fixing offers to remove
it). Report anything else there too.skills/?.md with an
associated subdirectory), does the subdirectory exist and does it
contain the skills the subrouter references?update).skills/ (root or subdirectories
other than core/ and personal/) that have no
row in the router (neither directly nor through a subrouter)? (Not an
error — these are inactive skills — but reported for visibility.)skills/core/: report which core skills are not in
the router. Core skills are always available but, like any other skill,
activated by being listed in the router.skills/personal/: report which personal skills are
not in the Personal section of the router. The default
is that all personal skills are listed — they exist because the project
uses them — so omissions are worth the user's visibility. Not an error:
a personal skill may be intentionally unrouted (kept for reference,
draft, superseded), but the user should confirm it is on purpose./home/claude/state/skills/core/edit-todo.md) so that Claude
does not have to resolve anything at read time. Report any relative
paths as deviations.Obtain exact copies of the upstreams, as the list in step 1 of
update.md says (never a rendered web page), and compare
byte for byte:
skills/core/ with Metaproject's
skills/core/;Report, among the deviations, every skill that differs from its
upstream, every one present here but not upstream, and every core skill
that is new upstream (what update would call
Modified, Local and New); a modification the
conventions record is named as known. If an upstream cannot be
downloaded, ask the user to upload it; if that is not possible either,
its skills are reported as not checked, not as conforming.
skills/personal/ is not compared.
The checks above name the elements the standard requires. A
maintenance release may also change wording that none of them names (a
flag in a command, a sentence in the closing protocol), so compare the
state with the current templates as well, section by section. Skip this
comparison when the state is on an older version than the current
standard: upgrade brings the wording in, and the report
would only fill up with what the upgrade will change anyway.
setup.md with the setup template it follows:
templates/setup-external.md if the project's material lives
outside the state (a repository, a server), otherwise
templates/setup-standalone.md.closing/readme.md with
templates/closing/readme.md. For an external project,
compare with the template without its project-zip
lines, as create.md says to remove them: their
absence is not a deviation, and their presence is (see Startup
file above).conventions.md
with those of templates/conventions.md.Sections the template leaves as placeholders (Project setup in the setup, Project-specific conventions) are not compared, and neither are template options that do not apply to the project (the git convention, in a project with no repository).
The state may be in another language, name the user and the project, and carry lines of its own. One section may hold differences of several kinds; each difference is one of three:
find of the closing check has no
-H").What the project's conventions record — a deviation kept on purpose, wording kept on purpose, an addition of its own — is named as known, not reported as news: a known addition among what conforms, a known deviation among the deviations, marked as known.
/mnt/project/ (the Files/Knowledge
section of the Claude project)? If so, list them — they would normally
belong in state or project, not there.Present the results to the user grouped in three blocks:
After presenting the report, ask the user whether they want to address any of the deviations, or align the wording. If they do, go on to Fixing.
An older version comes first. If the state is on an
older version than the current standard, do not patch it piece by piece
and fix nothing else: offer to run upgrade.md instead (it
ends by proposing update). The rest of the report will
change after the upgrade.
Otherwise, go through the deviations one at a time, in the order of the report. For each:
setup.md"); even then, apply them
one by one and show each.templates/setup-*.md,
templates/closing/readme.md,
templates/conventions.md), in the language of the file
being fixed, with the user's name and the project's slug. Change only
what the deviation names — add the missing rule or step, replace the
sentence that contradicts the template — and do not rewrite the rest of
the section. Cross-references use the section names the file already
uses./home/claude/state/pending-tasks.md (create the file if it
does not exist).After the deviations, offer to align the Wording only sentences, all in one question (the user may pick some). Each alignment replaces only a sentence listed as wording only with the template's current one (translated, in a translated file), with the user's name and the project's slug; apply them one by one, showing each before and after. A sentence that carries anything of the project's own (a name, a path, a clause the template does not have) is not replaced without showing it to the user first. Nothing else in the section changes. Aligning is optional: wording left as it is still conforms.
Some deviations are not fixed by editing the state here:
update.md, which compares them and asks about each
difference. Offer to run it.handoffs/readme.md. Propose removing
it, and remove it only if the user agrees; if not, propose recording in
the conventions that it is kept on purpose.handoffs/handoff-YYYYMMDD-vK.md, with today's date, titled
# Handoff vK — lost); otherwise leave the gap as it
is.CLAUDE.md): fix it there, in the repository, and commit and
push it as the closing protocol says./mnt/project/. Tell the user
what to change there, and why.When the user leaves a deviation or some wording as it is on purpose,
propose recording the decision in the Project-specific
conventions of conventions.md; propose the same for
the project's own additions the audit found. Name the section and
describe each in a line; do not copy the text there. The next audit then
names them as known, instead of judging them again. When fixing is over,
write in the new handoff, at close, what was fixed and what was
left.