@wrongstack/core 0.308.0 → 0.308.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.
Files changed (61) hide show
  1. package/dist/coordination/agents/index.js +4 -4
  2. package/dist/coordination/index.d.ts +1 -0
  3. package/dist/coordination/index.js +113 -15
  4. package/dist/coordination/task-boundary.d.ts +64 -0
  5. package/dist/core/index.js +1 -1
  6. package/dist/defaults/index.js +116 -19
  7. package/dist/execution/index.js +11 -8
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.js +127 -20
  10. package/dist/infrastructure/index.js +1 -1
  11. package/dist/storage/index.js +2 -1
  12. package/dist/tools/index.js +4 -4
  13. package/dist/types/config/ui.d.ts +1 -1
  14. package/dist/types/context-window.d.ts +18 -1
  15. package/dist/types/index.d.ts +1 -1
  16. package/dist/types/index.js +11 -4
  17. package/dist/types/runtime-capability-manifest.d.ts +1 -1
  18. package/instructions/agents/backend.md +3 -0
  19. package/instructions/agents/bug-hunter.md +3 -0
  20. package/instructions/agents/code-reviewer.md +1 -0
  21. package/instructions/agents/frontend.md +2 -0
  22. package/instructions/agents/test.md +2 -0
  23. package/instructions/coordination/director-preamble.md +9 -1
  24. package/instructions/coordination/subagent-baseline.md +4 -0
  25. package/instructions/modes/code-reviewer.md +1 -1
  26. package/instructions/modes/debugger.md +2 -2
  27. package/instructions/modes/refactorer.md +2 -2
  28. package/instructions/modes/tester.md +2 -2
  29. package/instructions/system-lite.md +37 -33
  30. package/instructions/system-pro.md +23 -7
  31. package/instructions/system.md +33 -11
  32. package/package.json +6 -4
  33. package/skills/api-design/SKILL.md +26 -1
  34. package/skills/audit-log/SKILL.md +22 -1
  35. package/skills/auto-review/SKILL.md +21 -1
  36. package/skills/bug-hunter/SKILL.md +8 -0
  37. package/skills/chimera/SKILL.md +9 -0
  38. package/skills/data-governance/SKILL.md +25 -1
  39. package/skills/design-system/SKILL.md +19 -1
  40. package/skills/docker-deploy/SKILL.md +26 -1
  41. package/skills/git-flow/SKILL.md +26 -1
  42. package/skills/mailbox-bridge/SKILL.md +25 -1
  43. package/skills/mnemosyne/SKILL.md +25 -2
  44. package/skills/multi-agent/SKILL.md +12 -0
  45. package/skills/node-modern/SKILL.md +28 -1
  46. package/skills/observability/SKILL.md +25 -1
  47. package/skills/output-standards/SKILL.md +28 -1
  48. package/skills/plugin-author/SKILL.md +31 -1
  49. package/skills/prompt-engineering/SKILL.md +27 -1
  50. package/skills/react-modern/SKILL.md +29 -1
  51. package/skills/refactor-planner/SKILL.md +10 -0
  52. package/skills/research-web/SKILL.md +28 -1
  53. package/skills/sdd/SKILL.md +18 -0
  54. package/skills/security-scanner/SKILL.md +25 -1
  55. package/skills/skill-creator/SKILL.md +25 -1
  56. package/skills/tech-stack/SKILL.md +25 -1
  57. package/skills/testing/SKILL.md +25 -1
  58. package/skills/typescript-strict/SKILL.md +30 -1
  59. package/skills/wrongstack-kanban/SKILL.md +24 -0
  60. package/skills/wrongstack-mailbox/SKILL.md +29 -1
  61. package/skills/wrongstack-mailbox-mcp/SKILL.md +30 -3
@@ -4,7 +4,7 @@ description: |
4
4
  Use this skill when validating package versions, checking for outdated dependencies,
5
5
  or evaluating third-party libraries in WrongStack. Triggers: user says "dependency",
6
6
  "package version", "outdated", "npm audit", "deprecated package", "tech stack".
