# SPEC-000: [Feature / Bug Fix Title] - **Status:** DRAFT | APPROVED | IN PROGRESS | REVISED | COMPLETED - **Stack:** [e.g., ASP Classic + Access MDB | C# ASP.NET Core + Postgres | PHP + SQLite] - **Target Files:** [List of files to be created/modified] --- ### 1. Business Context & Goal *Why is this change being made? What is the expected business outcome?* ### 2. Acceptance Criteria (Given / When / Then) - **AC-1:** Given [precondition], when [action], then [expected result]. - **AC-2:** Given [invalid input], when [action], then [graceful error handling]. ### 3. Technical Design & Contracts - **Data Model / Schema Changes:** (SQL statements or Access table structural updates) - **Functions / APIs / Interfaces:** (state preconditions, postconditions, and invariants per Design by Contract — see `.devfoundry/rules/general.md`) - `FunctionName(param1 As String, param2 As Integer) As Boolean` - Preconditions: - Postconditions: - **Architecture:** (web apps: confirm MVC layering — controller/model/view or the stack's equivalent — or justify a deviation) - **Error Handling Strategy:** ### 4. Implementation Plan (Atomic Steps, TDD-ordered) - [ ] **Step 1:** Prepare schema / table alterations (with rollback instructions). - [ ] **Step 2:** Write failing test(s) for the core business logic / backend functions (or, for legacy stacks with no test harness, write the manual verification steps for them). Confirm they fail for the right reason before proceeding. - [ ] **Step 3:** Implement core business logic / backend functions — only enough to make Step 2's tests pass. - [ ] **Step 4:** Update UI / output views (with tests first, where automatable). - [ ] **Step 5:** Run the full manual or automated verification checks. ### 5. Verification & Regression Plan - [ ] Verify AC-1 manually or via test script. - [ ] Verify AC-2 edge-case handling. - [ ] Check related features for regression (e.g., existing reports or queries relying on modified tables). ### 6. Retrospective *Filled by the Process Improver per `.devfoundry/skills/process-retrospective.md`, after QA approval and before archiving.* - **What worked:** - **Friction (rule/reference/interview gap, or none):** - **Logged in `.devfoundry/improvement-log.md`:** [ ] yes