From 74b0fb32ba971a153b1fc460f614399840fe84f9 Mon Sep 17 00:00:00 2001 From: devnomad Date: Sun, 5 Jul 2026 13:36:54 +0800 Subject: [PATCH] feat(tools): add Cosmosmith workflow rule --- docs/.vitepress/site/facts.ts | 76 +++++++++---------- docs/en/rules/tools.md | 6 ++ .../tools/cosmosmith-workflow/.cursorrules | 52 +++++++++++++ .../rules/tools/cosmosmith-workflow/README.md | 35 +++++++++ .../cosmosmith-multi-agent-governance.mdc | 17 +++++ docs/zh/rules/tools.md | 6 ++ 6 files changed, 154 insertions(+), 38 deletions(-) create mode 100644 docs/rules/tools/cosmosmith-workflow/.cursorrules create mode 100644 docs/rules/tools/cosmosmith-workflow/README.md create mode 100644 docs/rules/tools/cosmosmith-workflow/cosmosmith-multi-agent-governance.mdc diff --git a/docs/.vitepress/site/facts.ts b/docs/.vitepress/site/facts.ts index 8563e01..487eba6 100644 --- a/docs/.vitepress/site/facts.ts +++ b/docs/.vitepress/site/facts.ts @@ -1,6 +1,6 @@ /* This file is generated by docs/scripts/sync-site-facts.mjs */ export const siteFacts = { - "ruleCount": 132, + "ruleCount": 133, "domainCount": 32, "localeCount": 2, "topDomains": [ @@ -33,162 +33,162 @@ export const siteFacts = { { "category": "frontend", "count": 26, - "ratio": 0.197 + "ratio": 0.1955 }, { "category": "backend", "count": 21, - "ratio": 0.1591 + "ratio": 0.1579 }, { "category": "devops", "count": 12, - "ratio": 0.0909 + "ratio": 0.0902 }, { "category": "general", "count": 8, - "ratio": 0.0606 + "ratio": 0.0602 }, { "category": "data", "count": 7, - "ratio": 0.053 + "ratio": 0.0526 }, { "category": "ai", "count": 6, - "ratio": 0.0455 + "ratio": 0.0451 }, { "category": "mobile", "count": 5, - "ratio": 0.0379 + "ratio": 0.0376 }, { "category": "security", "count": 5, - "ratio": 0.0379 + "ratio": 0.0376 }, { "category": "blockchain", "count": 4, - "ratio": 0.0303 + "ratio": 0.0301 }, { "category": "hardware", "count": 4, - "ratio": 0.0303 + "ratio": 0.0301 }, { "category": "bio", "count": 3, - "ratio": 0.0227 + "ratio": 0.0226 }, { "category": "edge", "count": 3, - "ratio": 0.0227 + "ratio": 0.0226 }, { "category": "emerging-tech", "count": 3, - "ratio": 0.0227 + "ratio": 0.0226 }, { "category": "iot", "count": 3, - "ratio": 0.0227 + "ratio": 0.0226 }, { "category": "platform", "count": 3, - "ratio": 0.0227 + "ratio": 0.0226 + }, + { + "category": "tools", + "count": 3, + "ratio": 0.0226 }, { "category": "cms", "count": 2, - "ratio": 0.0152 + "ratio": 0.015 }, { "category": "data-science", "count": 2, - "ratio": 0.0152 + "ratio": 0.015 }, { "category": "database", "count": 2, - "ratio": 0.0152 + "ratio": 0.015 }, { "category": "gaming", "count": 2, - "ratio": 0.0152 + "ratio": 0.015 }, { "category": "quantum", "count": 2, - "ratio": 0.0152 - }, - { - "category": "tools", - "count": 2, - "ratio": 0.0152 + "ratio": 0.015 }, { "category": "ar-vr", "count": 1, - "ratio": 0.0076 + "ratio": 0.0075 }, { "category": "automation", "count": 1, - "ratio": 0.0076 + "ratio": 0.0075 }, { "category": "cloud", "count": 1, - "ratio": 0.0076 + "ratio": 0.0075 }, { "category": "compute", "count": 1, - "ratio": 0.0076 + "ratio": 0.0075 }, { "category": "industrial", "count": 1, - "ratio": 0.0076 + "ratio": 0.0075 }, { "category": "network", "count": 1, - "ratio": 0.0076 + "ratio": 0.0075 }, { "category": "robotics", "count": 1, - "ratio": 0.0076 + "ratio": 0.0075 }, { "category": "science", "count": 1, - "ratio": 0.0076 + "ratio": 0.0075 }, { "category": "simulation", "count": 1, - "ratio": 0.0076 + "ratio": 0.0075 }, { "category": "storage", "count": 1, - "ratio": 0.0076 + "ratio": 0.0075 }, { "category": "systems", "count": 1, - "ratio": 0.0076 + "ratio": 0.0075 } ], "coverageBuckets": [ @@ -209,7 +209,7 @@ export const siteFacts = { "dominantCategory": "frontend", "dominantCategoryCount": 26, "curatedSurfaceCount": 10, - "longTailCategoryCount": 17 + "longTailCategoryCount": 16 }, "timelineSignals": [ { diff --git a/docs/en/rules/tools.md b/docs/en/rules/tools.md index 58d3c94..6d18428 100644 --- a/docs/en/rules/tools.md +++ b/docs/en/rules/tools.md @@ -18,6 +18,12 @@ Cursor AI programming rules for Tools. |------|------| | [github-quality](https://github.com/LessUp/awesome-cursorrules-zh/blob/master/rules/tools/github-quality/.cursorrules) | 你是代码质量、Git 工作流和最佳实践方面的专家。 | +## cosmosmith-workflow + +| Rule | Description | +|------|------| +| [cosmosmith-workflow](https://github.com/LessUp/awesome-cursorrules-zh/blob/master/docs/rules/tools/cosmosmith-workflow/.cursorrules) | Multi-agent workflow governance for AGENTS.md, task.md, role handoffs, and verification evidence. | + ## Usage 1. Click the rule link to view the `.cursorrules` file on GitHub diff --git a/docs/rules/tools/cosmosmith-workflow/.cursorrules b/docs/rules/tools/cosmosmith-workflow/.cursorrules new file mode 100644 index 0000000..3f7e1d6 --- /dev/null +++ b/docs/rules/tools/cosmosmith-workflow/.cursorrules @@ -0,0 +1,52 @@ +你是多 Agent 软件工作流治理专家,负责让 Cursor、Claude Code、Codex、Copilot、OpenCode、Trae 等 AI 编程工具在同一个项目里遵循一致的规则、任务协议和验证闭环。 + +## 规则源 + +- 将 `AGENTS.md` 视为项目的唯一权威规则源。 +- 将 `CLAUDE.md`、`.cursor/rules/*.mdc`、`.github/copilot-instructions.md`、`.opencode/AGENTS.md`、`.trae/rules/*.md` 视为工具适配器。 +- 当适配器和 `AGENTS.md` 冲突时,遵循 `AGENTS.md`,并把适配器更新列为后续任务。 +- 不要把生成项目的规则和构建初始化器本身的规则混在一起。 + +## 任务账本 + +- 使用 `task.md` 作为当前任务账本。 +- 一次只领取一个足够小、可验证的任务。 +- 领取任务前记录角色、上下文、预期输出、验收检查和依赖。 +- 任务完成前必须记录验证证据。 +- 没有证据时,不要把任务标记为 `done`。 + +## 角色协作 + +- 产品角色澄清用户、场景、差异化和验收标准。 +- 研究角色检索竞品、生态、标准、风险和用户预期。 +- 架构角色定义边界、数据流、集成策略和风险控制。 +- UI/UX 角色定义流程、状态、可访问性和视觉 QA。 +- 前端角色实现客户端切片并提供浏览器或组件验证证据。 +- 后端角色实现 API、持久化、权限、领域逻辑和测试。 +- QA 角色把验收标准转成复现步骤、测试结果和发布信心。 +- DevOps 角色确认构建、配置、CI、部署、监控和回滚。 +- 治理评审角色检查规则漂移、证据缺失和任务交接断点。 + +## Prompt / Context / Harness / Loop + +- Prompt:明确当前角色、问题、输出格式和禁止事项。 +- Context:只加载完成当前任务需要的用户意图、文件、规范、研究、日志和测试结果。 +- Harness:优先使用脚本、测试、lint、build、浏览器检查、CI 或 schema 校验。 +- Loop:通过发现、提案、评审、实现、验证、发布和学习更新规则。 + +## 大任务处理 + +- 对很大的 `task.md`、`todo.md` 或 checkpoint 文件,不要一次性塞入全部上下文。 +- 选择下一个可领取任务,提炼局部上下文,完成最小可验证切片。 +- 运行验证命令后,更新任务证据和状态。 +- 如果任务被阻塞,写清阻塞条件和下一步。 + +## Cosmosmith 初始化 + +如果项目还没有这些治理文件,可以使用: + +```bash +npx cosmosmith@latest init --all +``` + +这会生成 `AGENTS.md`、`task.md`、proposal/design 模板,以及 Claude Code、Cursor、Copilot、OpenCode 和 Trae 适配文件。 diff --git a/docs/rules/tools/cosmosmith-workflow/README.md b/docs/rules/tools/cosmosmith-workflow/README.md new file mode 100644 index 0000000..df0a3d9 --- /dev/null +++ b/docs/rules/tools/cosmosmith-workflow/README.md @@ -0,0 +1,35 @@ +# Cosmosmith 多 Agent 工作流治理 .cursorrules 提示文件 + +## 你可以构建什么 + +- **多 Agent 软件项目**:让 Cursor、Claude Code、Codex、Copilot、OpenCode 和 Trae 共享同一套项目规则 +- **规格驱动工作流**:从想法、提案、设计、任务到账本化验证证据 +- **团队协作项目**:用角色、任务状态和检查命令减少 AI 协作中的上下文漂移 + +## 概要 + +这个规则文件为使用 Cosmosmith 的项目提供多 Agent 工作流治理规则。它把 `AGENTS.md` 视为项目宪法,把 `.cursor/rules/*.mdc`、`CLAUDE.md`、`.github/copilot-instructions.md` 等文件视为工具适配器,并要求通过 `task.md` 记录任务、验证证据和完成状态。 + +## 核心特性 + +- 以 `AGENTS.md` 作为唯一权威规则源 +- 使用 `task.md` 管理 claim、review、verify、done 状态 +- 明确 Prompt、Context、Harness、Loop 四个工作面 +- 支持产品、架构、UI/UX、前端、后端、QA、DevOps、治理评审等角色协作 +- 在标记完成前记录测试、构建、浏览器 QA 或人工验证证据 + +## 技术栈 + +- Cursor Project Rules +- AGENTS.md +- Claude Code / Codex / Copilot / OpenCode / Trae adapters +- Spec-driven development +- DevOps verification loops + +## 可选初始化器 + +```bash +npx cosmosmith@latest init --all +``` + +项目地址:https://github.com/devnomad-byte/cosmosmith diff --git a/docs/rules/tools/cosmosmith-workflow/cosmosmith-multi-agent-governance.mdc b/docs/rules/tools/cosmosmith-workflow/cosmosmith-multi-agent-governance.mdc new file mode 100644 index 0000000..9899953 --- /dev/null +++ b/docs/rules/tools/cosmosmith-workflow/cosmosmith-multi-agent-governance.mdc @@ -0,0 +1,17 @@ +--- +description: 多 Agent 项目治理规则,使用 AGENTS.md、task.md、角色协作和验证证据协调 Cursor 与其他 AI 编程工具。 +globs: **/* +alwaysApply: false +--- + +- Treat `AGENTS.md` as the canonical project constitution. +- Treat `CLAUDE.md`, `.cursor/rules/*.mdc`, `.github/copilot-instructions.md`, `.opencode/AGENTS.md`, and `.trae/rules/*.md` as adapters. +- If an adapter conflicts with `AGENTS.md`, follow `AGENTS.md` and record an adapter update task. +- Use `task.md` as the active task ledger. +- Claim one small, verifiable task at a time. +- Record role, context, expected output, acceptance checks, harness, and evidence before marking a task done. +- Use role context deliberately: product, research, architect, UI/UX, frontend, backend, QA, DevOps, and governance review. +- Make Prompt, Context, Harness, and Loop explicit for substantial work. +- Prefer tests, lint, build, browser checks, CI, schema checks, or reproducible manual evidence over unsupported claims. +- For large ledgers, read only the next claimable task and its necessary context. +- If the project has no governance files yet, initialize with `npx cosmosmith@latest init --all`. diff --git a/docs/zh/rules/tools.md b/docs/zh/rules/tools.md index 0edb2b2..359b6c0 100644 --- a/docs/zh/rules/tools.md +++ b/docs/zh/rules/tools.md @@ -18,6 +18,12 @@ editLink: false |------|------| | [github-quality](https://github.com/LessUp/awesome-cursorrules-zh/blob/master/rules/tools/github-quality/.cursorrules) | 你是代码质量、Git 工作流和最佳实践方面的专家。 | +## cosmosmith-workflow + +| 规则 | 说明 | +|------|------| +| [cosmosmith-workflow](https://github.com/LessUp/awesome-cursorrules-zh/blob/master/docs/rules/tools/cosmosmith-workflow/.cursorrules) | 你是多 Agent 软件工作流治理专家,负责协调 AGENTS.md、task.md、角色协作和验证闭环。 | + ## 使用方法 1. 点击规则链接,在 GitHub 上查看 `.cursorrules` 文件