/kanon-java-airails:sbcefrom kanon-java-airails
Spec-driven BCE workflow where one capability spec equals one business component (same name) and the spec is the boundary contract. Invoked as `/sbce new|apply <capability-or-feature>` (or by intent), it drives declare → converge; the stack's own test loop is the oracle for "done". `new` accepts a BC name or a natural-language feature description that may decompose into one or several BCs (new or existing). Stack-neutral — composes with `/bce` and a stack skill (`/java-cli-app`, `/microprofile-server`, `/web-components`, …) for code shape and verification. Use when authoring or converging a capability spec, declaring a feature as one or more BCs, mapping a spec to a BC, or running `/sbce new`, `/sbce apply`. Triggers on "SBCE", "capability spec", "spec-driven BCE", "declare a feature", "spec to BC", "converge to spec", "/sbce new", "/sbce apply".
Ships in kanon-java-airails. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Drive the spec-driven BCE workflow — one skill owns both the rules and the steps. Invoke as
/sbce <mode> <capability> (new or apply), or let it trigger from intent. Apply every rule
strictly.
package-info.java (Java, /// Markdown) or package-info.md (web) — co-located with the code it governs. There is no separate specs/ tree and no hand-typed package coordinate. In Java the /// doc renders via javadoc, so the same file is source-of-truth and published contract.spec vs BC on demand — never a hand-maintained tasks file.The BC name is the only identity — a single lowercase token (checkout), never a dotted path
or a bc/capability field. The stack skill owns where it lands:
checkout # BC name == the only identity
spec = package doc, co-located with code:
Java: src/main/java/<base>/checkout/package-info.java # `///` Markdown (JEP 467)
web: app/src/checkout/package-info.md # Markdown
code = same folder, {boundary,control,entity}/ # stack skill places it
## Boundary op ↔ one boundary entry-point method.## Requirements (EARS) ↔ behaviour and the tests covering it.## Entities ↔ the entity layer.An optional doc one altitude up — the base package's package-info.java /
app/src/package-info.md — for concerns that span BCs and have no other home. Add a section
only when a real cross-BC concern appears; a one-BC system needs none. Author from
references/system-doc-template.md.
Sn, no test; the single non-verifiable line in the doc, and the deliberate exception to the traceability invariant. May be proposed by /sbce new distilling a README seed (human accepts/edits)./bce owns the generic layering; this owns the concrete dependencies).shall statements (id Sn) no single BC owns.## Entities stays terse.Dn — <choice>. _(why: …; rejected: …)_. Rationale, not contract — like Vision and a statement's why: no test, not a trace target. Ids stable; a reversed decision gets a new entry, the old one marked superseded by Dm — never edited or deleted. Litmus: testable behaviour → an EARS statement (tested); a standing project rule → README ## Conventions; a point-in-time choice with rejected alternatives → Dn. A decision owned by a single BC may live in that BC's package doc under the same rules.apply reads it instead of re-inferring.Never duplicate a BC's one-liner — a hand-typed BC index drifts; the gap is read, not stored. For a BC map, mark it generated and regenerate it from the per-BC docs.
An optional repo-root README.md — a human on-ramp that is a projection of the specs, not a
source of truth. Author from references/readme-template.md. Two slices, handled oppositely:
Generated (never hand-edited) — the system doc's Charter + Vision, a BC map (each BC name, its > one-liner, a link to its package-info), and a Mermaid diagram of the declared ## Components wiring, fenced by <!-- sbce:generated:start --> / <!-- sbce:generated:end -->.
Hand-maintained (outside the markers, since no spec covers it — so it can't drift): ## Conventions, build/run/test delegated to the stack skill, plus free-form meta (license, links, motivation).
Doubles as the inception seed. The hand-written prose outside the markers is what /sbce new (no argument) reads to bootstrap vision + specs (see new); SBCE reads it, never rewrites it.
Components diagram — projection, never inference. Render only the declared wiring in the system doc's ## Components (allowed calls + integration events) as a Mermaid graph: nodes are BCs, edges the declared directed relationships. Never infer edges by scanning code — that is discovery, not projection, and drift-prone. No ## Components (a one-BC system) → nodes only, or omit. Basic Mermaid flowchart/graph syntax (version-stable, corpus-dense); delegate diagram style to /mermaid or /bce-diagrams.
## Conventions is the home for project-specific, non-behavioral standards (coverage target, "money is always cents", review policy): declared, not verified — no Sn, no test — and distinct from a System invariant, which must be behavioral and tested, and from a Dn decision, which records a point-in-time choice with its rejected alternatives.
Optional: a one-BC project needs none. No markers → apply leaves the README untouched.
| Concern | Owner | Deterministic? |
|---|---|---|
| Run tests / "is it green" | the stack's verification loop (the composed stack skill) | yes — existing tooling, no LLM |
| Decompose a feature into BCs (new vs existing) | this skill's judgment, over a read-only scan of the source tree's package docs, user-confirmed | no — semantic |
Record a confirmed choice as a Dn decision | this skill offers, user-confirmed — never recorded silently | no — semantic |
| Author the spec content (boundary ops, EARS requirements) | this skill's judgment | no — semantic |
| Place the BC — package doc + layer dirs at the source location | the composed stack skill (owns the package base / source root) | yes — stack-defined |
Structural sync, both directions (spec→code: op→method, Rn.m→test · code→spec: method→op, test-id→statement, entity→## Entities) | this skill, made checkable by the stack's traceability convention | grep-level |
| "Does this code satisfy the requirement" | this skill's judgment, grounded by the requirement's passing test | no — semantic |
Regenerate the README generated block (Charter/Vision/BC map/## Components diagram) from the package docs | this skill | yes — mechanical projection |
Read mode + capability from the invocation (/sbce apply checkout). If mode is missing, infer: no
spec yet → new; spec exists but not converged → apply; else ask.
Declare a new feature from a BC name (one precise BC), a natural-language feature
description (which may decompose into one or several BCs, new or existing), or the repo
README seed (/sbce new with no argument). The novelty is the intent, not the artifact —
coining a BC and extending one are both "new".
Clarify first (both paths). Resolve every ambiguity the contract needs before authoring. Vague
input ("store a session with title, description, conference, date") hides scope and edge cases —
a guessed spec makes the oracle verify assumptions, not intent.
If…then), state constraints (While…) — and across the BC: scope (create-only vs full lifecycle, in/out), entities and fields (required/optional, identity, validation), and what "done" means.BC name (/sbce new checkout):
references/spec-template.md: one-line responsibility, boundary ops, EARS requirements, optional entities, out-of-scope.boundary/control/entity dirs. Write no BC source./sbce apply <bc-name>.Feature description (/sbce new "let a customer check out a cart"):
## Decisions if present: never propose an alternative a Dn records as rejected.Dn in the system doc's ## Decisions; never record one silently.README seed (/sbce new, no argument):
The repo-root README.md doubles as an optional inception seed — a human (often a product
owner or analyst) writes free-form intent there and SBCE bootstraps from it. Read only the
hand-written prose outside the sbce:generated markers.
## Vision line distilled from the seed; the human accepts or edits it — never author it silently./sbce new simply re-reads it and re-proposes through the same confirm-first path.Guard: one capability ≡ one BC — output is 1..N package-doc specs, never a persisted feature artifact.
Make reality match the declared spec — the "make it so" step. Idempotent.
/sbce new <bc-name> first and stop.Stack line if present, else AGENTS.md/README, else ask once. Read the system doc's ## Decisions if present — never close a gap with an approach a Dn rejected.boundary method; each untested statement id Rn.m → a traceable test (delegate the EARS→table transform to /ears-tests — one parameterized test per ### Rn, one labeled row per Rn.m); then write code to pass them. Invoke /bce (invariants) + the stack skill (idioms).boundary method with no declared op, a test tracing an id no statement carries, an entity type absent from ## Entities — report each as drift and stop on it. The spec is the source of truth, so the user decides: declare it (/sbce new / extend the doc) or delete the orphan. Never edit the spec to match code.Green build + no structural gap or drift is the only definition of done.
*Impl/*Service) → /bce. Code idioms + verification → the stack skill./bce or the stack skill; if either conflicts with a spec, surface it, don't guess.Sections in order: # Title + one-line responsibility, ## Boundary, ## Requirements, optional ## Entities, optional ## Decisions (BC-local confirmed choices — same rules as the system doc's section), ## Out of scope.
Boundary operations are verb-noun and transport-neutral (place-order, not POST /orders).
Requirements are EARS statements — one of six patterns, the system always the BC — grouped under a titled ### Rn, each statement carrying a stable id Rn.m (group n, statement m). Reach for If…then and While… to capture error and edge cases.
| Pattern | Template |
|---|---|
| Ubiquitous | The BC shall <response>. |
| State-driven | While <precondition>, the BC shall <response>. |
| Event-driven | When <trigger>, the BC shall <response>. |
| Optional-feature | Where <feature is included>, the BC shall <response>. |
| Unwanted-behaviour | If <trigger>, then the BC shall <response>. |
| Complex | While <precondition>, when <trigger>, the BC shall <response>. |
Every statement uses shall and is mandatory and tested — no SHOULD/MAY gradation (the oracle is binary); express optionality with the Where (optional-feature) pattern.
Ids are stable: never renumber on reorder; a removed id is retired, not reused.
Every boundary op traces to a group Rn; every statement Rn.m traces to ≥1 test that embeds its id — per-statement and bijective both ways: a new Rn.m with no test is a gap, and a method, trace id, or entity type with no spec counterpart is inverse drift (surfaced, never absorbed into the spec). The trace form is the stack skill's call (an r1_2… method, a @requirement R1.2 JavaDoc tag on the test, a system-test or Playwright name); SBCE only requires the id be grep-visible.
Optional why. Any Rn.m statement (or boundary op) may carry a trailing _(why: …)_ — terse origin/intent for the rule. Rationale, not contract: non-verified (the oracle ignores it), not a trace target (the statement still needs its test; a why is never drift), and bound to its id (retires with the statement, never orphans; the Rn.m prefix stays first so id-grep is unaffected). Capture why the rule exists, never how it currently works — immutable origin, not a description to re-sync.
The control layer is implementation — pure how — so it has no spec section; only ## Boundary, ## Requirements, and ## Entities map to code.
Stack-neutral throughout: no types, transports, framework verbs, or how.
The worked example — a checkout BC — lives in references/spec-template.md. The chain it
illustrates: the BC name comes from the package/folder, no frontmatter; the stack skill places
boundary/control/entity beside the doc; each boundary op becomes one boundary method
(place-order → placeOrder); each statement id (R1.1, R2.2, …) gets a test whose trace
embeds that id.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub themaverik/kanon --plugin kanon-java-airails8 skills in this plugin
/bceGeneric, composable architecture rules for the Boundary-Control-Entity (BCE/ECB) pattern — business components, layer responsibilities, package structure, and cross-component relationships. Technology-neutral; meant to be composed with language- or framework-specific skills (e.g. microprofile-server, web-components, aws-cdk, java-cli-app). Use when creating, generating, scaffolding, writing, or reviewing code organized as business components with boundary/control/entity layers. Triggers on "BCE", "ECB", "Boundary-Control-Entity", "business component", "BC layout", "BC structure", "boundary layer", "control layer", "entity layer", or requests to organize, package, refactor, or review code along BCE lines./continuous-testingContinuous test-driven development loop — after every code change, builds the project, starts the server, and runs Unit Tests, Integration Tests, and System Tests. Applies on top of microprofile-server skill. Use during development when you want full verification after each change. Triggers on "continuous testing", "continuous-testing", "test loop", "st-loop", or requests to run all tests after every change./ears-testsGenerate parameterized (table-driven) tests from EARS requirement statements — the deterministic transform that turns an SBCE capability spec's `## Requirements` into one parameterized test per requirement group and one labeled row per statement id. Stack-neutral; owns only the EARS→table mapping and the spec↔test trace, and delegates the test syntax to the composed stack skill (JUnit 5, zunit, Playwright). Use whenever turning EARS requirements, acceptance criteria, or an SBCE/`/sbce` spec into tests; whenever you see "When/While/If…then, the … shall …" statements that need covering; or when asked for table-driven, data-driven, or parameterized tests from a requirement group. Triggers on "EARS", "parameterized tests", "table-driven tests", "data-driven tests", "tests from requirements", "tests from the spec", "cover requirement Rn", "generate tests for this capability", "acceptance criteria to tests".