diff --git a/.kilocode/workflows/speckit.implement.md b/.kilocode/workflows/speckit.implement.md index bab8eea..d2e2a47 100644 --- a/.kilocode/workflows/speckit.implement.md +++ b/.kilocode/workflows/speckit.implement.md @@ -1,5 +1,10 @@ --- description: Execute the implementation plan by processing and executing all tasks defined in tasks.md +handoffs: + - label: Verify Changes + agent: speckit.test + prompt: Verify the implementation of... + send: true --- ## User Input diff --git a/.kilocode/workflows/speckit.test.md b/.kilocode/workflows/speckit.test.md new file mode 100644 index 0000000..e25e166 --- /dev/null +++ b/.kilocode/workflows/speckit.test.md @@ -0,0 +1,66 @@ +--- +description: Run semantic validation and functional tests for a specific feature, module, or file. +handoffs: + - label: Fix Implementation + agent: speckit.implement + prompt: Fix the issues found during testing... + send: true +--- + +## User Input + +```text +$ARGUMENTS +``` + +**Input format:** Can be a file path, a directory, or a feature name. + +## Outline + +1. **Context Analysis**: + - Determine the target scope (Backend vs Frontend vs Full Feature). + - Read `semantic_protocol.md` to load validation rules. + +2. **Phase 1: Semantic Static Analysis (The "Compiler" Check)** + - **Command:** Use `grep` or script to verify Protocol compliance before running code. + - **Check:** + - Does the file start with `[DEF:...]` header? + - Are `@TIER` and `@PURPOSE` defined? + - Are imports located *after* the contracts? + - Do functions marked "Critical" have `@PRE`/`@POST` tags? + - **Action:** If this phase fails, **STOP** and report "Semantic Compilation Failed". Do not run runtime tests. + +3. **Phase 2: Environment Prep** + - Detect project type: + - **Python**: Check if `.venv` is active. + - **Svelte**: Check if `node_modules` exists. + - **Command:** Run linter (e.g., `ruff check`, `eslint`) to catch syntax errors immediately. + +4. **Phase 3: Test Execution (Runtime)** + - Select the test runner based on the file path: + - **Backend (`*.py`)**: + - Command: `pytest -v` + - If no specific test file exists, try to find it by convention: `tests/test_.py`. + - **Frontend (`*.svelte`, `*.ts`)**: + - Command: `npm run test -- ` + + - **Verification**: + - Analyze output logs. + - If tests fail, summarize the failure (AssertionError, Timeout, etc.). + +5. **Phase 4: Contract Coverage Check (Manual/LLM verify)** + - Review the test cases executed. + - **Question**: Do the tests explicitly verify the `@POST` guarantees defined in the module header? + - **Report**: Mark as "Weak Coverage" if contracts exist but aren't tested. + +## Execution Rules + +- **Fail Fast**: If semantic headers are missing, don't waste time running pytest. +- **No Silent Failures**: Always output the full error log if a command fails. +- **Auto-Correction Hint**: If a test fails, suggest the specific `speckit.implement` command to fix it. + +## Example Commands + +- **Python**: `pytest backend/tests/test_auth.py` +- **Svelte**: `npm run test:unit -- src/components/Button.svelte` +- **Lint**: `ruff check backend/src/api/` diff --git a/.specify/memory/constitution.md b/.specify/memory/constitution.md index 0fe1e77..3e00c54 100644 --- a/.specify/memory/constitution.md +++ b/.specify/memory/constitution.md @@ -1,12 +1,9 @@
- -