diff --git a/.flowr/flows/architecture-flow.mermaid b/.flowr/flows/architecture-flow.mermaid deleted file mode 100644 index 2506f89..0000000 --- a/.flowr/flows/architecture-flow.mermaid +++ /dev/null @@ -1,3 +0,0 @@ -{ - "mermaid": "stateDiagram-v2\n state \"architecture-assessment\" as architecture-assessment\n state \"context-mapping\" as context-mapping\n state \"technical-design\" as technical-design\n state \"review-signoff\" as review-signoff\n architecture-assessment --> complete : no-architecture-needed | architecture-complete: ==verified\n architecture-assessment --> context-mapping : needs-context-update | domain-model-md: ==exists\n architecture-assessment --> technical-design : needs-technical-design | domain-model-md: ==exists\n architecture-assessment --> context-mapping : greenfield | domain-model-md: ==missing\n architecture-assessment --> needs-discovery : delivery-mismatch-unresolvable\n architecture-assessment --> needs-discovery : needs-discovery\n context-mapping --> technical-design : done\n context-mapping --> needs-discovery : needs-discovery\n technical-design --> review-signoff : done\n review-signoff --> complete : approved | alignment: ==domain-model-verified, adr-compliance: ==adrs-respected, committed-to-main-locally: ==verified\n review-signoff --> architecture-assessment : inconsistent\n review-signoff --> needs-discovery : needs-discovery" -} diff --git a/.flowr/flows/branding-flow.mermaid b/.flowr/flows/branding-flow.mermaid deleted file mode 100644 index 3c79b14..0000000 --- a/.flowr/flows/branding-flow.mermaid +++ /dev/null @@ -1,3 +0,0 @@ -{ - "mermaid": "stateDiagram-v2\n state \"setup-branding\" as setup-branding\n state \"design-colors\" as design-colors\n state \"design-assets\" as design-assets\n setup-branding --> design-colors : confirmed\n setup-branding --> cancelled : cancelled\n design-colors --> design-assets : approved\n design-colors --> design-colors : revise\n design-colors --> cancelled : cancelled\n design-assets --> branded : approved | logo-monochrome: ==passes, logo-scalability: ==passes, logo-blur-test: ==passes, committed-to-main-locally: ==verified\n design-assets --> design-assets : revise\n design-assets --> cancelled : cancelled" -} diff --git a/.flowr/flows/delivery-flow.mermaid b/.flowr/flows/delivery-flow.mermaid deleted file mode 100644 index 1441c48..0000000 --- a/.flowr/flows/delivery-flow.mermaid +++ /dev/null @@ -1,3 +0,0 @@ -{ - "mermaid": "stateDiagram-v2\n state \"acceptance\" as acceptance\n state \"local-merge\" as local-merge\n state \"publish-decision\" as publish-decision\n state \"pr-creation\" as pr-creation\n acceptance --> local-merge : approved | feature-status: ==ACCEPTED\n acceptance --> rejected : rejected\n local-merge --> publish-decision : merged\n local-merge --> needs-development : conflict\n publish-decision --> next-feature : accumulate\n publish-decision --> pr-creation : publish\n pr-creation --> next-feature : approved | ci-passes: ==verified, no-changes-requested: ==verified\n pr-creation --> needs-development : changes-requested\n pr-creation --> cancelled : cancelled" -} diff --git a/.flowr/flows/delivery-flow.yaml b/.flowr/flows/delivery-flow.yaml index 01e91b5..645589b 100644 --- a/.flowr/flows/delivery-flow.yaml +++ b/.flowr/flows/delivery-flow.yaml @@ -26,7 +26,7 @@ states: - approval_record conditions: feature-accepted: - feature-status: ==ACCEPTED + acceptance-verified: ==verified next: approved: to: local-merge diff --git a/.flowr/flows/development-flow.mermaid b/.flowr/flows/development-flow.mermaid deleted file mode 100644 index 3c4bea8..0000000 --- a/.flowr/flows/development-flow.mermaid +++ /dev/null @@ -1,3 +0,0 @@ -{ - "mermaid": "stateDiagram-v2\n state \"project-structuring\" as project-structuring\n tdd-cycle --> tdd-cycle-flow\n note right of tdd-cycle: invokes tdd-cycle-flow\n state \"tdd-cycle\" as tdd-cycle\n review-gate --> review-gate-flow\n note right of review-gate: invokes review-gate-flow\n state \"review-gate\" as review-gate\n state \"commit\" as commit\n project-structuring --> tdd-cycle : ready\n project-structuring --> needs-planning : needs-planning\n tdd-cycle --> review-gate : all-green | yagni: ==no-premature-abstractions, kiss: ==simplest-solution, dry: ==no-duplicated-logic, objcal: ==calisthenics-followed, smells: ==all-smells-addressed, solid: ==principles-applied, patterns: ==patterns-justified\n tdd-cycle --> project-structuring : blocked\n review-gate --> commit : pass\n review-gate --> tdd-cycle : fail\n commit --> done : done" -} diff --git a/.flowr/flows/development-flow.yaml b/.flowr/flows/development-flow.yaml index 9191f51..e9190ee 100644 --- a/.flowr/flows/development-flow.yaml +++ b/.flowr/flows/development-flow.yaml @@ -1,18 +1,17 @@ flow: development-flow -version: 8.0.0 +version: 9.0.0 params: [feature_id] exits: - done - - needs-planning states: - - id: project-structuring + - id: feature-structuring attrs: - description: "SA creates the project skeleton — branch, package structure, port interfaces, aggregate root signatures — before any feature-specific stubs" + description: "SA creates the feature branch and feature-level structure — package directories, port interfaces, aggregate root signatures — before TDD cycles begin" owner: SA git: feature skills: - - structure-project + - structure-feature in: - features/.feature - domain_model.md @@ -22,14 +21,13 @@ states: - git_branch next: ready: tdd-cycle - needs-planning: needs-planning - id: tdd-cycle attrs: description: "SE implements the feature through repeated RED-GREEN-REFACTOR cycles until all BDD examples pass" git: feature flow: tdd-cycle-flow - flow-version: "^4" + flow-version: "^5" conditions: design-declared: yagni: ==no-premature-abstractions @@ -43,33 +41,25 @@ states: all-green: to: review-gate when: design-declared - blocked: project-structuring - id: review-gate attrs: - description: "R independently verifies implementation across three tiers — design, structure, and conventions — before commit" - git: feature - flow: review-gate-flow - flow-version: "^6" - next: - pass: commit - fail: tdd-cycle - - - id: commit - attrs: - description: "SE commits the reviewed, passing implementation with traceability to feature files" - owner: SE + description: "R independently verifies implementation across three tiers — design, structure, conventions — then commits the passing implementation with @id traceability" + owner: R git: feature skills: - - commit-implementation + - review-gate in: - test-implementations - source-implementations - - design_review_evidence - - structure_review_evidence - - conventions_review_evidence - features/.feature out: - feature-commits + conditions: + commit-gate: + committed: ==verified next: - done: done \ No newline at end of file + pass: + to: done + when: commit-gate + fail: tdd-cycle \ No newline at end of file diff --git a/.flowr/flows/discovery-flow.mermaid b/.flowr/flows/discovery-flow.mermaid deleted file mode 100644 index cffb7b1..0000000 --- a/.flowr/flows/discovery-flow.mermaid +++ /dev/null @@ -1,3 +0,0 @@ -{ - "mermaid": "stateDiagram-v2\n state \"stakeholder-interview\" as stakeholder-interview\n state \"domain-discovery\" as domain-discovery\n state \"scope-boundary\" as scope-boundary\n state \"feature-discovery\" as feature-discovery\n stakeholder-interview --> domain-discovery : needs-full-discovery\n stakeholder-interview --> scope-boundary : needs-scope-only\n stakeholder-interview --> complete : already-known\n domain-discovery --> scope-boundary : done\n domain-discovery --> stakeholder-interview : needs-reinterview\n scope-boundary --> feature-discovery : done\n scope-boundary --> stakeholder-interview : needs-reinterview\n feature-discovery --> complete : done | committed-to-main-locally: ==verified\n feature-discovery --> stakeholder-interview : needs-reinterview" -} diff --git a/.flowr/flows/feature-development-flow.mermaid b/.flowr/flows/feature-development-flow.mermaid deleted file mode 100644 index 064399e..0000000 --- a/.flowr/flows/feature-development-flow.mermaid +++ /dev/null @@ -1,3 +0,0 @@ -{ - "mermaid": "stateDiagram-v2\n planning --> planning-flow\n note right of planning: invokes planning-flow\n state \"planning\" as planning\n development --> development-flow\n note right of development: invokes development-flow\n state \"development\" as development\n delivery --> delivery-flow\n note right of delivery: invokes delivery-flow\n state \"delivery\" as delivery\n post-mortem --> post-mortem-flow\n note right of post-mortem: invokes post-mortem-flow\n state \"post-mortem\" as post-mortem\n planning --> development : complete\n planning --> needs-architecture : needs-architecture\n planning --> completed : no-features\n development --> delivery : done\n development --> planning : needs-planning\n delivery --> planning : next-feature\n delivery --> post-mortem : rejected\n delivery --> development : needs-development\n delivery --> cancelled : cancelled\n post-mortem --> planning : complete\n post-mortem --> needs-architecture : needs-architecture\n post-mortem --> cancelled : no-action" -} diff --git a/.flowr/flows/feature-development-flow.yaml b/.flowr/flows/feature-development-flow.yaml index 4c21e26..11539a2 100644 --- a/.flowr/flows/feature-development-flow.yaml +++ b/.flowr/flows/feature-development-flow.yaml @@ -1,11 +1,12 @@ flow: feature-development-flow -version: 7.0.0 +version: 9.0.0 params: [feature_id] exits: - needs-architecture - cancelled - completed + - rejected states: - id: planning @@ -13,7 +14,7 @@ states: description: "Plan feature breakdown, BDD scenarios, and development readiness" git: main flow: planning-flow - flow-version: "^7" + flow-version: "^11" next: complete: development needs-architecture: needs-architecture @@ -24,10 +25,9 @@ states: description: "Implement the feature through TDD cycles, review, and commit" git: feature flow: development-flow - flow-version: "^6" + flow-version: "^9" next: done: delivery - needs-planning: planning - id: delivery attrs: @@ -37,17 +37,6 @@ states: flow-version: "^5" next: next-feature: planning - rejected: post-mortem + rejected: rejected needs-development: development - cancelled: cancelled - - - id: post-mortem - attrs: - description: "Investigate rejection, document findings, and determine corrective action" - git: main - flow: post-mortem-flow - flow-version: "^3" - next: - complete: planning - needs-architecture: needs-architecture - no-action: cancelled \ No newline at end of file + cancelled: cancelled \ No newline at end of file diff --git a/.flowr/flows/main-flow.mermaid b/.flowr/flows/main-flow.mermaid deleted file mode 100644 index 92feb64..0000000 --- a/.flowr/flows/main-flow.mermaid +++ /dev/null @@ -1,3 +0,0 @@ -{ - "mermaid": "stateDiagram-v2\n discovery --> discovery-flow\n note right of discovery: invokes discovery-flow\n state \"discovery\" as discovery\n architecture --> architecture-flow\n note right of architecture: invokes architecture-flow\n state \"architecture\" as architecture\n feature-development --> feature-development-flow\n note right of feature-development: invokes feature-development-flow\n state \"feature-development\" as feature-development\n discovery --> architecture : complete\n architecture --> feature-development : complete\n architecture --> discovery : needs-discovery\n feature-development --> architecture : needs-architecture\n feature-development --> cancelled : cancelled\n feature-development --> completed : completed" -} diff --git a/.flowr/flows/main-flow.yaml b/.flowr/flows/main-flow.yaml index adf303f..8b62c89 100644 --- a/.flowr/flows/main-flow.yaml +++ b/.flowr/flows/main-flow.yaml @@ -1,6 +1,6 @@ flow: main-flow -version: 9.0.0 -exits: [completed, cancelled] +version: 10.0.0 +exits: [completed, cancelled, rejected] states: - id: discovery @@ -8,7 +8,7 @@ states: description: "Understand the domain, define scope, and establish ubiquitous language through stakeholder interviews and domain modeling" git: main flow: discovery-flow - flow-version: "^6" + flow-version: "^11" next: complete: architecture @@ -17,7 +17,7 @@ states: description: "Design technical architecture, context boundaries, and API contracts for the entire project" git: main flow: architecture-flow - flow-version: "^6" + flow-version: "^8" next: complete: feature-development needs-discovery: discovery @@ -27,8 +27,9 @@ states: description: "Feature-level loop: Planning → Development → Acceptance → Delivery per feature" git: feature flow: feature-development-flow - flow-version: "^7" + flow-version: "^9" next: needs-architecture: architecture cancelled: cancelled - completed: completed \ No newline at end of file + completed: completed + rejected: rejected \ No newline at end of file diff --git a/.flowr/flows/planning-flow.mermaid b/.flowr/flows/planning-flow.mermaid deleted file mode 100644 index 7368430..0000000 --- a/.flowr/flows/planning-flow.mermaid +++ /dev/null @@ -1,3 +0,0 @@ -{ - "mermaid": "stateDiagram-v2\n state \"feature-selection\" as feature-selection\n state \"feature-breakdown\" as feature-breakdown\n state \"feature-examples\" as feature-examples\n state \"create-py-stubs\" as create-py-stubs\n state \"definition-of-done\" as definition-of-done\n state \"ready\" as ready\n feature-selection --> feature-breakdown : selected\n feature-selection --> needs-architecture : needs-architecture\n feature-selection --> no-features : no-features\n feature-breakdown --> feature-examples : done | independent: ==no-shared-data-or-side-effects, negotiable: ==scope-negotiated, valuable: ==user-value-clear, estimable: ==effort-estimated, small: ==fits-single-sprint, testable: ==acceptance-criteria-defined\n feature-breakdown --> feature-breakdown : needs-respecification\n feature-examples --> create-py-stubs : done | all-examples-have-ids: ==verified, all-examples-have-gherkin: ==verified, premortem-done: ==verified, concerns: <=2, must-examples: <=8, all-examples-observable: ==each-then-describes-single-outcome, all-examples-declarative: ==behaviour-not-ui-steps, distinctness-verified: ==no-duplicate-observable-behaviours\n feature-examples --> feature-breakdown : needs-respecification\n create-py-stubs --> definition-of-done : done\n definition-of-done --> ready : done\n ready --> complete : done | feature-status: ==BASELINED, committed-to-main-locally: ==verified" -} diff --git a/.flowr/flows/planning-flow.yaml b/.flowr/flows/planning-flow.yaml index 5fcb4fa..d8a7b97 100644 --- a/.flowr/flows/planning-flow.yaml +++ b/.flowr/flows/planning-flow.yaml @@ -1,5 +1,5 @@ flow: planning-flow -version: 9.0.0 +version: 11.0.0 params: [feature_id] exits: - complete @@ -41,17 +41,11 @@ states: - rules conditions: invest-passed: - independent: ==no-shared-data-or-side-effects - negotiable: ==scope-negotiated - valuable: ==user-value-clear - estimable: ==effort-estimated - small: ==fits-single-sprint - testable: ==acceptance-criteria-defined + invest-passed: ==verified next: done: to: feature-examples when: invest-passed - needs-respecification: feature-breakdown - id: feature-examples attrs: @@ -69,80 +63,54 @@ states: - features/.feature: - examples conditions: - examples-have-ids: - all-examples-have-ids: ==verified - examples-have-gherkin: - all-examples-have-gherkin: ==verified - premortem-done: - premortem-done: ==verified - decomposition-valid: - concerns: <=2 - must-examples: <=8 examples-complete: - all-examples-have-ids: ==verified - all-examples-have-gherkin: ==verified - premortem-done: ==verified - concerns: <=2 - must-examples: <=8 - all-examples-observable: ==each-then-describes-single-outcome - all-examples-declarative: ==behaviour-not-ui-steps - distinctness-verified: ==no-duplicate-observable-behaviours + examples-complete: ==verified next: done: - to: create-py-stubs + to: spec-review when: examples-complete - needs-respecification: feature-breakdown - - id: create-py-stubs + - id: spec-review attrs: - description: "SA creates minimum typed stubs and test stubs as domain model breadcrumbs for the current feature" - owner: SA + description: "R independently verifies the feature spec for cross-document consistency, domain alignment, BDD quality, and pre-mortem coverage" + owner: R git: main skills: - - create-py-stubs + - review-spec in: - features/.feature + - product_definition.md - domain_model.md - glossary.md - out: - - typed-source-stubs - - test-skeletons + out: [] conditions: - stubs-traceable: - all-ids-have-stubs: ==verified - next: - done: definition-of-done - - - id: definition-of-done - attrs: - description: "PO tailors the definition of done criteria based on the specific feature's requirements" - owner: PO - git: main - skills: - - define-done - in: - - features/.feature - - product_definition.md - out: - - product_definition.md: - - definition_of_done + spec-verified: + spec-verified: ==verified next: - done: ready + done: + to: create-py-stubs + when: spec-verified + fail: feature-breakdown - - id: ready + - id: create-py-stubs attrs: - description: "PO confirms all planning artifacts are complete and the feature is ready for development" - owner: PO + description: "SA creates typed stubs and test stubs from the feature file and verifies all planning artifacts are complete before baseline" + owner: SA git: main skills: - - confirm-baseline + - create-py-stubs in: - features/.feature - product_definition.md - domain_model.md - out: [] + - glossary.md + out: + - typed-source-stubs + - test-skeletons conditions: - feature-baselined: + stubs-traceable: + all-ids-have-stubs: ==verified + baseline-confirmed: baseline-confirmed: ==verified committed-to-main-locally: committed-to-main-locally: ==verified @@ -150,5 +118,6 @@ states: done: to: complete when: - - feature-baselined + - stubs-traceable + - baseline-confirmed - committed-to-main-locally diff --git a/.flowr/flows/post-mortem-flow.mermaid b/.flowr/flows/post-mortem-flow.mermaid deleted file mode 100644 index 0f296f3..0000000 --- a/.flowr/flows/post-mortem-flow.mermaid +++ /dev/null @@ -1,3 +0,0 @@ -{ - "mermaid": "stateDiagram-v2\n state \"root-cause-analysis\" as root-cause-analysis\n state \"document-findings\" as document-findings\n state \"extract-lessons\" as extract-lessons\n state \"action-items\" as action-items\n root-cause-analysis --> document-findings : issues-found\n root-cause-analysis --> no-action : no-issues-found\n document-findings --> extract-lessons : done\n extract-lessons --> action-items : done\n action-items --> complete : replan\n action-items --> needs-architecture : architecture-issue\n action-items --> no-action : abandon" -} diff --git a/.flowr/flows/review-gate-flow.mermaid b/.flowr/flows/review-gate-flow.mermaid deleted file mode 100644 index 374c812..0000000 --- a/.flowr/flows/review-gate-flow.mermaid +++ /dev/null @@ -1,3 +0,0 @@ -{ - "mermaid": "stateDiagram-v2\n state \"design-review\" as design-review\n state \"structure-review\" as structure-review\n state \"conventions-review\" as conventions-review\n design-review --> structure-review : pass | alignment: ==domain-model-verified, adr-compliance: ==adrs-respected\n design-review --> fail : fail\n structure-review --> conventions-review : pass | coverage: ==threshold-met, traceability: ==all-ids-covered, coupling: ==behavior-not-implementation\n structure-review --> fail : fail\n conventions-review --> pass : pass | formatting: ==clean, naming: ==domain-language\n conventions-review --> fail : fail" -} diff --git a/.flowr/flows/review-gate-flow.yaml b/.flowr/flows/review-gate-flow.yaml deleted file mode 100644 index 3f7c7b8..0000000 --- a/.flowr/flows/review-gate-flow.yaml +++ /dev/null @@ -1,84 +0,0 @@ -flow: review-gate-flow -version: 6.0.0 -params: [feature_id] -exits: - - pass - - fail - -states: - - id: design-review - attrs: - description: "R verifies implementation aligns with domain model, follows DDD patterns, and respects architectural decisions" - owner: R - git: feature - skills: - - review-design - in: - - features/.feature - - domain_model.md - - glossary.md - - product_definition.md - - refactored-source - out: - - design_review_evidence - conditions: - design-approved: - alignment: ==domain-model-verified - adr-compliance: ==adrs-respected - next: - pass: - to: structure-review - when: design-approved - fail: fail - - - id: structure-review - attrs: - description: "R verifies test coverage, BDD example pass rate, test coupling, and behavior-vs-structure testing" - owner: R - git: feature - skills: - - review-structure - - verify-traceability - in: - - coverage-reports - - test-output - - refactored-source - - features/.feature - - domain_model.md - - glossary.md - out: - - structure_review_evidence - conditions: - structure-approved: - coverage: ==threshold-met - traceability: ==all-ids-covered - coupling: ==behavior-not-implementation - next: - pass: - to: conventions-review - when: structure-approved - fail: fail - - - id: conventions-review - attrs: - description: "R verifies formatting, docstrings, type hints, import ordering, and lint rules unrelated to design" - owner: R - git: feature - skills: - - review-conventions - in: - - linter-output - - refactored-source - - product_definition.md - - glossary.md - out: - - conventions_review_evidence - conditions: - conventions-approved: - formatting: ==clean - naming: ==domain-language - next: - pass: - to: pass - when: conventions-approved - fail: fail diff --git a/.flowr/flows/setup-project-flow.mermaid b/.flowr/flows/setup-project-flow.mermaid deleted file mode 100644 index e8ef718..0000000 --- a/.flowr/flows/setup-project-flow.mermaid +++ /dev/null @@ -1,3 +0,0 @@ -{ - "mermaid": "stateDiagram-v2\n state \"assess-requirements\" as assess-requirements\n state \"configure-parameters\" as configure-parameters\n state \"apply-substitutions\" as apply-substitutions\n state \"verify-and-finalize\" as verify-and-finalize\n assess-requirements --> configure-parameters : assessed\n assess-requirements --> cancelled : cancelled\n configure-parameters --> apply-substitutions : confirmed | pyproject-toml: ==exists, readme-md: ==exists, github-workflows-ci-yml: ==exists, license: ==exists, tests-unit-main-test-py: ==exists, app-directory: ==exists\n configure-parameters --> cancelled : missing-files\n apply-substitutions --> verify-and-finalize : applied | no-stale-app-imports: ==verified, package-renamed: ==verified, version-reset: ==verified\n apply-substitutions --> cancelled : failed\n verify-and-finalize --> initialized : initialized | tests-pass: ==verified, imports-valid: ==verified, artifacts-cleaned: ==verified, committed-to-main-locally: ==verified\n verify-and-finalize --> cancelled : failed" -} diff --git a/.flowr/flows/tdd-cycle-flow.mermaid b/.flowr/flows/tdd-cycle-flow.mermaid deleted file mode 100644 index f010650..0000000 --- a/.flowr/flows/tdd-cycle-flow.mermaid +++ /dev/null @@ -1,3 +0,0 @@ -{ - "mermaid": "stateDiagram-v2\n state \"red\" as red\n state \"green\" as green\n state \"refactor\" as refactor\n red --> green : test-written\n red --> blocked : blocked\n green --> refactor : test-passes\n refactor --> red : next-example\n refactor --> all-green : all-examples-pass" -} diff --git a/.flowr/flows/tdd-cycle-flow.yaml b/.flowr/flows/tdd-cycle-flow.yaml index 1cc47a9..10046ec 100644 --- a/.flowr/flows/tdd-cycle-flow.yaml +++ b/.flowr/flows/tdd-cycle-flow.yaml @@ -1,9 +1,8 @@ flow: tdd-cycle-flow -version: 4.0.0 +version: 5.0.0 params: [feature_id] exits: - all-green - - blocked states: - id: red @@ -23,7 +22,6 @@ states: - test-implementations next: test-written: green - blocked: blocked - id: green attrs: diff --git a/.opencode/knowledge/software-craft/git-conventions.md b/.opencode/knowledge/software-craft/git-conventions.md index 379aedb..26e3393 100644 --- a/.opencode/knowledge/software-craft/git-conventions.md +++ b/.opencode/knowledge/software-craft/git-conventions.md @@ -86,5 +86,5 @@ Before any merge, verify the feature works in its delivery context: ## Related - [[software-craft/tdd]]: commit discipline (separate refactor from feature) -- [[software-craft/stub-design]]: branch setup during project structuring +- [[software-craft/source-stubs]]: branch setup during project structuring - [[software-craft/code-review]]: three-tier review before merge \ No newline at end of file diff --git a/.opencode/knowledge/software-craft/stub-design.md b/.opencode/knowledge/software-craft/source-stubs.md similarity index 58% rename from .opencode/knowledge/software-craft/stub-design.md rename to .opencode/knowledge/software-craft/source-stubs.md index 4c37569..d5fae58 100644 --- a/.opencode/knowledge/software-craft/stub-design.md +++ b/.opencode/knowledge/software-craft/source-stubs.md @@ -1,45 +1,36 @@ --- domain: software-craft -tags: [stub-design, typed-stubs, traceability, package-structure] -last-updated: 2026-04-30 +tags: [source-stubs, typed-stubs, package-structure] +last-updated: 2026-05-08 --- -# Stub Design +# Source Stubs ## Key Takeaways -- Stubs are created at two levels: project-level creates the package skeleton; feature-level creates typed source stubs and test stubs per feature. -- Every `@id` tag in the feature file must have a corresponding test stub; traceability is verified at baseline. -- Package structure mirrors the module structure from technical design: each module maps to a Python package, each contract maps to a Protocol file. +- Stubs are created at two levels: project-level creates the package skeleton; feature-level creates typed source stubs per feature. +- Typed stubs are derived from the three contract types in technical design (API, event, interface); they compile but have no behaviour. +- Source stubs contain the absolute minimum to compile and trace: Protocol signatures with `raise NotImplementedError` bodies, no docstrings, no type hints beyond the contract. +- Package structure mirrors the module structure from technical design; the domain package depends on nothing. - Feature branches are created from the latest main. -- Source stubs are breadcrumbs from the domain model: the SE can add, remove, or modify them as the real shape emerges from TDD. +- Create artifacts in scaffold order: branch, directories, port interfaces, Protocol stubs, test stubs, verify @ids. ## Concepts -**Two-Level Stub Creation**. Stubs are created at two levels of granularity. **Project-level**: the SA creates the package skeleton only: directory structure mirroring the module layout, `__init__.py` files, port interfaces (Protocol abstractions from hexagonal architecture), and aggregate root class signatures. No entity, value object, or use case stubs are created at this level. **Feature-level**: the SA creates minimum typed stubs for the entities, value objects, and use cases referenced by the current feature's Examples, plus test stubs for each `@id` tag. These feature-level stubs are breadcrumbs from the domain model. The SE can add, remove, or modify them as the real implementation shape emerges from TDD. +**Two-Level Stub Creation**. Stubs are created at two levels of granularity. **Project-level**: the SA creates the package skeleton only: directory structure mirroring the module layout, `__init__.py` files, port interfaces (Protocol abstractions from hexagonal architecture), and aggregate root class signatures. No entity, value object, or use case stubs are created at this level. **Feature-level**: the SA creates minimum typed stubs for the entities, value objects, and use cases referenced by the current feature's Examples. These feature-level stubs are breadcrumbs from the domain model. The SE can add, remove, or modify them as the real implementation shape emerges from TDD. **Typed Stubs from Contracts**. At feature level, Protocol interfaces are derived from the three contract types defined in technical design: API contracts (REST endpoints → Protocol methods), event contracts (domain events → dataclasses with event schema), and interface definitions (hexagonal ports → Protocol abstractions). These stubs compile but have no behaviour. They serve as the architecture's skeleton. **Minimum Stub Principle**. Source stubs contain the absolute minimum needed to compile and trace. Protocol method signatures with `raise NotImplementedError` bodies: no docstrings, no type hints beyond the contract (return types and parameter types required by the Protocol). Docstrings, type hints, and lint compliance (ruff check, ruff format) are added when reviewers require them, not proactively. Adding them early is waste because refactoring changes code shape and invalidates them. -**@id Traceability Chain**. Each `@id` tag in the feature file produces one test stub at `tests/features//_test.py` with a function named `test__`. The `stubs_traceable` condition on the `create-py-stubs.done` transition verifies that `all_ids_have_stubs: ==true`. This ensures no acceptance criterion is lost between planning and implementation. - -**Test Stub Format**. Every test stub follows the project's test stub template (located in `.templates/`). The format requires: -- Decorated with `@pytest.mark.skip(reason="not yet implemented")`, never use `...` ellipsis bodies -- Docstring contains the raw Gherkin steps (Given/When/Then) for traceability -- Body is `raise NotImplementedError`, so the test fails explicitly if the skip decorator is removed prematurely -- Function name follows `test__` naming convention -- No MoSCoW tags or priority labels anywhere in the stub - **Package Structure from Module Structure**. The module structure section of technical design maps directly to the package layout: each module becomes a Python package, each Protocol becomes a file in that package, and each test module mirrors its production counterpart. The domain package depends on nothing; infrastructure packages depend on domain Protocols, never the reverse. **Branch Setup**. Implementation begins on a feature branch (`feat/`) created from the latest main. Branch naming follows [[software-craft/git-conventions]]. -**Scaffolding Order**. Create artifacts in this order: (1) feature branch from main, (2) package directories from module structure, (3) port interfaces and aggregate root signatures, (4) per-feature: Protocol stubs from contracts + test stubs from @id tags, (5) verify all @ids have corresponding test stubs. +**Scaffolding Order**. Create artifacts in this order: (1) feature branch from main, (2) package directories from module structure, (3) port interfaces and aggregate root signatures, (4) per-feature: Protocol stubs from contracts + test stubs from @id tags per [[software-craft/test-stubs#key-takeaways]], (5) verify all @ids have corresponding test stubs. ## Related - [[architecture/contract-design]]: the three contract types that define stub shapes - [[architecture/technical-design]]: module structure and package layout -- [[requirements/gherkin]]: @id tag format and traceability convention -- [[software-craft/git-conventions]]: branch naming and commit format \ No newline at end of file +- [[software-craft/test-stubs]]: test stub format and @id traceability chain diff --git a/.opencode/knowledge/software-craft/test-design.md b/.opencode/knowledge/software-craft/test-design.md index be6af00..741b154 100644 --- a/.opencode/knowledge/software-craft/test-design.md +++ b/.opencode/knowledge/software-craft/test-design.md @@ -70,5 +70,5 @@ last-updated: 2026-04-29 - [[software-craft/tdd]]: the RED-GREEN-REFACTOR cycle that produces these tests - [[software-craft/code-review]]: reviewing whether tests meet these quality criteria - [[requirements/gherkin]]: the specification format that drives test design -- [[software-craft/stub-design]]: creating typed stubs that maintain semantic alignment +- [[software-craft/source-stubs]]: creating typed stubs that maintain semantic alignment - [[requirements/pre-mortem]]: behavior pre-mortem surfaces counterexamples for property tests \ No newline at end of file diff --git a/.opencode/knowledge/software-craft/test-stubs.md b/.opencode/knowledge/software-craft/test-stubs.md new file mode 100644 index 0000000..80d2df3 --- /dev/null +++ b/.opencode/knowledge/software-craft/test-stubs.md @@ -0,0 +1,28 @@ +--- +domain: software-craft +tags: [test-stubs, traceability] +last-updated: 2026-05-08 +--- + +# Test Stubs + +## Key Takeaways + +- Every `@id` tag in the feature file must have a corresponding test stub; traceability is verified at baseline. +- Test stubs follow the project template: one-line description of what the example proves, blank line, Gherkin steps (`test__` naming, `raise NotImplementedError` body, skip decorator, no MoSCoW tags). + +## Concepts + +**@id Traceability Chain**. Each `@id` tag in the feature file produces one test stub at `tests/features//_test.py` with a function named `test__`. The `stubs-traceable` condition on the `create-py-stubs.done` transition verifies that `all-ids-have-stubs: ==verified`. This ensures no acceptance criterion is lost between planning and implementation. + +**Test Stub Format**. Every test stub follows the project's test stub template (located in `.templates/`). The format requires: +- Decorated with `@pytest.mark.skip(reason="not yet implemented")`, never use `...` ellipsis bodies +- Docstring begins with a one-line description of what this specific example proves, followed by a blank line, then the Gherkin steps (Given/When/Then) for traceability +- Body is `raise NotImplementedError`, so the test fails explicitly if the skip decorator is removed prematurely +- Function name follows `test__` naming convention +- No MoSCoW tags or priority labels anywhere in the stub + +## Related + +- [[requirements/gherkin]]: @id tag format and traceability convention +- [[software-craft/source-stubs]]: typed source stubs and scaffolding order diff --git a/.opencode/skills/confirm-baseline/SKILL.md b/.opencode/skills/confirm-baseline/SKILL.md deleted file mode 100644 index 33ffadb..0000000 --- a/.opencode/skills/confirm-baseline/SKILL.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -name: confirm-baseline -description: "Confirm all planning artifacts are complete and the feature is ready for development" ---- - -# Confirm Baseline - -Available knowledge: [[requirements/decomposition#key-takeaways]]. `in` artifacts: read all before starting work. - -1. Verify all Examples have `@id` tags. If any are missing, the feature is not ready for baseline. -2. Verify the feature passes decomposition checks per [[requirements/decomposition#key-takeaways]]: no more than 2 concerns, no more than 8 Must Examples. -3. Verify all planning artifacts are present and consistent. diff --git a/.opencode/skills/create-py-stubs/SKILL.md b/.opencode/skills/create-py-stubs/SKILL.md index 90e09c1..622ca5a 100644 --- a/.opencode/skills/create-py-stubs/SKILL.md +++ b/.opencode/skills/create-py-stubs/SKILL.md @@ -1,13 +1,16 @@ --- name: create-py-stubs -description: "Create minimum typed stubs and test stubs as domain model breadcrumbs for the current feature" +description: "Create minimum typed stubs and test stubs as domain model breadcrumbs for the current feature, then verify all planning artifacts are complete for baseline" --- # Create Python Stubs -Available knowledge: [[architecture/technical-design]], [[software-craft/stub-design]], [[software-craft/tdd]]. `in` artifacts: read all before starting work. +Available knowledge: [[architecture/technical-design]], [[software-craft/source-stubs]], [[software-craft/test-stubs]], [[software-craft/tdd]], [[requirements/decomposition#key-takeaways]]. `in` artifacts: read all before starting work. 1. Read the feature file and identify all `@id` tags and the domain entities, value objects, and use cases referenced by the Examples. -2. For each referenced entity/value object/use case not yet implemented, create a minimal typed stub per [[software-craft/stub-design#concepts]]: Protocol method signatures with `raise NotImplementedError` bodies, no docstrings, no type hints beyond the contract. These stubs are breadcrumbs from the domain model. The SE can add, remove, or modify them during implementation. -3. Create test stubs from the project's test stub template with `@id` traceability per [[software-craft/stub-design#concepts]]. Each stub uses `@pytest.mark.skip(reason="not yet implemented")`, follows `test__` naming, and contains raw Gherkin steps in the docstring: never MoSCoW tags or `...` ellipsis bodies. -4. Verify all `@id` tags from the feature file have corresponding test stubs per [[software-craft/stub-design#key-takeaways]]. +2. For each referenced entity/value object/use case not yet implemented, create a minimal typed stub per [[software-craft/source-stubs#concepts]]: Protocol method signatures with `raise NotImplementedError` bodies, no docstrings, no type hints beyond the contract. These stubs are breadcrumbs from the domain model. The SE can add, remove, or modify them during implementation. +3. Create test stubs from the project's test stub template with `@id` traceability per [[software-craft/test-stubs#concepts]]. Each stub uses `@pytest.mark.skip(reason="not yet implemented")`, follows `test__` naming, and has a docstring with a one-line description of what the example proves, a blank line, then the Gherkin steps: never MoSCoW tags or `...` ellipsis bodies. +4. Verify all `@id` tags from the feature file have corresponding test stubs per [[software-craft/test-stubs#key-takeaways]]. +5. Verify decomposition per [[requirements/decomposition#key-takeaways]]: no more than 2 concerns, no more than 8 Must Examples. +6. Verify all planning artifacts are present and consistent: feature file, product definition, domain model, glossary. +7. Commit all changes to local main. diff --git a/.opencode/skills/define-done/SKILL.md b/.opencode/skills/define-done/SKILL.md deleted file mode 100644 index 8f64d5d..0000000 --- a/.opencode/skills/define-done/SKILL.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -name: define-done -description: "Define the quality gates that must pass before the feature is considered complete" ---- - -# Define Done - -Available knowledge: [[software-craft/code-review#key-takeaways]]. `in` artifacts: read all before starting work. - -1. Define quality gates per [[software-craft/code-review#key-takeaways]]: design correctness, test quality, and conventions. -2. Incorporate quality attributes from the product definition into the gates. -3. Verify spec compliance: for each interface element documented in the technical design (command flags, configuration keys, API parameters), verify it exists in the implementation. Interface elements specified in the design but not implemented indicate an incomplete feature. diff --git a/.opencode/skills/model-domain/SKILL.md b/.opencode/skills/model-domain/SKILL.md deleted file mode 100644 index fac4c2b..0000000 --- a/.opencode/skills/model-domain/SKILL.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -name: model-domain -description: "Formalize candidates into bounded contexts, entities, relationships, and aggregate boundaries" ---- - -# Model Domain - -Available knowledge: [[domain-modeling/event-storming#key-takeaways]]. `in` artifacts: read all before starting work. - -1. Define bounded contexts per [[domain-modeling/event-storming#key-takeaways]]. -2. Define entities within each context: name, attributes, lifecycle. -3. Define relationships between entities: associations, dependencies, invariants. -4. Define aggregate boundaries per [[domain-modeling/event-storming#key-takeaways]]. -5. Write a summary of the domain model. diff --git a/.opencode/skills/review-architecture/SKILL.md b/.opencode/skills/review-architecture/SKILL.md deleted file mode 100644 index ec6ee00..0000000 --- a/.opencode/skills/review-architecture/SKILL.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -name: review-architecture -description: "Independently verify architecture alignment with domain model and requirements, and cross-document consistency" ---- - -# Review Architecture - -Available knowledge: [[architecture/reconciliation#key-takeaways]], [[architecture/adr#key-takeaways]]. `in` artifacts: read all before starting work. - -1. Declare adversarial stance per [[architecture/reconciliation#concepts]]. -2. Run cross-document consistency checks per [[architecture/reconciliation#concepts]]. -3. Verify ADR consistency per [[architecture/adr#concepts]]. -4. Verify architectural style satisfies quality attribute priorities per - [[architecture/quality-attributes#concepts]]. -5. If any inconsistency is found, resolve per [[architecture/reconciliation#concepts]]. -6. When flagging issues, include file:line references (e.g., "product_definition.md:34 contradicts domain_model.md:12"). Vague findings create rework. diff --git a/.opencode/skills/review-conventions/SKILL.md b/.opencode/skills/review-conventions/SKILL.md deleted file mode 100644 index 4982270..0000000 --- a/.opencode/skills/review-conventions/SKILL.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -name: review-conventions -description: "Verify formatting, docstrings, type hints, and lint rules" ---- - -# Review Conventions - -Available knowledge: [[requirements/ubiquitous-language]], [[software-craft/code-review]]. `in` artifacts: read all before starting work. - -1. This review tier runs after design and structure review have passed. The SE addresses convention findings only at this stage. The SE does not proactively run lint, format, or type checks during the TDD cycle. -2. Declare fail-fast stance per [[software-craft/code-review#concepts]]: stop at the first failure. -3. Run `ruff check .` and `task static-check` to verify formatting and lint rules pass. -4. Verify docstrings, type hints, and naming follow domain language per [[requirements/ubiquitous-language#key-takeaways]]. -5. The reviewer MUST NOT modify any files per [[software-craft/code-review#key-takeaways]]: lint and type errors are findings to report, not to fix during review. -6. When flagging issues, include file:line references (e.g., "auth/handler.py:12 uses 'userName' instead of 'user_name'"). Vague findings create rework. diff --git a/.opencode/skills/review-design/SKILL.md b/.opencode/skills/review-design/SKILL.md deleted file mode 100644 index 04d0a13..0000000 --- a/.opencode/skills/review-design/SKILL.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -name: review-design -description: "Verify implementation aligns with domain model, architectural decisions, and quality attributes" ---- - -# Review Design - -Available knowledge: [[architecture/reconciliation]], [[architecture/adr]], [[software-craft/code-review]], [[software-craft/refactoring]], [[software-craft/object-calisthenics]], [[software-craft/smell-catalogue]], [[software-craft/design-patterns]], [[software-craft/solid]], [[software-craft/tdd]]. `in` artifacts: read all before starting work. - -1. This review tier checks design correctness ONLY. Do not flag lint, coverage, docstring, or naming issues. Those belong to structure or conventions review. -2. Declare adversarial stance per [[software-craft/code-review#concepts]]: default hypothesis: "it might be broken despite green tests." -3. Verify implementation aligns with domain model and bounded contexts per [[architecture/reconciliation#concepts]]. -4. Verify architectural decisions from ADRs are respected per [[architecture/adr#key-takeaways]]. -5. Verify Object Calisthenics per [[software-craft/object-calisthenics#key-takeaways]]: check each rule for violations. -6. Check for code smells per [[software-craft/smell-catalogue#key-takeaways]]: Bloaters, OO Abusers, Change Preventers, Dispensables, Couplers. Check detection heuristics per [[software-craft/smell-catalogue#concepts]]. -7. Before flagging code as dead or unnecessary, verify against domain model, technical design, and interview notes. Code that matches the architecture but hasn't been exercised by a test yet is **planned code**. Flag as WARN (planned-not-reached), not REJECT. Only code that contradicts the architecture or was superseded is **dead code**: REJECT. -8. IF a smell is found → list it in findings per [[software-craft/code-review#key-takeaways]]. "Minor" is not a pass: acknowledged smells are still findings. -9. IF multiple `if/elif` on type/state → check for missing State or Strategy pattern per [[software-craft/design-patterns#concepts]]. -10. IF technical debt is identified → verify it is tracked or being paid down per [[software-craft/refactoring#concepts]]. -11. IF a quality attribute from the product definition has no corresponding design decision → flag it as a gap. -12. Stop at the first failure per [[software-craft/code-review#key-takeaways]]: write a minimal REJECTED report with file:line evidence. -13. When flagging issues, include file:line references (e.g., "domain_model.md:23 conflicts with login.feature:15"). Vague findings create rework. diff --git a/.opencode/skills/review-gate/SKILL.md b/.opencode/skills/review-gate/SKILL.md new file mode 100644 index 0000000..20334c7 --- /dev/null +++ b/.opencode/skills/review-gate/SKILL.md @@ -0,0 +1,32 @@ +--- +name: review-gate +description: "Three-tier review with fail-fast: design → structure → conventions" +--- + +# Review Gate + +Available knowledge: [[software-craft/code-review]], [[software-craft/test-design]], [[software-craft/smell-catalogue]]. `in` artifacts: read all before starting work. + +**Fail-fast rule**: Stop at first failure in any tier. Do NOT proceed to next tier if current tier fails. + +## Tier 1: Design Review + +1. Verify implementation aligns with domain model per [[software-craft/code-review#concepts]]: entities match domain model, value objects enforce invariants, use cases follow aggregate boundaries. +2. Verify implementation aligns with architectural decisions per [[software-craft/code-review#concepts]]: ADR compliance, quality attributes met. +3. Verify implementation aligns with feature specification: all Examples have corresponding test implementations, behavior matches Gherkin steps. +4. **FAIL-FAST**: If any design violations found → exit `fail` with specific citations (file:line). Do NOT proceed to structure review. + +## Tier 2: Structure Review + +5. Verify test coverage per [[software-craft/test-design#concepts]]: all @id tags have test implementations, no missing edge cases. +6. Verify test quality per [[software-craft/test-design#concepts]]: tests follow AAA pattern, clear assertions, behavior-focused not implementation-coupled. +7. Run `task test-coverage` and verify coverage meets project standards. +8. **FAIL-FAST**: If any structure violations found → exit `fail` with specific citations. Do NOT proceed to conventions review. + +## Tier 3: Conventions Review + +9. Run `ruff check .` and verify no lint violations. +10. Run `ruff format --check .` and verify formatting compliance. +11. Verify all functions have Google-style docstrings per project standards. +12. Verify all public interfaces have complete type hints and pass pyright checks. +13. **FAIL-FAST**: If any convention violations found → exit `fail` with specific citations. diff --git a/.opencode/skills/review-spec/SKILL.md b/.opencode/skills/review-spec/SKILL.md new file mode 100644 index 0000000..ffc2220 --- /dev/null +++ b/.opencode/skills/review-spec/SKILL.md @@ -0,0 +1,18 @@ +--- +name: review-spec +description: "Independently verify the feature spec for cross-document consistency, domain alignment, BDD quality, and pre-mortem coverage" +--- + +# Review Spec + +Available knowledge: [[architecture/reconciliation]], [[requirements/gherkin#concepts]], [[requirements/pre-mortem#concepts]]. `in` artifacts: read all before starting work. + +1. Declare adversarial stance per [[architecture/reconciliation#concepts]]: actively search for inconsistencies, not confirm alignment. +2. Run the four applicable cross-document consistency checks per [[architecture/reconciliation]] (skip ADR check — ADRs are not in the `in` list for this review): + - domain_model ↔ glossary + - domain_model ↔ feature + - glossary ↔ feature + - product_definition ↔ scope +3. Verify BDD quality per [[requirements/gherkin#concepts]]: every Example is declarative, each `Then` has a single observable outcome, no two Examples duplicate the same `Then` outcome. +4. Verify pre-mortem coverage per [[requirements/pre-mortem#concepts]]: each Rule has undergone specification pre-mortem; each distinct `Then` outcome has undergone behavior pre-mortem with Examples added for surfaced failure modes. +5. If any inconsistency or quality gap is found, flag with file:line references (e.g., "domain_model.md:23 conflicts with .feature:15"). Vague findings create rework. diff --git a/.opencode/skills/review-structure/SKILL.md b/.opencode/skills/review-structure/SKILL.md deleted file mode 100644 index 3f3efdd..0000000 --- a/.opencode/skills/review-structure/SKILL.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: review-structure -description: "Verify test coverage, test quality, and behavior-vs-implementation coupling" ---- - -# Review Structure - -Available knowledge: [[software-craft/test-design]], [[software-craft/tdd]], [[software-craft/code-review]]. `in` artifacts: read all before starting work. - -1. This review tier checks test quality and coverage ONLY. Do not flag lint, docstring, or naming issues. Those belong to conventions review. -2. Declare adversarial stance per [[software-craft/code-review#concepts]]: default hypothesis: "tests might be coupled to the wrong thing." -3. Verify tests specify observable behaviour, not implementation details, per [[software-craft/test-design#key-takeaways]]. -4. IF a test breaks when refactoring preserves behaviour → flag it as implementation-coupled per [[software-craft/test-design#concepts]]. -5. Verify each @id test exercises the entry point described in its acceptance criterion per [[software-craft/test-design#key-takeaways]]. If the AC describes a user-facing command with flags, the test must pass those flags through the command handler, not call domain methods directly. Domain-layer stubs test domain logic, but they don't verify that command flags reach the domain. -6. Run `task test-coverage` to verify test coverage meets the project threshold. -7. Verify @id-to-test traceability: every @id in the feature file must have exactly one test in tests/features//, and every test in tests/features/ must trace back to an @id. Missing tests → REJECT (feature not done). Orphan tests in tests/features/ → REJECT (move to tests/unit/). -8. Stop at the first failure per [[software-craft/code-review#key-takeaways]]: write a minimal REJECTED report with file:line evidence. -9. When flagging issues, include file:line references (e.g., "test_login.py:45 tests domain method directly instead of command handler"). Vague findings create rework. diff --git a/.opencode/skills/select-feature/SKILL.md b/.opencode/skills/select-feature/SKILL.md index bfa1c70..42517d6 100644 --- a/.opencode/skills/select-feature/SKILL.md +++ b/.opencode/skills/select-feature/SKILL.md @@ -13,25 +13,31 @@ description: "Select the next feature to develop by detecting delivery status fr 4. For each feature slug in delivery order, determine delivery status with a single pipeline — do NOT open or read individual feature or test files: - a. Extract every @id tag from the feature file and the matching test function + a. Count @id tags in the feature file. If zero, the feature has not been + broken down into BDD examples yet → feature is incomplete (select it). + + grep -c '@id:' docs/features/.feature + + b. Extract every @id tag from the feature file and the matching test function hex suffixes from the test directory, then compare: diff \ <(grep -oP '@id:\K\w+' docs/features/.feature | sort -u) \ <(grep -rh "def test__" tests/features// 2>/dev/null \ - | grep -oP 'test__\K\w+' | sort) + | grep -oP 'test__\K\w+' | sort -u) - Diff produces output → some @id tags lack matching test functions → feature is incomplete (select it). - Diff is clean → all @id tags have matching test functions. - b. If diff is clean, run the tests scoped to that feature's test directory + c. If diff is clean, run the tests scoped to that feature's test directory using the project's test runner (see Project Commands table). - Any failures → feature is incomplete (select it). - All pass → feature is delivered (skip). - c. If the test directory does not exist (grep returns nothing), the - diff will fail → feature is incomplete (select it). + d. If the test directory does not exist, grep returns nothing and diff + exits non-zero → feature is incomplete (select it). This also covers + the case where no test files exist to match @id tags. 5. Select the first incomplete feature by delivery order. 6. IF every feature in the delivery order is delivered (diff clean + tests pass for all) → diff --git a/.opencode/skills/structure-feature/SKILL.md b/.opencode/skills/structure-feature/SKILL.md new file mode 100644 index 0000000..b72d08d --- /dev/null +++ b/.opencode/skills/structure-feature/SKILL.md @@ -0,0 +1,11 @@ +--- +name: structure-feature +description: "Create feature branch and package structure from design artifacts" +--- + +# Structure Feature + +Available knowledge: [[software-craft/source-stubs#concepts]], [[software-craft/git-conventions#key-takeaways]]. `in` artifacts: read all before starting work. + +1. Create feature branch per [[software-craft/git-conventions#content]]: `feat/` from latest main. +2. Create package structure per [[software-craft/source-stubs#concepts]] and [[architecture/technical-design#key-takeaways]]. diff --git a/.opencode/skills/structure-project/SKILL.md b/.opencode/skills/structure-project/SKILL.md deleted file mode 100644 index 98c72bb..0000000 --- a/.opencode/skills/structure-project/SKILL.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -name: structure-project -description: "Create project skeleton: branch, package directories, port interfaces, aggregate root signatures, from design artifacts" ---- - -# Structure Project - -Available knowledge: [[architecture/technical-design#key-takeaways]], [[software-craft/stub-design]], [[software-craft/git-conventions#key-takeaways]]. `in` artifacts: read all before starting work. - -1. Create feature branch per [[software-craft/git-conventions#content]]: `feat/` from latest main. -2. Create package structure per [[architecture/technical-design#key-takeaways]]: directories, `__init__.py` files, port interfaces (Protocol abstractions from hexagonal architecture), and aggregate root class signatures. diff --git a/.opencode/skills/write-test/SKILL.md b/.opencode/skills/write-test/SKILL.md index 81ce41f..a0a05c5 100644 --- a/.opencode/skills/write-test/SKILL.md +++ b/.opencode/skills/write-test/SKILL.md @@ -8,6 +8,6 @@ description: "Write a failing test body for one BDD example" Available knowledge: [[software-craft/tdd]], [[software-craft/test-design]], [[software-craft/smell-catalogue]], [[software-craft/object-calisthenics]], [[software-craft/solid]]. `in` artifacts: read all before starting work. 1. Pick the next unimplemented `@id` from the feature file: order by fewest dependencies first per [[software-craft/tdd#concepts]]. IF the `@id` belongs to a structural (invariant) Rule → also generate a Hypothesis property test in `tests/unit/` per [[software-craft/test-design#concepts]], using the counterexamples surfaced by the behavior pre-mortem per [[requirements/pre-mortem#concepts]]. -2. Write a failing test that specifies the expected behavior per [[software-craft/tdd#key-takeaways]]. Preserve the full docstring from the test stub. The Gherkin steps (Given/When/Then) are immutable specification content for traceability and must not be removed, shortened, or reformatted. +2. Write a failing test that specifies the expected behavior per [[software-craft/tdd#key-takeaways]]. Preserve the full docstring from the test stub. The one-line description and the Gherkin steps (Given/When/Then) are immutable specification content for traceability and must not be removed, shortened, or reformatted. 3. IF a spec gap or inconsistency is discovered → do NOT modify specification documents (domain_model.md, glossary.md, product_definition.md, ADRs, feature files). Flag it in output notes. The SE may ONLY modify production code and test code. 4. Run `task test-fast` to confirm the test fails for the right reason (RED) per [[software-craft/tdd#key-takeaways]]. diff --git a/.templates/tests/features/_test.py.template b/.templates/tests/features/_test.py.template index 02f16e0..cfa9532 100644 --- a/.templates/tests/features/_test.py.template +++ b/.templates/tests/features/_test.py.template @@ -3,9 +3,10 @@ import pytest @pytest.mark.skip(reason="not yet implemented") def test__() -> None: - """ + """. + Given When Then """ - raise NotImplementedError \ No newline at end of file + raise NotImplementedError