agentleFS
calven-aicalven-ai/demoverse/AGENTS.md

demoverse

AGENTS.md6 starsChanged 4 months agoMITView on GitHub

Demoverse is operated by a coding agent. The deterministic TypeScript engine does the mechanical work; the agent does the judgment and the prose. This file is the contract for that handoff, for any agent tool (Claude Code, Codex, Cursor, Copilot, …): Part 1 is the engine contract and the core loop, Part 2 takes a new user from a fresh clone to a living world, Part 3 has per-tool notes. The engine owns everything structural: ledger I/O, ids and referential…

  • Reads credentials
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 35,040 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 repository4 other files it gives its agents.

The file

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

12 rules. About 0 are common, 2 are distinctive, and 10 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.

  • 10

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Plan: Run npm run pipeline for one living increment on demand (it equals npm run apply -- --weeks=1).

    line 31
  2. Very specific:

    Ingest: Run npm run apply -- --ingest --reconcile.

    line 53
  3. Very specific:

    Verify: Run npm run lint. Fix any error findings by editing the result and re-ingesting.

    line 58
  4. Distinctive:

    Use only the given facts: Never invent competitors, contacts, or companies.

    line 66
  5. Very specific:

    #competitive questions: write only the human question, never an answer.

    line 75
  6. Distinctive:

    All output is clearly-fabricated demo data.

    line 87
  7. Very specific:

    Every command is idempotent and supports --dry-run.

    line 128
  8. Very specific:

    Step 0 · Preflight: Verify node -v ≥ 20 and npm ci has run.

    line 153
  9. Very specific:

    Step 3 · Validate: Run npm run init. Zod validation errors name the file and the key.

    line 185
  10. Very specific:

    Step 4 · First light: Run npm run apply -- --weeks=1 --dry-run and show the user the plan ("would create N opps, plan K artifacts").

    line 188
  11. Very specific:

    If the user declines, print the manual routine instead: npm run pipeline → fill → npm run apply -- --ingest --reconcile → npm run lint → …

    line 214
  12. Very specific:

    Never write result prose in the main context.

    line 231

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

AGENTS.md: how a coding agent drives Demoverse

Demoverse is operated by a coding agent. The deterministic TypeScript engine does the mechanical work; the agent does the judgment and the prose. This file is the contract for that handoff, for any agent tool (Claude Code, Codex, Cursor, Copilot, …): Part 1 is the engine contract and the core loop, Part 2 takes a new user from a fresh clone to a living world, Part 3 has per-tool notes.


Part 1: The engine contract

