@tudeorangbiasa/sdd-multiagent-opencode 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,6 +28,13 @@ Implement an existing change from `specs/active/<change-id>/`.
28
28
  - Verify with the commands listed in `design.md` when available.
29
29
  - Stop on blockers. Do not silently skip tasks.
30
30
 
31
+ ## Test Integrity
32
+
33
+ - **Source of Truth**: The "Test Spec" table in `tasks.md` defines the exact test cases. You must implement every row in that table.
34
+ - **No Weakening**: You are FORBIDDEN from modifying test assertions (e.g., changing `toBe(401)` to `toBeTruthy()`, or removing edge cases) to make a test pass.
35
+ - **Fix Implementation, Not Test**: If a test fails, fix the source code (`src/...`), NOT the test code (`*.test.ts`).
36
+ - **Report Mismatches**: If you believe the Test Spec in `tasks.md` is incorrect, STOP and report it as a blocker. Do not silently change the test to fit your implementation.
37
+
31
38
  ## Context Safety
32
39
 
33
40
  - Treat `tasks.md` and `progress.md` as the source of truth, not chat history.
@@ -77,6 +77,7 @@ Keep artifacts short enough to review. Prefer concrete bullets over generic proc
77
77
  - Dependencies, if any
78
78
  - Test or verification step for each phase
79
79
  - Suggested execution mode: sequential or parallel-safe groups
80
+ - **Structured Test Specifications**: For tasks involving logic, include a Markdown table with columns: `Scenario`, `Input`, `Expected Output`, `Mock Requirement`. The implementer must translate this table exactly into code.
80
81
 
81
82
  `progress.md` for large changes must include:
82
83
  - Current phase
