# SP Ecosystem Capability Map

## Scope
Repo-overarching owner-first capability map for the current SmilingPirate-related project landscape:

- `sp-gh-copilot-kit`
- `sp-theme-system`
- `capability-modeling-toolkit`
- `sp-music-hero`
- `sp-learning-languages-with-movies`
- `smilingpirate-site`

This semantic map is the authoritative source for the intended responsibility split between those repositories.
Visualization properties and any HTML page are companion artefacts for layout and presentation only.
This remains the owner-first lens. The companion capability-first lens lives in `docs/visualization-src/sp-ecosystem-capability-implementation-map.md`.

## Hierarchy decision
- Level 0 container: owner repositories.
- Level 1: the stable capability clusters each repository owns.
- Level 2: defining feature slices that make each capability concrete enough to scope and defend.
- Secondary lens:
  - reusable core owner
  - shared-system owner
  - mixed-toolkit owner
  - product owner
  - host / publish owner
- Rationale:
  - the main question is still where a change must start if drift is to stay low;
  - therefore owner repos remain the cleanest Level 0 structure;
  - the extra Level 2 feature slice is there to make the capability borders less abstract.
- Detail rule:
  - this map now carries one explicit feature layer below each capability;
  - deeper repo-local feature, module, or code maps still stay local to the owning repo.

## Layout heuristic
- Primary structure: columns ordered from reusable core owners to product repos to the host / publish target.
- Left to right reading:
  1. generic workflow governance
  2. shared-system contracts
  3. capability-modeling lifecycle
  4. product semantics
  5. host publication
- The graphical map should show the owner repo, its main capability clusters, and short feature slice lists.
- Detailed ownership rules still belong in the readout surface below the map.

## Hierarchy placement
- Level 0:
  - each repository gets one bounded owner column.
- Level 1:
  - capability cards sit inside the owner column and represent stable concerns that repo owns.
- Level 2:
  - short feature slice lists sit inside or directly beneath the owning capability card.
- Level 3:
  - deeper sub-features remain nested under the local repo map and are not promoted back into this cross-repo overview unless they become portfolio-level ownership concerns.

## Visualization plan
- Template family: columns.
- Layout grammar: owner-responsibility columns in a reusable-core -> product -> host progression.
- Why this grammar fits:
  - the main distinction is ownership, not runtime flow;
  - the viewer should be able to answer "where should this change start?" quickly;
  - columns make non-ownership and consumption boundaries easier to compare than a radial map.
- Visual encodings:
  - ownership -> column placement
  - scope breadth -> card width
  - complexity -> badge value `C#`
  - importance -> fill emphasis `I#`
  - gap to target -> border emphasis `G#`
  - owner type -> column accent color
  - feature slices -> short nested chips or lists inside the capability card
  - dependency / consumption -> arrows in Mermaid source and explicit `Consumes` notes in the readout
- Density split:
  - graphical map -> repo title, capability titles, compact badges, and short feature slice lists
  - semantic readout -> owner type, ownership rule, consumption rule, non-ownership rule, and notes

## Level 0 structure

| Level 0 | Owner repo | Purpose |
|---|---|---|
| Workflow governance | `sp-gh-copilot-kit` | Own the generic workflow, prompt, planning, and visualization-orchestration model. |
| Shared experience system | `sp-theme-system` | Own reusable theme, shell, runtime-light, and host-integration contracts. |
| Capability-modeling lifecycle | `capability-modeling-toolkit` | Own workbook-backed capability-modeling lifecycle and mixed-plane CBP governance. |
| Product semantics: music | `sp-music-hero` | Own the music-learning product semantics, practice loop, and instrument coaching behavior. |
| Product semantics: language | `sp-learning-languages-with-movies` | Own the subtitle-based language-learning product semantics, card model, and override flow. |
| Host and publication | `smilingpirate-site` | Own the integrated site host, publish target, and injection surface. |

