refactor: 梳理规则体系并统一记忆与部署流程
This commit is contained in:
@@ -1,62 +1,38 @@
|
||||
# Project AGENTS Router
|
||||
|
||||
Root `AGENTS.md` is a navigation and global-constraint layer only.
|
||||
Root `AGENTS.md` is routing + cross-domain policy only.
|
||||
Do not place backend/frontend implementation details here.
|
||||
|
||||
## Scope
|
||||
|
||||
- Applies to repository root and cross-domain tasks.
|
||||
- Subdomain rules: `backend/AGENTS.md`, `apps/AGENTS.md`.
|
||||
- If rules conflict, use the stricter one.
|
||||
|
||||
## Rule Order
|
||||
|
||||
Apply rules in this order:
|
||||
|
||||
1. System/developer/platform safety instructions
|
||||
2. Workspace global runtime rules (`AGENTS.md` and `rules/*` in workspace runtime config)
|
||||
3. This file (routing + project-wide constraints)
|
||||
4. Domain sub-rules:
|
||||
- `backend/AGENTS.md`
|
||||
- `apps/AGENTS.md`
|
||||
|
||||
If two rules conflict, use the stricter one.
|
||||
1. System / developer / platform safety instructions
|
||||
2. Workspace runtime rules (`AGENTS.md` + `rules/*`)
|
||||
3. This file (routing + project-level constraints)
|
||||
4. Subdomain rules (backend/apps)
|
||||
|
||||
## Mandatory Routing
|
||||
|
||||
- Any change under `backend/**` MUST follow `backend/AGENTS.md`.
|
||||
- Any change under `apps/**` MUST follow `apps/AGENTS.md`.
|
||||
- Cross-domain changes MUST satisfy all relevant sub-AGENTS together.
|
||||
- Infrastructure-only changes under `infra/**` follow this file plus `infra/` conventions.
|
||||
|
||||
## Development Context Mapping
|
||||
|
||||
| Context | Required Rule Set |
|
||||
|---|---|
|
||||
| Backend Python/FastAPI | `backend/AGENTS.md` |
|
||||
| Flutter mobile app | `apps/AGENTS.md` |
|
||||
| Backend + Flutter in one task | `backend/AGENTS.md` + `apps/AGENTS.md` |
|
||||
| Infra/ops scripts | This file + `infra/` conventions |
|
||||
| API contract/doc updates | Also sync `docs/runtime/runtime-route.md` |
|
||||
- `backend/**` must follow `backend/AGENTS.md`.
|
||||
- `apps/**` must follow `apps/AGENTS.md`.
|
||||
- Cross-domain changes must satisfy all relevant subdomain rules.
|
||||
- `infra/**` follows this file plus `infra/` conventions.
|
||||
|
||||
## Project-Wide Constraints
|
||||
|
||||
- Default branch is `dev`; never develop directly on `main`.
|
||||
- Preferred feature workflow: `git worktree add -b feature/xxx ../feature-xxx dev`.
|
||||
- Never push remote changes unless the user explicitly requests it.
|
||||
- Keep AGENTS chain lean: put domain details in sub-AGENTS, avoid duplicate rules across layers.
|
||||
- Default development branch is `dev`; do not develop directly on `main`.
|
||||
- Never push unless explicitly requested by the user.
|
||||
- Keep AGENTS layered and lean: shared rules at root, domain rules in sub-AGENTS.
|
||||
|
||||
## Protocol as Source of Truth
|
||||
## Protocol Source of Truth
|
||||
|
||||
`docs/protocols/` is the single source of truth for data formats and protocols.
|
||||
`docs/protocols/` is the single source of truth for protocol and data format.
|
||||
|
||||
- All data schemas, API contracts, and UI schema definitions MUST be documented in `docs/protocols/`.
|
||||
- Frontend and backend implementations MUST conform to the protocols defined in `docs/protocols/`.
|
||||
- Before modifying any data format or protocol:
|
||||
1. Update the corresponding document in `docs/protocols/` first
|
||||
2. Verify the change is backward compatible or plan migration
|
||||
3. Then implement the code changes
|
||||
|
||||
This ensures frontend and backend stay synchronized and prevents drift.
|
||||
|
||||
## Skills Index
|
||||
|
||||
- `ag-ui`: AG-UI protocol implementation guidance.
|
||||
- `agentscope-skill`: AgentScope framework guidance.
|
||||
- `ui-ux-pro-max`: APP UI design guidelines.
|
||||
|
||||
Skill invocation and process routing are governed by workspace runtime rules.
|
||||
- Update protocol docs before changing data/API/UI contracts.
|
||||
- Document compatibility strategy (backward-compatible vs migration).
|
||||
- Keep frontend/backend implementations aligned with documented protocol.
|
||||
|
||||
Reference in New Issue
Block a user