7
- version: 1.2.0
7
+ version: 1.3.0
8
8
  required-capabilities: [dependencies.manage]
9
9
  required-tools: []
10
10
  optional-capabilities: [web.research]
@@ -112,6 +112,30 @@ When APPROVED:
112
112
  </nextsteps>
113
113
  ```
114
114
 
115
+ ## Out of scope
116
+
117
+ - **Don't trust version numbers from the model.** Training data is stale. The registry is the truth; fetch the latest version from the registry, not from memory.
118
+ - **Don't recursively analyze transitive dependencies.** This skill is single-shot. 1–2 iterations: detect → search registry → verify → report. Deep dependency analysis is a different workflow.
119
+ - **Don't greenlight prehistoric technology.** Anything superseded ≥5 years ago is rejected by default. Use the per-ecosystem built-in preference map.
120
+ - **Don't add a third-party package when the standard library covers it.** Prefer built-in. Every modern runtime ships an obsoleting API; check the built-in map before greenlighting any dependency.
121
+ - **Don't accept a dead package.** A package with no release in >2 years and unresolved critical issues is dead; suggest a maintained replacement. "Deprecated" / "yanked" / "archived" are the dead signals, not opinions.
122
+ - **Don't pick a random ecosystem.** Detect from project files first; ask when multiple markers exist; default to JavaScript only when `package.json` is present and nothing else is.
123
+ - **Don't deep-dive CVEs.** Known-CVE work is `security-scanner`'s lane. This skill validates existence, version, and deprecation — not vulnerability surface.
124
+ - **Don't approve without a registry URL.** The reader needs to verify; cite the registry endpoint that was actually fetched.
125
+
126
+ ## Before returning
127
+
128
+ - [ ] Ecosystem detected (explicit or via project file scan)
129
+ - [ ] Registry endpoint fetched; package existence verified
130
+ - [ ] Latest version pulled from the registry, not from training memory
131
+ - [ ] Dead-package signals checked (`deprecated`, yanked, archived)
132
+ - [ ] Prehistoric-tech check ran against the per-ecosystem preference map
133
+ - [ ] Built-in vs. third-party preference map consulted
134
+ - [ ] Status is APPROVED / REJECTED / NEEDS_INVESTIGATION with one-sentence verdict
135
+ - [ ] On REJECTED, modern alternative named with a migration step
136
+ - [ ] Registry URL cited so the reader can verify
137
+ - [ ] No transitive dependency recursion; single-shot budget honored
138
+
115
139
  ## Skills in scope
116
140
 
117
141
  - `node-modern` — for Node.js built-in vs. third-party decisions
@@ -4,7 +4,7 @@ description: |
4
4
  Use this skill when writing, reviewing, or improving tests in WrongStack.
5
5
  Triggers: user says "test", "unit test", "integration test", "e2e", "mock",
6
6
  "vitest", "coverage", "assert", "expect", "test strategy", "write tests".
7
- version: 1.0.0
7
+ version: 1.1.0
8
8
  required-capabilities: [filesystem.read, verification.run]
9
9
  required-tools: []
10
10
  optional-capabilities: [execution.shell]
@@ -165,6 +165,30 @@ coverageThreshold: {
165
165
  - **pnpm workspaces**: Run `pnpm test` in the package root, or `pnpm -r test` for all packages.
166
166
  - **Vitest config**: Each package has its own `vitest.config.ts`.
167
167
 
168
+ ## Out of scope
169
+
170
+ - **Don't test internal modules.** Test the public API surface. Mocking `../src/internal/helper` couples the test to implementation; the moment the helper moves, the test breaks for the wrong reason.
171
+ - **Don't commit test-only deps to `dependencies`.** Devs install `devDependencies`. Test-only deps in `dependencies` bloat the production install and can leak into runtime code.
172
+ - **Don't lower the coverage gate to make tests pass.** New code carries its own ≥70% coverage; existing coverage never decreases. A passing test suite with sinking coverage is regression, not progress.
173
+ - **Don't write async tests without a timeout.** `test(..., { timeout: 5000 })` is mandatory. A hang in CI is a worse failure than a flapping test.
174
+ - **Don't mock `node:fs` and forget cleanup.** `vi.restoreAllMocks()` and `vi.useRealTimers()` in `afterEach` are mandatory. Mocks leaking across tests are how unit tests go red in a clean checkout.
175
+ - **`setTimeout` is the wrong timeout primitive in tests.** `AbortSignal.timeout()` is the WrongStack convention. A timer, not a signal, bypasses the abort plumbing.
176
+ - **Don't import from `dist/`.** Subpath exports are the entry point. `dist/` is build output; tests against it depend on the build having been run.
177
+ - **Don't report a coverage percentage from a partial run.** Coverage is the full suite, not a subset. A 90% on 60% of the files is not 90%.
178
+
179
+ ## Before returning
180
+
181
+ - [ ] Tests co-located: `src/foo.ts` → `tests/foo.test.ts` in the same package
182
+ - [ ] Public API only; no internal-module mocks
183
+ - [ ] Async tests carry an explicit timeout (`{ timeout: 5000 }` or appropriate)
184
+ - [ ] `vi.restoreAllMocks()` and `vi.useRealTimers()` in `afterEach`
185
+ - [ ] `AbortSignal.timeout()` used for timeouts, not `setTimeout`
186
+ - [ ] No new `dependencies` entries for test-only packages
187
+ - [ ] Coverage gate met: new code ≥70%, existing coverage not reduced
188
+ - [ ] Coverage from full suite, not partial run
189
+ - [ ] Failing tests pair with the code under test, not staged in a separate commit
190
+ - [ ] `<nextsteps>` mirrors the open test gaps in priority order
191
+
168
192
  ## Skills in scope
169
193
 
170
194
  - `bug-hunter` — for turning test failures into concrete bugs
@@ -4,7 +4,7 @@ description: |
4
4
  Use this skill when writing or reviewing TypeScript code with strict mode
5
5
  in WrongStack. Triggers: user mentions "TypeScript", "strict", "type error",
6
6
  "type safety", "narrowing", "branded type", "discriminated union", "noUncheckedIndexedAccess".
7
- version: 1.1.0
7
+ version: 1.2.0
8
8
  required-capabilities: [filesystem.read, filesystem.write]
9
9
  required-tools: []
10
10
  optional-capabilities: [verification.run]
@@ -235,6 +235,35 @@ const len: number = str?.length ?? 0;
235
235
  console.log(name!.toUpperCase());
236
236
  ```
