speclite-brownfield-context-builder

speclite-brownfield-context-builder is a skill for Claude Code from flanliulf/SpecLite. It costs 77 tokens per session (1,837 once invoked), scanned A, original, MIT.

A workflow for analyzing an existing codebase and producing a documented picture of how it currently works. It extracts facts about APIs, data models, dependencies, configuration, tests, and project structure, then creates planning inputs.

In plain words
What is it for?
Use it to map monoliths, monorepos, and subsystems; create an as-is baseline; investigate selected areas; and prepare planning briefs, change slices, and feature entry points.
Why use it?
It helps teams understand a system they inherited before proposing changes. Evidence, uncertainty, and high-risk areas are recorded so later planning is based on the actual code.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to map monoliths, monorepos, and subsystems; create an as-is baseline; investigate selected areas; and prepare planning briefs, change slices, and feature entry points.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/flanliulf/speclite/speclite-brownfield-context-builder
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add flanliulf/SpecLite --skill speclite-brownfield-context-builder
Clone the repo
git clone --depth 1 https://github.com/flanliulf/SpecLite

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for speclite-brownfield-context-builder

README.md
[![agentmods](https://agentmods.dev/badge/skills/flanliulf/speclite/speclite-brownfield-context-builder/github.svg)](https://agentmods.dev/skills/flanliulf/speclite/speclite-brownfield-context-builder)
Your own site
<a href="https://agentmods.dev/skills/flanliulf/speclite/speclite-brownfield-context-builder"><img src="https://agentmods.dev/badge/skills/flanliulf/speclite/speclite-brownfield-context-builder/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for speclite-brownfield-context-builder

Your own site · 80×15
<a href="https://agentmods.dev/skills/flanliulf/speclite/speclite-brownfield-context-builder"><img src="https://agentmods.dev/badge/skills/flanliulf/speclite/speclite-brownfield-context-builder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,837 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00077 $0.01837
Opus 5 $0.00039 $0.00919
Sonnet 5 $0.00015 $0.00367
Haiku 4.5 $0.00008 $0.00184

Measured 6d ago against content hash 0893858d39f3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

speclite-brownfield-context-builder scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

The scan reads SKILL.md. This mod also ships 12 executable files (scripts/adversarial_grounding_check.py, scripts/build_dependency_graph.py, scripts/collect_config_surface.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

assets/source/speclite/sdlc-skills/1-analysis/speclite-brownfield-context-builder/SKILL.md · 83 lines

How it starts

The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.

[技能说明] Speclite Brownfield Context Builder 是 1-analysis 阶段的既有系统分析工作流。它把现有代码仓库恢复为可追溯、可复查、可供后续 PRD / Architecture / Epics / Stories 消费的 as-is 基线和规划前置上下文。

[核心能力] - 仓库分类与边界识别:识别 monolith / monorepo / multi-part 结构,划分子系统边界与技术栈。 - 确定性证据提取:通过 {skill-root}/scripts/ 下的脚本提取 API、数据模型、依赖图、配置面、测试面和历史文档候选事实。 - Evidence-First 基线合成:先生成 evidence 与 baseline skeleton,再由 LLM 仅补受限叙述,避免无来源事实写入。 - 历史文档交叉验证:将历史 PRD / 技术方案作为候选事实,经过代码或当前文档验证后再进入基线。 - 局部深潜分析:对高风险或用户指定区域做 targeted deep dive,补充可复用能力、约束和变更风险。 - 规划前置交接:默认生成 brownfield-planning-brief、candidate-change-slices、feature-entry-points 等后续 Speclite 工作流输入,不替代 create-prd / create-architecture / create-epics-and-stories。 - 状态持久化与恢复:每阶段写盘并更新 project-scan-report.json,支持 resume 和 full rescan 归档。 - 质量护栏:执行 coverage contract、strict anchors、adversarial grounding check 和 golden regression。

[约定] 裸路径相对于 {skill-root} 解析;{project-root} 是目标项目工作目录;{speclite-runtime-root}{project-root}/_speclite{skill-name} 是目录 basename。

运行配置必须运行 `speclite resolve config --project-root {project-root}`。推荐解析字段:
- `{project_knowledge}` = `[modules.sdlc].project_knowledge`
- `{planning_artifacts}` = `[modules.sdlc].planning_artifacts`
- `{brownfield_output}` = `{project_knowledge}/brownfield`
- `{history_sources}` 默认 `{project-root}/docs/history`,可由用户指定

[执行流程] 本 Skill 采用 4 种运行模式和 6 个阶段,路由规则以 references/workflow-router.md 为准。

1. 激活后解析三层 customize:`{skill-root}/customize.toml`、`{speclite-runtime-root}/custom/{skill-name}.toml`、`{speclite-runtime-root}/custom/{skill-name}.user.toml`。缺失覆盖文件时跳过;标量覆盖,表深度合并。
2. 运行 `speclite resolve config --project-root {project-root}`。配置缺失或 `project_knowledge`、`planning_artifacts` 为空时 HALT。
3. Phase 0:检查 `{brownfield_output}/project-scan-report.json`,按 `initial_scan` / `full_rescan` / `targeted_deep_dive` / `planning_generation` / resume 判定执行路径。初始化状态时运行:`python {skill-root}/scripts/update_state.py init --project-root {project-root} --output-dir {brownfield_output}`。
4. Phase 1:运行 `python {skill-root}/scripts/scan_repo.py {project-root} --output-dir {brownfield_output}`,并按 `references/repository-classifier.md` 划分仓库结构。
5. Phase 2:按 `references/evidence-extractor.md` 执行证据提取脚本,所有脚本必须显式传入 `--output-dir {brownfield_output}`;历史文档摄取额外传入 `--history-dir {history_sources}`。完成后运行 `validate_outputs.py --phase evidence`。
6. Phase 3:读取 `references/known-failure-patterns.md`,运行 `render_baseline_skeleton.py` 生成 skeleton,再按 `references/baseline-synthesizer.md` 补充受限叙述。完成后必须运行 `adversarial_grounding_check.py` 和 `validate_outputs.py --phase baseline --strict-anchors`。
7. Phase 4:如用户指定目标区域,按 `references/deep-dive-analyzer.md` 生成 `deep-dives/deep-dive-{area}.md`,并将发现反馈到 baseline 或 planning brief。
8. Phase 5:按 `references/planning-synthesizer.md` 生成规划前置产物。默认输出 `brownfield-planning-brief.md`、`candidate-change-slices.md`、`feature-entry-points.md` 到 `{planning_artifacts}` 或 `{brownfield_output}/planning/`,并明确后续应交给 Speclite `speclite-create-prd`、`speclite-create-architecture`、`speclite-create-epics-and-stories` 继续处理。

[输出目录结构] 默认产物写入目标项目的 {project_knowledge}/brownfield/,规划前置交接文档可同步到 {planning_artifacts}

```text
{project_knowledge}/brownfield/
├── project-scan-report.json
├── evidence/
├── baseline/
├── deep-dives/
├── planning/
└── validation/
```

[核心边界原则] 1. 不伪造历史:不反推研发历史,不虚构优先级、排期或验收过程。 2. 历史文档是证据源,不是真相源:历史资料必须经过候选事实、交叉验证、基线事实路径。 3. as-is 与 to-be 分离:baseline 只写当前系统事实,planning 只写后续规划输入。 4. 不吞并后续阶段:本 Skill 可生成 planning brief 和候选切片,但默认不替代 Speclite PRD、Architecture、Epics/Stories 工作流。 5. 强落盘、弱上下文:阶段完成后立即写盘并更新状态,只在上下文中保留摘要。 6. 证据优先于叙述:每个关键结论必须有 evidence anchor;证据不足时标注不确定性,不补全事实。

[注意事项] - 所有脚本调用必须使用 {skill-root}/scripts/...,不得依赖源码仓库路径。 - 所有运行输出必须使用 {brownfield_output}{planning_artifacts},不得把 {project_knowledge}/brownfield 写成当前运行依赖。 - config.toml.example 仅作字段结构参考,不作为 runtime fallback。 - 修改 scripts/extract_*.py、framework adapters 或 skeleton renderer 后,必须运行 python {skill-root}/scripts/run_golden.py {skill-root}/golden。 - 事实冲突(fact-conflicts.json)必须提示用户确认,不得自动裁决。 - 输出文档末尾必须追加 *本文档由 speclite-brownfield-context-builder Skill 自动生成* 标注。

Read the full file on GitHub · 83 lines

Files

What ships with it

40 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 83 lines · 77 tokens per session scan A 0893858d39f3

Subscribe to this mod's changes

speclite-brownfield-context-builder is a skill published in the GitHub repository flanliulf/SpecLite (4 stars, last pushed 2mo ago), licensed MIT. It adds 77 tokens to every session and 1,837 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

lain

Structural code intelligence for AI coding agents. Use this skill when the user wants to understand how a codebase is organized (modules, call graphs, file dependencies), find where to start reading, trace the impact of a change, find code by meaning, or understand what a symbol does in its full context. Do NOT use…

spuentesp/lain · 90 tokens

botpipe-workflow-authoring

Author, review, and improve Botpipe workflows. Use when Codex is asked to create packaged or workspace-local Botpipe workflows, convert codebases into workflows, design provider-heavy producer/verifier steps, write Botpipe prompts/contracts, inspect Botpipe traces, or apply Codex CLI/gpt-5.5 workflow patterns.

mrauter1/botpipe · 72 tokens

intake

The planning front-door. Captures feature ideas and bugs as graded rows in the root INTAKE.md ledger. Use it when the user says "log an idea", "capture a bug", "add to the backlog", "note this down", "track this feature", or invokes /intake. Owns the requirements interview — fleshes out thin ideas, proactively…

ndisisnd/msg · 239 tokens

merge

The ship gate — the only skill that merges. --staging merges the feature→staging PR on green CI, deploys, verifies, emits a human test script and stamps the staging sign-off on approval. --production ships the double-confirmed release to main and deploys production. Never self-certifies staging; nothing reaches main…

ndisisnd/msg · 94 tokens

pre-merge

The CI gate. Takes a feature branch from "eng says done" to "PR open against staging with green checks". Runs the project's preflight-resolved pipeline from devkit/policy.json components[]: sync → parallel correctness + security waves → coverage → regression tail → security/migration → PRD-consistency → open PR. Emits…

ndisisnd/msg · 101 tokens

msg

Root menu for msg skills, plus harness modes. --init is the one-time project bootstrap — use it when the user says "initialise project", "bootstrap repo", "set up the framework", "start a new project", or asks to set up project structure in an empty repo. Other modes: --init-staging (add a staging branch), --update…

ndisisnd/msg · 162 tokens