sa-brownfield-extract
Skill9 starsChanged 6 months agoApache-2.0View on GitHub
SA extract-mode procedure for brownfield onboarding Stage 2. Use when Solution Architect is dispatched in `extract` mode before SRS exists to turn Codebase Archaeologist reports and existing code/docs into a provisional docs/architecture.md with Source: extracted and confidence tags, plus extracted API/message contract stubs, route/dependency/async workflow coverage, and confirmation-pending open issues.
In this repository61 other files it gives its agents.
- rules/CLAUDE.mdCLAUDE.md
- acceptance-criteria-authorSkill
- adr-authorSkill
- api-contract-authorSkill
- backend-logging-traceabilitySkill
- ba-design-completenessSkill
- ba-ingestion-pipelineSkill
- ba-iteration-planningSkill
- ba-mode-augmentSkill
- ba-mode-external-sourceSkill
- ba-mode-multi-docSkill
- ba-mode-requirements-folderSkill
- ba-mode-reverse-engineerSkill
- ba-mode-single-docSkill
- ba-post-implementationSkill
- be-framework-coding-standardSkill
- c4-authorSkill
- codebase-inventorySkill
- data-lifecycle-contractsSkill
- design-system-authorSkill
- docker-deploymentSkill
- external-integration-adequacySkill
- fe-framework-coding-standardSkill
- figma-canvas-layoutSkill
- figma-design-handoffSkill
- figma-requirements-extractionSkill
- figma-srs-mappingSkill
- flutter-implementationSkill
- flutter-performanceSkill
- flutter-platform-integrationSkill
- format-boundary-contractsSkill
- git-commitSkill
- incident-debuggingSkill
- intent-archaeologySkill
- kubernetes-deploymentSkill
- local-deploymentSkill
- migration-safetySkill
- observability-readinessSkill
- playwright-authorSkill
- qa-author-by-taskSkill
- qa-author-by-usSkill
- qa-execution-runnerSkill
- react-native-implementationSkill
- react-native-performanceSkill
- react-native-platform-integrationSkill
- release-readinessSkill
- rollback-readinessSkill
- sa-architecture-designSkill
- secrets-config-auditSkill
- security-compliance-checklistSkill
- solution-defaultsSkill
- ssh-remote-operationsSkill
- staging-deploymentSkill
- task-sizingSkill
- <kebab-case-name-matching-folder>Skill
- test-case-authorSkill
- third-party-dependency-evaluationSkill
- ui-test-executionSkill
- ui-ux-page-scopingSkill
- user-story-authorSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 8 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Use this skill only for SA extract mode during brownfield onboarding Stage 2.
- Very specific: line 35
Read all archaeology reports for the scope.
- Very specific: line 36
Before extracting, verify the report contains ## Service Boundary & Entry Point Map, ## Route / RPC / Job Trace Matrix, ## Dependency & …
- Very specific: line 37
If the project has public/internal APIs or brokered messages but those sections are missing or shallow, halt with NEEDS_CONTEXT and request …
- Distinctive: line 41
Do not extract C4 Code.
- Very specific: line 56
Never mark extracted contracts Frozen.
- Distinctive: line 68
Keep architecture self-contained.
- Very specific: line 69
Commit changes, then emit plan-update.json.
- Distinctive: line 73
Document what exists; do not recommend or redesign.
- Very specific: line 74
Do not invent intent. An inferred item with no Intent-Trace: is a blocking Stage 3.5 finding that routes back to Stage 1b — never route an …
- Very specific: line 75
Every citation must resolve at the snapshot commit.
- Distinctive: line 76
Do not omit confidence tags.
- Distinctive: line 77
Do not propose new third-party dependencies.
- Distinctive: line 78
Do not write SRS or plan content.
- Very specific: line 79
Do not collapse API/message contracts into prose-only architecture.
- Distinctive: line 80
Do not treat a one-sided message observation as complete.
- Distinctive: line 82
Commit before signaling ready-to-finalize.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.
Files
SA Brownfield Extract
Use
Use this skill only for SA extract mode during brownfield onboarding Stage 2. The output documents what exists; it does not recommend changes.
Inputs
docs/archaeology-reports/<topic-slug>.inventory.md— the Tier-1 manifest. Read this first. Enumerated ground truth with stableINV-*IDs; it tells you the size of the job before you start, and Stage 3.5 reconciles your output against it as a set difference.docs/archaeology-reports/<topic-slug>.intent.md— intent verdicts.accidentalverdicts mark observed mechanisms that are residue rather than design; document them as deprecation candidates, not as architecture the team owns.docs/archaeology-reports/<topic-slug>.md- Existing codebase/docs named by the report
- Optional
scope:dispatch parameter:architecture-only,security-compliance, or a service/module name
Outputs
- Provisional
docs/architecture.md, every section carrying the provenance header block (Snapshot-Commit,Extracted-From,Covers-Inventory,Source-Hash) per.claude/rules/brownfield-onboarding.md§ Provenance and drift - Observed-decision ADRs only when code irrefutably encodes the decision
- Extracted API/message contract stubs under
docs/api-contracts/when endpoints, RPC operations, or messages are observable. Use service-level OpenAPI for REST, AsyncAPI for brokered messaging, proto for gRPC, GraphQL SDL for GraphQL, and markdown only for legacy/prototype surfaces with an explicit gap note. docs/open-issues.mdentries with categoryextract-confirmation-pending- Worktree
plan-update.json
Procedure
- Read the Tier-1 manifest and the intent report before anything else. Every section you write carries
Covers-Inventory: <IDs>. AnINV-*ID that ends up in no section is an extraction gap, and Stage 3.5 Check 2 is a set difference — it will find it. Where a surface genuinely does not belong in the architecture (a health check, build tooling, a dead route), disposition it explicitly (internal/dead/out-of-scope/deprecated) with evidence rather than leaving it uncovered; silence is indistinguishable from an oversight. - Read all archaeology reports for the scope. If any required report is
INSUFFICIENT, halt and request more archaeology or team-interview input.- Before extracting, verify the report contains
## Service Boundary & Entry Point Map,## Route / RPC / Job Trace Matrix,## Dependency & Call Graph (C3),## Message Broker / Consumer Logic, and## API / Message Spec Candidatesfor the in-scope services. - If the project has public/internal APIs or brokered messages but those sections are missing or shallow, halt with
NEEDS_CONTEXTand request a Stage 1 archaeology re-dispatch with deep route/dependency/contract scope. Do not compensate by writing vague architecture.
- Before extracting, verify the report contains
- Map observed services/modules to C4 C1-C3:
- C1/C2 are usually high confidence from repo layout, deploy manifests, and public surfaces.
- C3 is package/module inferred; mark confidence honestly.
- Do not extract C4 Code.
- Populate architecture sections from observed evidence:
- data models from migrations/ORM/schema files;
- API inventory from Public API Surface + Service Boundary & Entry Point Map + API / Message Spec Candidates;
- per-operation route trace from Route / RPC / Job Trace Matrix;
- dependency/call graph from imports, clients, service registries, Route Trace rows, Dependency & Call Graph edges, and manifests;
- async workflows from Message Broker / Consumer Logic, producers, consumers, topics, state transitions, retry/DLQ configs, and idempotency/dedup evidence;
- cross-cutting concerns from middleware/config;
- NFR posture from metrics when available, otherwise
unknown -- measure during pilot.
- For each discovered API/message, create an extracted contract stub with
Status: Extracted,Source: extracted, confidence, observed auth, schemas, and TODO markers for non-introspectable fields.- REST: create or update
docs/api-contracts/<service>.openapi.yamlwithopenapi: 3.1.0, one operation per observed route, operationId, auth/security scheme, request/response schemas, observed status codes, standard error envelope, idempotency/rate-limit notes, andx-source-evidencefile:line values. - gRPC: create or update
docs/api-contracts/<service>.protowith observed service/method/message shapes and TODO markers for unknown field types. - GraphQL: create or update
docs/api-contracts/<service>.graphqlwith observed query/mutation/subscription names, input/output types, auth notes, and TODO markers for unknown fields. - Async messaging: create or update
docs/api-contracts/<service-or-broker>.asyncapi.yamlwithasyncapi: 2.6.0or the project's declared version, channels, producer/consumer operation bindings, payload schemas, consumer groups, ack/commit behavior, retry/backoff/DLQ, idempotency/dedup, ordering/partition key, and side effects. - WebSocket/SSE: document as OpenAPI callbacks/webhooks when the project already uses OpenAPI that way; otherwise create a markdown extracted contract with connection/auth/message/event schemas and lifecycle states.
- Never mark extracted contracts
Frozen. FE Dev cannot consume them until BE Dev validates and freezes them during governed implementation or the human confirmation flow explicitly promotes them.
- REST: create or update
Tag every architecture section with
Source: extracted | Confidence: high|medium|low|inferred. The tag is a function of evidence class, not a judgement call — Stage 3.5 Check 4 enforces this table and an inflated tag is blocking:Tag Requires higha Tier-1 INV-*ID, or a passing test that asserts the behaviormediumread from source but not mechanically confirmed lownon-kit documentation, comments, or naming convention only inferredno source; MUST carry an Intent-Trace:from Stage 1b and a paired OQSelf-assessed confidence is noise:
hightags are exactly what Stage 4 reviewers skim past, sohighhas to mean something checkable. If a section you believe is right cannot cite an inventory ID or a test, the honest tag ismedium.- File one open issue for every
Confidence: inferreditem. - Keep architecture self-contained. Do not put substantive body references back to archaeology reports or source paths.
- Commit changes, then emit
plan-update.json.
Hard Rules
- Document what exists; do not recommend or redesign.
- Do not invent intent. An
inferreditem with noIntent-Trace:is a blocking Stage 3.5 finding that routes back to Stage 1b — never route an unprobed inference to a human. - Every citation must resolve at the snapshot commit.
Extracted-Frompaths,Covers-InventoryIDs,x-source-evidencevalues, and anyfile:lineare checked mechanically at Stage 3.5 Check 1. A citation that does not resolve is treated as fabrication, not as a typo. - Do not omit confidence tags.
- Do not propose new third-party dependencies.
- Do not write SRS or plan content.
- Do not collapse API/message contracts into prose-only architecture. If a route, RPC, or brokered message is observable, write a contract stub under
docs/api-contracts/or halt with a named extraction gap. - Do not treat a one-sided message observation as complete. A broker flow needs producer, payload, topic/queue, consumer handler, ack/commit, retry/DLQ, idempotency, and side effects when observable; unknown items become TODOs and open issues.
- Your output is gated by the Extraction Validator at Stage 3.5 before any human sees it. You do not self-certify the extraction.
- Commit before signaling ready-to-finalize.
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
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.

