Adolf is a fork/vendored clone of github.com/openclaw/openclaw (v2026.6.11), free to diverge. Tree copied sans upstream .git; upstream remote added for future syncs. Node pinned to 24 (.nvmrc); engines already require >=22.19. Preserves docs/ARCHITECTURE.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LeqyaxJF2nbRXJtae2kNB2
8.5 KiB
AGENT and CONTRIBUTING Principles
This reference consolidates the core rules for agent-policy and contributor-governance docs.
You must:
- Discover repo-level and nested instruction files with:
rg --files -g 'AGENTS.md' -g 'CONTRIBUTING.md' -g 'CLAUDE.md' -g 'AGENT.md' -g '.cursor/rules/*' -g '.cursorrules' -g '.agent/**' -g '.agents/**' -g '.pi/**' -g 'AGENTS.*.md' - Read the root and nearest-scope
AGENTS.md/CONTRIBUTING.mdpair before editing. - If alias files exist, normalize to one canonical source (
AGENTS.mdpreferred when present; otherwise nearest alias), plus compatibility pointers or explicit symlink notes. - Document conflicting instructions and precedence decisions.
GitHub + AGENTS baseline
Source: https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/setting-guidelines-for-repository-contributors Source: https://agents.md/ Source: https://github.blog/ai-and-ml/github-copilot/how-to-write-a-great-agents-md-lessons-from-over-2500-repositories/ Source: https://cobusgreyling.substack.com/p/what-is-agentsmd Source: https://www.infoq.com/news/2025/08/agents-md/
Use these as default operating principles:
- Keep
CONTRIBUTING.mddiscoverable and actionable (.github, root, ordocs). - Keep agent instructions concrete: real commands, real paths, clear boundaries.
- Use explicit behavior boundaries for agents:
Always,Ask first,Never. - Keep contributor and agent rules aligned with actual repository workflows.
- Ensure clear guidance is provided to agents on if, when and how to raise issues and pull requests.
Canonical and alias policy
Source: https://agents.md/ Source: https://github.blog/ai-and-ml/github-copilot/how-to-write-a-great-agents-md-lessons-from-over-2500-repositories/
- Treat
AGENTS.mdas canonical when present. - If
AGENTS.mdis absent, treat the nearest alias file as canonical. - Keep compatibility surfaces explicit:
AGENTS.md,AGENT.md,.cursorrules,.cursor/rules/*,.agent/,.agents/,.pi/. - If aliases are used, document how they map back to canonical policy (or symlink when supported).
- When repos use
.agents/as canonical rule storage, keep.cursoras a compatibility symlink to.agentsfor Cursor rule auto-loading. - Keep policy DRY: store one shared policy core and expose it via aliases/symlinks instead of duplicating rule text.
Context-awareness by agent platform
Source: https://github.com/vercel-labs/agent-skills/blob/main/AGENTS.md Source: https://github.com/openai/codex/blob/main/AGENTS.md
- For Cursor and Claude-style glob consumers, keep rule files narrow and bounded.
- Avoid over-referencing large path sets that inflate context for glob-based agents.
- For Codex-style workflows, prefer explicit file references and deterministic commands.
- Keep long runbooks outside top-level policy files; link to scoped docs.
- Ensure all agents have a happy path regardless so ensuring everything works across Codex, Claude and other coding agents.
Symlink and compatibility operations
- Preferred layout for multi-agent compatibility:
- canonical rule directory:
.agents/ - Cursor compatibility path:
.cursor -> .agentssymlink - canonical policy doc:
AGENTS.mdpointing to.agentspaths where relevant
- canonical rule directory:
- Validate symlink state before finalizing changes:
- if
.agents/exists and.cursoris missing, create.cursorsymlink to.agents - if
.cursoris a symlink to another target, fix target or document why it must differ - if
.cursoris a real directory/file, treat as migration conflict and ask before replacement
- if
- Validate rule payload through the canonical directory:
- rules:
.agents/rules/*.mdcwith valid frontmatter (description,globs,alwaysApplyas needed) - commands:
.agents/commands/*.mdwhen command routing is used - MCP config:
.agents/mcp.jsonwhen MCP is in scope
- rules:
- Keep Codex behavior explicit:
AGENTS.mdis primary for Codex repository instructions.cursorcompatibility is for Cursor auto-loading and does not replace canonical AGENTS policy
- Record applied symlink fixes and unresolved compatibility gaps in validation notes.
Dual-mode and deliverable standards
Source: https://github.blog/ai-and-ml/github-copilot/how-to-write-a-great-agents-md-lessons-from-over-2500-repositories/ Source: https://agents.md/ Source: https://github.com/openai/codex/blob/main/AGENTS.md Source: https://github.com/vercel-labs/agent-skills/blob/main/AGENTS.md
- Author one shared policy core (same commands, boundaries, and precedence) for all agents.
- For Cursor/Claude-style agents, expose that core through glob-driven and bounded files (small
AGENTS.md/rule surface). - For Codex, expose that same core through explicit file references with precise scope.
- Where styles diverge, prefer the smallest common structure that satisfies both and avoid duplicating policy text.
- Treat AGENTS/CONTRIBUTING as first-class deliverables when in scope.
- Preserve required structure, constraints, and examples from existing files.
- Align wording and commands with active repository instructions.
Proactive issue discovery and remediation
Source: https://github.blog/ai-and-ml/github-copilot/how-to-write-a-great-agents-md-lessons-from-over-2500-repositories/ Source: https://github.com/openai/codex/blob/main/AGENTS.md Source: https://github.com/vercel-labs/agent-skills/blob/main/AGENTS.md
- Run a conflict matrix review across AGENTS/aliases/CONTRIBUTING and related command/rule docs before finalizing.
- Treat the following as high-priority defects: missing referenced files, non-existent setup commands, command scope mismatches, and branch/commit policy conflicts.
- Do not stop at caveat-only notes when a low-risk fix is clear; apply the fix in the same pass.
- If a canonical entry file is missing (for example a directory
README.mdthat docs depend on), create a minimal actionable file and update references. - Long-running investigations are acceptable when needed to uncover cross-file drift, especially in agent-instruction ecosystems.
Discovery
- Agents prefer simple terminal commands so having a well defined
make *ornpm run *is ideal - Agents can discover terminal commands through shell completion so providing shell completion helps
CONTRIBUTING size and scope control
Source: https://contributing.md/how-to-build-contributing-md/ Source: https://blog.codacy.com/best-practices-to-manage-an-open-source-project Source: https://mozillascience.github.io/working-open-workshop/contributing/ Source: https://github.com/openclaw/openclaw/blob/main/CONTRIBUTING.md
- Keep root
CONTRIBUTING.mdfocused on setup, issue flow, PR flow, testing, and review gates. - Use issue/PR template links instead of embedding every process detail inline.
- When the file grows too large, split by domain and link from root.
- Move any large content into docs if avalible (for example Mintlify/Fern/Sphinx workflows) to avoid large contributor guide.
- Optimize for agent/machine readability as well as humans.
Example repos to emulate
Source: https://github.com/openclaw/openclaw/blob/main/AGENTS.md Source: https://github.com/openclaw/openclaw/blob/main/CONTRIBUTING.md Source: https://github.com/openclaw/openclaw/blob/main/VISION.md Source: https://github.com/openai/codex/blob/main/AGENTS.md Source: https://github.com/processing/p5.js/blob/main/AGENTS.md Source: https://github.com/vercel-labs/agent-skills/blob/main/AGENTS.md Source: https://github.com/agentsmd/agents.md/blob/main/AGENTS.md Source: https://github.com/rails/rails/blob/main/CONTRIBUTING.md Source: https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md Source: https://github.com/atom/atom/blob/master/CONTRIBUTING.md Source: https://github.com/github/docs/blob/main/CONTRIBUTING.md Source: https://github.com/facebook/react/blob/main/CONTRIBUTING.md
- OpenClaw: strong real-world alias policy and AGENTS/CONTRIBUTING/VISION cohesion.
- OpenAI Codex: strict command discipline and explicit scope control.
- p5.js: explicit AI-policy guardrails in agent instructions.
- Vercel + agentsmd spec: compact, context-efficient AGENTS patterns.
- Rails/Kubernetes/Atom/GitHub Docs/React: contributor guidance patterns at different project scales.
Practical merge policy
When these rules conflict:
- Preserve contributor and reader task success first.
- Preserve instruction clarity and unambiguous boundaries second.
- Preserve long-term maintainability and context-efficiency third.
- Add extra agent optimization only if it does not reduce human clarity or there is explict need.
- Use your judgement as the expert.