## Capabilities

| ID | Level | Parent or container | Owner repo | Capability | Provider-side description | Customer proximity | User visibility | Importance (1-5) | Complexity (1-5) | Gap to target (1-5) | Boundary note |
|---|---|---|---|---|---|---|---|---:|---:|---:|---|
| ECO-W1 | L1 | Workflow governance | `sp-gh-copilot-kit` | Govern shared workflow, planning, and prompt semantics | Define the reusable SP workflow core, plan contract, prompt families, and host-agnostic adapter logic. | mixed | high | 5 | 4 | 2 | Owns generic workflow semantics, not product or theme semantics. |
| ECO-W2 | L1 | Workflow governance | `sp-gh-copilot-kit` | Orchestrate project visualization and kit evolution | Provide propose/apply visualization workflows, prompt refactoring, packaging, import, and update orchestration. | mixed | medium | 5 | 4 | 2 | Owns orchestration rules, not every semantic artefact those flows may touch. |
| ECO-T1 | L1 | Shared experience system | `sp-theme-system` | Publish reusable theme and shell contracts | Define shared token, brand, shell, and CSS contract surfaces for standalone and host-mounted usage. | mixed | high | 5 | 4 | 2 | Owns shared-system contracts, not workflow or product meaning. |
| ECO-T2 | L1 | Shared experience system | `sp-theme-system` | Govern host-integration and shared-system adoption | Define host integration rules, optional runtime helpers, overlays, and migration/publish discipline for shared-system changes. | enabling-internal | medium | 4 | 4 | 2 | Owns integration contract clarity, not host content ownership. |
| ECO-C1 | L1 | Capability-modeling lifecycle | `capability-modeling-toolkit` | Operate workbook-backed capability-modeling lifecycle | Own export/import/insert/move/renumber/migrate flows and the authoritative workbook-centered capability-map lifecycle. | mixed | medium | 5 | 5 | 2 | Owns CBP lifecycle and workbook truth, not generic workflow governance or theme contracts. |
| ECO-C2 | L1 | Capability-modeling lifecycle | `capability-modeling-toolkit` | Govern mixed-plane coexistence and CBP self-models | Explain how Plane A/B/C/D coexist, when repo-owned self-model bundles are allowed, and how CBP differs from target-domain maps. | enabling-internal | medium | 5 | 4 | 2 | Owns CBP coexistence rules, not the semantics of external product repos. |
| ECO-M1 | L1 | Product semantics: music | `sp-music-hero` | Deliver the music practice loop and playback experience | Own the practice engine, timed playhead loop, instrument views, and learning-facing interaction model. | customer-facing | high | 5 | 5 | 2 | Owns music-product semantics, not generic workflow or shared-system truth. |
| ECO-M2 | L1 | Product semantics: music | `sp-music-hero` | Own music-specific content, mapping, and coaching semantics | Define timeline models, instrument variants, mapping logic, and music-learning UX decisions. | customer-facing | high | 5 | 5 | 3 | Shared contracts may shape presentation, but the learning semantics stay local here. |
| ECO-I1 | L1 | Product semantics: language | `sp-learning-languages-with-movies` | Deliver subtitle-based learning paths and static card runtime | Own path structure, card runtime, and the learner-facing study flow for the static app. | customer-facing | high | 5 | 4 | 2 | Owns language-product semantics, not generic workflow or theme-system contracts. |
| ECO-I2 | L1 | Product semantics: language | `sp-learning-languages-with-movies` | Own content curation, local overrides, and merge-back workflow | Define how subtitle data becomes cards, how local edits persist, and how exported improvements merge back into the repo. | customer-facing | medium | 5 | 4 | 2 | Owns the content pipeline and override semantics, not host publication ownership. |
| ECO-S1 | L1 | Host and publication | `smilingpirate-site` | Host and publish integrated site surfaces | Provide the top-level site shell, deployed destination, and path-mounted entry points for published surfaces. | customer-facing | high | 4 | 3 | 2 | Owns host presence and deployment surface, not the underlying toolkit or product semantics. |
| ECO-S2 | L1 | Host and publication | `smilingpirate-site` | Inject and adopt shared outputs without semantic takeover | Apply themes, mounted outputs, and published artefacts from owner repos while preserving their upstream authority. | mixed | medium | 5 | 3 | 2 | Must consume and present external semantics without silently redefining them locally. |

