agentleFS
rp1-runrp1-run/rp1/AGENTS.md

rp1

AGENTS.md38 starsChanged 12 months agoApache-2.0View on GitHub

This file is intentionally narrow. Use it for agent and skill authoring rules that are specific to rp1. Project understanding belongs in .rp1/context/. This file covers runtime and authoring constraints. Use these prefixes exactly: Subagents generally cannot spawn other agents. If an agent is designed to run as a subagent: For Codex agents, interpret any instruction in the form Task: <sub-agent-name> as: Treat this as an execution directive, not as descriptive text. When Codex agents spawn subagents in this repo:

  • 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,337 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 repositoryOne other file it gives its agents.

The file

Show its rules and text

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

37 rules. About 0 are common, 20 are distinctive, and 17 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈20

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 17

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use these prefixes exactly:

    line 14
  2. Distinctive:

    Do not use SlashCommand to call other commands.

    line 23
  3. Very specific:

    Do not invoke other skills for KB context.

    line 24
  4. Distinctive:

    Treat this as an execution directive, not as descriptive text.

    line 33
  5. Distinctive:

    When Codex agents spawn subagents in this repo:

    line 37
  6. Distinctive:

    Do not assume a subagent failed just because it does not answer quickly.

    line 39
  7. Distinctive:

    Use longer wait windows for artifact-producing or workflow-heavy subagents.

    line 40
  8. Distinctive:

    Prefer waiting for the spawned subagent to complete before declaring it stalled or rerouting around it, unless the user explicitly wants …

    line 41
  9. Distinctive:

    Check for expected side effects such as artifact files before concluding the subagent is stuck.

    line 42
  10. Distinctive:

    If the subagent is on the critical path, babysit it with patient polling instead of replacing it after a short timeout.

    line 43
  11. Very specific:

    If a dev workflow depends on an rp1-base skill (such as rp1-base:artifact-templates) and it is unavailable, tell the user to install …

    line 49
  12. Distinctive:

    When referencing KB or work paths in prompts, use the resolved directory variables, not literal paths:

    line 114
  13. Very specific:

    When emitting artifact_registered events via rp1 agent-tools emit, artifact paths must follow these rules:

    line 125
  14. Very specific:

    Always include storageRoot explicitly: Do not rely on implicit defaults.

    line 127
  15. Distinctive:

    Use XML tags when a command spawns subagents, passes multiline content, or needs strongly delimited instructions.

    line 136
  16. Distinctive:

    Use inline positional parameters for simple single-agent delegation.

    line 137
  17. Very specific:

    All invocable prompts use the canonical SKILL.md format.

    line 141
  18. Very specific:

    If a skill executes shell commands, add allowed-tools in frontmatter.

    line 143
  19. Very specific:

    Add Bash(printf *) only when the skill actually needs it.

    line 149
  20. Very specific:

    Read plugins/base/skills/artifact-templates/SKILL.md -- scan the Template Index table for the matching producer and artifact name.

    line 159
  21. Very specific:

    Read the template file at the path listed in the index -- it contains YAML frontmatter with routing metadata (scope, path_pattern, …

    line 160
  22. Distinctive:

    Follow graph transitions exactly.

    line 186
  23. Very specific:

    Prefer Bun and its ecosystem for new code.

    line 213
  24. Distinctive:

    Keep the single-executable CLI build in mind when adding assets or runtime files.

    line 214
  25. Very specific:

    Use fp-ts pragmatically; prefer clear match, map, flatMap, and isLeft flows over overengineered abstractions.

    line 215
  26. Distinctive:

    When making commits, stage only the intended changes and verify the worktree state before committing.

    line 220
  27. Very specific:

    Use Conventional Commits for every commit message: <type>(<optional-scope>): <imperative summary>.

    line 221
  28. Very specific:

    Prefer scopes when they add clarity, such as feat(web-ui): move notifications into dedicated sidebar or docs(agent): require conventional …

    line 222
  29. Very specific:

    Do not use vague commit messages like updates, fix stuff, or wip for final commits.

    line 223
  30. Distinctive:

    Verify namespace prefixes are correct.

    line 229
  31. Distinctive:

    Keep agent prompts concise and non-redundant.

    line 230
  32. Distinctive:

    Ensure cross-plugin calls handle missing dependencies.

    line 231
  33. Very specific:

    Update relevant docs in docs/ when behavior changes.

    line 232
  34. Very specific:

    Run just to inspect available test, lint, and format commands when code changes require validation.

    line 233
  35. Very specific:

    If uv, bun, or npm package installs fail unexpectedly for network-related reasons, there may be environment-specific handling that applies.

    line 237
  36. Distinctive:

    Always read index.md first.

    line 262
  37. Distinctive:

    Only suggest when there is a clear match to the user's current activity.

    line 275

≈ “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

rp1 Agent Authoring Guide

This file is intentionally narrow. Use it for agent and skill authoring rules that are specific to rp1.

  1. Read .rp1/context/index.md first.
  2. Then load only the KB files needed for the task.

Project understanding belongs in .rp1/context/. This file covers runtime and authoring constraints.

Core Rules

Namespace prefixes

Use these prefixes exactly:

  • Skills: /rp1-base:skill-name, /rp1-dev:skill-name, /rp1-utils:skill-name
  • Agent references: subagent_type: rp1-base:agent-name for Claude Code, subagent_type: @rp1-dev/agent-name for OpenCode

Subagent limitations

Subagents generally cannot spawn other agents. If an agent is designed to run as a subagent:

  • Do not use SlashCommand to call other commands.
  • Do not invoke other skills for KB context; read KB files directly using the resolved {KB_ROOT} path (index.md first, then task-relevant files).
  • Inline only the prompt text or KB guidance the subagent actually needs.

Codex task shorthand

For Codex agents, interpret any instruction in the form Task: <sub-agent-name> as:

  • spawn <sub-agent-name>

Treat this as an execution directive, not as descriptive text.

Codex subagent waiting

When Codex agents spawn subagents in this repo:

  • Do not assume a subagent failed just because it does not answer quickly.
  • Use longer wait windows for artifact-producing or workflow-heavy subagents.
  • Prefer waiting for the spawned subagent to complete before declaring it stalled or rerouting around it, unless the user explicitly wants parallel speculative work.
  • Check for expected side effects such as artifact files before concluding the subagent is stuck.
  • If the subagent is on the critical path, babysit it with patient polling instead of replacing it after a short timeout.

Cross-plugin dependency rule

  • Dev agents may depend on base.
  • Base agents must not call dev commands.
  • If a dev workflow depends on an rp1-base skill (such as rp1-base:artifact-templates) and it is unavailable, tell the user to install rp1-base.

Parameters and templating

Argument style

Define parameters using structured arguments arrays in frontmatter. Skills nest arguments under metadata; agents place them at the top level.

Skills (metadata.arguments):

metadata:
  arguments:
    - name: FEATURE_ID
      type: string
      required: true
      description: "Feature identifier"
    - name: AFK
      type: boolean
      required: false
      default: false
      description: "Non-interactive mode"
      aliases:
        - "afk"
        - "no prompts"

Agents (top-level arguments):

arguments:
  - name: FEATURE_ID
    type: string
    required: true
    description: "Feature identifier"
  - name: CONTEXT
    type: string
    required: false
    description: "Optional context"

The build pipeline auto-derives the argument-hint string from these definitions. Do not write manual argument-hint strings or hand-written ## Parameters / ## 0. Parameters tables -- both trigger build errors.

Argument names use UPPER_SNAKE_CASE. Supported types: string, boolean, enum.

Canonical variable assignment

The build pipeline automatically injects a ## 0. Resolve Arguments section into every parameterized skill that declares metadata.arguments. This section calls rp1 agent-tools resolve-args --name rp1-{plugin}:{skill} to resolve both user-supplied arguments and environment variables, returning structured JSON. Skill authors do not write this section — it is generated from frontmatter.

Agents are excluded from this requirement -- they receive pre-resolved named parameters from parent skills and do not call resolve-args themselves.

Directory resolution

Project directories are resolved at runtime based on the active storage mode. The RP1_PROJECT_ROOT, RP1_KB_ROOT, and RP1_WORK_ROOT environment variables have been removed. Skills and agents should not declare them in environment schemas.

To discover project directories, use rp1 agent-tools rp1-root-dir which returns:

  • projectRoot -- the project root (directory containing .rp1/project_id)
  • kbRoot -- the knowledge base directory (respects active storage mode; defaults to <projectRoot>/.rp1/context)
  • workRoot -- the work artifacts directory (respects active storage mode; defaults to <projectRoot>/.rp1/work)

When referencing KB or work directories in agent and skill prompts, use the resolved variables {kbRoot} and {workRoot} (in skills) or {KB_ROOT} and {WORK_ROOT} (in agent arguments). Do not hardcode literal .rp1/context or .rp1/work paths -- these may not resolve correctly when a non-default storage mode is active.

Path interpolation

When referencing KB or work paths in prompts, use the resolved directory variables, not literal paths:

{kbRoot}/index.md
{workRoot}/features/{FEATURE_ID}/

Skills use {kbRoot} and {workRoot} from resolve-args output. Agents use {KB_ROOT} and {WORK_ROOT} from their declared arguments. Do not use ${} shell parameter expansion in Bash snippets intended for Claude Code.

Artifact Path Contract

When emitting artifact_registered events via rp1 agent-tools emit, artifact paths must follow these rules:

  • Always include storageRoot explicitly. Do not rely on implicit defaults.
  • Work artifacts (storageRoot: "work_dir"): Paths must be relative to the work root (.rp1/work/) without any prefix. Example: features/my-feature/design.md (not work/features/...).
  • KB artifacts (storageRoot: "project"): Paths must be relative to the project root. Example: .rp1/context/index.md.
  • Absolute paths: Used as-is regardless of storageRoot.

The system automatically resolves relative paths against the correct base directory based on storageRoot. Agents do not need to construct absolute paths manually.

XML tags vs inline parameters

  • Use XML tags when a command spawns subagents, passes multiline content, or needs strongly delimited instructions.
  • Use inline positional parameters for simple single-agent delegation.

Skill frontmatter

All invocable prompts use the canonical SKILL.md format.

If a skill executes shell commands, add allowed-tools in frontmatter. Default to:

allowed-tools: Bash(echo *), Bash(rp1 *)

Add Bash(printf *) only when the skill actually needs it.

allowed-tools is required on skills, not on agent files. Subagents inherit Bash permissions from the invoking skill.

Artifact templates

Agents that produce structured markdown artifacts (requirements, design docs, task lists, reports, KB files) must read the canonical template from the rp1-base:artifact-templates skill rather than embedding output formats inline. All 20 producer agents use this pattern.

Two-hop discovery flow (two Read calls):

  1. Read plugins/base/skills/artifact-templates/SKILL.md -- scan the Template Index table for the matching producer and artifact name.
  2. Read the template file at the path listed in the index -- it contains YAML frontmatter with routing metadata (scope, path_pattern, emit_hint) and the markdown body with placeholder patterns.

The agent fills placeholders ({FEATURE_ID}, {Date}, [Feature Title], etc.) and writes the artifact to the location specified by scope + path_pattern. If the template includes an emit_hint and the agent has no existing emit logic, use it to register the artifact via rp1 agent-tools emit.

Instruction variants

Choose the variant that matches the agent's output type:

Variant A -- Single-document producer (14 agents): Insert a "Template Loading" section before the output section. Remove inline template blocks. Retain content guidance (how to fill placeholders, conditional sections, business rules).

Variant B -- Multi-document producer (2 agents: feature-architect, feature-tasker): Same as Variant A but the instruction lists multiple template lookups, one per artifact. Each artifact gets its own template read instruction.

Variant C -- Section-type producer (3 agents: feature-editor, task-builder, task-reviewer): The instruction specifies the section template path from templates/_sections/ and explicitly states append semantics -- append to existing file, not create standalone document. The template type: section frontmatter reinforces this.

Variant D -- Format reference (1 agent: hypothesis-tester): The agent reads and updates existing documents, not creates them. The instruction reads the template for format verification while preserving the agent's append-findings workflow.

State machines

Skills and agents may opt into workflow state tracking by adding a ## STATE-MACHINE section with a stateDiagram-v2 Mermaid block.

Required rules:

  • --workflow must be the bare skill directory name (or agent filename) that owns the state machine -- build, not rp1-dev:build. The loader resolves the value verbatim to plugins/<plugin>/skills/<workflow>/SKILL.md, then plugins/<plugin>/agents/<workflow>.md. A mismatch fails with state machine for '<workflow>' not found, which reads like a missing diagram rather than a wrong name.
  • State IDs must match the --step values sent to rp1 agent-tools emit.
  • --run-id is mandatory for state-machine-enabled skills and agents.
  • --unit enables per-task tracking.
  • Follow graph transitions exactly; invalid steps are rejected with actionable error messages listing valid states and transitions.
  • Sub-agents emitting into a parent run must namespace their step names with the agent identifier and a colon separator to avoid collision with parent workflow states. This applies to status_change; for artifact_registered the step is a phase label that may match the parent's state.

Build lint L016 enforces the --run-id, storageRoot, and sub-agent step-namespacing rules against compiled output on every platform, so violating them fails the build rather than surfacing at runtime.

Sub-agent step namespacing

Sub-agents prefix --step values with {agent-name}: so their steps are distinguishable from parent workflow states and bypass parent state machine validation:

# Correct: namespaced sub-agent step
rp1 agent-tools emit --workflow build --step task-builder:building ...

# Wrong: bare step collides with parent workflow
rp1 agent-tools emit --workflow build --step building ...

Examples of correctly namespaced steps:

  • task-builder:building, task-builder:completed, task-builder:failed
  • feature-verifier:verifying, feature-verifier:completed, feature-verifier:failed
  • task-reviewer:reviewing, task-reviewer:completed, task-reviewer:failed

For the full pattern and command examples, see the STATE-MACHINE sections in the relevant agent and skill files.

Repo-specific development defaults

  • Prefer Bun and its ecosystem for new code. Fall back to Node.js only when Bun is not viable.
  • Keep the single-executable CLI build in mind when adding assets or runtime files.
  • Use fp-ts pragmatically; prefer clear match, map, flatMap, and isLeft flows over overengineered abstractions.
  • For frontend work in cli/web-ui/, use frontend-design and playwright-cli; run just serve-web-ui before browser validation and use /tmp for temporary screenshots.

Commit discipline

  • When making commits, stage only the intended changes and verify the worktree state before committing.
  • Use Conventional Commits for every commit message: <type>(<optional-scope>): <imperative summary>.
  • Prefer scopes when they add clarity, such as feat(web-ui): move notifications into dedicated sidebar or docs(agent): require conventional commits.
  • Do not use vague commit messages like updates, fix stuff, or wip for final commits.

Delivery checklist

After changes:

  • Verify namespace prefixes are correct.
  • Keep agent prompts concise and non-redundant.
  • Ensure cross-plugin calls handle missing dependencies.
  • Update relevant docs in docs/ when behavior changes.
  • Run just to inspect available test, lint, and format commands when code changes require validation.

Environment note

If uv, bun, or npm package installs fail unexpectedly for network-related reasons, there may be environment-specific handling that applies. Consult your memory / local environment notes for the relevant steps before retrying repeatedly or escalating to the user.

On a network that blocks registry.npmjs.org, bun install fails with IntegrityCheckFailed because the blocked-page HTML is fetched instead of the tarball. Override the registry for the shell rather than editing the committed bunfig.toml files, which must keep pointing at npmjs so the lockfiles stay installable for everyone else:

export BUN_CONFIG_REGISTRY=<your internal npm registry URL>

bun add then stamps that host onto every entry of the lockfile it touches. Run just normalize-lockfiles before committing; just check-no-artifactory runs on pre-commit and pre-push and fails on any lockfile that still carries an internal host.

<!-- rp1:start:v0.7.12 -->

rp1 Knowledge Base

Use Progressive Disclosure Pattern

Location: .rp1/context/

Files:

  • index.md (always load first)
  • architecture.md
  • modules.md
  • patterns.md
  • concept_map.md

Loading rules:

  1. Always read index.md first.
  2. Then load based on task type:
    • Code review: patterns.md
    • Bug investigation: architecture.md, modules.md
    • Feature work: modules.md, patterns.md
    • Strategic or system-wide analysis: all files

rp1 Skill Awareness

Installed plugins: rp1-base, rp1-dev. Run /guide to discover skills by task.

  • Suggest at most 1 skill per turn: name, one-line reason, offer to run.
  • Skip if the user declined this session or a workflow is already running.
  • Only suggest when there is a clear match to the user's current activity.
<!-- rp1:end:v0.7.12 --><!-- 1up:start:0.1.7 -->

1up — Agent Quick Reference

Tool Selection

Pick by what you know, not by habit:

You know...UseReason
Concept, not files/keywords1up searchSemantic search needs no vocabulary
Symbol/keyword name1up symbol -r or grepLiteral match = precise, low noise
Keyword, need ALL instancesgrepGuaranteed-complete, best signal:noise
Nothing (new codebase)1up searchWorks w/o prior knowledge

Sub-agents: Include this section in sub-agent prompts.

Setup

1up status before searching. Confirm index built + Last file check recent (~30s refresh). If not initialized: 1up start (macOS/Linux) or 1up init && 1up index ..

Commands

1up search "<query>" -n 5          # semantic + keyword hybrid
1up symbol <name> [-r]             # def lookup; -r = all references
1up context <file>:<line>          # enclosing scope at location
1up impact --from-symbol <name>    # blast radius from symbol
1up impact --from-file <path>      # blast radius from file
1up impact --from-segment <id>     # blast radius from segment
1up structural "<ts-query>"        # tree-sitter AST pattern search

Flags: --format plain|json|human (default: plain), -v/-vv.

Workflow

  1. search — explore by meaning/intent
  2. symbol — known or partial name lookup
  3. context — read scope at file:line
  4. impact — dependency/blast-radius analysis
  5. structural — AST-level pattern matching

Search-then-Verify

Semantic search ranks by relevance; may omit matches. Never conclude "only N callers" from search alone. Verify completeness w/ 1up symbol -r <name> or grep.

<!-- 1up:end:0.1.7 -->

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.