[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78DGJ8WGSZPP5PS2BHRHRVH":3,"skill-same:01M78DGJ8WGSZPP5PS2BHRHRVH":68},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":31,"ownerHtmlUrl":32,"ownerBlogUrl":33,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M78DGJ8WGSZPP5PS2BHRHRVH","bc-implementation",null,"Use this skill to implement one refined but not-yet-built Bounded Context from its approved specification files. Trigger phrases include \"implement this BC\", \"generate code from the BC specs\", \"build the refined bounded context\", and \"start implementation after refinement\". This skill validates specification readiness, maps BDD scenarios to tests, writes failing tests before production code, implements the complete BC, and verifies traceability. Do not use it for changing an already-built BC; use bc-enhancement instead.","mali-tintash\u002Fhgate","mali-tintash","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F53075248?v=4","01M78DG04F75J4YWYZ3M4MAYP9","Muhammad Ali","01M78DG05AYCDYETC2V5GDJN6D",7,"MIT","https:\u002F\u002Fgithub.com\u002Fmali-tintash\u002Fhgate\u002Fblob\u002Fmain\u002Fskills\u002Fbc-implementation\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bc-implementation\ndescription: >\n  Use this skill to implement one refined but not-yet-built Bounded Context from\n  its approved specification files. Trigger phrases include \"implement this BC\",\n  \"generate code from the BC specs\", \"build the refined bounded context\", and\n  \"start implementation after refinement\". This skill validates specification\n  readiness, maps BDD scenarios to tests, writes failing tests before production\n  code, implements the complete BC, and verifies traceability. Do not use it for\n  changing an already-built BC; use bc-enhancement instead.\ncontext: fork\n---\n\n# BC Implementation\n\n## Purpose\n\nImplement one approved Bounded Context (BC) from the artifacts produced by\n`bc-refinement`. Preserve the BC boundary, turn its BDD scenarios into executable\ntests, and deliver complete production code without inventing missing business\nbehavior.\n\nThis skill is for an initial implementation. If the BC is already materially\nimplemented and its behavior must change, stop and use `bc-enhancement`.\n\n## Input\n\n- The name of one BC\n- An approved skill directory at `.github\u002Fskills\u002F\u003Cbc-name>\u002F`\n- Project-wide engineering conventions\n- Any confirmed handoff from `domain-exploration`\n\nThe BC skill directory should contain:\n\n- `SKILL.md`\n- `domain-model.md`\n- `bdd-scenarios.md`\n- `decisions.md`\n- One `*-acl.md` file for each external integration\n- Optional `properties.md` when Goal 3 business-logic verification was selected\n\n## Output\n\n- Complete source code for one BC\n- Database migrations or persistence definitions required by the specification\n- Unit tests for domain and application behavior\n- Integration or acceptance tests for critical BDD scenarios\n- Adapters for specified external dependencies\n- A specification-to-code traceability report\n- An immutable module-scoped BDD-to-TDD sign-off artifact\n- When explicitly selected, executable property\u002Fmodel evidence and a separate\n  immutable Goal 3 sign-off artifact\n- A completion report listing any explicitly deferred items\n\n## Golden Rules\n\n1. One BC per implementation session.\n2. Approved BC specification files are the source of truth.\n3. Never close a specification gap with an implementation assumption.\n4. Write a failing test before the production behavior that makes it pass.\n5. Implement the whole approved BC, not only the happy path.\n6. Access adjacent BCs and external systems only through specified contracts,\n   ports, events, and ACL adapters.\n7. Do not import another BC's aggregates, repositories, application services, or\n   persistence models.\n8. Do not modify BC specification files during implementation unless the user\n   first returns the design to `bc-refinement`.\n9. Do not report completion while approved rules or scenarios remain\n   unimplemented.\n10. Obtain user approval of the implementation plan before editing source code.\n\n## Workflow\n\n### Phase 0 - Scope Lock and Full State Read\n\nBefore generating code:\n\n1. Read every file in `.github\u002Fskills\u002F\u003Cbc-name>\u002F`.\n2. Read project-wide instructions such as `CLAUDE.md` or `AGENTS.md`.\n3. Read adjacent BC skill files named by the target BC, but only to understand\n   ownership and published contracts.\n4. Inventory existing source files matching the BC's domain terms.\n5. Identify shared project patterns needed for implementation:\n   - Module registration and dependency injection\n   - Error handling and validation\n   - Persistence and migrations\n   - Authentication, authorization, and tenancy\n   - Testing conventions\n   - External adapter registration\n\nDo not copy business rules from another BC. Existing code is evidence of project\nconventions, not a substitute for the target BC specification.\n\nRead the target BC's `decisions.md` as supporting rationale. The current\nbehavioral contract remains the complete set of approved BC specification files.\n\nRead `status.md` and require lifecycle `REFINED` or `SPEC_REVIEWED`. After\neligibility and specification readiness pass and the user approves the plan,\nrecord:\n\n```text\nREFINED | SPEC_REVIEWED -> IMPLEMENTING\n```\n\nImmediately synchronize that lifecycle into `docs\u002Fhgate-project.json` and\nvalidate it; the transition remains owned by `status.md`.\n\nDeclare:\n\n```text\nScope lock: This session implements the \u003Cbc-name> BC only.\n\nIn scope:\n- \u003Ccapabilities owned by this BC>\n\nOut of scope:\n- \u003Cadjacent BC>: \u003Cwhat it owns>\n\nCross-BC interaction:\n- \u003Ccontract, port, or event this BC uses or publishes>\n```\n\nThen report what was read:\n\n```text\nPhase 0 complete.\n\nSkill files:\n- [...]\n\nProject conventions:\n- [...]\n\nAdjacent contract files:\n- [...]\n\nExisting source files:\n- [...]\n```\n\n#### Initial-build eligibility check\n\nClassify the current code state:\n\n| State | Action |\n|---|---|\n| No BC implementation exists | Continue |\n| Only empty scaffolding or generated placeholders exist | Continue and identify what may be replaced |\n| A partial implementation exists but has never been completed | Report it and ask whether to complete it here or first reconcile it through refinement |\n| A material implementation already exists | Stop and recommend `bc-enhancement` |\n| Code behavior conflicts with the approved specification | Stop and recommend `bc-enhancement`; do not overwrite the conflict as if it were a new build |\n\nDo not infer eligibility merely from the absence or presence of a module\ndirectory. Trace enough behavior to classify it correctly.\n\n### Phase 1 - Specification Readiness Gate\n\nValidate the specification before planning source code.\n\n#### Required consistency checks\n\nRun the deterministic part first and treat each failure as a blocking gap\n(`G#`) with its `file:line`; do not re-derive these by reading the files:\n\n```bash\nnpm run verify:spec -- --bc \u003Cbc-name> --phase implementation\n```\n\nIt enforces checks 1 (VSP001), 4 (VSP003\u002F004\u002F102\u002F103), 5 (VSP002\u002F101), 6\n(VSP105), and the clean-spec preconditions (VSP006-013, VSP104 unresolved\n`[OPEN]` questions, VSP106 lifecycle `REFINED`\u002F`SPEC_REVIEWED`). If the tool is\nnot installed, perform the list manually. Checks 2, 3, 7, 8, 9, and 10 stay\njudgment checks; apply them yourself.\n\n1. Every aggregate in `SKILL.md` is defined in `domain-model.md`.\n2. Every business rule has at least one BDD scenario.\n3. Every lifecycle state has defined allowed transitions and actors.\n4. Every external dependency has an ACL file and port contract.\n5. Every emitted or consumed event has a defined name and payload.\n6. Persistence ownership and tenant\u002Fglobal schema placement are explicit.\n7. Authorization and resource ownership rules are explicit.\n8. Idempotency, concurrency, and duplicate-request behavior are explicit where\n   side effects or state transitions exist.\n9. Failure behavior is defined for validation and external dependencies.\n10. Ubiquitous language is consistent across all files.\n\nProduce:\n\n```text\n## Specification Readiness Report\n\n### Ready\n- [capability\u002Frule]: supported by [file:section]\n\n### Blocking gaps\n- [G1] [missing or contradictory behavior]\n  Needed before implementation: [decision or artifact]\n\n### Non-blocking deferred items\n- [item]: [why it does not affect the approved implementation]\n\nReadiness: READY | BLOCKED\n```\n\n#### Gap protocol\n\nA gap is blocking when different answers could change:\n\n- A BC boundary or owner\n- An aggregate or lifecycle\n- An API, event, or port contract\n- Persistence or consistency behavior\n- Authorization or tenant isolation\n- Idempotency, financial effects, or recovery\n- An expected success or failure outcome\n\nWhen a blocking gap exists:\n\n1. Explain the ambiguity and its implementation consequences.\n2. Recommend the most likely path and alternatives.\n3. Ask the user to confirm how to resolve it.\n4. Return the BC to `bc-refinement` so the specification files are updated.\n5. Resume implementation only after the revised specification is approved.\n\nDo not edit the specification ad hoc inside this skill. Do not mark a gap closed\nuntil the user confirms it and the approved specification reflects the answer.\n\nImplementation-only decisions concluded during this session belong in the\ntarget BC's `decisions.md`. Decisions affecting several BCs require a standalone\nADR under `docs\u002Fadr\u002F`, linked from each affected BC. Never append to a global\ndecisions file.\n\n### Phase 2 - Build the Traceability Matrix\n\n**Before doing any work in this phase, read `references\u002Fphase-2-build-the-traceability-matrix.md` in full and follow it exactly. It contains the complete body of this phase; do not proceed from memory or skip it.**\n\n### Phase 3 - Implementation Plan and Approval\n\nCreate an ordered file-by-file plan containing:\n\n- Files to create or modify\n- Specification rule or scenario implemented by each file\n- Tests written before each production component\n- Module wiring and dependency injection\n- Migrations, indexes, and constraints\n- Ports and adapters\n- Public entry points\n- Validation commands\n\nUse:\n\n```text\n## Implementation Plan - \u003Cbc-name>\n\n### Slice 1 - \u003Cbusiness behavior>\n[test file]\n  ADD: failing tests for [rules\u002Fscenarios]\n\n[production file]\n  ADD: minimum implementation satisfying those tests\n\n### Slice 2 - \u003Cbusiness behavior>\n...\n\n### Final wiring\n[module\u002Fconfiguration files]\n  ADD\u002FMODIFY: [...]\n\n### Validation\n- [...]\n```\n\nPlan by cohesive vertical business slices where practical. Within each slice,\npreserve the dependency direction:\n\n```text\npresentation -> application -> domain ports\n                                  ^\n                                  |\n                         infrastructure adapters\n```\n\nPresent the plan and wait for explicit user approval. Do not modify source,\nmigrations, or tests before approval.\n\n### Phase 4 - Test-First Execution\n\n**Before doing any work in this phase, read `references\u002Fphase-4-test-first-execution.md` in full and follow it exactly. It contains the complete body of this phase; do not proceed from memory or skip it.**\n\n### Phase 5 - BC Isolation and Integration Audit\n\nAfter all slices are green, inspect the complete BC for boundary violations:\n\n```text\n## BC Isolation Audit\n\nDirect imports from adjacent BC internals:\n- [...]\n\nCross-BC database access:\n- [...]\n\nRaw external DTOs entering the domain:\n- [...]\n\nOutbound dependencies without ports:\n- [...]\n\nAdapters leaking external terminology:\n- [...]\n\nStatus: CLEAR | VIOLATIONS FOUND\n```\n\nThe audit must verify:\n\n1. Application services depend on port interfaces, not concrete adapters.\n2. ACL adapters translate external contracts into this BC's language.\n3. No repository queries another BC's private tables or models.\n4. No shared module contains target-BC business rules.\n5. Events and public contracts contain sufficient context without exposing\n   private aggregates.\n6. Cross-BC calls follow the ownership established during refinement.\n\nFix all violations before completion.\n\n### Phase 6 - Specification Conformance and Validation\n\n**Before doing any work in this phase, read `references\u002Fphase-6-specification-conformance-and-validation.md` in full and follow it exactly. It contains the complete body of this phase; do not proceed from memory or skip it.**\n\n### Phase 7 - Close Report\n\nEnd with:\n\n```text\n## Implementation Complete - \u003Cbc-name> BC\n\n### Capabilities implemented\n- [...]\n\n### Tests added\n- [test]: [rules\u002Fscenarios protected]\n\n### Ports and integrations\n- [...]\n\n### Persistence changes\n- [...]\n\n### Traceability\n- \u003Cimplemented>\u002F\u003Ctotal> business rules\n- \u003Ccovered>\u002F\u003Ctotal> BDD scenario IDs\n- BDD sign-off: [artifact path]\n- Goal 3: [property sign-off artifact path] \u002F Declined: [BC decision entry]\n\n### Open or deferred items\n- None | [...]\n\n### Recommended next step\n- Run `bc-review full` for an independent specification and implementation audit.\n```\n\nAfter all completion criteria pass, update the BC-local status:\n\n```text\nIMPLEMENTING -> IMPLEMENTED\n```\n\nBecause lifecycle is projected, synchronize `docs\u002Fhgate-project.json` after the\nauthoritative `status.md` transition. Do not edit other projected fields unless\ntheir authoritative Markdown changed through the approved workflow. Preserve\nstable IDs and unrelated entries, omit timestamps, sort deterministically, and\nvalidate against `docs\u002Fhgate-project.schema.json` before reporting completion.\n\nIf implementation is blocked, record `IMPLEMENTING -> BLOCKED` with the blocker,\nowner, and intended return state. Never set `IMPLEMENTED` while traceability\ncontains a `Missing` item, BDD sign-off is incomplete, or selected Goal 3\nverification is not `SIGNED_OFF`.\n\n## Standing Rules\n\n### Specifications are not suggestions\n\nImplementation may choose code structure consistent with project conventions,\nbut it may not reinterpret approved business behavior. If two valid\nimplementations would produce different business outcomes, the specification is\nnot ready.\n\n### Tests come before production behavior\n\nDo not write all production code and add tests afterward. Work in small slices:\n\n```text\nscenario\u002Frule -> failing test -> production behavior -> passing test -> refactor\n```\n\nGenerated tests must be capable of failing. A test that only checks that a\nprovider or class exists is not evidence that a business rule works.\n\n### Complete vertical paths\n\nDo not leave domain objects disconnected from application services, ports\nwithout adapters, controllers without validation, migrations outside the runner,\nor events without their specified publication path.\n\n### Preserve failure semantics\n\nDo not use broad catches, silent fallbacks, or success-shaped defaults to make\ntests pass. Translate and surface errors according to the approved contract.\n\n### Preserve type safety\n\nDo not use `any`, unsafe casts, or raw external response objects to bridge an\nunfinished design. Define the correct domain and boundary types.\n\n### No speculative extensibility\n\nImplement the approved BC, not imagined future BCs. A port, event, method, or\nabstraction that only serves an unapproved future use case is a YAGNI violation.\n\n## Relationship to Other Skills\n\n| Skill | When to use |\n|---|---|\n| `domain-exploration` | Discover the problem, domains, and BC boundaries |\n| `bc-refinement` | Create or correct one BC's specification files |\n| `bc-implementation` | Build one refined, not-yet-built BC using TDD |\n| `bc-review` | Independently audit specifications and implementation |\n| `bc-enhancement` | Change behavior in an already-built BC and remove ghost behavior |\n| `architecture-decision-exploration` | Resolve unresolved technical or cross-system architecture decisions |\n\n## Completion Criteria\n\nImplementation is complete only when:\n\n- Specification readiness was confirmed before coding\n- The user approved the implementation plan\n- Every approved business rule is implemented\n- Every approved BDD scenario ID has executable coverage\n- No executable test references an unknown or retired scenario ID\n- Tests were observed failing before their production behavior was added\n- Domain, application, infrastructure, and presentation layers are fully wired\n- Specified migrations, constraints, ports, adapters, and events are present\n- BC isolation audit is clear\n- Targeted tests pass\n- Existing build or type checks pass\n- Explicit human BDD-to-TDD sign-off is recorded in an immutable module-scoped\n  artifact\n- When Goal 3 was selected, every approved property has meaningful executable\n  coverage (verifier reports no `PROP011`-`PROP014`) and a separate current property sign-off artifact\n- When Goal 3 was declined, the scoped decision and rationale are recorded in\n  the BC's `decisions.md` and no skipped artifact exists\n- The traceability report contains no `Missing` approved behavior\n- `docs\u002Fhgate-project.json` reflects the final `status.md` lifecycle and passes\n  schema validation\n\nIf any condition is unmet, report the implementation as incomplete or blocked\nrather than claiming completion.\n","# BC Implementation\n\n## Purpose\n\nImplement one approved Bounded Context (BC) from the artifacts produced by\n`bc-refinement`. Preserve the BC boundary, turn its BDD scenarios into executable\ntests, and deliver complete production code without inventing missing business\nbehavior.\n\nThis skill is for an initial implementation. If the BC is already materially\nimplemented and its behavior must change, stop and use `bc-enhancement`.\n\n## Input\n\n- The name of one BC\n- An approved skill directory at `.github\u002Fskills\u002F\u003Cbc-name>\u002F`\n- Project-wide engineering conventions\n- Any confirmed handoff from `domain-exploration`\n\nThe BC skill directory should contain:\n\n- `SKILL.md`\n- `domain-model.md`\n- `bdd-scenarios.md`\n- `decisions.md`\n- One `*-acl.md` file for each external integration\n- Optional `properties.md` when Goal 3 business-logic verification was selected\n\n## Output\n\n- Complete source code for one BC\n- Database migrations or persistence definitions required by the specification\n- Unit tests for domain and application behavior\n- Integration or acceptance tests for critical BDD scenarios\n- Adapters for specified external dependencies\n- A specification-to-code traceability report\n- An immutable module-scoped BDD-to-TDD sign-off artifact\n- When explicitly selected, executable property\u002Fmodel evidence and a separate\n  immutable Goal 3 sign-off artifact\n- A completion report listing any explicitly deferred items\n\n## Golden Rules\n\n1. One BC per implementation session.\n2. Approved BC specification files are the source of truth.\n3. Never close a specification gap with an implementation assumption.\n4. Write a failing test before the production behavior that makes it pass.\n5. Implement the whole approved BC, not only the happy path.\n6. Access adjacent BCs and external systems only through specified contracts,\n   ports, events, and ACL adapters.\n7. Do not import another BC's aggregates, repositories, application services, or\n   persistence models.\n8. Do not modify BC specification files during implementation unless the user\n   first returns the design to `bc-refinement`.\n9. Do not report completion while approved rules or scenarios remain\n   unimplemented.\n10. Obtain user approval of the implementation plan before editing source code.\n\n## Workflow\n\n### Phase 0 - Scope Lock and Full State Read\n\nBefore generating code:\n\n1. Read every file in `.github\u002Fskills\u002F\u003Cbc-name>\u002F`.\n2. Read project-wide instructions such as `CLAUDE.md` or `AGENTS.md`.\n3. Read adjacent BC skill files named by the target BC, but only to understand\n   ownership and published contracts.\n4. Inventory existing source files matching the BC's domain terms.\n5. Identify shared project patterns needed for implementation:\n   - Module registration and dependency injection\n   - Error handling and validation\n   - Persistence and migrations\n   - Authentication, authorization, and tenancy\n   - Testing conventions\n   - External adapter registration\n\nDo not copy business rules from another BC. Existing code is evidence of project\nconventions, not a substitute for the target BC specification.\n\nRead the target BC's `decisions.md` as supporting rationale. The current\nbehavioral contract remains the complete set of approved BC specification files.\n\nRead `status.md` and require lifecycle `REFINED` or `SPEC_REVIEWED`. After\neligibility and specification readiness pass and the user approves the plan,\nrecord:\n\n```text\nREFINED | SPEC_REVIEWED -> IMPLEMENTING\n```\n\nImmediately synchronize that lifecycle into `docs\u002Fhgate-project.json` and\nvalidate it; the transition remains owned by `status.md`.\n\nDeclare:\n\n```text\nScope lock: This session implements the \u003Cbc-name> BC only.\n\nIn scope:\n- \u003Ccapabilities owned by this BC>\n\nOut of scope:\n- \u003Cadjacent BC>: \u003Cwhat it owns>\n\nCross-BC interaction:\n- \u003Ccontract, port, or event this BC uses or publishes>\n```\n\nThen report what was read:\n\n```text\nPhase 0 complete.\n\nSkill files:\n- [...]\n\nProject conventions:\n- [...]\n\nAdjacent contract files:\n- [...]\n\nExisting source files:\n- [...]\n```\n\n#### Initial-build eligibility check\n\nClassify the current code state:\n\n| State | Action |\n|---|---|\n| No BC implementation exists | Continue |\n| Only empty scaffolding or generated placeholders exist | Continue and identify what may be replaced |\n| A partial implementation exists but has never been completed | Report it and ask whether to complete it here or first reconcile it through refinement |\n| A material implementation already exists | Stop and recommend `bc-enhancement` |\n| Code behavior conflicts with the approved specification | Stop and recommend `bc-enhancement`; do not overwrite the conflict as if it were a new build |\n\nDo not infer eligibility merely from the absence or presence of a module\ndirectory. Trace enough behavior to classify it correctly.\n\n### Phase 1 - Specification Readiness Gate\n\nValidate the specification before planning source code.\n\n#### Required consistency checks\n\nRun the deterministic part first and treat each failure as a blocking gap\n(`G#`) with its `file:line`; do not re-derive these by reading the files:\n\n```bash\nnpm run verify:spec -- --bc \u003Cbc-name> --phase implementation\n```\n\nIt enforces checks 1 (VSP001), 4 (VSP003\u002F004\u002F102\u002F103), 5 (VSP002\u002F101), 6\n(VSP105), and the clean-spec preconditions (VSP006-013, VSP104 unresolved\n`[OPEN]` questions, VSP106 lifecycle `REFINED`\u002F`SPEC_REVIEWED`). If the tool is\nnot installed, perform the list manually. Checks 2, 3, 7, 8, 9, and 10 stay\njudgment checks; apply them yourself.\n\n1. Every aggregate in `SKILL.md` is defined in `domain-model.md`.\n2. Every business rule has at least one BDD scenario.\n3. Every lifecycle state has defined allowed transitions and actors.\n4. Every external dependency has an ACL file and port contract.\n5. Every emitted or consumed event has a defined name and payload.\n6. Persistence ownership and tenant\u002Fglobal schema placement are explicit.\n7. Authorization and resource ownership rules are explicit.\n8. Idempotency, concurrency, and duplicate-request behavior are explicit where\n   side effects or state transitions exist.\n9. Failure behavior is defined for validation and external dependencies.\n10. Ubiquitous language is consistent across all files.\n\nProduce:\n\n```text\n## Specification Readiness Report\n\n### Ready\n- [capability\u002Frule]: supported by [file:section]\n\n### Blocking gaps\n- [G1] [missing or contradictory behavior]\n  Needed before implementation: [decision or artifact]\n\n### Non-blocking deferred items\n- [item]: [why it does not affect the approved implementation]\n\nReadiness: READY | BLOCKED\n```\n\n#### Gap protocol\n\nA gap is blocking when different answers could change:\n\n- A BC boundary or owner\n- An aggregate or lifecycle\n- An API, event, or port contract\n- Persistence or consistency behavior\n- Authorization or tenant isolation\n- Idempotency, financial effects, or recovery\n- An expected success or failure outcome\n\nWhen a blocking gap exists:\n\n1. Explain the ambiguity and its implementation consequences.\n2. Recommend the most likely path and alternatives.\n3. Ask the user to confirm how to resolve it.\n4. Return the BC to `bc-refinement` so the specification files are updated.\n5. Resume implementation only after the revised specification is approved.\n\nDo not edit the specification ad hoc inside this skill. Do not mark a gap closed\nuntil the user confirms it and the approved specification reflects the answer.\n\nImplementation-only decisions concluded during this session belong in the\ntarget BC's `decisions.md`. Decisions affecting several BCs require a standalone\nADR under `docs\u002Fadr\u002F`, linked from each affected BC. Never append to a global\ndecisions file.\n\n### Phase 2 - Build the Traceability Matrix\n\n**Before doing any work in this phase, read `references\u002Fphase-2-build-the-traceability-matrix.md` in full and follow it exactly. It contains the complete body of this phase; do not proceed from memory or skip it.**\n\n### Phase 3 - Implementation Plan and Approval\n\nCreate an ordered file-by-file plan containing:\n\n- Files to create or modify\n- Specification rule or scenario implemented by each file\n- Tests written before each production component\n- Module wiring and dependency injection\n- Migrations, indexes, and constraints\n- Ports and adapters\n- Public entry points\n- Validation commands\n\nUse:\n\n```text\n## Implementation Plan - \u003Cbc-name>\n\n### Slice 1 - \u003Cbusiness behavior>\n[test file]\n  ADD: failing tests for [rules\u002Fscenarios]\n\n[production file]\n  ADD: minimum implementation satisfying those tests\n\n### Slice 2 - \u003Cbusiness behavior>\n...\n\n### Final wiring\n[module\u002Fconfiguration files]\n  ADD\u002FMODIFY: [...]\n\n### Validation\n- [...]\n```\n\nPlan by cohesive vertical business slices where practical. Within each slice,\npreserve the dependency direction:\n\n```text\npresentation -> application -> domain ports\n                                  ^\n                                  |\n                         infrastructure adapters\n```\n\nPresent the plan and wait for explicit user approval. Do not modify source,\nmigrations, or tests before approval.\n\n### Phase 4 - Test-First Execution\n\n**Before doing any work in this phase, read `references\u002Fphase-4-test-first-execution.md` in full and follow it exactly. It contains the complete body of this phase; do not proceed from memory or skip it.**\n\n### Phase 5 - BC Isolation and Integration Audit\n\nAfter all slices are green, inspect the complete BC for boundary violations:\n\n```text\n## BC Isolation Audit\n\nDirect imports from adjacent BC internals:\n- [...]\n\nCross-BC database access:\n- [...]\n\nRaw external DTOs entering the domain:\n- [...]\n\nOutbound dependencies without ports:\n- [...]\n\nAdapters leaking external terminology:\n- [...]\n\nStatus: CLEAR | VIOLATIONS FOUND\n```\n\nThe audit must verify:\n\n1. Application services depend on port interfaces, not concrete adapters.\n2. ACL adapters translate external contracts into this BC's language.\n3. No repository queries another BC's private tables or models.\n4. No shared module contains target-BC business rules.\n5. Events and public contracts contain sufficient context without exposing\n   private aggregates.\n6. Cross-BC calls follow the ownership established during refinement.\n\nFix all violations before completion.\n\n### Phase 6 - Specification Conformance and Validation\n\n**Before doing any work in this phase, read `references\u002Fphase-6-specification-conformance-and-validation.md` in full and follow it exactly. It contains the complete body of this phase; do not proceed from memory or skip it.**\n\n### Phase 7 - Close Report\n\nEnd with:\n\n```text\n## Implementation Complete - \u003Cbc-name> BC\n\n### Capabilities implemented\n- [...]\n\n### Tests added\n- [test]: [rules\u002Fscenarios protected]\n\n### Ports and integrations\n- [...]\n\n### Persistence changes\n- [...]\n\n### Traceability\n- \u003Cimplemented>\u002F\u003Ctotal> business rules\n- \u003Ccovered>\u002F\u003Ctotal> BDD scenario IDs\n- BDD sign-off: [artifact path]\n- Goal 3: [property sign-off artifact path] \u002F Declined: [BC decision entry]\n\n### Open or deferred items\n- None | [...]\n\n### Recommended next step\n- Run `bc-review full` for an independent specification and implementation audit.\n```\n\nAfter all completion criteria pass, update the BC-local status:\n\n```text\nIMPLEMENTING -> IMPLEMENTED\n```\n\nBecause lifecycle is projected, synchronize `docs\u002Fhgate-project.json` after the\nauthoritative `status.md` transition. Do not edit other projected fields unless\ntheir authoritative Markdown changed through the approved workflow. Preserve\nstable IDs and unrelated entries, omit timestamps, sort deterministically, and\nvalidate against `docs\u002Fhgate-project.schema.json` before reporting completion.\n\nIf implementation is blocked, record `IMPLEMENTING -> BLOCKED` with the blocker,\nowner, and intended return state. Never set `IMPLEMENTED` while traceability\ncontains a `Missing` item, BDD sign-off is incomplete, or selected Goal 3\nverification is not `SIGNED_OFF`.\n\n## Standing Rules\n\n### Specifications are not suggestions\n\nImplementation may choose code structure consistent with project conventions,\nbut it may not reinterpret approved business behavior. If two valid\nimplementations would produce different business outcomes, the specification is\nnot ready.\n\n### Tests come before production behavior\n\nDo not write all production code and add tests afterward. Work in small slices:\n\n```text\nscenario\u002Frule -> failing test -> production behavior -> passing test -> refactor\n```\n\nGenerated tests must be capable of failing. A test that only checks that a\nprovider or class exists is not evidence that a business rule works.\n\n### Complete vertical paths\n\nDo not leave domain objects disconnected from application services, ports\nwithout adapters, controllers without validation, migrations outside the runner,\nor events without their specified publication path.\n\n### Preserve failure semantics\n\nDo not use broad catches, silent fallbacks, or success-shaped defaults to make\ntests pass. Translate and surface errors according to the approved contract.\n\n### Preserve type safety\n\nDo not use `any`, unsafe casts, or raw external response objects to bridge an\nunfinished design. Define the correct domain and boundary types.\n\n### No speculative extensibility\n\nImplement the approved BC, not imagined future BCs. A port, event, method, or\nabstraction that only serves an unapproved future use case is a YAGNI violation.\n\n## Relationship to Other Skills\n\n| Skill | When to use |\n|---|---|\n| `domain-exploration` | Discover the problem, domains, and BC boundaries |\n| `bc-refinement` | Create or correct one BC's specification files |\n| `bc-implementation` | Build one refined, not-yet-built BC using TDD |\n| `bc-review` | Independently audit specifications and implementation |\n| `bc-enhancement` | Change behavior in an already-built BC and remove ghost behavior |\n| `architecture-decision-exploration` | Resolve unresolved technical or cross-system architecture decisions |\n\n## Completion Criteria\n\nImplementation is complete only when:\n\n- Specification readiness was confirmed before coding\n- The user approved the implementation plan\n- Every approved business rule is implemented\n- Every approved BDD scenario ID has executable coverage\n- No executable test references an unknown or retired scenario ID\n- Tests were observed failing before their production behavior was added\n- Domain, application, infrastructure, and presentation layers are fully wired\n- Specified migrations, constraints, ports, adapters, and events are present\n- BC isolation audit is clear\n- Targeted tests pass\n- Existing build or type checks pass\n- Explicit human BDD-to-TDD sign-off is recorded in an immutable module-scoped\n  artifact\n- When Goal 3 was selected, every approved property has meaningful executable\n  coverage (verifier reports no `PROP011`-`PROP014`) and a separate current property sign-off artifact\n- When Goal 3 was declined, the scoped decision and rationale are recorded in\n  the BC's `decisions.md` and no skipped artifact exists\n- The traceability report contains no `Missing` approved behavior\n- `docs\u002Fhgate-project.json` reflects the final `status.md` lifecycle and passes\n  schema validation\n\nIf any condition is unmet, report the implementation as incomplete or blocked\nrather than claiming completion.\n",{"name":5,"context":24,"description":25},"fork","Use this skill to implement one refined but not-yet-built Bounded Context from its approved specification files. Trigger phrases include \"implement this BC\", \"generate code from the BC specs\", \"build the refined bounded context\", and \"start implementation after refinement\". This skill validates specification readiness, maps BDD scenarios to tests, writes failing tests before production code, implements the complete BC, and verifies traceability. Do not use it for changing an already-built BC; use bc-enhancement instead.\n","main","6a7f371586f355e96c59ae63ad3dc2c195477614","skills\u002Fbc-implementation",0,"https:\u002F\u002Fgithub.com\u002Fmali-tintash\u002Fhgate","https:\u002F\u002Fmali-tintash.github.io\u002Fhgate\u002F","https:\u002F\u002Fgithub.com\u002Fmali-tintash","www.tintash.com","| Tinkerer | Builder | ","2026-11-03 19:24:04",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add mali-tintash\u002Fhgate --skill bc-implementation",{"tool":42,"command":43},"bunx","bunx skills add mali-tintash\u002Fhgate --skill bc-implementation",{"tool":45,"command":46},"pnpm","pnpm dlx skills add mali-tintash\u002Fhgate --skill bc-implementation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmali-tintash\u002Fhgate\u002Fblob\u002Fmain\u002Fskills\u002Fbc-implementation\u002FSKILL.md",true,[50,56,60,64],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"decisions.md","REFERENCE","参考文档",2062,"https:\u002F\u002Fgithub.com\u002Fmali-tintash\u002Fhgate\u002Fblob\u002Fmain\u002Fskills\u002Fbc-implementation\u002Fdecisions.md",{"path":57,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fphase-2-build-the-traceability-matrix.md",4865,"https:\u002F\u002Fgithub.com\u002Fmali-tintash\u002Fhgate\u002Fblob\u002Fmain\u002Fskills\u002Fbc-implementation\u002Freferences\u002Fphase-2-build-the-traceability-matrix.md",{"path":61,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fphase-4-test-first-execution.md",2595,"https:\u002F\u002Fgithub.com\u002Fmali-tintash\u002Fhgate\u002Fblob\u002Fmain\u002Fskills\u002Fbc-implementation\u002Freferences\u002Fphase-4-test-first-execution.md",{"path":65,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002Fphase-6-specification-conformance-and-validation.md",4545,"https:\u002F\u002Fgithub.com\u002Fmali-tintash\u002Fhgate\u002Fblob\u002Fmain\u002Fskills\u002Fbc-implementation\u002Freferences\u002Fphase-6-specification-conformance-and-validation.md",[69,75,81,87,94,101],{"skillNo":70,"name":71,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M78DHXACC092QA12GKTXQG37","cart","https:\u002F\u002Fgithub.com\u002Fmali-tintash\u002Fhgate\u002Fblob\u002Fmain\u002Ftools\u002Fverify-spec\u002Ftests\u002Ffixtures\u002Fgood\u002F.github\u002Fskills\u002Fcart\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M78DHW4KZPYHGSE6BB6DNWHZ","ordering","https:\u002F\u002Fgithub.com\u002Fmali-tintash\u002Fhgate\u002Fblob\u002Fmain\u002Ftools\u002Fproject-projection\u002Ftests\u002Ffixtures\u002Fexample\u002F.github\u002Fskills\u002Forders\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M78DHSTQSSD30FAQ6GEQGG4H","catalog","https:\u002F\u002Fgithub.com\u002Fmali-tintash\u002Fhgate\u002Fblob\u002Fmain\u002Ftools\u002Fproject-projection\u002Ftests\u002Ffixtures\u002Fexample\u002F.github\u002Fskills\u002Fcatalog\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M78DHK7ZYW1ATJH91DH0FEE3","hgate-guide","Use this skill when a user needs help deciding where to start or which hGATE skill to use next. It diagnoses the current lifecycle stage, checks available artifacts, recommends exactly one next skill, and explains that skill's input, output, fork requirement, and completion signal. Trigger phrases include \"how do I use hGATE\", \"what should I do next\", \"which skill should I use\", \"where do I start\", and \"guide me through the workflow\". It never invokes another skill or advances lifecycle state automatically.","https:\u002F\u002Fgithub.com\u002Fmali-tintash\u002Fhgate\u002Fblob\u002Fmain\u002Fskills\u002Fhgate-guide\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M78DHBF93F8N59EHDQEC04TM","domain-exploration","Use this skill when a user needs to understand a business problem or requirement, discover the relevant domain concepts, or determine whether the work belongs to one bounded context or several. Trigger phrases include \"explore this domain\", \"identify the bounded contexts\", \"is this one BC or multiple BCs\", \"help me understand this requirement\", \"break this problem into domains\", and \"where does this feature belong\". This skill is interactive and confirmation-gated. It does not produce source code or detailed BC specifications.","https:\u002F\u002Fgithub.com\u002Fmali-tintash\u002Fhgate\u002Fblob\u002Fmain\u002Fskills\u002Fdomain-exploration\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":19},"01M78DH5NKAX5GAWA05RHARJ7Y","cross-bc-validation","Use this skill to validate one completed business journey that crosses two or more implemented bounded contexts. It performs a read-only comparison of published contracts, events, ports, adapters, runtime wiring, and tests; identifies incompatible or missing journey hops; and routes each finding to its owning BC. Trigger phrases include \"validate this cross-BC feature\", \"verify the end-to-end bounded context flow\", \"check integration between these BCs\", and \"does this business journey work across contexts\". It does not redesign boundaries or implement fixes.","https:\u002F\u002Fgithub.com\u002Fmali-tintash\u002Fhgate\u002Fblob\u002Fmain\u002Fskills\u002Fcross-bc-validation\u002FSKILL.md",[],[]]