brownfield-adopter
Reverse-scan an existing codebase and record what can be verified from the code — a system map and a list of scenario candidates — as a current-state seed. The seed is written to a private staging area and committed by the openlogos baseline-seed command, never edited into logos/resources/ directly.
This Skill is an explicit, optional accelerator. It is not the default next step after openlogos adopt, and it never decides whether you may create a change. If you skip it entirely, change-writer still fills in the formal specs for the scenarios each change touches.
Phase & Trigger
Section titled “Phase & Trigger”- Phase: Existing-project onboarding (adopted projects,
bootstrap: adopted) - Trigger conditions:
- You explicitly ask to “build a current-state seed”, “pre-scan the whole codebase”, or “run baseline-seed”
- You ask to resume or rescan a safe open run / uncommitted staging
- Never triggered automatically just because
adoptfinished or becausestatus/nextshowbaseline_seed_state: requiredorpartial. None of the seed states is a prerequisite for change, plan, delta, merge, or verify.
Prerequisites
Section titled “Prerequisites”logos/logos.config.jsonexists and the target module is registered as an adopted module inlogos-project.yaml(baseline-seedrejects other modules).- The AI session has read access to the codebase.
- The CLI supports
openlogos baseline-seed begin | commit | status(0.16.0 does).
Unlike the other Skills, brownfield-adopter is not copied into logos/skills/ by init / sync. It ships with the npm package (skills/brownfield-adopter/SKILL.md) and with the OpenLogos Claude Code plugin; ask the AI to load it when you want a seed.
The openlogos baseline-seed command
Section titled “The openlogos baseline-seed command”openlogos baseline-seed is the only writer of the seed state and of the seeded target documents. The AI writes only into the run’s staging directory.
| Subcommand | Purpose |
|---|---|
openlogos baseline-seed begin --module <id> --manifest <path> | Validate the logical plan (manifest), create a private staging directory logos/resources/verify/baseline-seed-runs/<run_id>/staging/, and return a run_id. A previous open run of the same module is superseded. |
openlogos baseline-seed commit --module <id> --run-id <id> | Validate the staged bytes (paths, schema, candidate keys) and commit them atomically together with the index and the seeded state. |
openlogos baseline-seed status --module <id> | Show the current run, the seed state, and how many expected items are staged or missing. |
All three accept --format json.
The module’s seed state is one of:
baseline_seed_state | Meaning |
|---|---|
required | No seed committed yet (the default after adopt). Informational only — you can create changes right away. |
partial | Some staged items were valid but the set was incomplete; nothing was committed. Uncommitted staging never enters the effective view. |
seeded | A complete seed was committed. Later changes can use it to locate evidence faster. |
What It Does
Section titled “What It Does”-
Confirms the intent and the recovery gate — checks that you really asked for an eager seed (not a normal adopt → change), and recovers any unfinished commit journal first. If it reports
baseline_commit_in_progress, the Skill stops. -
Scans the code and plans a manifest — a logical plan without content hashes, with at least a
system-mapand ascenario-candidatesentry:{"module": "core","expected": [{ "kind": "system-map", "target_path": "logos/resources/prd/3-technical-plan/1-architecture/core-system-map.md", "candidate_keys": ["core::<hash>"] },{ "kind": "scenario-candidates", "target_path": "logos/resources/prd/3-technical-plan/2-scenario-implementation/core-scenario-candidates.md", "candidate_keys": ["core::<hash>"] }]}A candidate key is
<module>::<first 12 hex chars of sha256(normalized anchor)>, where the anchor is a semantic identifier such as a CLI command, an exported entry point, or a route. Target paths must be project-relative and inside the allowedlogos/resources/targets. -
Begins a run —
Terminal window openlogos baseline-seed begin --module core --manifest .logos-seed-plan.json --format json -
Writes the documents into staging — each document goes to
staging/<target_path>and carries a## 逆向基线来源(reverse-engineered baseline source) section with a fenced YAMLcandidates[]list. Every candidate isstate: activeandverified: false; the staged key set must equal the manifest’scandidate_keys. -
Commits the run —
Terminal window openlogos baseline-seed commit --module core --run-id <run_id> --format json- all required kinds present and every expected item valid → committed atomically, state becomes
seeded; - at least one valid item but the set is incomplete →
partial, nothing committed; fill in staging and reruncommit; - no valid item → state unchanged.
- all required kinds present and every expected item valid → committed atomically, state becomes
-
Hands control back — whether the seed was committed or paused, the next step is
openlogos change <slug>.
Core Principles
Section titled “Core Principles”- Only facts verifiable from the code — the system map (modules, entry points, dependencies) and scenario candidates. No PRD, no historical “why”.
verified: falsestays frozen — there is no confirmation step that upgrades a candidate.- Staging only — the Skill never edits
logos-project.yamlor the target files inlogos/resources/; the CLI is the only committer. - A missing capability never blocks change — if the scan cannot run, the Skill says so and gives you the
openlogos change <slug>command to copy. - Safe partial vs. unfinished transaction — an open run or uncommitted staging can be excluded and work can continue; a commit journal in
prepared/committingmust be recovered first. - Existing code is grandfathered — the seed is an unconfirmed snapshot; methodology gates apply only to new intent.
Sources the Skill may rely on are recomputable facts: code entry points, routes, dependency manifests, configuration, and tests. Comments, READMEs, and doc examples are hints only.
Recovery
Section titled “Recovery”- Scan interrupted before commit — safe
partial: complete the staging and reruncommit,beginagain, or simply start a change. - Commit crashed — the next
baseline-seed,status,next,index, orsynccall recovers it under the module lock: apreparedjournal rolls back to the old state; acommittingjournal rolls forward if possible, otherwise back. - Recovery impossible — the commands report
baseline_commit_in_progressand stop reading standard resources until it is resolved.
Outputs
Section titled “Outputs”- After a successful commit: the seeded documents under
logos/resources/(for examplecore-system-map.mdandcore-scenario-candidates.md), the derivedbaseline_index, andbaseline_seed_state: seededinlogos-project.yaml— all written by the CLI. - During a run: only files under
logos/resources/verify/baseline-seed-runs/<run_id>/staging/.
Related
Section titled “Related”- Adopt an Existing Project — the default path: adopt, then create changes directly
openlogos adopt— onboards the project and setsbaseline_seed_state: requiredchange-writer— fills in the specs each change touches, with or without a seed