agentsope/SkillAlchemy / skills/agentsop-repo-state-gating
agentsop-repo-state-gating
VerifiedA 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 start a coding agent.
| File | Kind | Size |
|---|---|---|
| README.md | markdown | 2.3 KB |
| SKILL.md | skill md | 15.3 KB |
| intermediate/operation_candidates.json | config | 6.3 KB |
| references/R1-state-taxonomy.md | markdown | 6.6 KB |
| references/R2-gate-questions.md | markdown | 7.6 KB |
README.md
View on GitHub# d-repo-state-gating-skill
A 5-minute gate the coder-agent runs at project kickoff to classify the repo and pick the right tool/strategy *before* writing the first prompt.
## What it answers
> "Am I in a greenfield, brownfield, mid-size familiar, or library/SDK repo? And what does that imply for tool choice, context primitive, and autonomy?"
## Why it exists
Phase C gap analysis (`output/phase-c-gap-analysis.md` row A1) flagged this as a `new_distill` gap: **medium frequency, high savings-per-event**. No local skill, no skill.sh match. The wrong tool at kickoff wastes 1–3 hours.
Phase B inventory: every coder SOP except the most autonomous ones implicitly assumes a state, but **none gates explicitly**.
## What's inside
- `SKILL.md` — the operational doc. 7 sections, ~400 lines. Triggers, mental model, 5-step SOP, 8 ops, 4 cases, anti-patterns, cross-framework table.
- `references/R1-state-taxonomy.md` — definitions and edge cases for the 4 states (greenfield / brownfield-large / mid-size-familiar / library-SDK).
- `references/R2-gate-questions.md` — the 5 question rubric + decision tree, and what to do with multi-state monorepos.
- `intermediate/operation_candidates.json` — 8 ops in machine-readable form (gate-classify, per-state strategies, reclassify, multi-state, mismatch-rescue).
## Lineage
- **Primary**: `output/aider-sop-skill/` (R4 anti-pattern §1 — "Aider's edge assumes existing code; for greenfield repo-map is empty.")
- **Secondary**: `output/dify-sop-skill/` (code-escape-hatch — visual builder helps greenfield prototypes; brownfield wants raw code).
- **Tertiary**: `output/dspy-sop-skill/` ("don't compile until the signature stabilizes" — same shape as "don't choose a brownfield tool until the repo *is* brownfield").
- **External**: BMAD greenfield-vs-brownfield, GSD /gsd-map-codebase workflow, "The Brownfield Problem" (jjmasse 2026), 2026 AI coding tool comparison surveys.
## When to use
Trigger at every:
- new `cd` into a repo for an agent session
- post-merge or post-scaffold inflection point
- "should I use Cursor or Aider here?" hesitation moment
Skip if you already gated this repo today and nothing changed.
## Frontmatter
```
name: repo-state-gating
version: 0.1.0
```
Tool skill (decision artifact, not a deep library doc). Intended to be ~5 min to apply.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |