@wrongstack/core 0.1.0

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.
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: multi-agent
3
+ description: |
4
+ Multi-agent orchestration workflow. Covers leader/worker roles,
5
+ task delegation, done conditions, and result aggregation.
6
+ Use for parallel task execution.
7
+ version: 1.0.0
8
+ ---
9
+
10
+ # Multi-Agent Coordination
11
+
12
+ Guide for orchestrating multiple agents to work together on complex tasks.
13
+
14
+ ## When to use multiple agents
15
+
16
+ - Large refactoring across multiple modules
17
+ - Parallel feature development
18
+ - Code review + implementation simultaneously
19
+ - Any task where separation of concerns speeds things up
20
+
21
+ ## Agent roles
22
+
23
+ Define clear roles to avoid overlap:
24
+
25
+ - **Leader** — Coordinates, delegates, synthesizes
26
+ - **Worker** — Executes specific tasks
27
+ - **Reviewer** — Reviews and approves
28
+ - **Architect** — Makes design decisions
29
+ - **Debugger** — Root cause analysis
30
+
31
+ ## Task delegation principles
32
+
33
+ 1. **Atomic tasks** — Each task should be independently executable
34
+ 2. **Clear boundaries** — Tasks should not overlap
35
+ 3. **Dependency awareness** — Respect task dependencies
36
+ 4. **Result aggregation** — Leader synthesizes worker results
37
+
38
+ ## Communication
39
+
40
+ Agents communicate via structured messages:
41
+
42
+ - `task` — Assign work
43
+ - `result` — Return output
44
+ - `progress` — Status updates
45
+ - `error` — Failures
46
+ - `stop` — Cancellation
47
+
48
+ ## Done conditions
49
+
50
+ Choose appropriate done condition:
51
+
52
+ - `all_tasks_done` — Wait for all tasks
53
+ - `critical_path_done` — Wait for critical path
54
+ - `first_completion` — Stop at first success
55
+ - `max_iterations` — Bounded execution
56
+
57
+ ## Anti-patterns
58
+
59
+ - Over-delegation — Don't fragment work too much
60
+ - Under-delegation — Single agent bottleneck
61
+ - Role confusion — Workers doing leadership work
62
+ - Result loss — Not aggregating agent outputs
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: node-modern
3
+ description: |
4
+ Use this skill for Node.js >= 22 idioms: ESM-only, native fetch, AbortSignal,
5
+ node: protocol imports, structuredClone, Web Streams, and modern async patterns.
6
+ version: 1.0.0
7
+ ---
8
+
9
+ # Modern Node.js (>= 22)
10
+
11
+ ## Imports
12
+
13
+ - Always use `node:` protocol for built-ins: `import * as fs from 'node:fs/promises'`.
14
+ - ESM only — no CommonJS in new code. Use `.js` extension in relative imports.
15
+ - Prefer `import.meta` over `__dirname` (compute via `fileURLToPath`).
16
+
17
+ ## I/O
18
+
19
+ - Use `fs.promises` (or `node:fs/promises`). Avoid the callback API.
20
+ - Use native `fetch` — no axios, no node-fetch.
21
+ - Use `AbortSignal` everywhere that takes time: fetch, child_process spawn, timers (via `setTimeout(..., { signal })`).
22
+
23
+ ## Patterns
24
+
25
+ ```ts
26
+ // Combine signals
27
+ const combined = AbortSignal.any([userSignal, timeoutSignal]);
28
+
29
+ // Atomic write
30
+ import { rename, writeFile } from 'node:fs/promises';
31
+ const tmp = `${target}.${randomBytes(4).toString('hex')}.tmp`;
32
+ await writeFile(tmp, data);
33
+ await rename(tmp, target);
34
+ ```
35
+
36
+ ## Anti-patterns
37
+
38
+ - `require()` in new code
39
+ - `__dirname` without `fileURLToPath`
40
+ - Mixing `fs.readFile` callback with `await`
41
+ - Swallowing AbortError silently
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: prompt-engineering
3
+ description: |
4
+ Use this skill when designing system prompts, tool descriptions, or task
5
+ instructions for LLM agents. Covers structure, specificity, and common pitfalls.
6
+ version: 1.0.0
7
+ ---
8
+
9
+ # Prompt engineering
10
+
11
+ ## Structure
12
+
13
+ - Identity → principles → environment → memory. (WrongStack's 4-layer system prompt.)
14
+ - Static content first (cacheable), volatile last.
15
+ - Markdown headings help models parse structure.
16
+
17
+ ## Tool descriptions
18
+
19
+ - Describe *when* to use, not just *what*. "Use `read` before `edit`" is more useful than "reads files".
20
+ - Include schema constraints in prose; the JSON schema alone is rarely enough.
21
+ - Give one example for non-obvious tools.
22
+
23
+ ## Anti-patterns
24
+
25
+ - "Please" / "kindly" — adds tokens, no benefit.
26
+ - "You are a helpful AI assistant" — already implied, wastes tokens.
27
+ - Long preamble before the actual question.
28
+ - Ambiguous pronouns ("do it again") — names beat pronouns.
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: react-modern
3
+ description: |
4
+ Use this skill when writing or reviewing React 19+ code. Covers Server
5
+ Components vs Client Components, useTransition, Suspense, the `use` hook,
6
+ Actions, and form state.
7
+ version: 1.0.0
8
+ ---
9
+
10
+ # Modern React (19+)
11
+
12
+ ## Component types
13
+
14
+ - Default to Server Components for data fetching and static UI.
15
+ - Mark interactive code with `'use client'` and keep it minimal.
16
+ - Don't pass Server Components into Client Component children unless serialized.
17
+
18
+ ## Data fetching
19
+
20
+ - In Server Components: `await fetch(...)`, server-side caching is automatic with framework support.
21
+ - In Client Components: use a library (TanStack Query) or `use(promise)` for awaitable thenables.
22
+
23
+ ## State
24
+
25
+ - `useState` for local state. `useReducer` for state machines.
26
+ - `useTransition` for non-urgent updates that should not block input.
27
+ - Avoid `useEffect` for derived state — compute during render.
28
+
29
+ ## Anti-patterns
30
+
31
+ - `useEffect` to sync local state with props
32
+ - Class components in new code
33
+ - `forwardRef` in new code (React 19 makes `ref` a regular prop)
34
+ - Default exports for components (named exports help refactor tools)
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: sdd
3
+ description: |
4
+ Specification-driven development workflow. Covers spec parsing,
5
+ task graph generation from requirements, dependency tracking, and
6
+ done-condition execution. Use when implementing features.
7
+ version: 1.0.0
8
+ ---
9
+
10
+ # Spec-Driven Development
11
+
12
+ Guide the agent through specification-first development workflow.
13
+
14
+ ## Core Principle
15
+
16
+ Every non-trivial change starts with a spec. The spec is the source of truth. Tasks are derived from specs, not the other way around.
17
+
18
+ ## Workflow
19
+
20
+ ```
21
+ Spec → Analysis → Task Graph → Execution → Done
22
+ ```
23
+
24
+ ### When to use
25
+
26
+ - New feature implementation
27
+ - Bug fix with complexity
28
+ - Refactoring with scope
29
+ - Any task requiring more than 1 hour
30
+
31
+ ### Spec sections
32
+
33
+ A good spec includes:
34
+
35
+ 1. **Overview** — What problem does this solve?
36
+ 2. **Requirements** — Functional and non-functional requirements with priorities
37
+ 3. **Architecture** — High-level design if needed
38
+ 4. **API Design** — If applicable
39
+ 5. **Data Model** — If applicable
40
+ 6. **Security** — Auth, permissions, data handling
41
+ 7. **Acceptance Criteria** — How do we know it's done?
42
+
43
+ ### Requirement format
44
+
45
+ ```
46
+ [functional] User can authenticate with OAuth2
47
+ [security] Rate limiting: 100 req/min per user
48
+ [performance] Response time < 200ms p95
49
+ ```
50
+
51
+ Priority markers: `[critical]`, `[high]`, `[medium]`, `[low]`
52
+
53
+ ## Task generation
54
+
55
+ Tasks are derived from requirements:
56
+
57
+ - Each requirement → one or more tasks
58
+ - Requirements with acceptance criteria → separate test tasks
59
+ - Critical requirements → tasks marked critical
60
+ - Blocked requirements → blocked tasks
61
+
62
+ ## Task states
63
+
64
+ ```
65
+ pending → in_progress → review → completed
66
+
67
+ blocked (waiting on dependencies)
68
+
69
+ failed
70
+ ```
71
+
72
+ ## Done conditions
73
+
74
+ A feature is done when:
75
+ 1. All critical and high priority tasks completed
76
+ 2. Tests written and passing
77
+ 3. Documentation updated
78
+ 4. No blocked tasks remaining
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: typescript-strict
3
+ description: |
4
+ Use this skill when writing or reviewing TypeScript code with strict mode.
5
+ Covers strict null checks, exhaustive switch, branded types, discriminated
6
+ unions, and noUncheckedIndexedAccess pitfalls.
7
+ version: 1.0.0
8
+ ---
9
+
10
+ # TypeScript strict mode
11
+
12
+ ## Core rules
13
+
14
+ - `strict: true` is non-negotiable. So is `noUncheckedIndexedAccess: true`.
15
+ - Never silence type errors with `as any`. Use `as unknown as T` only at trust boundaries with a comment explaining why.
16
+ - Prefer discriminated unions over enums.
17
+ - Use `readonly` aggressively on properties and arrays.
18
+
19
+ ## Common patterns
20
+
21
+ ### Exhaustive switch
22
+
23
+ ```ts
24
+ function assertNever(x: never): never {
25
+ throw new Error(`Unhandled: ${JSON.stringify(x)}`);
26
+ }
27
+
28
+ switch (block.type) {
29
+ case 'text': return renderText(block);
30
+ case 'tool_use': return renderToolUse(block);
31
+ default: return assertNever(block);
32
+ }
33
+ ```
34
+
35
+ ### Branded types for invariants
36
+
37
+ ```ts
38
+ type UserId = string & { readonly __brand: 'UserId' };
39
+ const toUserId = (s: string): UserId => s as UserId;
40
+ ```
41
+
42
+ ### noUncheckedIndexedAccess
43
+
44
+ After enabling this, `arr[i]` is `T | undefined`. Don't disable it — handle the undefined explicitly.
45
+
46
+ ## Anti-patterns
47
+
48
+ - `!` non-null assertion in production code (use a narrow check)
49
+ - Returning `Promise<any>` from a public API
50
+ - `Function` or `Object` types — always be specific