237
237
 
238
+ ## Out of scope
239
+
240
+ - **Don't use `as any` or double assertions to silence errors.** Validate or narrow values at trust boundaries. A cast that hides a real type error is a bug surfaced later in runtime.
241
+ - **Don't use `!` non-null assertion.** `name!.toUpperCase()` silences the type checker without explanation. Use a narrow check or an assertion function.
242
+ - **`Function` and `Object` types are too broad.** They're `any`-shaped in disguise. Be specific.
243
+ - **Don't return `Promise<any>`.** `Promise<unknown>` or a generic. `Promise<any>` loses the type information the caller needs.
244
+ - **Don't omit return types on exported functions.** Without an explicit return type, exported functions hide errors and let callers assume any shape. Annotate public APIs.
245
+ - **Don't use optional chaining chains to dodge narrowing.** `a?.b?.c?.d` is "I don't know what `a` is" with a costume. Verify with `if (a)` first.
246
+ - **Don't loosen `noUncheckedIndexedAccess` to make tests pass.** It is the safety net. Once it's off, array access silently returns `T` instead of `T | undefined` and `undefined` slips through.
247
+ - **Don't mix `enum` and union types.** Pick one per project. `enum` is the legacy form; const-asserted string unions are the modern form.
248
+ - **Don't write code that compiles under `strict: false`.** WrongStack runs with `strict`, `noUncheckedIndexedAccess`, `noImplicitReturns`, and `exactOptionalPropertyTypes`. Code that only compiles under relaxed flags is the kind of debt this skill exists to prevent.
249
+ - **Don't accept `unknown` without narrowing at the use site.** `unknown` is the safe top type; leaving it un-narrowed is a typed-any escape hatch.
250
+
251
+ ## Before returning
252
+
253
+ - [ ] No `as any` or double assertions; validation/narrowing at boundaries
254
+ - [ ] No `!` non-null assertion; narrow checks or assertion functions instead
255
+ - [ ] No `Function` or `Object`; specific function/object types used
256
+ - [ ] No `Promise<any>`; `Promise<unknown>` or generic
257
+ - [ ] Exported functions carry explicit return types
258
+ - [ ] `noUncheckedIndexedAccess` honored; `T | undefined` handled at every index access
259
+ - [ ] `exactOptionalPropertyTypes` honored; `prop?: T` and `prop: T | undefined` distinguished
260
+ - [ ] Discriminated unions used over optional fields where state is finite
261
+ - [ ] `assertNever` in `default:` of exhaustive switches
262
+ - [ ] Branded types for invariant strings (`UserId`, `SessionId`)
263
+ - [ ] `strict`, `noUncheckedIndexedAccess`, `noImplicitReturns`, `exactOptionalPropertyTypes` in `tsconfig.json`
264
+ - [ ] `pnpm run typecheck` passes before merge
265
+ - [ ] `<nextsteps>` mirrors open follow-ups (cast removals, narrowing gaps, tsconfig tightening)
266
+
238
267
  ## Skills in scope
