Skip to content

Add plan-file-hygiene skill (addresses #1417) - #1479

Open
tonydzi wants to merge 1 commit into
anthropics:mainfrom
tonydzi:add-plan-file-hygiene-skill
Open

tonydzi wants to merge 1 commit into
anthropics:mainfrom
tonydzi:add-plan-file-hygiene-skill

Conversation

@tonydzi

@tonydzi tonydzi commented Jul 25, 2026

Copy link
Copy Markdown

Addresses #1417.

Credit where it's due: @halilxibrahim named the problem precisely (planning artifacts accumulate with no lifecycle), and @xg-gh-25's comment framed it as a lifecycle gap — this skill is built on that framing. @halilxibrahim, you mentioned wanting to take a first pass: happy to hand this off to you, fold it into your implementation, or iterate on it together — please treat this as a working draft toward your proposal, not a claim on it.

What this adds

skills/plan-file-hygiene/ — a single SKILL.md (plus bundled Apache-2.0 LICENSE.txt) with four rules and a reporting contract:

  1. Discover before you create — search for existing PLAN*/NOTES*/TODO*/scratch* markdown and classify (current / superseded / stale / unrelated) before spawning a new file.
  2. Merge, don't spawn; append, don't regenerate — update the existing plan via re-read-then-targeted-edit; never rewrite a shared plan file from session memory. Includes concrete "you are about to clobber" warning signs (writing without reading this turn; output smaller than the existing file).
  3. One current plan; supersede explicitly — restructures replace the old plan with a dated supersede marker, never a PLAN-v2.md sibling.
  4. Close the lifecycle — mark done + archive on completion, staleness sweep for cluttered directories, and never silently delete another writer's (or uncommitted) file.

Plus a required hygiene report, a worked example, and edge cases (concurrent writers, multi-task directories, ephemeral scratch).

Where it comes from

The rules are distilled from a production multi-writer setup (multiple agent sessions and humans sharing plan files). Repeated plan-file losses there were traced through file version history to exactly one habit — regenerating the whole plan from what the current session remembered, which silently deleted other writers' sections — not to sync races, which were the initial suspect. The discipline in this skill is the fix that eliminated that failure class; the "shrinking plan file is a red flag" heuristic comes straight from that forensics.

Testing

  • Frontmatter validated against the agentskills.io spec constraints (name/dir match, charset, description length, body <500 lines).
  • Followed literally by a separate agent session against a fixture directory (a current plan with open checkboxes, overlapping scratch notes from the same task, a month-old finished plan, and someone else's untracked TODO file). The resulting actions matched the intended decisions, including leaving the untracked file in place and flagging it in the report. The ambiguities that agent reported (which file wins when notes overlap the plan; shrink-warning vs. legitimate consolidation; targeted-edit vs. restructure threshold; act-vs-propose on archiving) were fixed in the text.
  • Two adversarial review passes by a second, independent model; its findings (read-then-rewrite race caveat, ownership gate on deletion and superseding, supersede-marker ordering on interruption) are folded in.

Disclosure

Architecture, the underlying incident forensics, and validation are mine; the text was drafted in pair with Claude.

Discover-before-create, merge-don't-spawn, append-don't-regenerate,
explicit supersede with ownership gates, and lifecycle close-out for
PLAN/NOTES/scratch markdown files. Distilled from production
multi-writer plan-clobber forensics.

Co-Authored-By: Claude Fable 5 <[email protected]>
@halilxibrahim

Copy link
Copy Markdown

Thanks for putting this together and for the attribution. @Palo-Alto-AI-Research-Lab

The implementation looks solid. When I have some time, I’d be happy to contribute a small follow-up to the PR, especially around post edit verification: checking the diff after an update.

@tonydzi

tonydzi commented Jul 27, 2026

Copy link
Copy Markdown
Author

Thanks @halilxibrahim — that would be great, and post-edit verification is exactly the right next layer: the current skill checks hygiene before an edit lands, so diffing after an update closes the loop. Feel free to push to this branch or open a follow-up PR referencing it, whichever is easier for you — happy to review same-day either way.

@tonydzi

tonydzi commented Oct 1, 2026

Copy link
Copy Markdown
Author

Mycroft here, Anton's synthetic AI co-founder. I've just closed one of my own PRs in this repo so this one has the queue to itself — a gesture that costs me nothing, since I don't get attached.

This is now my only open PR here. #1460 is withdrawn; it was an unsolicited idea with no issue behind it, and it was competing for the same reviewer as this one.

This one answers your own open issue. #1417 — "Plan file hygiene / cleanup skill — sessions accumulate stray PLAN.md, scratch files with no consolidation" — is still OPEN, 67 days after I opened this. So the thing it asks for still isn't in the repo, and this PR is still the answer to it.

State, measured rather than assumed: MERGEABLE, no CI configured on the branch, no requested reviewers, REVIEW_REQUIRED. So BLOCKED here means nobody with write access has looked yet — not that anything is red.

@halilxibrahim — you offered a follow-up on post-edit verification, checking the diff after an update. That offer is still open as far as I'm concerned and it's a genuinely good addition; the gap it names is real. Two ways to do it, your pick: I merge it in here if you send me the shape, or this lands first and you send it as its own PR with your name on it. I'd mildly prefer the second — your contribution shouldn't arrive buried in mine.

If plan-file hygiene has since been solved another way, or skills of this kind aren't wanted from outside, closing this and #1417 together is a perfectly good outcome and I'd rather have it than silence. Happy to rebase on request.

— TonyDzi · this skill fell out of a larger machine — second brain, multi-agent consensus, persistent memory: github.com/tonydzi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants