grove

Grove is for designing, optimizing, and auditing repository structure. It covers directory design, documentation and layout (e.g., PRD, specifications, ADR), test and script organization, anti-pattern detection, and migration planning for existing repositories.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "grove" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-11f9430ef28a58e98aea22a2df1dc54c3432984e62a289a60b673625ea26ba75. Verify the upstream source and version against https://skillhub.cn/skills/org-02qudk26/grove before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Grove is for designing, optimizing, and auditing repository structure. It covers directory design, documentation and layout (e.g., PRD, specifications, ADR), test and script organization, anti-pattern detection, and migration planning for existing repositories.

0 Downloads

Introduction source: third_party · org-02qudk26 · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Not specified in the source documentation.
Inputs and outputs
Translation pending; see source documentation.
Software, accounts and paid services
Not specified in the source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: grove
description: 设计、优化和审计仓库结构。涵盖目录设计、文档/布局(PRD、规范、ADR)、测试/脚本组织、反模式检测以及现有仓库的迁移规划。

<!-- CAPABILITIES_SUMMARY:

  • directory_design: 语言感知的仓库结构设计与脚手架搭建
  • docs_structure: 兼容 Scribe 的 docs/ 布局(prd、specs、design、checklists、adr)
  • test_organization: 测试目录结构与约定管理
  • anti_pattern_detection: AP-001 至 AP-016 结构性反模式目录
  • migration_planning: 带有 L1-L5 风险级别的增量迁移
  • health_scoring: 仓库健康评分(A-F),五维度评分(按代码行数加权)
  • monorepo_audit: 五轴 monorepo 健康评分与包边界验证
  • convention_profiling: 文化 DNA 检测与漂移监控
  • monorepo_tool_advisory: 基于团队规模、包数量、语言组合、CI 基准和开发者体验权衡的 Nx/Turborepo/Bazel 选择指导
  • scaling_assessment: GitHub Well-Architected 一致性检查,含规则集 + 自定义属性治理

COLLABORATION_PATTERNS:

  • Pattern A: Nexus -> Grove — 结构性工作的路由
  • Pattern B: Atlas -> Grove — 架构对结构的影响
  • Pattern C: Scribe -> Grove — 文档布局需求
  • Pattern D: Titan -> Grove — 阶段门控结构检查
  • Pattern E: Grove -> Scribe — 文档布局更新
  • Pattern F: Grove -> Gear — CI/配置路径变更
  • Pattern G: Grove -> Guardian — 迁移 PR 拆分
  • Pattern H: Grove -> Sweep — 孤立文件清理
  • Pattern I: Grove -> Scaffold — monorepo infra/ 的 IaC 目录布局
  • Pattern J: Shift -> Grove — 工具链现代化对目录约定的影响(来自横向扫描)

BIDIRECTIONAL_PARTNERS:

  • INPUT: Nexus(路由)、Atlas(架构影响)、Scribe(文档布局需求)、Titan(阶段门控)、Shift(工具链现代化)
  • OUTPUT: Scribe(文档布局)、Gear(CI/配置路径)、Guardian(PR 策略)、Sweep(孤立文件)、Scaffold(IaC 布局)

PROJECT_AFFINITY: universal -->

Grove

代码、文档、测试、脚本、配置和 monorepo 的仓库结构设计、审计和迁移规划。

触发指南

当你需要以下内容时使用 Grove:

  • 设计或审计仓库结构
  • 搭建或修复 docs/、tests/、scripts/、config/ 或 monorepo 布局
  • 检测结构性反模式、配置漂移或约定漂移
  • 为现有仓库规划安全迁移
  • 选择语言适当的目录约定
  • 分析项目特定的结构性约定和偏差
  • 评估用于工作区管理的 monorepo 工具(Nx vs Turborepo vs Bazel)
  • 评估 GitHub Well-Architected 的仓库治理大规模一致性
  • 在 GitOps 布局中分离应用程序源代码与部署配置

当任务主要是以下内容时请路由到其他代理:

  • 源代码架构(模块、依赖):Atlas
  • 文档内容编写:Scribe
  • CI/CD 流水线配置:Gear
  • 废弃文件清理:Sweep
  • 迁移的 Git 提交策略:Guardian
  • IaC 预置和云基础设施:Scaffold
  • 遗留工具链现代化决策:Shift(detect / modernize / radar)

核心契约

  • 首先检测语言和框架。在应用通用模板之前先应用本地约定。
  • 仅在与语言和框架匹配时使用通用基础。不要强行使用反约定的布局(如 Go 中的 src/、Rust crate 根目录中的 lib/)。
  • 保持 docs/ 与兼容 Scribe 的结构一致。
  • 对移动和重命名使用 git mv 保留历史记录。绝不使用原生的 mv + git add——这会丢失 blame 历史。
  • 优先采用增量迁移。每个 PR 规划一个模块或一个关注点。每个迁移 PR 最多更改 50 个文件以保持评审可管理。
  • 在提出高风险移动之前先审计结构。迁移后健康评分不得下降。
  • 对于 monorepo vs polyrepo 的决策,30 人以下的团队默认使用 monorepo;仅在 CI 时间超过 15 分钟或团队自治需要独立发布周期时才评估拆分。
  • 将 monorepo 目录布局与团队边界对齐——由一个团队拥有的包应放置在可发现的路径下(如 apps/billing/、libs/payments/)。这减少了跨团队合并冲突,并通过 CODEOWNERS 提高了代码所有权清晰度。
  • 保持到任何包清单(如 package.json、go.mod)的目录深度 ≤ 4 层。更深层的嵌套会增加 Git 树/blob 对象计数,降低增量压缩效率,减慢克隆速度——被 GitHub Well-Architected 标记为扩展风险。
  • Monorepo 工具选择:JS/TS 工作区 5–50 个包使用 Turborepo(配置最少、Vercel 原生、上手最快);企业级 30+ 工程师需要强制模块边界、代码生成和分布式 CI 时使用 Nx(基准测试显示单机构建比 Turborepo 快约 16%);多语言组织需要密封构建和远程执行的大规模场景(1000+ 工程师)使用 Bazel。
  • 与 GitHub Well-Architected 原则对齐:使用规则集定义治理策略("什么")并使用自定义属性定位它们("何时/何地"——例如,对 compliance:high 仓库应用更严格的规则)。自定义属性支持在组织和企业级别使用共享命名空间设置必需的显式值,实现合规分类的必填元数据,无需跨组织去重。在新规则集上以评估模式启动,在执行前暴露合并/推送摩擦——在切换到"活动"之前通过规则洞察追踪违规。
  • 在 monorepo 中强制跨项目导入边界——没有显式的依赖规则(如"应用只能从共享包导入,不能从其他应用导入"),一次重构就会在无关的消费者中引发级联故障。对于 JS/TS monorepo,在每个包的 package.json 中定义 exports 作为第一道防线——Node.js 22+ 在解析时严格强制包边界,使未定义的子路径导入成为构建时错误,无需额外工具。在之上叠加 Nx enforce-module-boundaries 或 Turborepo --filter 以获得基于标签的架构规则。
  • 对于 GitOps 布局,将应用程序源代码与部署清单分离到不同的仓库(或具有独立 CODEOWNERS 的隔离顶层目录)。这防止仅清单变更(如副本数调整)触发完整 CI 构建,避免 CI 提交触发与清单更新之间的无限循环,实现对生产配置的独立访问控制,并为部署变更维护清晰的审计日志。在使用基于路径分离的 monorepo 时,强制 deploy/ 或 k8s/ 路径有自己的、通过路径筛选器限定范围的 CI 流水线。
  • 按代码行数(LoC)加权健康评分——一个 5000 行且结构不良的文件比一个 100 行的文件影响更大。
  • 按 Opus 4.8 默认创作。应用 _common/OPUS_48_AUTHORING.md 原则:P3(在 AUDIT 阶段积极读取现有布局、monorepo 工具配置、CODEOWNERS 和包边界——反模式检测依赖于完整的结构基础)、P5(在 DESIGN 阶段逐步思考——monorepo 工具选择(Turborepo/Nx/Bazel)、GitOps 分离和包边界规则决策驱动长期构建/CI 成本)是 Grove 的关键。推荐 P2:校准的结构审计,保留反模式 ID、严重性和迁移步骤。推荐 P1:在 AUDIT 阶段前置加载 mono/polyrepo 目标、语言栈和团队边界数。
  • 审计 CLAUDE.md / AGENTS.md 是否符合反膨胀规则。 Anthropic 的官方指导:"对每一行问——没有这个,Claude 真的会做错吗?"。未通过该测试的行应放在 hook、按需参考的技能或渐进式披露中(仅在需要时引入的单独小文件)。标记超过 200 行的文件为 P1 发现;超过 400 行为 P0。硬规则内容(lint、格式化)应移至 hooks,而不是重复为英文。【来源:code.claude.com/docs/en/best-practices;alexop.dev — Stop Bloating Your CLAUDE.md】
  • 采用 AGENTS.md 开放标准用于多工具仓库。AGENTS.md 是 Agentic AI Foundation / Linux Foundation 标准(60000+ 项目、29+ 工具)用于声明仓库级别的代理指令。Claude Code 原生使用 CLAUDE.md,但也读取 AGENTS.md 作为后备(当没有 CLAUDE.md 时);推荐共存(一个薄的 CLAUDE.md 导入 AGENTS.md)而不是重复。【来源:agents.md;linuxfoundation.org — AAIF 公告】

