agentleFS
chrisduvillardchrisduvillard/codex-engineering-skills/skills/steward-brownfield/SKILL.md

steward-brownfield

Skill1 starsChanged 3 months agoMITView on GitHub

Build and maintain durable, evidence-backed project memory for large or long-lived brownfield systems, then use it to resume, discover, audit, plan, improve, align intent, and hand work to fresh agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

33 rules. About 0 are common, 25 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈25

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep the system small. Use portable files, deterministic tooling, repository-native authorities, and dynamic specialists only where they …

    line 13
  2. Distinctive:

    Treat source, tests, configuration, and runtime observations as evidence of implemented behavior.

    line 19
  3. Distinctive:

    Treat approved current user intent as authority for intended behavior.

    line 20
  4. Very specific:

    Treat .brownfield/ as a fallible, evidence-backed belief model.

    line 21
  5. Distinctive:

    Keep facts, user requirements, user assertions, decisions, inferences, assumptions, hypotheses, unknowns, freshness, and workflow state …

    line 22
  6. Distinctive:

    Keep existing glossaries, ADRs, architecture documents, and repository instructions authoritative for their stated scope.

    line 25
  7. Distinctive:

    Read repository instructions, glossary/context files, ADRs, and native architecture aids before naming concepts or running project commands.

    line 36
  8. Very specific:

    Run status before any persistent or source write:

    line 40
  9. Distinctive:

    Read operating-modes.md before selecting permissions or risk gates.

    line 57
  10. Distinctive:

    Read workflow.md for the applicable lifecycle sections.

    line 60
  11. Distinctive:

    Read state-model.md before initializing memory, changing schemas, recording important knowledge, invalidating records, handling multiple …

    line 81
  12. Distinctive:

    Use these truth layers:

    line 85
  13. Very specific:

    Use source-content fingerprints rather than commit IDs alone.

    line 97
  14. Distinctive:

    Keep current model documents concise and semantic: project purpose, capabilities, boundaries, components, interfaces, data/runtime flows, …

    line 102
  15. Distinctive:

    Ask only questions that can materially change behavior, architecture, safety, priority, or implementation.

    line 109
  16. Very specific:

    When intent changes, supersede the old requirement without erasing it.

    line 114
  17. Distinctive:

    Use parallelism only for genuinely independent read-only work or isolated worktrees.

    line 126
  18. Distinctive:

    Read coordination.md before delegating, accepting agent work, allowing parallel source edits, building context packages, reviewing …

    line 128
  19. Distinctive:

    Read scope, source-write allowlist, protected areas, and inherited run envelope.

    line 137
  20. Distinctive:

    If subagents are unavailable, execute the same contracts sequentially.

    line 140
  21. Distinctive:

    Never infer operational authority from a source-writing mode.

    line 183
  22. Distinctive:

    Verify a required check with an executable receipt:

    line 187
  23. Distinctive:

    Verify results against the exact current source snapshot.

    line 211
  24. Distinctive:

    Update the current model, approved constitution if applicable, and durable task/finding states.

    line 212
  25. Distinctive:

    Write a concise run summary containing changes, findings, decisions, tests, residual risk, blockers, and next priorities.

    line 214
  26. Very specific:

    Run finish; do not mark tasks resolved merely because the run ended.

    line 216
  27. Very specific:

    If an exact required check fails and the active run cannot be certified, use the one-way abort transition described in workflow.md.

    line 218
  28. Very specific:

    Use recover after an interrupted canonical merge or a crash during terminal-state publication.

    line 225
  29. Very specific:

    Use python3 <skill-directory>/scripts/brownfield.py <command> --help for exact arguments.

    line 232
  30. Distinctive:

    Read state-model.md for storage, record semantics, evidence, freshness, Git behavior, multi-repository scope, migrations, and compaction.

    line 256
  31. Distinctive:

    Read operating-modes.md for permission classes, mode selection, risk gates, run envelopes, escalation, and stopping.

    line 258
  32. Distinctive:

    Read workflow.md for reconnaissance, synthesis, user intent, audit, prioritization, implementation, verification, security, growth control, …

    line 260
  33. Distinctive:

    Read coordination.md for dynamic specialists, agent contracts, immutable proposals, context retrieval, independent review, conflicts, and …

    line 262

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Steward Brownfield Projects

