agentleFS
luksteilukstei/curtain/AGENTS.md

curtain

AGENTS.md2 starsChanged 2 months agoMITView on GitHub

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository3 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    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:

    Prefer snapshot testing instead of a list of assertions

    line 1
  2. Very specific:

    Always place runner state transitions and status mutations in src/transitions.ts

    line 2
  3. Very specific:

    Run npm run verify when completing a task (not after every intermediate edit)

    line 3
  4. Distinctive:

    Never add any backwards compatibility regarding the code, there is no external consumer of the code

    line 5

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md 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
AGENTS.md
  • Prefer snapshot testing instead of a list of assertions
  • Always place runner state transitions and status mutations in src/transitions.ts
  • Run npm run verify when completing a task (not after every intermediate edit)
  • For each edge case (a branch that goes against intuition or against what the function is supposed to do), add a concise comment: if the cause is internal (i.e. how we structure our code) use // smell: <reason>, otherwise // edge case: <reason>
  • Never add any backwards compatibility regarding the code, there is no external consumer of the code
  • Ignore dist/curtain.mjs and .agents/plugins/curtain/dist/curtain.mjs, these are automatically built from the source code
  • Only ever add optional or nulled types when it is really required, do not add them just to be defensive, because it leads to really ugly code. If you want to add an optional/nulled type, take a step back and think if you are handling separate exclusive states, where a discrimanted union is needed.
  • Reference implementations for cross-agent integrations:
    • Universal packaging & shims: ponytail (~/.gemini/config/plugins/ponytail/, analyzed in docs/PACKAGING.md)
    • Loop interception (Stop hook): ralph-loop (~/.claude/plugins/marketplaces/claude-plugins-official/plugins/ralph-loop/)
    • Skill discovery: superpowers (~/.claude/plugins/cache/claude-plugins-official/superpowers/4.3.0/)
    • Tool docs: Convert coding-agent session transcripts between harness formats: https://docs.rs/crate/txcript/latest/source/docs/formats/README.md

Source File Map (src/)

Root (src/)

  • cli.ts: Entry point for the CLI, parsing subcommands and flags.
  • transitions.ts: Pure state transition functions and status mutations for runner lifecycle.
  • state.ts: Reads, writes, and paths curtain-state.json on disk keyed by conversation ID.
  • types.ts: TypeScript interfaces for hook payloads, egress responses, and messages.

Subsystems

  • parser/: Generic Markdown AST tokenizer and block parser splitting playbooks by callout delimiters (> [!CURTAIN], > [!INTERMISSION]).
  • resolver/: Locates and loads script and skill files across workspace paths and harnesses.
  • handlers/index.ts: Deterministic hook dispatcher routing lifecycle events to pre or stop handlers.
  • handlers/pre.ts: Handles PreInvocation lifecycle hook, intercepting slash commands and user prompts.
  • handlers/stop.ts: Handles Stop lifecycle hook, auto-advancing, pausing at review curtains, and completing runs.
  • harnesses/: Adapters for agent environments (AGY, Claude Code, Codex, Copilot) normalizing ingress/egress.
  • lib/assertNever.ts: Exhaustiveness checking helper for union types.
  • lib/logDebug.ts: File-based debug logger active when debug flags are set.
  • lib/parseCommand.ts: Extracts and parses runner slash commands from text inputs.
  • shim/runtime-shim.ts: Entry point for agent hook execution, detecting the harness and dispatching to handlers.
  • shim/stdin.ts: Reads and parses JSON payloads from standard input with timeout handling.

Tests (tests/)

  • test-utils.ts: Test utilities for path stripping and snapshot normalization across environments.
  • replay.test.ts: End-to-end transcript replay integration tests.
  • fixtures/: Recorded transcript logs and shared snapshot fixtures.

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.