agentleFS
quocldquocld/hephaestus-agent-skills/skills/knowledge-placement/SKILL.md

knowledge-placement

Skill8 starsChanged 12 days agoMITView on GitHub

Use before editing AGENTS.md or CLAUDE.md, before creating or editing a skill, or when asked to "remember this for the project", "add a rule", "thêm rule", "viết skill".

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 11 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Put each fact at the first tier that fits, not the most convenient one.

    line 12
  2. Distinctive:

    Add a one-line pointer to AGENTS.md only if an always-loaded rule must name the skill.

    line 26
  3. Distinctive:

    When changing a contract, edit the owner's existing wording, then grep for references and fix them.

    line 40
  4. Distinctive:

    Keep behind only what must survive with no skill loaded: the trigger to load the skill and any safety-critical fact.

    line 44
  5. Distinctive:

    Never add "unless it matters" clauses.

    line 59
  6. Distinctive:

    Test before shipping, red then green, with the same 3-5 scenarios on both sides and one fresh subagent per side.

    line 62
  7. Distinctive:

    Use them, update that file in the same change as the skill, and create it the first time you run red/green for a skill that has none.

    line 64
  8. Very specific:

    When editing an existing skill, first snapshot it (cp -r skills/<name> <scratchpad>/<name>-old) and run red against the snapshot, so red …

    line 67
  9. Distinctive:

    If it already behaves, there is nothing to write.

    line 68
  10. Distinctive:

    Every edit that changes an instruction gets at least the green run.

    line 71
  11. Distinctive:

    Keep 2-3 near-miss phrases with the scenarios: requests that share keywords with the description but need something else.

    line 73
  12. Very specific:

    If the runs keep writing the same helper script, bundle it in the skill's scripts/ and point the steps at it.

    line 75
  13. Distinctive:

    Prefer rewriting or pruning existing lines over appending new ones.

    line 83

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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

knowledge-placement

AGENTS.md is paid for by every session, every time. A skill is paid for only by sessions that load it. Put each fact at the first tier that fits, not the most convenient one.

Decision tree (stop at the first yes)

  1. Is it mechanically checkable on every tool call (a banned character, a banned command, a protected branch)? -> A Claude Code hook: its script in this repo's hooks/ folder, registered in hooks/hooks.json (the plugin's registration, never ~/.claude/settings.json), with cases added to hooks/test.sh. The prose keeps one line naming the hook, so an agent knows why a call was blocked; prose alone gets skipped under pressure. A hook is a guard, so it needs the mounted-and-fails test from AGENTS.md.
  2. Is it a rule about code in one project that a diff can be checked against (a migration needs a backfill, no raw SQL in handlers)? -> A project check in that project's .agents/checks/, per verify-loop section 4, which runs it before every PR/MR.
  3. Does an agent need it on almost every session to operate? -> AGENTS.md, inline, a line or two.
  4. Is it needed only in a nameable situation (a deploy, a migration, a release, a specific workflow)? -> A skill whose description states that trigger. Add a one-line pointer to AGENTS.md only if an always-loaded rule must name the skill.
  5. Is it product, setup, or user reference? -> README or user-facing docs.
  6. Is it architecture a maintainer needs (ownership, boundaries, extension points, rationale)? -> Architecture docs.
  7. Is it exact mechanics (flags, commands, paths)? -> The script's header comment and its --help, not prose elsewhere.
  8. Is it task evidence (chronology, failed hypotheses, temp paths, delivery proof)? -> The PR description, Jira ticket, or a handoff note; distill any durable fact into its real owner first.

One-owner rule

  • State every contract (format, state machine, procedure) in full exactly once.
  • Everywhere else, use a one-line cross-reference, never a restatement; copies drift.
  • When changing a contract, edit the owner's existing wording, then grep for references and fix them.

Moving content out of AGENTS.md

  • Keep behind only what must survive with no skill loaded: the trigger to load the skill and any safety-critical fact.
  • Move everything else out completely; no partial "just in case" copies.

Writing or editing a skill

  • A skill nothing loads is dead weight; keep one workflow per skill.
  • The description says only when to load the skill, never what it does or how: start with "Use when" or "Use before", list the situations, symptoms, and phrases the user types (in every language they use), in the third person, under about 500 characters. A description that summarizes the workflow gets followed instead of the body.
  • The body opens with one or two lines on why the skill exists, then the steps. Refer to other skills by name (root-cause), never by @ path, which force-loads the file.
  • Pick the form from the failure you observed:
    • A rule skipped under pressure: a plain prohibition plus the excuses it closes.
    • Output in the wrong shape: a recipe saying what the output is, part by part, in order.
    • A required part left out: a required slot in the template the agent fills in.
    • Behavior that depends on a condition: a conditional on something observable. Never add "unless it matters" clauses; state a real exception as its own conditional.
  • What a script or schema can check gets the script or schema, not prose.
  • Exact flags and long references go in a references/ file or a script's --help; call bundled scripts through their interpreter (bash scripts/x.sh), since packagers can drop executable bits.
  • Test before shipping, red then green, with the same 3-5 scenarios on both sides and one fresh subagent per side; never a swarm for a skill test. In this plugin repo, the scenarios, near misses, and reader-test questions live in evals/<skill>.md (format and run prompts: evals/README.md); elsewhere, keep them in an evals.md beside the skill's SKILL.md. Use them, update that file in the same change as the skill, and create it the first time you run red/green for a skill that has none. The run results go in the PR/MR body, never in the repo.
    1. Red: give a fresh subagent realistic scenarios that tempt the failure, without the skill, and record what it does. When editing an existing skill, first snapshot it (cp -r skills/<name> <scratchpad>/<name>-old) and run red against the snapshot, so red compares old against new. If it already behaves, there is nothing to write.
    2. Green: run the same scenarios with the skill in one fresh subagent whose prompt also asks it to hunt contradictions, unfollowable steps, and gaps, and to answer the reader-test questions when they apply. Fix and rerun at most 3 green iterations, then report the remaining gaps instead of looping. Every edit that changes an instruction gets at least the green run. An edit that changes no instruction (a typo, a link fix, a trim whose diff shows no rule changed) needs no run.
  • Keep 2-3 near-miss phrases with the scenarios: requests that share keywords with the description but need something else; the skill must not load for them.
  • Judge from the subagent's transcript or reasoning, not only its final answer; a right answer reached by skipping a step is a failure.
  • If the runs keep writing the same helper script, bundle it in the skill's scripts/ and point the steps at it.
  • A green on a weak check is worse than none: when a scenario was trivially satisfied, or the old version passes it too, say so and replace it in evals/<skill>.md.
  • For a document agents read (AGENTS.md, a project-init block, a skill body), add a reader test: 3-5 questions a future agent would need answered from the document alone, folded into the green subagent's prompt, or given to one fresh subagent when there is no green run; fix the document until every answer is correct, within the same 3-iteration cap.

Style for tracked Markdown

  • One full sentence per line.
  • Plain dash "-", never an em dash.
  • Prefer rewriting or pruning existing lines over appending new ones.

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.