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.
- CLAUDE.mdCLAUDE.md
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
- Distinctive: line 14
Use these prefixes exactly:
- Distinctive: line 23
Do not use SlashCommand to call other commands.
- Very specific: line 24
Do not invoke other skills for KB context.
- Distinctive: line 33
Treat this as an execution directive, not as descriptive text.
- Distinctive: line 37
When Codex agents spawn subagents in this repo:
- Distinctive: line 39
Do not assume a subagent failed just because it does not answer quickly.
- Distinctive: line 40
Use longer wait windows for artifact-producing or workflow-heavy subagents.
- Distinctive: line 41
Prefer waiting for the spawned subagent to complete before declaring it stalled or rerouting around it, unless the user explicitly wants …
- Distinctive: line 42
Check for expected side effects such as artifact files before concluding the subagent is stuck.
- Distinctive: line 43
If the subagent is on the critical path, babysit it with patient polling instead of replacing it after a short timeout.
- Very specific: line 49
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 …
- Distinctive: line 114
When referencing KB or work paths in prompts, use the resolved directory variables, not literal paths:
- Very specific: line 125
When emitting artifact_registered events via rp1 agent-tools emit, artifact paths must follow these rules:
- Very specific: line 127
Always include
storageRootexplicitly: Do not rely on implicit defaults. - Distinctive: line 136
Use XML tags when a command spawns subagents, passes multiline content, or needs strongly delimited instructions.
- Distinctive: line 137
Use inline positional parameters for simple single-agent delegation.
- Very specific: line 141
All invocable prompts use the canonical SKILL.md format.
- Very specific: line 143
If a skill executes shell commands, add allowed-tools in frontmatter.
- Very specific: line 149
Add Bash(printf *) only when the skill actually needs it.
- Very specific: line 159
Read plugins/base/skills/artifact-templates/SKILL.md -- scan the Template Index table for the matching producer and artifact name.
- Very specific: line 160
Read the template file at the path listed in the index -- it contains YAML frontmatter with routing metadata (scope, path_pattern, …
- Distinctive: line 186
Follow graph transitions exactly.
- Very specific: line 213
Prefer Bun and its ecosystem for new code.
- Distinctive: line 214
Keep the single-executable CLI build in mind when adding assets or runtime files.
- Very specific: line 215
Use fp-ts pragmatically; prefer clear match, map, flatMap, and isLeft flows over overengineered abstractions.
- Distinctive: line 220
When making commits, stage only the intended changes and verify the worktree state before committing.
- Very specific: line 221
Use Conventional Commits for every commit message: <type>(<optional-scope>): <imperative summary>.
- Very specific: line 222
Prefer scopes when they add clarity, such as feat(web-ui): move notifications into dedicated sidebar or docs(agent): require conventional …
- Very specific: line 223
Do not use vague commit messages like updates, fix stuff, or wip for final commits.
- Distinctive: line 229
Verify namespace prefixes are correct.
- Distinctive: line 230
Keep agent prompts concise and non-redundant.
- Distinctive: line 231
Ensure cross-plugin calls handle missing dependencies.
- Very specific: line 232
Update relevant docs in docs/ when behavior changes.
- Very specific: line 233
Run just to inspect available test, lint, and format commands when code changes require validation.
- Very specific: line 237
If uv, bun, or npm package installs fail unexpectedly for network-related reasons, there may be environment-specific handling that applies.
- Distinctive: line 262
Always read index.md first.
- Distinctive: line 275
Only suggest when there is a clear match to the user's current activity.
≈ “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.
Files
rp1 Agent Authoring Guide
This file is intentionally narrow. Use it for agent and skill authoring rules that are specific to rp1.
- Read
.rp1/context/index.mdfirst. - 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-namefor Claude Code,subagent_type: @rp1-dev/agent-namefor 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-baseskill (such asrp1-base:artifact-templates) and it is unavailable, tell the user to installrp1-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
storageRootexplicitly. 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(notwork/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):
- Read
plugins/base/skills/artifact-templates/SKILL.md-- scan the Template Index table for the matching producer and artifact name. - 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:
--workflowmust be the bare skill directory name (or agent filename) that owns the state machine --build, notrp1-dev:build. The loader resolves the value verbatim toplugins/<plugin>/skills/<workflow>/SKILL.md, thenplugins/<plugin>/agents/<workflow>.md. A mismatch fails withstate machine for '<workflow>' not found, which reads like a missing diagram rather than a wrong name.- State IDs must match the
--stepvalues sent torp1 agent-tools emit. --run-idis mandatory for state-machine-enabled skills and agents.--unitenables 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; forartifact_registeredthe 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:failedfeature-verifier:verifying,feature-verifier:completed,feature-verifier:failedtask-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, andisLeftflows over overengineered abstractions. - For frontend work in
cli/web-ui/, usefrontend-designandplaywright-cli; runjust serve-web-uibefore browser validation and use/tmpfor 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 sidebarordocs(agent): require conventional commits. - Do not use vague commit messages like
updates,fix stuff, orwipfor 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
justto 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:
- Always read index.md first.
- 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... | Use | Reason |
| Concept, not files/keywords | 1up search | Semantic search needs no vocabulary |
| Symbol/keyword name | 1up symbol -r or grep | Literal match = precise, low noise |
| Keyword, need ALL instances | grep | Guaranteed-complete, best signal:noise |
| Nothing (new codebase) | 1up search | Works 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 searchFlags: --format plain|json|human (default: plain), -v/-vv.
Workflow
search— explore by meaning/intentsymbol— known or partial name lookupcontext— read scope at file:lineimpact— dependency/blast-radius analysisstructural— 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 -->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
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.