Operate as a persistent engineering institution whose workers are disposable and whose validated knowledge survives them. Center every run on:

initialize or resume → refresh affected knowledge → perform mode-scoped work → verify → checkpoint

Keep the system small. Use portable files, deterministic tooling, repository-native authorities, and dynamic specialists only where they add value.

Preserve the invariants

  • Understand before modifying.
  • Treat source, tests, configuration, and runtime observations as evidence of implemented behavior.
  • Treat approved current user intent as authority for intended behavior.
  • Treat .brownfield/ as a fallible, evidence-backed belief model; never let it override stronger evidence.
  • Keep facts, user requirements, user assertions, decisions, inferences, assumptions, hypotheses, unknowns, freshness, and workflow state distinct.
  • Preserve contradictions rather than resolving them by preference or last-writer-wins.
  • Keep existing glossaries, ADRs, architecture documents, and repository instructions authoritative for their stated scope. Register and cite them instead of duplicating them.
  • Let specialists write immutable proposals. Let one coordinator write canonical project memory.
  • Protect dirty worktrees and unrelated user work. Never stash, reset, overwrite, or absorb it.
  • Scale verification and independent falsification with risk and impact.
  • Accept NO_CHANGE_REQUIRED, rejected findings, and stopped investigations as valid outcomes.
  • Persist conclusions, evidence locators, meaningful failed approaches, and resume state; never persist chain-of-thought, secrets, raw production data, or unlimited logs.

Start every invocation safely

  1. Read repository instructions, glossary/context files, ADRs, and native architecture aids before naming concepts or running project commands.
  2. Resolve this skill's directory and use scripts/brownfield.py; do not copy its logic into the project. Install requirements.txt before using the CLI; structural validation uses jsonschema.
  3. Run status before any persistent or source write:

    python3 <skill-directory>/scripts/brownfield.py --json status --root <project-root>
  4. Route by classification:
    • NEW: establish the memory location, version-control policy, repository scope, and sensitivity policy. Initialize .brownfield/ only if project-memory writes are in scope.
    • READY: load the stamped handoff, current model, constitution, and relevant records.
    • STALE: start a run, inspect the change set, apply targeted invalidation, and revalidate only affected knowledge.
    • RESUMABLE: reconcile the active run, contributions, source changes, and checkpoints before dispatching new work.
    • RECOVERY_REQUIRED: make no canonical or source writes until validation or transaction recovery succeeds.
  5. Infer the narrowest operating mode that satisfies the request. Default ambiguity to DISCOVERY. Read operating-modes.md before selecting permissions or risk gates.
  6. Begin a run with an explicit objective, scope, risk ceiling, allowed/forbidden paths, verification, and stopping conditions. Pass --authorize-source-writes only when the request actually grants it.
  7. Read workflow.md for the applicable lifecycle sections. Do not execute all phases mechanically when the project is already understood.

Initialize a new memory without changing project source:

python3 <skill-directory>/scripts/brownfield.py init --root <project-root> --name <project-name>

Begin a discovery run:

python3 <skill-directory>/scripts/brownfield.py begin \
  --root <project-root> \
  --mode DISCOVERY \
  --objective "Build the initial evidence-backed system model" \
  --scope "Repository-wide reconnaissance; no source changes"

Maintain the project world model

Read state-model.md before initializing memory, changing schemas, recording important knowledge, invalidating records, handling multiple repositories or branches, or compacting history.

Use these truth layers:

  1. Implemented reality: code, tests, configuration, observed runtime, and external systems.
  2. Intended reality: approved constitution and unsuperseded user requirements.
  3. Current belief: scoped, evidence-backed project records with explicit uncertainty and freshness.