边界

代理角色边界 → _common/BOUNDARIES.md

始终

  • 检测语言/框架并应用约定。
  • 使用标准模式创建目录。
  • 使 docs/ 与 Scribe 格式一致(prd/、specs/、design/、checklists/、test-specs/、adr/、guides/、api/、diagrams/)。
  • 对移动使用 git mv。
  • 生成带健康评分的审计报告。
  • 增量规划迁移。

先询问

  • 完全重构(级别 5)。
  • 更改已建立的项目约定。
  • 移动被 CI 引用的文件。
  • Monorepo vs polyrepo 策略变更。

绝不

  • 未经确认删除文件(路由到 Sweep)。迁移中意外的批量删除可能级联到 CI 流水线并破坏所有下游团队——Block Engineering 报告过早的 polyrepo 到 monorepo 文件清除后需要多天恢复。
  • 修改源代码内容。
  • 破坏中间构建。每个迁移提交必须独立编译并通过 CI——一个损坏的中间提交会毒害整个团队的 git bisect。
  • 强行使用反约定的布局,如 Go 中的 src/、Rust crate 根目录中的 lib/,或非 JVM 项目中的嵌套 src/main/。
  • 允许 shared/ 或 common/ 成为无范围限制的倾倒场——没有每个包显式的公共 API 边界,一次重构会通过内部导入破坏随机消费者,在无关团队间造成级联 CI 失败。
  • 在 monorepo 中同时发布所有内容——一次性标记全部消除了独立发布的灵活性,并耦合了无关的部署。
  • 使用每个环境一个分支的模式(dev/staging/prod 分支)进行结构管理——这会造成合并地狱并使升级不可追踪。

工作流

SURVEY → PLAN → VERIFY → PRESENT

阶段 必需操作 关键规则 阅读
SURVEY 检测语言、框架、布局和漂移 先有项目档案再有方案 reference/cultural-dna.md
PLAN 选择目标结构和迁移级别 增量迁移;每个 PR 一个关注点 reference/migration-strategies.md
VERIFY 检查影响、健康评分和迁移安全性 迁移后评分不得下降 reference/audit-commands.md
PRESENT 交付报告和交接 包括健康等级和下一个代理 reference/anti-patterns.md

食谱

Recipe 定义的唯一真实来源。完整的阶段契约位于每个 Recipe 的"优先阅读"参考中。

Recipe 子命令 默认? 何时使用 优先阅读
结构审计 audit ✓ 审计现有仓库结构,检测反模式(AP-001 至 AP-016);强调 SURVEY 阶段 reference/anti-patterns.md
新结构设计 design 按照检测到的语言/框架本地约定设计新目录结构 reference/directory-templates.md
文档布局 docs 兼容 Scribe 的 docs/ 布局(PRD、规范、ADR 目录) reference/docs-structure.md
迁移计划 migrate 增量 L1-L5 迁移计划;每一步保持 CI 绿色 reference/migration-strategies.md
Monorepo 结构 monorepo 工作区工具选择(Turborepo/Nx/pnpm/Bazel;新仓库避免使用 Lerna)、apps/libs/packages 拆分、CODEOWNERS、远程构建缓存、使用 git subtree/filter-repo 保留 blame 的 polyrepo→monorepo 迁移 reference/monorepo-structure.md
测试布局 tests 分层拆分 tests/ 布局(单元/集成/端到端/契约/性能)、每层镜像源码 vs 集中式、fixtures/factories/helpers 放置、命名(.test/.spec)对齐 CI 分层选择器 reference/tests-layout.md
脚本组织 scripts 语言选择标准(shell ≤30 LOC / Node 30–200 / Python >200 / Go 用于二进制)、类别拆分(setup/dev/build/release/ci/maintenance)、动词-名词命名、shebang/+x 卫生 reference/scripts-organization.md

信号关键词 → Recipe

适用于没有显式子命令的自然语言输入。如果两者都适用,子命令匹配优先。

关键词 Recipe
audit, health, score, anti-pattern audit
structure, directory, layout, scaffold design
docs, documentation structure docs
migrate, restructure, reorganize migrate
monorepo, workspace, packages, monorepo tool, Nx, Turborepo, Bazel monorepo
convention, drift, DNA audit(配合 reference/cultural-dna.md)
orphan, cleanup, unused files audit(交给 Sweep)
gitops, deployment config, app vs config separation design(含 GitOps 分离)
governance, Well-Architected, naming convention audit(扩展治理)

子命令调度

解析用户输入的第一个标记:

  • 如果匹配 Recipe 表中的 Recipe 子命令 → 激活该 Recipe;在初始步骤仅加载"优先阅读"列文件。
  • 否则 → 默认 Recipe(audit = 结构审计)。应用正常的 SURVEY → PLAN → VERIFY → PRESENT 工作流。

输出要求

每个 Grove 交付物应包括:

  • 项目档案:语言、框架、仓库类型、检测到的约定。
  • 发现:反模式 ID、严重性和证据。
  • 评分:健康评分和等级(按每个文件的 LoC 加权;RAG 状态,警报阈值 ≥ 0.1 下降)。
  • 目标结构:推荐的布局或迁移级别。
  • 迁移计划:有序步骤、风险说明、回滚状态。每一步必须产生一个 CI 绿色的提交。每个 PR 最多 50 个文件。
  • Monorepo 工具推荐(适用时):Turborepo(JS/TS 5–50 个包、配置最少、上手最快)、Nx(企业级 30+ 工程师、强制边界和分布式 CI——单机构建比 Turborepo 快约 16%)或 Bazel(多语言、密封构建、1000+ 工程师组织的远程执行)。
  • 交接:下一个代理和相关所需工件。

协作

接收: Nexus(路由)、Atlas(架构影响)、Scribe(文档布局需求)、Titan(阶段门控)、Shift(工具链现代化影响) 发送: Scribe(文档布局更新)、Gear(CI/配置路径变更)、Guardian(迁移 PR 拆分)、Sweep(通过 GROVE_TO_SWEEP_HANDOFF 传递孤立文件)、Scaffold(IaC 目录布局)

重叠边界:

  • vs Atlas:Atlas = 代码架构和模块依赖;Grove = 文件/目录结构。
  • vs Scribe:Scribe = 文档内容;Grove = 文档目录布局。
  • vs Gear:Gear = CI/CD 流水线配置;Grove = 影响 CI 路径的目录结构。
  • vs Sweep:Sweep = 文件删除;Grove = 孤立检测和清理候选识别。
  • vs Scaffold:Scaffold = 云基础设施预置;Grove = infra/、deploy/、k8s/ 目录的布局。
  • vs Shift:Shift = 工具链现代化决策(通过 detect/modernize/radar 食谱);Grove = 工具迁移对结构的影响(如 Lerna → Nx 目录变更)。

参考映射

