$npx -y skills add AdamBien/airails --skill bc-carverCarve candidate business components from the confirmed domain concepts — cluster by CONCEPTS.md co-occurrence, name each BC with a canonical glossary term — and document the as-is → to-be diff in migration/CARVING.md without changing any code. Step between concept-clarifier and s
| 1 | # BC Carver |
| 2 | |
| 3 | Decide the decomposition, don't perform it. Carving and executing are different acts: the carver produces a written, reviewable cut of the system into business components — the diff a human argues about *before* the first class moves. Candidates, not verdicts. |
| 4 | |
| 5 | ## Inputs |
| 6 | |
| 7 | - `migration/GLOSSARY.md` — canonical terms and `## Decisions`: ground truth, never contradicted. |
| 8 | - `migration/CONCEPTS.md` — co-occurrence graph and evidence pointers. |
| 9 | |
| 10 | No mining, no new concepts. Vocabulary missing here is an extractor defect — stop and re-run `/concept-extractor`, don't improvise. |
| 11 | |
| 12 | ## Carving Heuristics |
| 13 | |
| 14 | - BCs are the dense clusters in the co-occurrence graph; cut along sparse edges. |
| 15 | - Homonym splits settled by the clarifier are the strongest boundary signals — a word that means two things marks two components. |
| 16 | - Name each BC with one canonical glossary term as a single lowercase token (`contracts`, `pricing`) — this is the future sbce BC name. |
| 17 | - Give each BC a one-line responsibility phrased in glossary language. If the line needs "and", reconsider the cut. |
| 18 | - Inter-BC references are directed (`uses`); cycles between candidates are a carving error, not a documentation fact. |
| 19 | |
| 20 | ## CARVING.md Format |
| 21 | |
| 22 | Write `migration/CARVING.md` — regenerable, diffable: |
| 23 | |
| 24 | ```markdown |
| 25 | # Carving: <system name> |
| 26 | |
| 27 | ## Components |
| 28 | ### <bc-name> |
| 29 | - **Responsibility:** <one line, glossary language> |
| 30 | - **Concepts:** <canonical terms> |
| 31 | - **Uses:** <bc-name>, ... |
| 32 | |
| 33 | ## Diff |
| 34 | | Current | Target BC | Layer | |
| 35 | |---|---|---| |
| 36 | | com.legacy.contractmgmt | contracts | — | |
| 37 | | com.legacy.common.ContractValidator | contracts | control | |
| 38 | |
| 39 | ## Unmapped |
| 40 | <technical noise, dead-code candidates, shared utilities — with reasons> |
| 41 | |
| 42 | ## Open Questions |
| 43 | ### Q<n> — <one-line question> |
| 44 | <evidence; candidate assignments> |
| 45 | ``` |
| 46 | |
| 47 | - **Diff granularity:** package-level rows by default; class-level rows only where a package splits across BCs — that is where the information matters, and full class listings on large systems are enormous and instantly stale. |
| 48 | - **Layer** (boundary | control | entity) only where the evidence supports it; leave `—` otherwise. |
| 49 | - **Unmapped is mandatory** — silent omission reads as "covered". |
| 50 | - **Open Questions** continue the shared Q-id space from `CONCEPTS.md`: never reuse or renumber ids, continue counting. Ambiguous assignments ("Tariff → contracts or pricing?") are questions, not guesses — resolve via `/concept-clarifier`. |
| 51 | |
| 52 | ## Rules |
| 53 | |
| 54 | - Documentation only — zero code changes; `/sbce` + the stack skill execute the carving, one BC at a time. |
| 55 | - A human confirms the cut before anything downstream consumes it. |
| 56 | - Respect `GLOSSARY.md` `## Decisions` on re-runs: resolved assignments stay resolved. |
| 57 | - Never overwrite a human-edited `CARVING.md` — regenerate to `migration/CARVING.new.md` (same convention as `CONCEPTS.md`). |