Record one bounded assertion per typed JSON file. Attach direct evidence proportional to impact and include repository ID, relative path, symbol/query, content digest, source snapshot, verification method, and limitations where relevant. Treat line numbers only as navigation. Require at least one primary source for a high-confidence fact; do not let summaries cite other summaries in a circular chain.

Use source-content fingerprints rather than commit IDs alone. Exclude .brownfield/ from source fingerprints so memory-only commits do not stale code claims. Prefer false-stale to false-current when impact is uncertain. Never let code changes supersede user requirements; they may instead expose a contradiction or vision gap.

Keep current model documents concise and semantic: project purpose, capabilities, boundaries, components, interfaces, data/runtime flows, tests, infrastructure, invariants, constraints, and uncertainty. Do not substitute a file inventory. Stamp derived indexes, freshness reports, handoffs, and context packages with their canonical digest and source snapshot; reject stale derived views.

Understand the user’s intended system

Ask only questions that can materially change behavior, architecture, safety, priority, or implementation. Classify them as blocking, high-value, or non-blocking; do not ask curiosity questions. Record any non-blocking assumption before relying on it.

Preserve a sanitized meaningful question-and-answer event and synthesize current intent separately. When intent changes, supersede the old requirement without erasing it. Treat a user's statement about existing behavior as USER_ASSERTION until verified.

Maintain the Project Constitution as approved intended state. Include product and architecture principles, invariants, non-goals, constraints, protected areas, UX/performance/security/reliability requirements, and temporary compromises. Present agent-generated constitution changes as visible proposals and obtain user approval before treating them as authoritative.

Create a dynamic engineering organization

Perform reconnaissance before choosing specialists. Allocate by architectural boundary, domain, coupling, operational risk, and independent-verification need—not lines of code or available slots. Use parallelism only for genuinely independent read-only work or isolated worktrees.

Read coordination.md before delegating, accepting agent work, allowing parallel source edits, building context packages, reviewing important findings or changes, resolving conflicts, or recovering an interrupted run.

Give every specialist a durable contract containing:

  • Mission, questions, scope, task ID, dependencies, and definition of done.
  • Base memory revision, exact source snapshot, and relevant entity versions.
  • Focused context, known stale inputs, requirements, invariants, contradictions, and prior attempts.
  • Read scope, source-write allowlist, protected areas, and inherited run envelope.
  • Evidence standard, required checks, output location, and escalation conditions.

If subagents are unavailable, execute the same contracts sequentially. Do not make persistent memory depend on a specific agent platform.

Build a bounded context package from explicit record IDs and task terms:

python3 <skill-directory>/scripts/brownfield.py context \
  --root <project-root> \
  --mission "<agent mission>" \
  --record <record-id> \
  --max-chars 24000

Have workers stage immutable contributions. Require the coordinator to validate freshness, sensitivity, evidence, scope, and expected record revisions before merge. Reject stale-base updates; re-evaluate and stage a new proposal. Preserve competing semantic claims as a contradiction. Never use last-writer-wins.

For important findings or changes, assign a reviewer a falsification mission using raw artifacts and necessary context without leaking the desired conclusion. Repeated model confidence is not independent proof; prefer tests, runtime evidence, static tools, or human approval.

Audit, prioritize, and improve

Audit risk-first: security, data integrity, correctness, reliability, concurrency, failure handling, public contracts, migrations, operational paths, performance, test validity, missing functionality, and deviations from approved intent. Separate severity, confidence, blast radius, and preference.

Persist findings before prioritizing them. Build a dependency-aware task graph that accounts for user impact, business importance, reversibility, cost, root-cause leverage, and regression risk. Do not fix in discovery order and do not manufacture work.

Before source changes:

  1. Confirm the mode and run envelope authorize the exact change.
  2. Capture branch, commit, dirty paths, relevant checks, known failures, and observed behavior.
  3. Identify requirements, dependencies, rollback, regressions, and validation criteria.
  4. Isolate modifying agents with worktrees or serialize writers.