## Defining feature slices

| Capability ID | Owner repo | Defining feature slices |
|---|---|---|
| ECO-W1 | `sp-gh-copilot-kit` | plan workflow contract and claim lifecycle; prompt family semantics across hosts; bridge/help/orientation entry surfaces |
| ECO-W2 | `sp-gh-copilot-kit` | goal/capability/architecture visualization bundle flows; propose/apply/update/import orchestration; atlas and studio publication surfaces |
| ECO-T1 | `sp-theme-system` | token taxonomy and brand layers; shell pattern and CSS contract surfaces; standalone and host-mounted theme packaging |
| ECO-T2 | `sp-theme-system` | DOM and CSS host integration rules; optional runtime helpers and overlays; migration and publish discipline for adopters |
| ECO-C1 | `capability-modeling-toolkit` | export/import round-trip flows; insert/move/renumber/migrate workbook operations; workbook-derived capability-map lifecycle |
| ECO-C2 | `capability-modeling-toolkit` | Plane A/B/C/D artifact context rules; CBP self-model exception and repo-local bundle rules; dual-toolkit sync governance across SP and CBP |
| ECO-M1 | `sp-music-hero` | shared timeline and practice transport loop; notation plus instrument rendering surfaces; audio and playhead-driven session feedback |
| ECO-M2 | `sp-music-hero` | note/chord/drum mapping logic; instrument variant registry and compatibility gates; music coaching and content semantics |
| ECO-I1 | `sp-learning-languages-with-movies` | subtitle-path and chapter learning flow; static card runtime and path navigation; study session progression surfaces |
| ECO-I2 | `sp-learning-languages-with-movies` | subtitle-to-card generation pipeline; local override storage and export; merge-back curation workflow for improvements |
| ECO-S1 | `smilingpirate-site` | site shell and mounted route surfaces; publish target and deployment packaging; integrated host landing and entry points |
| ECO-S2 | `smilingpirate-site` | theme and artefact injection scripts; upstream output adoption rules; no-semantic-takeover guardrails |

## Repo boundary readout

| Repo | Owner type | Owns | Consumes | Standalone usefulness rule | Must not silently own |
|---|---|---|---|---|---|
| `sp-gh-copilot-kit` | reusable core owner | SP workflow core, plan semantics, prompt families, visualization orchestration | project and toolkit signals from other repos when orchestrating changes | Must stay independently useful as a reusable workflow kit, not just as ecosystem glue. | product semantics, theme contracts, host publication truth |
| `sp-theme-system` | shared-system owner | tokens, shell contracts, integration model, optional theme runtime | owner needs from host and product repos | Must stay independently useful as a consumable theme or shell contract package. | workflow governance, CBP lifecycle, product-domain meaning |
| `capability-modeling-toolkit` | mixed-toolkit owner | workbook lifecycle, CBP operations, mixed-plane governance, CBP self-model exception rules | generic SP visualization workflow where helpful | Must stay independently useful as a capability-modeling toolkit with workbook-backed value of its own. | host publication, shared theme ownership, external product semantics |
| `sp-music-hero` | product owner | music-learning semantics, timeline logic, instrument coaching, product UX | shared workflow and shared-system contracts | Product repo; standalone usefulness is local product value, not reusable-kit value. | generic kit governance, generic theme-system semantics, host ownership |
| `sp-learning-languages-with-movies` | product owner | subtitle-learning semantics, card model, local override flow, content curation | shared workflow and optionally shared-system contracts | Product repo; standalone usefulness is local product value, not reusable-kit value. | generic kit governance, host ownership, external product semantics |
| `smilingpirate-site` | host / publish owner | site host shell, publication target, mounted output adoption | upstream artefacts, themes, and published outputs from owner repos | Host repo; standalone usefulness is publish or host value, not reusable-kit value. | upstream product meaning, toolkit semantics, CBP lifecycle truth |

