monorepo-workflow
AGENTS.md1 starsChanged 4 months agoMITView on GitHub
This file is the shared operating guide for AI coding agents and human contributors working in this repository. It defines the workspace layout, routing rules, documentation expectations, and safe-change boundaries for the monorepo workflow template. This repository is a generic full-stack, multi-client workspace template. The starter registry coordinates one backend and three frontend clients: The directory names fornt_admin and pc_fornt are intentionally preserved for compatibility with the current template. Agents should also recognize the aliases front_admin and pc_front when interpreting…
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 33,398 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 repository15 other files it gives its agents.
- api/AGENTS.mdAGENTS.md
- fornt_admin/AGENTS.mdAGENTS.md
- m_front/AGENTS.mdAGENTS.md
- pc_fornt/AGENTS.mdAGENTS.md
- .cursor/rules/api-first-no-mock.mdcCursor rule
- .cursor/rules/code-review.mdCursor rule
- .cursor/rules/multi-project-workspace.mdcCursor rule
- .cursor/rules/project-routing.mdcCursor rule
- .cursor/rules/project-workflow-api.mdcCursor rule
- .cursor/rules/project-workflow-front.mdcCursor rule
- .cursor/rules/project-workflow-product.mdcCursor rule
- .cursor/rules/project-workflow-test.mdcCursor rule
- .cursor/rules/project-workflow-ui.mdcCursor rule
- .cursor/rules/security.mdCursor rule
- .cursor/rules/subdir-rule-priority.mdcCursor rule
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
18 rules. About 0 are common, 12 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Use Simplified Chinese for maintainer-facing explanations unless the user explicitly asks for another language.
- Distinctive: line 10
Keep code identifiers in the language and style already used by the target project.
- Distinctive: line 11
Add clear Chinese comments for generated project files when comments are useful.
- Distinctive: line 12
Keep changes small, readable, and aligned with KISS and SOLID principles.
- Distinctive: line 13
If the target project, target app, or intended behavior is ambiguous, ask one concise clarification before changing code.
- Distinctive: line 14
Do not rewrite unrelated files, shared components, or global configuration unless the task explicitly requires it.
- Distinctive: line 15
After implementation, perform a basic self-check and document what was verified.
- Very specific: line 34
Use the root registry and .codex/rules/project-routing.mdc before making changes.
- Very specific: line 44
When the user only says "frontend" and the target client cannot be inferred from paths or prior context, ask whether the target is …
- Distinctive: line 67
Before coding in a project, read in this order:
- Distinctive: line 77
Do not invent module documentation paths.
- Distinctive: line 81
Prefer existing project conventions over new abstractions.
- Distinctive: line 82
Keep the implementation inside the matched project unless the task explicitly requires multi-client changes.
- Very specific: line 114
Treat .codex/ as the source of truth for rules and agents.
- Very specific: line 115
Run scripts/sync-codex-to-cursor.sh after changing .codex/README.md, .codex/rules/, or .codex/agents/.
- Very specific: line 116
Keep README.md and README.zh-CN.md aligned when changing public-facing project behavior.
- Distinctive: line 117
Keep module templates under all four project docs directories aligned in structure and intent.
- Very specific: line 118
When adding third-party Skills, scripts, or assets, preserve their license and update THIRD_PARTY_NOTICES.md.
≈ “Common” is an estimate: at least 1 in 5 of the 43,423 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
Agents Guide
Current File Purpose
This file is the shared operating guide for AI coding agents and human contributors working in this repository. It defines the workspace layout, routing rules, documentation expectations, and safe-change boundaries for the monorepo workflow template.
Language And Communication
- Use Simplified Chinese for maintainer-facing explanations unless the user explicitly asks for another language.
- Keep code identifiers in the language and style already used by the target project.
- Add clear Chinese comments for generated project files when comments are useful.
- Keep changes small, readable, and aligned with KISS and SOLID principles.
- If the target project, target app, or intended behavior is ambiguous, ask one concise clarification before changing code.
- Do not rewrite unrelated files, shared components, or global configuration unless the task explicitly requires it.
- After implementation, perform a basic self-check and document what was verified.
Workspace Model
This repository is a generic full-stack, multi-client workspace template. The starter registry coordinates one backend and three frontend clients:
| Project ID | Directory | Role |
api | api/ | Backend API |
fornt_admin | fornt_admin/ | Admin dashboard frontend |
m_front | m_front/ | Mobile / H5 portal frontend |
pc_fornt | pc_fornt/ | PC website frontend |
The directory names fornt_admin and pc_fornt are intentionally preserved for compatibility with the current template. Agents should also recognize the aliases front_admin and pc_front when interpreting user intent.
This four-project registry is the default topology, not the workspace limit. Maintainers may add project groups, services, clients, internal tools, or other repositories by extending the root registry, routing rules, repos.conf, and the new project's AGENTS.md and documentation indexes together.
Routing Rules
Use the root registry and .codex/rules/project-routing.mdc before making changes.
| User Intent | Target Scope |
full stack, all, general, multi-client, 四端, 全栈 | api + fornt_admin + m_front + pc_fornt |
backend, API, server, 接口, 后端 | api/ |
admin, dashboard, 管理平台, 管理后台 | fornt_admin/ |
mobile, H5, portal, 门户端, 移动端 | m_front/ |
website, PC site, 官网, PC前端 | pc_fornt/ |
When the user only says "frontend" and the target client cannot be inferred from paths or prior context, ask whether the target is fornt_admin, m_front, or pc_fornt.
Documentation Layout
Workspace-level requirement and design documents live under:
docs/general/{feature-name}/
├── 需求文档/
├── 技术设计方案/
└── coding-plan/Long-lived implementation knowledge lives inside each project directory:
{project}/docs/
├── README.md
├── modules/
├── codebase/
└── rules/Before coding in a project, read in this order:
- Root
AGENTS.md. .codex/rules/project-routing.mdc.- The matched workflow under
.codex/rules/. {project}/AGENTS.md, if present.{project}/docs/README.md.{project}/docs/modules/README.md.- Related files under
{project}/docs/codebase/or{project}/docs/rules/.
Do not invent module documentation paths. Use the actual links and indexes that exist in the target project.
Development Rules
- Prefer existing project conventions over new abstractions.
- Keep the implementation inside the matched project unless the task explicitly requires multi-client changes.
- Frontend clients must use the real backend contract from
api/; do not add mock-only behavior for integration work. - Backend changes must preserve existing request validation, authentication, error handling, and response contracts unless a breaking change is explicitly requested.
- Frontend changes must cover loading, empty, error, permission, and responsive states when relevant.
- For multi-client tasks, report changes by project: backend, admin, mobile portal, PC website, and integration verification.
Version-Control Policy
The root repository tracks workflow assets, agent rules, documentation templates, and project docs. Real application source code in api/, fornt_admin/, m_front, and pc_fornt may be managed by separate repositories.
The root .gitignore intentionally keeps each project's AGENTS.md and docs/ templates trackable while ignoring unregistered application source files by default.
Important Files
| Purpose | Path |
| Public overview | README.md |
| Chinese overview | README.zh-CN.md |
| Codex configuration source | .codex/ |
| Cursor mirror | .cursor/ |
| Codex-to-Cursor sync script | scripts/sync-codex-to-cursor.sh |
| Repository pull configuration | repos.conf |
| Repository pull script | pull_repos.sh |
| Integration agreement template | docs/general/workspace/联调约定.md |
| Public documentation index | docs/README.md |
| Open-source release checklist | docs/guides/open-source-release-checklist.md |
| Contribution and security policies | CONTRIBUTING.md, SECURITY.md, CODE_OF_CONDUCT.md |
| License and third-party notices | LICENSE, THIRD_PARTY_NOTICES.md |
| Baseline CI | .github/workflows/ci.yml |
Maintenance Notes
- Treat
.codex/as the source of truth for rules and agents. - Run
scripts/sync-codex-to-cursor.shafter changing.codex/README.md,.codex/rules/, or.codex/agents/. - Keep
README.mdandREADME.zh-CN.mdaligned when changing public-facing project behavior. - Keep module templates under all four project docs directories aligned in structure and intent.
- When adding third-party Skills, scripts, or assets, preserve their license and update
THIRD_PARTY_NOTICES.md.
<!-- AIGC:cursor|author:沉香|lines:约130|dates:2026-07|功能说明:重写开源版AGENTS指南,面向AI Agent与贡献者说明四端工作区、路由规则、文档结构和维护策略 -->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.