@@ -0,0 +1,165 @@
1
+ ---
2
+ description: Quick one-shot fix for cosmetic/config changes with lightweight verification
3
+ agent: sdd-implementer
4
+ ---
5
+
6
+ Execute a small, safe change with minimal overhead. No full spec artifacts required.
7
+
8
+ ## Usage
9
+
10
+ ```text
11
+ /sdd-quick "fix typo: succesful -> successful"
12
+ /sdd-quick "rename isLoading to isFetching in auth.ts"
13
+ ```
14
+
15
+ ## Phase 1: Rule-Based Change Classification
16
+
17
+ Do NOT guess the change type. Classify using these deterministic rules, evaluated in order. The first matching rule wins.
18
+
19
+ ### Force → CONTRACT (❌ Abort → suggest `/sdd-propose`)
20
+ - Change to any exported function, class, interface, or type name
21
+ - Change to any file matching: `**/api/**`, `**/dto/**`, `**/schema/**`, `**/types/public-api.ts`, `**/graphql/types.ts`
22
+ - Change to function signature (add/remove/rename parameter)
23
+ - Change to any file explicitly marked as `@public` or `@api` in JSDoc
24
+
25
+ ### Force → LOGIC (❌ Abort → suggest `/sdd-propose`)
26
+ - ANY change to operators: `>`, `<`, `>=`, `<=`, `==`, `===`, `!=`, `!==`, `&&`, `||`, `!`, `?:`
27
+ - ANY change to control flow keywords: `if`, `else`, `switch`, `case`, `for`, `while`, `return`, `throw`, `try`, `catch`, `finally`
28
+ - ANY change to a condition expression or boolean logic
29
+ - ANY change to calculation or math expression
30
+ - Adding or removing a function call
31
+ - Changing a function's return value
32
+
33
+ ### Force → CONFIG (⚠️ Allowed with warning)
34
+ - Change to constant value, env var, feature flag, or config file (`*.config.*`, `.env`, `*.json`)
35
+ - Change to a string that is NOT rendered in a UI component
36
+
37
+ ### Default → COSMETIC (✅ Allowed)
38
+ - Typo fix in string literal or comment
39
+ - Whitespace or formatting change
40
+ - Internal variable rename (not exported)
41
+ - Import reordering or unused import removal
42
+ - Dead code removal
43
+ - Comment addition or update
44
+
45
+ If the change matches CONTRACT or LOGIC, STOP immediately. Do not proceed. Report why and suggest `/sdd-propose`.
46
+
47
+ ## Phase 2: Pre-Flight Checks
48
+
49
+ ### Lock File Check
50
+ 1. Check if `specs/.sdd-lock` exists.
51
+ 2. If it exists:
52
+ - Read the PID from the lock file.
53
+ - Check if that process is still running (`ps -p <PID>` or equivalent).
54
+ - If PID is alive → Warn: "Another SDD process is active. Proceed anyway? (yes/no)"
55
+ - If PID is dead → Remove stale lock and continue.
56
+ 3. If no lock exists → Create `specs/.sdd-lock` with current PID and command name.
57
+
58
+ ### Cross-File Impact Scan
59
+ 1. Identify the symbol, string, or pattern that will change.
60
+ 2. Run a project-wide grep for that pattern.
61
+ 3. Count references:
62
+ - ≤ 5 references → ✅ Continue
63
+ - > 5 references → ⚠️ Flag as "Ripple Risk", show user the affected files, ask for confirmation before proceeding.
64
+
65
+ ### String Length Check (for string changes only)
66
+ 1. Calculate the length delta: `|new_length - old_length|`
67
+ 2. Calculate percentage change: `delta / old_length * 100`
68
+ 3. If delta > 20 characters OR percentage increase > 50%:
69
+ - Flag as "UI Layout Risk"
70
+ - Check if the string is in a UI component file (`.tsx`, `.vue`, `.jsx`, `.svelte`)
71
+ - If in UI component → Require explicit user confirmation before proceeding
72
+ 4. If the string is in a non-UI file (`.ts` logic, config, etc.) → Allow without flag
73
+
74
+ ## Phase 3: Execute Change
75
+
76
+ - Make the smallest possible change that satisfies the request.
77
+ - Do NOT touch any file beyond what is strictly necessary.
78
+ - Do NOT create new files.
79
+ - Do NOT refactor or "improve" surrounding code.
80
+ - Do NOT change logic, only what was explicitly requested.
81
+
82
+ ## Phase 4: Verification
83
+
84
+ ### Mandatory Checks
85
+ Run the project's available verification commands. Check `package.json` scripts or equivalent:
86
+
87
+ 1. **Lint**: `npm run lint` (or `pnpm lint`, `yarn lint`, etc.)
88
+ 2. **Typecheck**: `npm run typecheck` (or `tsc --noEmit`, `vue-tsc`, etc.)
89
+
90
+ ### Decision Table
91
+ | Result | Action |
92
+ |--------|--------|
93
+ | Both pass | ✅ Continue to Phase 5 |
94
+ | Lint fails | ❌ Auto-revert all changes, report failure |
95
+ | Typecheck fails | ❌ Auto-revert all changes, report failure |
96
+ | Test fails (if run) | ⚠️ Check if failure is pre-existing or caused by this change. If caused by this change → auto-revert. If pre-existing → allow with warning. |
97
+
98
+ If the project has NO lint or typecheck script → ❌ Reject, suggest `/sdd-propose` (project lacks safety net for quick changes).
99
+
100
+ ## Phase 5: Atomic Ledger Append
101
+
102
+ Do NOT create individual files per change. Append to a single ledger file.
103
+
104
+ ### Ledger File: `specs/QUICKFIX_LOG.md`
105
+
106
+ Format for each entry:
107
+
108
+ ```markdown
109
+ ## YYYY-MM-DD HH:MM — <kebab-case-slug>
110
+
111
+ - **Trigger:** `/sdd-quick "<original request>"`
112
+ - **Files:** `<file-path>` (L<line>, L<line>)
113
+ - **Type:** Cosmetic | Config
114
+ - **Verification:** `npm run lint` passed, `npm run typecheck` passed
115
+ - **Cross-file refs:** <count> files affected (list if > 3)
116
+ - **Status:** ✅ Applied | ❌ Reverted (reason)
117
+ ```
118
+
119
+ ### Atomic Write Procedure
120
+ 1. Read current content of `specs/QUICKFIX_LOG.md` (create if not exists, with header `# Quick Change Log`)
121
+ 2. Append new entry at the END of the file
122
+ 3. Write to temp file: `specs/QUICKFIX_LOG.md.tmp`
123
+ 4. Atomic rename: replace `specs/QUICKFIX_LOG.md` with temp file
124
+ 5. Remove `specs/.sdd-lock`
125
+
126
+ ### Ledger Maintenance
127
+ If the ledger exceeds 50 entries:
128
+ - Move the oldest 25 entries to `specs/QUICKFIX_LOG_ARCHIVE.md`
129
+ - Keep only the most recent 25 entries in the main ledger
130
+
131
+ ## Anti-Generic Gate
132
+
133
+ Before final output, verify:
134
+
135
+ - [ ] Change type was classified using deterministic rules, not AI judgment.
136
+ - [ ] Lock file was checked and cleaned up.
137
+ - [ ] Cross-file scan was performed.
138
+ - [ ] Lint and typecheck were run and passed.
139
+ - [ ] Ledger was updated atomically.
140
+ - [ ] No logic, contract, or new files were touched.
141
+
142
+ If any item fails, report the failure and do not claim success.
143
+
144
+ ## Output
145
+
146
+ End with:
147
+
148
+ ```markdown
149
+ changed: Quick fix applied — <slug>
150
+ type: Cosmetic | Config
151
+ verified: lint + typecheck passed
152
+ cross-file refs: <count> files
153
+
154
+ Log: specs/QUICKFIX_LOG.md
155
+
156
+ Next: commit the change or run `/sdd-quick` again.
157
+ ```
158
+
159
+ If aborted:
160
+
161
+ ```markdown
162
+ aborted: Quick fix rejected — <slug>
163
+ reason: <specific rule that blocked it>
164
+ suggestion: Run `/sdd-propose "<request>"` for full workflow.
165
+ ```
@@ -21,6 +21,15 @@ Verify a completed change before considering it ready.
21
21
  - Do not make product code changes unless the user explicitly asks for fixes.
22
22
  - If the user asks to finalize, mark the change complete only when readiness is `yes`.
23
23
 
24
+ ## Asymmetric Verification
25
+
26
+ Perform a strict audit comparing the "Test Spec" tables in `tasks.md` against the actual test files (`*.test.ts`):
27
+
28
+ - **Completeness**: Ensure every row in the Test Spec table has a corresponding test case in the code.
29
+ - **Assertion Strength**: Check for "weakening" (e.g., spec says `expect(status).toBe(401)` but code says `expect(status).toBeGreaterThan(400)`). This is a VIOLATION.
30
+ - **Mock Accuracy**: Verify mocks match the "Mock Requirement" column in the spec.
31
+ - **Halt on Violation**: If you find a violation, DO NOT attempt to auto-correct. Mark `ready: no` and report the specific mismatch in findings.
32
+
24
33
  ## Review Focus
25
34
 
26
35
  - Requirements satisfied
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tudeorangbiasa/sdd-multiagent-opencode",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Spec-Driven Development workflow kit for OpenCode with 4 core commands, multi-agent support, and configurable model routing",
5
5
  "type": "module",
6
6
  "main": ".opencode/plugins/sdd-register.js",