The split (don't cross it)

The engine owns everything structural: ledger I/O, ids and referential integrity, the simulation clock and trends, sampling accounts, contacts, deals and competitors, schema validation, the coherence lint, reports, and reconcile into CRM, Drive and Slack. You own two things: writing the prose for each emitted request, and, when the operator sets new direction, updating state/directives.md + state/trends.json. You never hand-edit state/world.json.

The generation-request protocol (the core loop)

By default this loop runs unattended: .github/workflows/pipeline-update.yml runs steps 1-4 weekly through Claude Code, then reconciles and commits itself (see docs/automation.md). Run it by hand for an extra week, a nudge, or a repo without Actions.

  1. Plan. Run npm run pipeline for one living increment on demand (it equals npm run apply -- --weeks=1). Plain npm run apply generates only the periods the real calendar has produced, and -- --backfill covers the first big run. The engine advances the world: a couple of new deals, each open deal moved along its own cycle (usually one stage, more for a short deal, none at all for one that has gone quiet), closes for the deals whose cycle is up. Then it writes a request bundle holding only the touch points those events earned, 1–3 per deal. Never a deal's whole history; that is what --backfill-touchpoints is for.
    state/requests/<periodIndex>/manifest.json        # index of all requests
    state/requests/<periodIndex>/<artifactId>.prompt.md
    state/requests/<periodIndex>/results/             # ← you write here
  2. Fill. Each .prompt.md is fully grounded in the exact ledger facts. For every request in manifest.json, read the prompt and write the result:
    • output: markdown → write results/<artifactId>.md (the artifact body).
    • output: slack_messages → write results/<artifactId>.json as {"messages":[{"personaHandle":"…","text":"…"}, …]}.
    • output: email_thread → write results/<artifactId>.json as {"emails":[{"from":"…","to":["…"],"subject":"…","body":"…","date":"YYYY-MM-DD","contactRef":"…"}, …]} (one object per message, in send order).
  3. Ingest. Run npm run apply -- --ingest --reconcile. The engine validates each result, files markdown into state/content/, attaches Slack messages and email threads onto their artifacts, and reconciles into every connector that is enabled and has credentials. Anything that fails validation stays planned and reappears in the next bundle. Refill it and re-ingest.
  4. Verify. Run npm run lint. Fix any error findings by editing the result and re-ingesting. The cause is usually a missing competitor name or win/loss reason in the prose.

Rules for filling requests (non-negotiable)

The prompt carries GROUNDING RULES. Honor them exactly. In short:

  • Use only the given facts. Never invent competitors, contacts, or companies.
  • Cross-system consistency. A deal's transcript, win-loss artifact, and Slack thread must name the same competitor(s) and the same win/loss reason recorded on the deal. The linter checks this.
  • The primary use case is the dominant theme. It is what the buyer came for, what discovery digs into, what gets demoed, what the objections are about. Other capabilities stay secondary.
  • none-mode deals: the #win-loss post is the sole win/loss signal. Make it carry the whole story (outcome + reason + competitors).
  • #competitive questions: write only the human question, never an answer. Answering is the job of whatever product consumes this data.
  • Detail levels come from the prompt (low/medium/high): interviews are long and conversational, surveys are terse, transcripts are medium.
  • The VARIETY block is part of the grounding contract. Deal prompts carry a seeded per-deal texture (backstory, buyer tone, objections, timeline), a per-artifact shape, and a banned-phrase list. Write from them; they are what keeps hundreds of deals from telling the same story. (Story banks live in config/prose.yaml; Slack persona voice cards in config/slack-personas.yaml.)
  • No em dashes in the artifact body. Rewrite the sentence instead. They are the loudest tell that a corpus was machine-written, and npm run lint warns on every one it finds. Fix with --refill=<artifactId> and a rewritten line.
  • All output is clearly-fabricated demo data. Never reference real people.

Detail-layer backfill contract (bulk filling of existing deals)

The living increment adds 1–3 touch points per deal per week (0 for a stalled deal that period, and a fast-track deal may end its whole life with 2). The one-time historical seed instead fills a deal's whole sales cycle. Per opportunity:

  1. npm run apply -- --next=N lists the next opps needing work: untouched, or planned:K for planted-but-unfilled, which is resumable.
  2. Per opp: npm run apply -- --backfill-touchpoints --opp=<id> (idempotent). Capture the manifest immediately; the next plant overwrites it.
  3. Fill via ONE dedicated agent context per opportunity, never batched (Claude Code: the opp-filler subagent, Part 3).
  4. npm run apply -- --ingest --opp=<id> → fix invalid → npm run lint -- --opp=<id> → fix errors via --refill=<artifactId> + a scoped re-fill → npm run apply -- --ingest --reconcile --opp=<id> → commit "detail layer: <id> (<Account>)".

--refill is the sanctioned way to regenerate a bad result, since you never hand-edit world.json. It refuses once the artifact has external records, because regenerating would duplicate them.

Setting direction (Tier 2 / Tier 3)

  • Tier 3 nudge (one period, not remembered): pass it at trigger time, as in npm run apply -- --nudge="2× losses to Pricing this week". The engine echoes how it resolved it.
  • Tier 2 directive (durable): append an entry under ## Active in state/directives.md, and materialize it in state/trends.json. Examples:
    • "ramp velocity" → raise volume.newOppsPerWeek; note it in directiveEffects.
    • "Competitor A is getting tougher" → set competitors.<name>.driftPerQuarter positive; drop the winRate trend.
    • "buyers are starting to talk about X" → add a voice.arcs entry (label, category pain|job|buying_trigger|gain, says, dated [date, weight] points); voice.gainShare steers gains vs pains. Amending = move the entry to ## Superseded and adjust from that date forward.

Ergonomics you can rely on

  • Every command is idempotent and supports --dry-run. Output is machine-readable enough to branch on (counts, filled/pending/invalid).
  • npm run lint exits non-zero on coherence errors, so it is safe to gate a commit on. Scope it with lint -- --opp=<id>. lint -- --repetition is a warn-only repeated-phrase detector; promote persistent offenders into banned_phrases in config/prose.yaml.
  • Nothing external is touched unless a connector is enabled in config/connectors.yaml and its credentials are present. Otherwise you get a clean, labeled skip.
  • Only cohort members reach external systems (state/cohort.json, ~50 curated deals). Never widen the cohort to "push everything".
  • apply -- --next=N prints a read-only queue of opps still needing a detail layer.
  • Fills parallelize freely, since they write distinct result files. apply/lint runs must stay serial, because state/world.json is written whole (last-writer-wins).

Part 2: The onboarding playbook (fresh clone → living world)

Claude Code users: run /setup, which executes exactly this. Any other agent: when the user asks to get started, follow these steps in order, checking off what already exists (every step is resumable).

Step 0 · Preflight. Verify node -v ≥ 20 and npm ci has run. If config/world.yaml already exists, ask whether to amend or start over. Never silently overwrite a configured world.

Step 1 · Interview the user. Demoverse ships templates, not a canned company, so the user's fictional company is invented here. Ask one topic at a time, and offer to invent plausible details from a one-line seed idea ("a devtools SaaS selling error monitoring") whenever the user shrugs:

  1. The company: name, colloquial short name, a .example domain (or one they own), a one-line product description, category.
  2. Product surface: 2–4 product domains/modules, each with named capabilities ("agents"/features) and the pain each solves.
  3. Market: 3–5 competitors, invented by default. Real vendor names are allowed if the user explicitly wants them (point them at DISCLAIMER.md: fabricated outcomes about real companies stay in their private systems). Industries served, company sizes, regions.
  4. Sales motion: typical deal size band (derive pricing tiers), team size (generate a fictional manager/AE roster), rough win rate, dominant loss reasons.
  5. Buying group: propose the template personas (Champion, Economic Buyer, Technical Buyer, User, Influencer); ask which roles matter and typical titles in their market.
  6. Prose texture: the shipped prose.yaml works as-is. Offer to tailor the narrative angles and objection themes to the invented product (recommended).

Step 2 · Write the config. Copy each file from config/templates/ to config/ and fill it from the interview. Keep every schema key; replace placeholders. Then show the user a one-screen summary (company, modules, competitors, segments, team, pricing) and get an explicit confirm before proceeding.

Step 3 · Validate. Run npm run init. Zod validation errors name the file and the key. Fix the config (or re-ask the user) and re-run until clean.

Step 4 · First light. Run npm run apply -- --weeks=1 --dry-run and show the user the plan ("would create N opps, plan K artifacts"). Then run npm run pipeline for real, open one generated state/requests/<n>/<artifactId>.prompt.md, and fill it as the hello-world. Ingest with npm run apply -- --ingest, run npm run lint, and show the result. The world now exists, entirely locally, with zero credentials.

Step 5 · Connectors (optional, one at a time). For each system the user wants (Salesforce / Google Drive / Slack / HubSpot): follow the matching guide in docs/connectors/, write the credentials into .env, flip enabled: true in config/connectors.yaml, and verify with the cheapest real call before declaring success (Salesforce: a scoped apply -- --ingest --reconcile --opp=<one-cohort-id> --dry-run then real; Drive/Slack: reconcile and confirm the file/post appears). Remind the user: isolated, dedicated orgs and workspaces only.

Step 6 · Commit. git add -A && git commit -m "demoverse: initial world for <Company>".

Step 7 · Automate (recommended). Offer to make the weekly run hands-off per docs/automation.md: push to a private GitHub repo, create the automation environment restricted to main, and set a Claude credential plus each enabled connector's values as environment secrets. The user enters secret values themselves (gh secret set <NAME> --env automation prompts for them); never echo or store them. Verify with one manual run (gh workflow run pipeline-update.yml, then gh run watch) and git pull. If the user declines, print the manual routine instead: npm run pipeline → fill → npm run apply -- --ingest --reconcile → npm run lint → commit.


Part 3: Per-tool notes

Claude Code (v2.1.277 or later reads this file directly). Skills in .claude/skills/:

SkillWhat it runs
/setupPart 2, end to end
/pipeline-update [weeks]The weekly increment: advance → fill → ingest → lint → fix → reconcile → commit. Also runs unattended every Sunday from .github/workflows/pipeline-update.yml (steps 1-4; the workflow reconciles and commits; docs/automation.md)
/backfill-opps [N]The detail-layer loop for N opportunities, one commit per opp. For a bulk backfill run /loop /backfill-opps 5 until npm run apply -- --next=1 prints (no opportunities need a detail layer)
/import-hubspotProvision the HubSpot schema, import the CRM structure into the dedicated test account, verify record by record

Never write result prose in the main context. Every fill goes through the opp-filler subagent (.claude/agents/opp-filler.md, Read/Write/Glob only), one per opportunity; the main context runs only apply, lint and git, serially. If a subagent hits a session limit, relaunch it for the remaining artifacts of that same deal.

Codex / Cursor / other AGENTS.md-aware tools: this file is the whole contract. Mirror the subagent rule by hand: fill one opportunity per session/task, keep apply/lint serial, and commit per opportunity during backfills.

No agent at all: the engine runs, but nothing writes the prose, so artifacts stay empty until a model does. The prompts in state/requests/ are self-contained briefs a human can fill for a handful of artifacts, not a world. The realistic path is your own filler script: docs/request-protocol.md specifies the result formats for any generator you point at a model API.

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.