agentleFS
Natsuki-KaedeNatsuki-Kaede/purify-codex/skills/purify/SKILL.md

purify

Skill1 starsChanged 7 days agoMITView on GitHub

Audit and clean Codex-style pollution in AI agent setups and in repositories, including their design documents. Pollution means replies padded with what was not done or left unchanged, proof-boundary disclaimers, "X, not Y" framing, invented or duplicated rules, task-log memories, and over-defensive code (fallbacks, repeated validation, shims). Covers Codex, Claude Code, the Claude app, Antigravity, Gemini CLI, Cursor, Windsurf, GitHub Copilot, OpenCode, and others. Use for /purify, 净化, Codex 风格污染, 过度设计, 过度边界, de-hedging AGENTS.md / CLAUDE.md / GEMINI.md or agent memory, or cleaning a codebase written with GPT-5.x / GPT-6 (Sol, Astra) in Codex.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. mystilleef/spae-framework★ 2same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 6 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run the read-only scanner from this skill's directory.

    line 28
  2. Very specific:

    Add --json for structured output.

    line 35
  3. Very specific:

    Read references/patterns.md.

    line 65
  4. Very specific:

    Agent audit: Use references/locations.md and check:

    line 67
  5. Distinctive:

    Global instructions and their imports: Look for rules that produce the style: lists of checks to report as unverified, "does not authorize" …

    line 69
  6. Very specific:

    Open channels: Import and sync settings, shared skill directories, and hooks copied from another agent will bring the pollution back.

    line 76
  7. Distinctive:

    Skills: Look for Codex-only tool names inside other agents' skills, proof-boundary boilerplate, and copies that drifted apart.

    line 80
  8. Distinctive:

    Repositories: When the current repository's CLAUDE.md or GEMINI.md only imports AGENTS.md, recommend a project audit.

    line 84
  9. Very specific:

    Repository audit: Follow references/project-audit.md, and judge design documents with references/design-audit.md.

    line 87
  10. Very specific:

    Write the report using the applicable global reporting rules.

    line 105
  11. Distinctive:

    Back up first: Before editing files outside a git repository, archive every file you will touch into a timestamped directory, and give its …

    line 109
  12. Very specific:

    Memory: Follow references/memory.md, then re-run the scanner and compare the counts.

    line 112
  13. Distinctive:

    Code: Run the project's required checks, and report which ran and their results.

    line 113

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Purify

Codex models tend to tell the reader what they won't do, list what stayed unchanged, add disclaimers for hypothetical risks, invent rules, and write defensive code that no requirement asks for. OpenAI's own prompting guide tells developers to switch these habits off. The habits spread anyway:

  • into Codex's own memory and AGENTS.md;
  • into other agents' instruction files, memories, and hooks, through import and sync features and copied rules;
  • into the code and docs of the repositories these agents work in.

Other models then read that text and imitate it. This skill finds the pollution, shows the evidence, and changes what the user picks. Daily reporting rules belong in the agent's global instructions; PURIFY.md is a reusable template. Keep rules already merged there. The installer (npx github:Natsuki-Kaede/purify-codex) installs the audit skill and supplies rules where needed; use install --skill-only for custom wording maintained by the user.

Modes

InvocationWhat it does
/purifyAgent audit, then an offer to audit the current repository
/purify agentsAudit agent instructions, rules, memory, skills, hooks, and settings on this machine
/purify <path>Audit one repository: design documents, code, docs, comments, and the agent rules inside it. A folder inside a repository narrows the audit to that folder

Each mode ends with a report. Files change only for the finding IDs the user picks, or for a whole group when the user says so ("apply A").

Step 1: Scan

Run the read-only scanner from this skill's directory. It needs Node 18 or later.

node <skill-dir>/scripts/scan.mjs agents
node <skill-dir>/scripts/scan.mjs project <path>

Add --json for structured output.

Agents mode prints, for each installed agent:

  • its global instructions, including @ references and explicit Read and follow / 读取并遵循 references; when it has none, which paths were checked;
  • recognized rule configuration: inline text, managed inline blocks, or references to recognized rules;
  • memory directories and summary files found on disk, including both Codex memories_v2 and memories;
  • its hooks, flagging any that name a different agent;
  • the text that is kept in the account and not on disk.

It then prints, across all agents:

  • the skills with the most hits, and skill copies that drifted apart;
  • duplicated or name-swapped instruction files;
  • instruction files sitting inside agent directories;
  • the Codex settings that matter.

