agentleFS
rx-chenxiangrx-chenxiang/monorepo-workflow/AGENTS.md

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…

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
  1. Distinctive:

    Use Simplified Chinese for maintainer-facing explanations unless the user explicitly asks for another language.

    line 9
  2. Distinctive:

    Keep code identifiers in the language and style already used by the target project.

    line 10
  3. Distinctive:

    Add clear Chinese comments for generated project files when comments are useful.

    line 11
  4. Distinctive:

    Keep changes small, readable, and aligned with KISS and SOLID principles.

    line 12
  5. Distinctive:

    If the target project, target app, or intended behavior is ambiguous, ask one concise clarification before changing code.

    line 13
  6. Distinctive:

    Do not rewrite unrelated files, shared components, or global configuration unless the task explicitly requires it.

    line 14
  7. Distinctive:

    After implementation, perform a basic self-check and document what was verified.

    line 15
  8. Very specific:

    Use the root registry and .codex/rules/project-routing.mdc before making changes.

    line 34
  9. Very specific:

    When the user only says "frontend" and the target client cannot be inferred from paths or prior context, ask whether the target is …

    line 44
  10. Distinctive:

    Before coding in a project, read in this order:

    line 67
  11. Distinctive:

    Do not invent module documentation paths.

    line 77
  12. Distinctive:

    Prefer existing project conventions over new abstractions.

    line 81
  13. Distinctive:

    Keep the implementation inside the matched project unless the task explicitly requires multi-client changes.

    line 82
  14. Very specific:

    Treat .codex/ as the source of truth for rules and agents.

    line 114
  15. Very specific:

    Run scripts/sync-codex-to-cursor.sh after changing .codex/README.md, .codex/rules/, or .codex/agents/.

    line 115
  16. Very specific:

    Keep README.md and README.zh-CN.md aligned when changing public-facing project behavior.

    line 116
  17. Distinctive:

    Keep module templates under all four project docs directories aligned in structure and intent.

    line 117
  18. Very specific:

    When adding third-party Skills, scripts, or assets, preserve their license and update THIRD_PARTY_NOTICES.md.

    line 118

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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

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

  1. Use Simplified Chinese for maintainer-facing explanations unless the user explicitly asks for another language.
  2. Keep code identifiers in the language and style already used by the target project.
  3. Add clear Chinese comments for generated project files when comments are useful.
  4. Keep changes small, readable, and aligned with KISS and SOLID principles.
  5. If the target project, target app, or intended behavior is ambiguous, ask one concise clarification before changing code.
  6. Do not rewrite unrelated files, shared components, or global configuration unless the task explicitly requires it.
  7. 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 IDDirectoryRole
apiapi/Backend API
fornt_adminfornt_admin/Admin dashboard frontend
m_frontm_front/Mobile / H5 portal frontend
pc_forntpc_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 IntentTarget 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:

  1. Root AGENTS.md.
  2. .codex/rules/project-routing.mdc.
  3. The matched workflow under .codex/rules/.
  4. {project}/AGENTS.md, if present.
  5. {project}/docs/README.md.
  6. {project}/docs/modules/README.md.
  7. 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

  1. Prefer existing project conventions over new abstractions.
  2. Keep the implementation inside the matched project unless the task explicitly requires multi-client changes.
  3. Frontend clients must use the real backend contract from api/; do not add mock-only behavior for integration work.
  4. Backend changes must preserve existing request validation, authentication, error handling, and response contracts unless a breaking change is explicitly requested.
  5. Frontend changes must cover loading, empty, error, permission, and responsive states when relevant.
  6. 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

PurposePath
Public overviewREADME.md
Chinese overviewREADME.zh-CN.md
Codex configuration source.codex/
Cursor mirror.cursor/
Codex-to-Cursor sync scriptscripts/sync-codex-to-cursor.sh
Repository pull configurationrepos.conf
Repository pull scriptpull_repos.sh
Integration agreement templatedocs/general/workspace/联调约定.md
Public documentation indexdocs/README.md
Open-source release checklistdocs/guides/open-source-release-checklist.md
Contribution and security policiesCONTRIBUTING.md, SECURITY.md, CODE_OF_CONDUCT.md
License and third-party noticesLICENSE, THIRD_PARTY_NOTICES.md
Baseline CI.github/workflows/ci.yml

Maintenance Notes

  1. Treat .codex/ as the source of truth for rules and agents.
  2. Run scripts/sync-codex-to-cursor.sh after changing .codex/README.md, .codex/rules/, or .codex/agents/.
  3. Keep README.md and README.zh-CN.md aligned when changing public-facing project behavior.
  4. Keep module templates under all four project docs directories aligned in structure and intent.
  5. 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与贡献者说明四端工作区、路由规则、文档结构和维护策略 -->

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.