用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/cwijayasundara/claude_harness_eng_v4 --skill brownfield命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | brownfield |
| description | Discover and map an existing codebase before planning or changing it. |
| argument-hint | [optional-focus-path-or-goal] |
| context | fork |
| agent | planner |
Use /brownfield in existing repositories before substantial planning, improvements, refactors, or bug work. The goal is to build a factual map of the current system so agents respect the codebase instead of inventing a parallel architecture.
This skill does not change production code.
Ultracode tip: Mapping an unknown codebase is the canonical fan-out task, so run
/effort ultracodebefore this phase — broad parallel coverage plus adversarial verification produces better maps. Drop back to/effort highbefore the execution phases (/auto,/implement).
/brownfield
/brownfield backend/src
/brownfield "map auth and billing before adding team invites"
Write these files:
| File | Purpose |
|---|---|
specs/brownfield/codebase-map.md | Languages, frameworks, package managers, entry points, services, commands. LLM-written inventory — distinct from symbol-map.md, the script-generated navigation index from /code-map |
specs/brownfield/code-graph.json | Deterministic dependency graph produced by /code-map |
specs/brownfield/code-graph.meta.json | Producer, language counts, scan warnings, timestamp |
specs/brownfield/dependency-graph.md | Mermaid render of file/module-level edges |
specs/brownfield/coupling-report.md | Fan-in, fan-out, cycles, hubs, unstable modules |
specs/brownfield/architecture-map.md | Modules, layers, data flow, public interfaces, external dependencies — cites graph evidence |
specs/brownfield/test-map.md | Test commands, coverage signals, public interfaces covered/missing, slow/flaky tests |
specs/brownfield/risk-map.md | Sensitive areas, fragile zones, structural risks, auth/security/billing/data risks |
specs/brownfield/change-strategy.md | Recommended lane for future work: /vibe, /change, /refactor, /spec, /auto |
specs/brownfield/seams-<goal>.md | Optional ranked seam candidates produced by /seam-finder "<goal>" |
CONTEXT.md | Optional domain glossary, created only when meaningful domain terms are discovered |
Discover facts, not guesses:
Use rg, find, package manifests, config files, and existing docs. Prefer primary repo evidence over assumptions.
/code-map)Run the /code-map skill (.claude/skills/code-map/SKILL.md) — its Steps 1–3 are the single source of truth for producer detection (AST indexer → Understand-Anything import → regex fallback), the exact commands, and the rendering of symbol-map.md, dependency-graph.md, and coupling-report.md. Do not restate or improvise those commands here; if anything in this skill disagrees with code-map's SKILL.md, code-map wins.
Expected artifacts under specs/brownfield/ when it completes: code-graph.json (+ .meta.json), symbol-map.md, skeletons/ (god files only), dependency-graph.md, coupling-report.md.
If the graph is empty or has only warnings, stop and report. Do not invent architecture from filenames. When the AST producer ran, treat symbol-map.md and skeletons/ as the navigation layer: read a single symbol with Read(offset=START, limit=END-START+1) instead of reading god files whole.
Write architecture-map.md with:
code-graph.jsonimports / calls chainsext:* targets from the graph where availablecoupling-report.mdEvery "module X depends on Y" claim must reference graph evidence, preferably an edge with file:line evidence. Do not redesign the system. Capture what exists.
Write test-map.md with:
If commands are obvious and safe, run lightweight discovery commands such as npm test -- --help, pytest --collect-only, or package script listing. Do not run expensive test suites unless the user asked.
Write risk-map.md with:
Read these from coupling-report.md and code-graph.json:
test-map.md.For each risk, include the evidence path or graph node id.
Write change-strategy.md with:
/vibe/change (behavior change; --issue N for a tracked bug)/refactor/spec → /design → /autoInclude a short "first safe next steps" list.
When recommending /spec → /design → /auto for any cluster of work, note in the strategy that /auto parallelizes on two axes:
.claude/agents/generator.md Rule 2..claude/skills/auto/SKILL.md.This shapes how you cluster stories AND how you shape the dependency graph: clusters with truly independent stories get within-group parallelism, and independent dependency groups (backend vs frontend vs ingest, for example) get cross-group parallelism. Prefer designs that surface independence at both levels — group by integration boundary internally, and minimize cross-group Consumes: edges in the dependency graph.
If the requested work has a concrete goal, recommend running /seam-finder "<goal>" after /brownfield. Use seams-<goal>.md to choose whether the next lane should extend an existing seam, wrap a boundary, introduce an adapter, split a read/write path, or avoid a poor seam.
If recurring domain terms are discovered, create or update CONTEXT.md.
Keep it domain-level:
# Context
## Terms
### Account
Definition meaningful to users/domain experts.
### User
Definition and how it differs from Account.
Do not fill CONTEXT.md with implementation details.
Before recommending implementation, present:
Do not proceed to code changes from /brownfield unless the user explicitly asks.
After all discovery artifacts are written, spawn the evaluator agent (artifact mode) to validate the brownfield analysis.
Agent invocation:
Spawn Agent with subagent_type="evaluator" and prompt:
Ratchet loop (max 2 iterations):
Human approval is required before proceeding to implementation.
Present the discovery maps with the evaluator's quality summary:
Ask: "Does this brownfield analysis look accurate? Approve to proceed, or flag areas that need re-scanning."
Do not proceed to code changes from /brownfield unless the user explicitly approves the discovery AND requests changes.
CONTEXT.md.