agentsop-repo-state-gating
A 5-minute gate the coder runs at project kickoff (and again whenever the repo shape changes). Classifies the workspace into Greenfield / Brownfield-large / Mid-size-familiar / Library-SDK, then maps the state to an agent strategy (autonomy, context primitive, tool choice). Use BEFORE picking Cursor vs Claude Code vs Aider, BEFORE turning on repo-map, BEFORE writing the first prompt. Skip only if the same repo was gated within the last day and nothing changed. Search keywords: greenfield vs brownfield, new project vs existing codebase, project setup strategy, legacy codebase agent, where to st
npx skills add agentsope/SkillAlchemy --skill agentsop-repo-state-gating --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Repo-State Gating — 5-Line Decision at Project Kickoff > 一句话:**agent strategy = f(repo-state)**。先判定 repo 状态,再选工具/上下文原语/自治程度。 > 跳过这一步 = 用错工具,浪费一个小时的上下文。 --- ## 1. 何时激活 只在以下时刻跑一次(≤5 分钟): - **新会话第一次进入某仓库**(含 `cd` 切到新目录、`git clone` 后第一次启动 agent) - **仓库形态显著变化**:从空目录跑到 100+ 文件、引入新子系统、merge 一个大 PR - **agent 选错过工具**之后的复盘("我为什么开了 Cursor 写 SDK / 用 Aider 起新项目") - **被项目经理/同事问到** "你应该用 X 还是 Y" — 给一个 5 行的答复 **不要激活**: - 同一 repo 当天已经 gate 过 → 复用上一次结论 - 单次脚本性任务("帮我跑个一次性的数据迁移") → 跳过,直接干 - 你已经知道答案且仓库状态明显("这是个三天前刚 `npx create-next-app` 的仓库") → 仍写下结论,但 30 秒搞定 --- ## 2. 核心心智模型 ### 2.1 一句话 > **不同 repo 状态,agent 的最佳武器不同**。同一个 prompt 在 greenfield 里能跑通,在 brownfield 里会胡编路径;同一个 Aider 在 brownfield 里发光,在 greenfield 里失去 70% 价值。 ### 2.2 四个状态 × 四个杠杆 ``` 状态 | 关键约束 | 最大杠杆 | 风险 ----------------------+-------------------+---------------------+------------------- Greenfield | 没有现成符号 | LM 自治 + scaffolder| 过度设计、目录漂移 Brownfield-large | 上下文炸 + 风格僵 | repo-map + 严格 /add| 修错文件、违反约定 Mid-size-familiar | 你脑里有图 | 最小上下文 + /ask | 多加文件稀释信号 Library / SDK | 你的代码即 API | 约定 + test-fix 环 | 破坏向后兼容 ``` 四个杠杆(按优先级递减): 1. **上下文原语**:repo-map / scaffolder / docstrings / test runner 2. **自治程度**:full-auto / approve-each-tool / ask-then-code / pa
- 1. 何时激活
- 2. 核心心智模型
- 2.1 一句话
- 2.2 四个状态 × 四个杠杆
- 2.3 错误状态假设的代价
- 3. SOP 工作流(5 步,每步 ≤30 秒)
- Step 1 — 三个一次性命令
- Step 2 — 五题门禁(每题二选一)
- Step 3 — 状态分类(看 A/B 计数 + 关键信号)
- Step 4 — 查状态卡片(§4 操作模型),挑工具 + 原语 + 自治度
- Step 5 — 把结论写一行进 chat 或 README
- 4. 操作模型(8 个 ops)
- 5. 困境决策案例
- 案例 1 — "boss 让我用 Aider 起个新微服务"
git log --oneline | wc -l # 提交数 git ls-files | wc -l # 跟踪文件数 ls -la # 顶层结构(package.json? pyproject? README? src/?)
What does the agentsop-repo-state-gating skill do?
A 5-minute gate the coder runs at project kickoff (and again whenever the repo shape changes). Classifies the workspace into Greenfield / Brownfield-large / Mid-size-familiar / Library-SDK, then maps the state to an agent strategy (autonomy, context primitive, tool choice). Use BEFORE picking Cursor vs Claude Code vs Aider, BEFORE turning on repo-map, BEFORE writing the first prompt. Skip only if the same repo was gated within the last day and nothing changed. Search keywords: greenfield vs brownfield, new project vs existing codebase, project setup strategy, legacy codebase agent, where to st
How do I install it?
Run `npx skills add agentsope/SkillAlchemy --skill agentsop-repo-state-gating --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From agentsope/SkillAlchemy, a repository with 255 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