## Visualization planning inputs

| ID | Scope breadth (1-5) | Complexity badge | Importance fill | Gap to target (1-5) | Dependency note |
|---|---:|---|---|---:|---|
| ECO-W1 | 5 | C4 | I5 | 2 | Feeds all downstream repos that consume workflow governance. |
| ECO-W2 | 4 | C4 | I5 | 2 | Supports cross-repo visualization, packaging, and governed change application. |
| ECO-T1 | 4 | C4 | I5 | 2 | Feeds host and product repos that adopt shared-system contracts. |
| ECO-T2 | 4 | C4 | I4 | 2 | Supports safe adoption and publication into host contexts. |
| ECO-C1 | 5 | C5 | I5 | 2 | Depends on CBP truth surfaces and supports target-domain capability work. |
| ECO-C2 | 4 | C4 | I5 | 2 | Depends on clear plane boundaries and reduces toolkit drift. |
| ECO-M1 | 5 | C5 | I5 | 2 | Depends on workflow and optionally theme contracts, but owns the music product surface. |
| ECO-M2 | 4 | C5 | I5 | 3 | Depends on M1 and local product choices more than on shared repos. |
| ECO-I1 | 4 | C4 | I5 | 2 | Depends on workflow adoption and local static-app runtime choices. |
| ECO-I2 | 4 | C4 | I5 | 2 | Depends on I1 and local content-pipeline decisions. |
| ECO-S1 | 3 | C3 | I4 | 2 | Depends on owner repos publishing consumable outputs. |
| ECO-S2 | 3 | C3 | I5 | 2 | Depends on strong upstream boundaries so host integration does not become semantic drift. |

## Reading
The main split is still between owner repos and consuming or hosting repos.
`sp-gh-copilot-kit`, `sp-theme-system`, and `capability-modeling-toolkit` are reusable owners, but each owns a different layer:

- workflow governance
- shared-system contracts
- workbook-backed capability modeling and mixed-plane CBP governance

`sp-music-hero` and `sp-learning-languages-with-movies` are product owners. They may consume reusable kits, but they remain the semantic owners of their user-facing products.
`smilingpirate-site` is intentionally different again: it is the host and publication surface, not the semantic owner of the upstream concepts it presents.

The new Level 2 feature slices make the owner boundaries less hand-wavy:

- planes and ownership governance stay canonical in `capability-modeling-toolkit`
- lanes and orchestration governance stay canonical in `sp-gh-copilot-kit`
- shared-system contracts stay canonical in `sp-theme-system`
- product semantics stay local to the product repos
- host publication stays local to `smilingpirate-site`

The reusable owners also have to pass a standalone-value test:

- `sp-gh-copilot-kit` must still be useful as an independent workflow toolkit
- `sp-theme-system` must still be useful as an independent shared-system or theming package
- `capability-modeling-toolkit` must still be useful as an independent capability-modeling toolkit

The key anti-drift rule is still:
- changes start in the repo that owns the stable concern;
- consuming repos adapt or integrate;
- the host publishes and injects, but does not redefine upstream meaning.

## Source notes
This map is a best-effort portfolio-level first pass derived from:

- `sp-gh-copilot-kit/README.md`
- `sp-theme-system/README.md`
- `capability-modeling-toolkit/README.md`
- `sp-music-hero/README.md`
- `sp-learning-languages-with-movies/README.md`
- the repo-owned goal/capability bundles added in those repositories
