DuDuClaw
AGENTS.md51 starsChanged 31 days agoApache-2.0View on GitHub
This file is loaded into every Codex session, so it stays short (target under 12 KB). It repeats the rules from CLAUDE.md that apply to code changes; when you change one of these sections, change it in both files. For anything not covered here, open the named file and read only the section you need. Owner instruction, 2026-10-03: 「每次有新功能與修復時都開分支」. It outranks every other workflow rule in this file. These conventions exist to prevent classes of bugs surfaced by the 2026-06…
- 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,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
We split this AGENTS.md into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 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.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Before starting a feature or a fix, create a branch from the latest origin/main (feat/…, fix/…, docs/…, chore/…).
- Distinctive: line 21
When another session is using the main checkout, work in a separate git worktree instead of switching branches there.
- Distinctive: line 22
When several open PRs touch the same files, merge them in the order the owner gives.
- Very specific: line 31
Every spawn that hands an employee's .mcp.json to a CLI goes through the spawn gate.
- Very specific: line 33
Write honest "not verified" notes.
- Very specific: line 47
Every document (.md, design notes, reports, specs) MUST be filed by TYPE × CONFIDENTIALITY.
- Very specific: line 88
Update docs/README.md (the public index) whenever a docs/ file is added, moved, or removed.
≈ “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
DuDuClaw Project Guidelines (Codex)
This file is loaded into every Codex session, so it stays short (target under 12 KB).
It repeats the rules from CLAUDE.md that apply to code changes; when you change one of
these sections, change it in both files. For anything not covered here, open the named
file and read only the section you need.
- Architecture map (crates, subsystems, where things live):
CLAUDE.md, section "Architecture map". - Current release state and deprecation policy:
CLAUDE.md, section "Current state". - UI and brand rules (dashboard work only):
CLAUDE.md, section "Design Context". - What shipped in which version:
CHANGELOG.md. - Per-subsystem history (file paths, config keys, known gaps):
wiki/duduclaw-kb/architecture/subsystem-reference.md. - Developer notes per release batch:
wiki/duduclaw-kb/architecture/release-implementation-notes.md.
Highest directive: every new feature and every fix gets its own branch
Owner instruction, 2026-10-03: 「每次有新功能與修復時都開分支」. It outranks every other workflow rule in this file.
- Before starting a feature or a fix, create a branch from the latest
origin/main(feat/…,fix/…,docs/…,chore/…). Feature and fix commits never go onmaindirectly. - The change reaches
mainthrough a pull request.mainrequires four checks on a PR merge: Rust ubuntu-latest, Dashboard, Python, Security Audit (cargo audit, required since 2026-10-08). The ECC Tools app comments on PRs (security evidence, risk taxonomy and other audits); its results are advisory and not required checks. - When another session is using the main checkout, work in a separate
git worktreeinstead of switching branches there. - When several open PRs touch the same files, merge them in the order the owner gives; the later one rebases.
- Release lanes:
minor/majorrequire the full signed delivery review;hotfix(deprecated alias:patch) auto-signs five unchanged delivery items and publishes all channels. Hotfix fixes and bump PRs use owner admin merge afterRust ubuntu-latestsucceeds. - Opening a branch is not permission to merge or release. Merging a PR and cutting a release stay the owner's decision.
Cross-cutting rules
- A gate that cannot read its config, its file or its identity denies. Validate the artifact that takes effect, not the proposal.
- New settings and arguments may only narrow what an employee can do unless the owner decided otherwise;
allownever removes a name-list gate. - Anything an employee can list it can call, and anything it cannot call is not listed.
- Every spawn that hands an employee's
.mcp.jsonto a CLI goes through the spawn gate; employees never write MCP or CLI config files. - Facts that need the live gateway (
ApprovalBroker, sessions, rotator) stay in the gateway; the separatemcp-serverprocess reaches them through signed loopback routes or the shared databases. - Write honest "not verified" notes. Live tests use an isolated home (
scripts/live-test/make-home.sh,mcp-probe.sh) with a production-shaped employee (wildcardmcp__duduclaw__*allowlist). - PR Rust CI runs on Linux; main pushes, nightly and manual runs test Linux, macOS and Windows as real legs. The release preflight blocks minor/major on missing or red native platform results and warns for hotfix. Discovery and computer-use workspaces are Unix-only by design.
Coding Conventions (security-relevant, from 2026-06 deep review)
These conventions exist to prevent classes of bugs surfaced by the 2026-06 whole-project review. Shared helpers live in duduclaw-core.
- Never slice strings by raw byte index.
&s[..n]panics whennlands mid-char on multi-byte UTF-8 (any CJK/emoji input). Useduduclaw_core::truncate_bytes(s, max_bytes)(byte budget, walks back to a char boundary) ortruncate_chars(s, max_chars)(codepoint count). Applies to every channel/log snippet and id prefix. - No unanchored
contains/starts_withfor security or routing decisions. Substring checks lethttp://localhost.evil.compass alocalhostallowlist and the keywordhimatch insidethis. Useduduclaw_core::origin_host_matches(origin, &allowed)for Origin/CORS allowlists andword_contains_ci(haystack, needle)for keyword matching; use exact/token equality for id routing. - Cross-process file appends must hold an advisory lock. Shared JSONL (
bus_queue.jsonl, audit logs) is appended by both the Rust gateway and Python adapters; records overPIPE_BUFinterleave and corrupt lines. Wrap the write induduclaw_core::with_file_lock(path, || …). - Security gates fail closed. Missing config, a detection error, or an unenumerated tool/method must DENY, never fall through to allow. MCP authorization is enumerated explicitly; any tool not in the scope table defaults to requiring Admin scope. Validate the artifact that actually takes effect (the written
patch.content, the final screenshot), not just the proposal/narrative.
Documentation Classification & Placement (from 2026-06-20 doc reorg)
Every document (.md, design notes, reports, specs) MUST be filed by TYPE × CONFIDENTIALITY. When creating or moving a doc, pick the matching cell below — do not drop loose files at a tree root, and never co-locate a higher-confidentiality doc inside a lower-confidentiality tree.
Confidentiality tiers (3 levels)
| Tier | Meaning | Git state | Lives in |
| L1 Public | Product / developer docs intended for the public repo, website, npm/PyPI README | Committed, externally published | root README*.md, CHANGELOG.md, ARCHITECTURE.md, SECURITY.md, LICENSING.md, docs/, templates/, marketing/press-kit/ |
| L2 Internal | Dev/ops material — committed but not product-facing | Committed (visible to repo collaborators), not polished docs | wiki/ (knowledge base + reports), team/, ISSUES.md, marketing/{blog,social-templates,threads-drafts}/ |
| L3 Confidential | Commercial plans, competitive analysis, pricing, research notes, secrets, build output | gitignored — never committed to the public repo | commercial/ (own nested git), research/, artifacts/, .env*, anything under a secret manager |
Hard rule: L3 lives ONLY in gitignored trees. Before committing, confirm no commercial/, research/, pricing, or secret content is staged. commercial/ and research/ are in .gitignore; if git ls-files <tree> ever returns rows, untrack them with git rm --cached -r <tree> (files stay on disk).
Type taxonomy → canonical home
L1 Public — docs/ only (one subdir per type, never loose at docs/ root):
docs/architecture/— system architecture & engine design (overview.md,evolution-engine.md)docs/rfc/— Request-for-Comments proposals (RFC-NN-*.md, plus their operator guides)docs/adr/— Architecture Decision Records (ADR-NNN-*.md)docs/todo/— public planning / tracking (TODO-*.md)docs/spec/— open format specs (SOUL.md, CONTRACT.toml, JSON Schema)docs/features/— feature deep-dives (+ja-JP/,zh-TW/translations)docs/guides/— user & developer how-tos (deployment, development, docker, MCP tools)docs/api/— protocol / OpenAPI reference
L2 Internal — operational, under wiki/ (single report home) + team/:
wiki/reports/tl-daily/<YYYY-MM-DD>.md— daily reports (date-only filename; neverdaily-report-*and never indocs/,reports/, orartifacts/)wiki/reports/skill-pipeline/<YYYY-MM>/,wiki/reports/memory-quality/<YYYY-MM>/— automated pipeline/eval outputswiki/sprint-reports/,wiki/pm/— sprint logs & PM trackingwiki/duduclaw-kb/{architecture,decisions,specs,drafts,w19,sprint-n}/— internal knowledge basewiki/{eval,impl,research}/— evaluation sets, implementation notes, internal design feedbackteam/— team roster & role docs
L3 Confidential — gitignored trees (do NOT add to docs/ or wiki/):
commercial/docs/— business plans, pricing, competitive analysis, SI methodology, commercial design docs (e.g. PTY-pool design, runtime TODOs)research/— AI paper / repo research notes (auto-mirrored to the shared wiki at runtime)artifacts/— build output (tarballs, generated bundles)
When in doubt
- Is it secret / commercial / competitive / a research note? → L3 gitignored tree. Stop.
- Is it a daily/sprint/eval/PM report or internal KB? → L2 under
wiki/(reports →wiki/reports/…). - Is it polished product/dev documentation safe to publish? → L1 under the matching
docs/<type>/subdir. - Update
docs/README.md(the public index) whenever adocs/file is added, moved, or removed; update in-repo links (READMEs,CLAUDE.md, code comments,CONTRACT.toml) in the same commit.
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.