239
268
 
240
269
  - `node-modern` — for TypeScript + ESM patterns
@@ -6,6 +6,7 @@ description: |
6
6
  managed Backlog→Todo→Running→Review→Done lifecycle, lease-fenced dispatch,
7
7
  and what "verified" means before a card reaches Done.
8
8
  trigger: working with the kanban tool, managing project work through boards, or advancing a managed card's lifecycle
9
+ version: 1.0.0
9
10
  required-capabilities: [work.plan]
10
11
  required-tools: [kanban]
11
12
  ---
@@ -127,6 +128,29 @@ filled in as it becomes known.
127
128
  | Omitting unfinished Todo/task/plan rows | Requirement identity and coverage would be lost |
128
129
  | Inventing subtasks for a leaf card | Recursive decomposition to satisfy process, not the work |
129
130
 
131
+ ## Out of scope
132
+
133
+ - **Don't create a card for trivial work.** A quick read, a one-line fix, or a question does not need a card. Resume the existing card for the same request instead of creating a duplicate.
134
+ - **Don't claim a task is done in chat without a board mutation.** Chat-only completion is fake progress. Persist via `kanban` actions; the board is the shared record.
135
+ - **Don't skip lifecycle stages on a managed board.** Managed cards move exactly one stage at a time. The guard rejects jumps; trying to bypass it is a bug.
136
+ - **Don't work an unclaimed card.** Another agent may be working it. Take `claim_task` first (via `kanban`), or let the Director's queue claim for you.
137
+ - **Don't lose the lease.** Heartbeat before the lease expires. An expired lease is recovered by the supervisor and the card returns to the queue.
138
+ - **Don't fence-less write.** Pass `expectedLeaseId` on every `mark_assignment` and `heartbeat_assignment`. If your lease was recovered, an unfenced write corrupts the successor's state.
139
+ - **Don't invent children for a leaf card.** Atomic work is one childless leaf. Recursive decomposition to satisfy process is process for process's sake.
140
+ - **Don't try to influence dispatch order.** Selection is deterministic by priority, column, order, and creation time. Shuffling tasks or boards doesn't change it.
141
+ - **Don't block on Kanban persistence.** If a board write fails, say so and keep working. The board follows the work; the work does not wait on the board.
142
+
143
+ ## Before returning
144
+
145
+ - [ ] Substantial work has a card with `description`, `assignee`, and `successCriteria` set
146
+ - [ ] Card claimed via `claim_task` (or Director queue) before any work started
147
+ - [ ] Lease heartbeated within the lease window
148
+ - [ ] Every material action produced a board mutation (no chat-only claims of progress)
149
+ - [ ] `mark_assignment` and `heartbeat_assignment` carried `expectedLeaseId`
150
+ - [ ] Completion went through the verifier; "Done" means the verifier actually ran
151
+ - [ ] Todo/task/plan rows preserve `kanbanBoardId` / `kanbanTaskId` bindings in full-list updates
152
+ - [ ] Card count scaled to the size of the work; no invented subtasks
153
+
130
154
  ## Related skills