Project mode prints:

  • the agent rule files;
  • design documents, including git-ignored design folders, with their non-goal and limitation sections, process logs, and compatibility, speculative, and fallback terms;
  • the other docs and code comments with the most hits;
  • code leads.

Text hits include internal labels that a file uses but never explains (label) and coined compound nouns (jargon).

Hits are leads. Confirm each one by reading the file. Without Node, walk the paths in references/locations.md by hand.

Step 2: Judge

Read references/patterns.md. Its test: keep a rule, sentence, or check when you can name what needs it, such as a user decision, an incident, a contract, a reachable failure, or a security or data-integrity need. Rewrite or remove the rest.

Agent audit. Use references/locations.md and check:

  1. Global instructions and their imports. Look for rules that produce the style: lists of checks to report as unverified, "does not authorize" boilerplate, "proof boundaries", copied constants, and duplicated prohibitions.
  2. Text loaded twice or by accident. Examples:

    • a home-level AGENTS.md next to CLAUDE.md or GEMINI.md;
    • a copy written by an import feature with agent names swapped;
    • an AGENTS.md left in an archive or backup inside an agent directory.

    Name which tool loads which file.

  3. Open channels. Import and sync settings, shared skill directories, and hooks copied from another agent will bring the pollution back. For example, a Codex hook that runs git-ai checkpoint claude records Codex's edits as Claude's. Propose closing or correcting each one.
  4. Memory. Distill memories imported from Codex, or written in its task-log format, with references/memory.md.

    For Codex-managed memory, check which sources the active session actually uses. The scanner inventories both ~/.codex/memories_v2/ and the older ~/.codex/memories/; files on disk may be inactive. Preserve user preferences, source pointers and generated files. When the user explicitly requests a memory correction, use the correction mechanism supported by the active host. Treat wording problems with a scoped correction; keep memory loading settings intact.

  5. Skills. Look for Codex-only tool names inside other agents' skills, proof-boundary boilerplate, and copies that drifted apart. A skill installed from a package (~/.agents/skills, plugin directories) belongs to its publisher: report it, and edit a local copy only if the user accepts the drift.
  6. Daily reporting rules. Inspect recognized configuration and read custom wording the scanner does not recognize. Detection describes files on disk; establish actual loading from session evidence when it matters.
    • Reuse rules already merged into global instructions. For custom wording, install only the audit skill with npx github:Natsuki-Kaede/purify-codex install --skill-only.
    • Where rules are needed, propose using the template once in the agent's global instructions. The installer preserves user-maintained references and recognized inline rules; it updates its own marked blocks.
  7. Repositories. When the current repository's CLAUDE.md or GEMINI.md only imports AGENTS.md, recommend a project audit.
  8. Account-level text. Claude app preferences, styles, and project instructions; Cursor User Rules; and ChatGPT custom instructions are not on disk. Ask for them at the end of the report.

Repository audit. Follow references/project-audit.md, and judge design documents with references/design-audit.md.

Step 3: Report

Report only findings you confirmed against the source, and drop hits that did not hold.

Group the findings, and within each group sort them by area (agent rules, design documents, docs, code by module). Give them stable IDs, such as A1 or B3:

  • A, apply directly: edits that keep the behavior. This covers rule rewrites with the same meaning, dead code, duplicates, and comments.
  • B, your decision: anything that changes behavior, configuration, or what gets loaded. This covers new files, settings, deleted rules, status codes, and UI.
  • K, keep: leads that look like pollution but are contracts or needed; at most about five lines, one each with the reason.

Each finding gives its location, what it is, the evidence, and the proposed change. B findings also state the impact. The location is file:line, a file plus a key for configuration, or a path that is missing.

Open with the main conclusion. Close by saying once how the audit ran and what you need from the user.

Save long reports outside tracked files, such as a git-ignored docs folder or a scratch directory, and give the path. Copy only the excerpts you need from private or credential directories.

Write the report using the applicable global reporting rules. Use the bundled PURIFY.md as a template for gaps, preserving the user's decisions.

Step 4: Apply what the user picks

  • Back up first. Before editing files outside a git repository, archive every file you will touch into a timestamped directory, and give its path.
  • Repositories. Work on an isolated branch or worktree, keep unrelated changes, and commit only when asked.
  • Files owned by a team, a package, or another tool. Prepare a patch for the user.
  • Memory. Follow references/memory.md, then re-run the scanner and compare the counts.
  • Code. Run the project's required checks, and report which ran and their results.
  • Instruction files. These load at session start, so tell the user once that new sessions pick up the change.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.