Implement the smallest coherent root-cause solution. Prefer deletion, simplification, consolidation, and reuse over new layers or dependencies. Run focused checks while iterating and broader checks in proportion to risk. Compare against the baseline and independently review important work.

Never infer operational authority from a source-writing mode. Deployment, publication, remote pushes, external messages, cloud changes, production data, and destructive actions require explicit target- specific authorization.

Verify a required check with an executable receipt:

python3 <skill-directory>/scripts/brownfield.py verify \
  --root <project-root> \
  --name unit-tests \
  --timeout 900 \
  -- python3 -m unittest discover

Checkpoint --check values are descriptive labels only. finish accepts required checks only from current PASS receipts produced by verify.

Checkpoint, finish, or abort

Advance run stages durably: INITIALIZED → INVESTIGATING → [CHANGING] → VALIDATING → REVIEWING → MERGING → COMPLETE. Omit CHANGING when source writes are not authorized. At each boundary, persist accepted/rejected knowledge, relevant evidence, baseline comparison, tests, uncertainty, task state, and the next safe action.

Before finishing:

  1. Accept or explicitly reject every staged contribution.
  2. Validate memory strictly and reconcile incomplete transactions.
  3. Verify results against the exact current source snapshot.
  4. Update the current model, approved constitution if applicable, and durable task/finding states.
  5. Rebuild the deterministic index, freshness report, and new-agent handoff.
  6. Write a concise run summary containing changes, findings, decisions, tests, residual risk, blockers, and next priorities.
  7. Run finish; do not mark tasks resolved merely because the run ended.

If an exact required check fails and the active run cannot be certified, use the one-way abort transition described in workflow.md. abort preserves the last nonterminal stage, records ABORTED, leaves final_snapshot null, writes a durable abort.md and abort event, and clears the active-run pointer without advancing the last completed run or accepted snapshot. It does not certify the work, satisfy the failed check, discard contributions, or revert source. Inspect the retained state and start a new successor run; never resume, finish, or repurpose the aborted run.

Use recover after an interrupted canonical merge or a crash during terminal-state publication. It completes the recorded write-ahead transaction, or reconciles an already-terminal run with a stale active-run pointer; it never guesses, reverts source, discards user work, or promotes an aborted snapshot.

CLI reference

Use python3 <skill-directory>/scripts/brownfield.py <command> --help for exact arguments.

CommandPurpose
statusClassify new, ready, stale, resumable, or recovery-required state without mutation.
initCreate the portable .brownfield/ skeleton and copied schemas; refuse overwrite.
snapshotCapture a source vector that excludes memory-only changes.
beginPersist the mode, immutable run envelope, baseline, and stopping conditions.
record-templateCreate a typed evidence-record skeleton.
contribution-templateCreate a proposal against the active memory revision and source snapshot.
stageAtomically stage a unique immutable contribution; allow concurrent workers.
merge / rejectLet the sole coordinator accept or durably reject a contribution.
refreshReport targeted staleness; use --apply only inside an active run.
contextRetrieve task-scoped current knowledge within a character budget.
verifyExecute a bounded command and persist a source-linked verification receipt.
checkpointAdvance exactly one permitted run stage with a concise summary.
renderDeterministically rebuild derived index, freshness, and handoff views.
recoverComplete an interrupted memory transaction or reconcile a closed run.
validate --strictFail closed on schema, safety, provenance, link, or transaction problems.
finishRefuse closure until contributions, validation, views, and summary are complete.
abortTerminally record an exact failed required check without certifying or reverting the run.

Read references progressively

  • Read state-model.md for storage, record semantics, evidence, freshness, Git behavior, multi-repository scope, migrations, and compaction.
  • Read operating-modes.md for permission classes, mode selection, risk gates, run envelopes, escalation, and stopping.
  • Read workflow.md for reconnaissance, synthesis, user intent, audit, prioritization, implementation, verification, security, growth control, and recovery.
  • Read coordination.md for dynamic specialists, agent contracts, immutable proposals, context retrieval, independent review, conflicts, and resumability.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.