131
155
 
132
156
  - `sdd` — spec-driven development creates boards from task graphs
@@ -8,7 +8,7 @@ description: |
8
8
  mailbox", "send to WrongStack", "wrongstack mail", "broadcast to the
9
9
  fleet", "tell the wrongstack agents", "is anyone online in
10
10
  wrongstack", or "register me with wrongstack".
11
- version: 1.0.0
11
+ version: 1.1.0
12
12
  required-capabilities: []
13
13
  required-tools: [mailbox]
14
14
  optional-capabilities: [mcp.dynamic, web.research]
@@ -738,6 +738,34 @@ mailbox serve` standalone all work. The first one to come up for a
738
738
  given project starts the bridge; subsequent surfaces join it via the
739
739
  per-project lock.
740
740
 
741
+ ## Out of scope
742
+
743
+ - **Don't open Mailbox files directly.** No `_mailbox.sqlite`, no legacy JSONL, no bridge locks, no token files. The bridge and `mb()` / `mbWithBootstrap()` are the only paths; bypassing them breaks trust and audit.
744
+ - **Don't impersonate `hq@...` or another agent.** Use a stable, honest `agentId` for your own identity. The bridge does not enforce sender identity; impersonation is on you, and it's the kind of thing that gets the bridge shut down.
745
+ - **Don't hardcode the token.** Read it from `.mailbox.token`, `.mailbox-bridge.lock`, or accept it from the user. Re-read after a 401. Tokens rotate on every fresh bridge start.
746
+ - **Don't let requests hang.** `AbortSignal.timeout(10_000)` is mandatory. The mailbox is local; 10 s is generous, and a hung bridge will wedge the agent.
747
+ - **Don't poll faster than 1 Hz.** The bridge enforces 120 req/min/token. Polling at sub-second rates hits the limit and looks like a flooding attempt.
748
+ - **Don't use SSE events as authoritative.** `GET /mailbox/events` is a wake-up hint, not a snapshot. After every event, reconcile through `/mailbox/query` or `/mailbox/check`.
749
+ - **Don't broadcast without thinking.** `to: "*"` reaches every online agent. One broadcast per task, with a clear subject. The WebUI marks broadcasts with a different color and humans notice noise.
750
+ - **Don't ack in a loop when `ack-many` fits.** If you have more than one unread message, use `/mailbox/ack-many` — one request, one lock, one rewrite.
751
+ - **Don't skip `register_self`.** Without registration, the WebUI can't show you as online, and heartbeats are unreconciled.
752
+ - **Don't randomize your `agentId`.** Read receipts and history break if your id changes every poll. Pick a stable convention and reuse it.
753
+ - **Don't promise features the bridge doesn't expose.** The bridge is mailbox only. For the full WrongStack tool surface, use `wstack mcp serve`; for SMTP/IMAP, push back — WrongStack's mailbox is internal.
754
+
755
+ ## Before returning
756
+
757
+ - [ ] No Mailbox files opened or edited directly; bridge and `mb()` only
758
+ - [ ] Stable, honest `agentId`; no impersonation of `hq@...` or other agents
759
+ - [ ] Token read from `.mailbox.token` or `.mailbox-bridge.lock`, not hardcoded
760
+ - [ ] `mbWithBootstrap()` used for discovery when env vars aren't set
761
+ - [ ] All requests carry `AbortSignal.timeout(10_000)`
762
+ - [ ] `register_self` called with stable name and role before any traffic
763
+ - [ ] Heartbeat every 30 s; `deregister_self` on clean shutdown
764
+ - [ ] SSE preferred for real-time; polling ≥ 1 Hz, ≤ 5–10 s
765
+ - [ ] `ack-many` used when more than one message needs acknowledgement
766
+ - [ ] Broadcast only with clear subject, at most once per task
767
+ - [ ] Bridge health (`/healthz`) probed before relying on routes
768
+
741
769
  ## Skills in scope
742
770
 
743
771
  - `node-modern` — `AbortSignal.timeout`, ESM-only imports.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: wrongstack-mailbox-mcp
3
3
  description: Coordinate with WrongStack agents through the project-scoped Mailbox MCP server. Use when an external coding agent needs to inspect unread or incomplete messages, query conversation history, discover online agents, send direct/reply/broadcast/steer messages, acknowledge outcomes, maintain its presence, soft-delete or restore messages, watch for changes, or perform explicitly authorized Mailbox administration without reading Mailbox files or SQLite directly.
4
+ version: 1.0.0
4
5
  required-capabilities: [mcp.dynamic]
5
6
  required-tools: [mcp_use]
6
7
  ---
@@ -69,6 +70,32 @@ contain identifiers and metadata, not the authoritative message snapshot.
69
70
  - `mailbox_admin` provides clear, purge, compaction, and credential issue/verify/revoke/rotate/list
70
71
  operations. It requires `--admin`, which implies writable mode.
71
72
 
72
- Before `clear_all`, purge, credential revocation/rotation, or another broad administrative action,
73
- confirm that it is explicitly requested and re-read relevant state. Never use an admin operation to
74
- work around a routing, identity, or authorization error.
73
+ ## Out of scope
74
+
75
+ - **Don't read or edit Mailbox files directly.** No `_mailbox.sqlite`, no legacy JSONL, no bridge locks, no token files. MCP is the only boundary; bypassing it through any of those channels breaks trust and audit.
76
+ - **Don't impersonate another actor.** The server fixes sender, receipt, deletion, registration, and heartbeat identity to `--actor`. Tool arguments cannot override that. Use the actor id you were given, honestly.
77
+ - **Don't reach for `steer` on routine direction.** Steer is for changed direction mid-task. For normal coordination, `ask`, `assign`, or `result` are the right types.
78
+ - **Don't broadcast when direct addressing is correct.** Broadcast reaches every relevant agent; most messages don't.
79
+ - **Don't run admin operations to bypass routing, identity, or authorization errors.** If a call is denied for one of those reasons, the call is wrong. Re-read state, ask, or stop. Admin paths are for explicitly authorized administration, not workarounds.
80
+ - **Don't skip `register_self`.** Without registration, the runtime can't reconcile heartbeats or surface the agent in the workbench.
81
+ - **Don't treat `mailbox_watch` events as authoritative.** Watch is a wake-up hint, not a snapshot. After every event, reconcile through `mailbox_read`.
82
+
83
+ ## Before returning
84
+
85
+ - [ ] MCP server reached via `mcp_use`; never opened Mailbox files directly
86
+ - [ ] Actor id stable and honest; no impersonation of `hq@...` or other agents
87
+ - [ ] `register_self` called with stable name and role before any other traffic
88
+ - [ ] `mailbox_read` with `unreadBy` + `incompleteOnly` used to find actionable work
89
+ - [ ] `online_agents` checked before time-sensitive direct sends
90
+ - [ ] `send` carries an explicit recipient and the right message type
91
+ - [ ] `replyTo` set on threaded replies; no orphan context
92
+ - [ ] `ack` / `ack_many` called with truthful `outcome` after work
93
+ - [ ] `heartbeat_self` running during long work; `deregister_self` on clean shutdown
94
+ - [ ] Admin operations (`clear_all`, purge, credential issue/revoke) only when explicitly requested
95
+
96
+ ## Skills in scope
97
+
98
+ - `mailbox-bridge` — for the WrongStack-internal HTTP façade this MCP server mirrors
99
+ - `wrongstack-mailbox` — for the external-facing counterpart used by Claude Code / Aider / scripts
100
+ - `security-scanner` — for confirming the MCP server's authn/authz surface matches project security conventions
101
+ - `output-standards` — for the `<nextsteps>` shape when reporting mailbox activity to the user