agentleFS
githubnextgithubnext/rig/AGENTS.md

rig

AGENTS.md14 starsChanged 20 days agoMITView on GitHub

Rig is a minimal TypeScript agent harness. The core runtime (skills/rig/rig.ts) provides declarative agent construction with typed input/output shapes, prompt intents, and a Copilot SDK runtime. All imports use the "rig" path alias (resolved via tsconfig paths + vitest alias). copilotEngine is exported directly from rig for client construction.

  • 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 31,774 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

Show its rules and text

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

13 rules. About 0 are common, 3 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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:

    All imports use the "rig" path alias (resolved via tsconfig paths + vitest alias).

    line 20
  2. Very specific:

    Keep the core (skills/rig/rig.ts) self-contained.

    line 36
  3. Very specific:

    Use node: prefix for Node.js built-in imports

    line 38
  4. Very specific:

    Use small as the model identifier in examples, tests, and defaults

    line 41
  5. Distinctive:

    Do not add legacy compatibility bridges.

    line 42
  6. Very specific:

    Treat skills/rig/SKILL.md as prompt context: keep only high-frequency construction rules, decisions, and a minimal canonical example.

    line 46
  7. Very specific:

    Put detailed API tables, edge cases, provider behavior, and scenario-specific patterns in focused files under skills/rig/.

    line 48
  8. Distinctive:

    Prefer one representative example, decision tables, and checklists over repeated prose.

    line 50
  9. Very specific:

    Keep each fact canonical. A compact rule may be summarized in SKILL.md, but its examples and edge cases should live in one reference file.

    line 51
  10. Very specific:

    Add new material to SKILL.md only when it changes how most Rig programs should be generated.

    line 52
  11. Very specific:

    When the API changes, update the affected reference and then audit SKILL.md, README.md, and samples for stale summaries or links.

    line 53
  12. Very specific:

    Before finishing documentation changes, verify relative links and compare wc -l -w -c skills/rig/*.md with the previous version.

    line 54
  13. Distinctive:

    All unit tests must pass before committing

    line 61

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

Project Overview

Rig is a minimal TypeScript agent harness. The core runtime (skills/rig/rig.ts) provides declarative agent construction with typed input/output shapes, prompt intents, and a Copilot SDK runtime.

Architecture

skills/rig/rig.ts      — Core runtime (agent, p, copilotEngine, schemas)
skills/rig/samples/    — Markdown sample programs; see skills/rig/samples.md for pattern buckets and task families
src/samples/           — TypeScript examples and provider integration fixtures
skills/rig/ — Focused documentation loaded on demand from SKILL.md
src/engines/copilot.test.ts — Copilot engine unit tests (vitest)
src/rig.test.ts        — Unit tests (vitest)
scripts/run-sample.test.ts — Sample runner with a stub Copilot SDK client (dry-run)
skills/rig/SKILL.md    — Compact skill entry point and reference router

All imports use the "rig" path alias (resolved via tsconfig paths + vitest alias). copilotEngine is exported directly from rig for client construction.

Commands

TaskCommand
Typechecknpm run typecheck
Unit testsnpm test
Run samples (stub)npm run sample
Refresh sample catalognpm run sample:catalog
Check catalog and duplicate programsnpm run sample:check
Run single sample (stub)RIG_SAMPLE=02 npm run sample
Run a sample for realecho "<input>" | node skills/rig/rig.ts <program-file> (npm run sample:run)

Code Style

  • Keep the core (skills/rig/rig.ts) self-contained; @github/copilot-sdk is imported directly in skills/rig/rig.ts
  • Minimal comments; code should be self-explanatory
  • Use node: prefix for Node.js built-in imports
  • Types are colocated with the module that defines them, not in separate .d.ts files
  • Trailing underscore on object keys (key_) means optional field
  • Use small as the model identifier in examples, tests, and defaults
  • Do not add legacy compatibility bridges; update callers, samples, and docs to the current API

Skill Documentation

  • Treat skills/rig/SKILL.md as prompt context: keep only high-frequency construction rules, decisions, and a minimal canonical example.
  • Target roughly 200 lines or fewer. Use line/word/byte counts as regression signals, not as a reason to compress prose until it is unclear.
  • Put detailed API tables, edge cases, provider behavior, and scenario-specific patterns in focused files under skills/rig/.
  • Route every reference from SKILL.md with a short “read when” description so an agent can load only the relevant secondary context.
  • Prefer one representative example, decision tables, and checklists over repeated prose. Remove duplication before adding guidance.
  • Keep each fact canonical. A compact rule may be summarized in SKILL.md, but its examples and edge cases should live in one reference file.
  • Add new material to SKILL.md only when it changes how most Rig programs should be generated; otherwise update or add a focused reference.
  • When the API changes, update the affected reference and then audit SKILL.md, README.md, and samples for stale summaries or links.
  • Before finishing documentation changes, verify relative links and compare wc -l -w -c skills/rig/*.md with the previous version.

Testing

  • Framework: vitest
  • Tests live in src/rig.test.ts (agent definition, invocation, validation, and prompt intent coverage)
  • Stub the Copilot SDK client with vi.mock("@github/copilot-sdk", ...)
  • All unit tests must pass before committing
  • Samples run via a stub Copilot SDK client that synthesizes shape-conforming output from the prompt's <output_schema> block

Key Concepts

  • Schema helpers (s.*): s.string, s.number, s.boolean, s.unknown, s.array, s.object, s.record, s.enum, s.optional. Schemas are always built with s.*; there is no shape-descriptor promotion.
  • Prompt intents (p.*): p.bash(cmd), p.read(path), p.write(path, content) — declarative placeholders resolved into prompt instructions, not executed in-process
  • Prompts: p\...`template tag composes instructions with inlinep.*` helpers
  • Runtime transport: Copilot SDK sessions are created by the harness; use launcher --server to switch to stdio transport.
  • Repair: built-in addon re-prompts on parse/validation failure up to maxTurns, and other addons can still steer retry prompts.

Sample guide

  • skills/rig/samples.md — generated inventory with pattern buckets, topic clusters, and task families. Retired sample replacements are tracked separately in skills/rig/sample-retirements.json. Run npm run sample:catalog after adding/removing samples; npm run sample:check rejects stale inventory and exact duplicates within a format. Review the nearest family before adding a new lesson.
  • 20-issue-reproducer.ts — chained diagnosis, fix planning, and review
  • 36-subagent-delegation.ts — focused-agent delegation
  • 47-prompt-intents.ts — prompt intent primitives
  • 50-end-to-end-release-agent.ts — end-to-end release workflow orchestration

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.