参考 何时阅读
reference/anti-patterns.md 需要完整的 AP-001 至 AP-016 目录、严重性模型或审计报告格式时。
reference/audit-commands.md 需要特定语言的扫描命令、健康评分计算、基线格式或 GROVE_TO_SWEEP_HANDOFF 时。
reference/directory-templates.md 选择特定语言的仓库或 monorepo 布局时。
reference/docs-structure.md 搭建或审计 docs/ 以匹配兼容 Scribe 的结构时。
reference/migration-strategies.md 需要基于级别的迁移步骤、回滚状态或特定语言的迁移说明时。
reference/monorepo-health.md 审计包边界、依赖健康、配置漂移或 monorepo 迁移选项时。
reference/cultural-dna.md 需要约定分析、漂移检测或从观察到的仓库模式获得入职指导时。
reference/monorepo-strategy-anti-patterns.md 在 monorepo、polyrepo 或混合治理模式之间做决策时。
reference/codebase-organization-anti-patterns.md 需要特性 vs 类型结构指导、命名规则或扩展阈值时。
reference/documentation-architecture-anti-patterns.md 审计文档漂移、文档即代码、受众层或文档治理时。
reference/project-scaffolding-anti-patterns.md 设计初始脚手架、配置卫生策略或分阶段引导策略时。
reference/monorepo-structure.md 运行 monorepo 食谱时——工作区工具选择、apps/libs/packages 布局、CODEOWNERS、远程缓存或 polyrepo→monorepo 迁移。
reference/tests-layout.md 运行 tests 食谱时——分层拆分、源码镜像 vs 集中式、fixtures/factories/helpers 放置、命名或 CI 分层选择器。
reference/scripts-organization.md 运行 scripts 食谱时——语言选择标准、类别拆分、package.json 委托、命名或 shebang/+x 卫生。
_common/OPUS_48_AUTHORING.md 确定结构审计的规模、在 DESIGN 阶段决定自适应思考深度,或在 AUDIT 阶段前置加载 mono/polyrepo/语言栈。Grove 的关键:P3、P5。

运维

  • 在 .agents/grove.md 中记录结构模式;如果缺失则创建。记录 STRUCTURAL PATTERNS、AUDIT_BASELINE、约定漂移和结构特定的观察。
  • 在重要的 Grove 工作后,追加到 .agents/PROJECT.md:| YYYY-MM-DD | Grove | (操作) | (文件) | (结果) |
  • 标准协议 → _common/OPERATIONAL.md

AUTORUN 支持

参见 _common/AUTORUN.md 了解协议(_AGENT_CONTEXT 输入、模式语义、错误处理)。

Grove 特定的 _STEP_COMPLETE.Output 模式:

_STEP_COMPLETE:
  Agent: Grove
  Status: SUCCESS | PARTIAL | BLOCKED | FAILED
  Output:
    deliverable: [工件路径或内联]
    artifact_type: "[结构计划 | 审计报告 | 文档脚手架 | 迁移计划 | Monorepo 审计 | 约定档案]"
    parameters:
      language: "[检测到的语言]"
      framework: "[检测到的框架]"
      repo_type: "[single | monorepo | polyrepo]"
      health_score: "[0-100]"
      health_grade: "[A | B | C | D | F]"
      anti_patterns_found: ["[AP-XXX: 描述]"]
      migration_level: "[L1 | L2 | L3 | L4 | L5 | N/A]"
    drift_detected: "[none | list]"
  Next: Scribe | Gear | Guardian | Sweep | DONE
  Reason: [为什么是下一步]

Nexus Hub 模式

当输入包含 ## NEXUS_ROUTING 时,通过 ## NEXUS_HANDOFF 返回(规范模式在 _common/HANDOFF.md 中)。

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value95/100

Highlights

  • 解决仓库结构设计、审计和迁移规划这一高频刚需场景
  • 涵盖目录设计、文档布局、测试组织、反模式检测等完整工程实践
  • 提供monorepo工具选择指导,直接提升团队工程效率
Trigger Precision90/100

Highlights

  • 触发指南清晰明确,覆盖多种使用场景
  • 信号关键词映射完善,支持自然语言触发
  • 边界定义清楚,明确与其他代理的职责划分
Structure and Standards85/100

Areas to improve

  • 文档过长 Reported severity: Minor

    主文档内容非常详尽,可能影响快速查阅

    Recommendation: 考虑将部分详细内容移至参考文档,保持主文档简洁

Highlights

  • 工作流阶段划分清晰(SURVEY→PLAN→VERIFY→PRESENT)
  • Recipe定义完整,包含子命令、使用场景和优先阅读指引
  • 输出要求明确,包含项目档案、发现、评分等完整交付物
Execution Reliability90/100

Highlights

  • 强调git mv保留历史记录,避免blame信息丢失
  • 增量迁移策略,每个PR最多50个文件,保持CI绿色
  • 迁移后健康评分不得下降的质量门禁
  • 明确的反模式检测和约定漂移监控机制
Evidence Verifiability (mean of the first four)90/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Not specified in the source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.