skills/community/creating-spec/SKILL.md
Create comprehensive technical specs for SDK gaps, feature modules, or system centralization efforts. Use when writing specs, PRDs, gap analysis documents, or planning centralization of scattered functionality into a single module. Triggers on "create spec", "write spec", "gap spec", "centralize", "fill the gap".
npx skillsauth add pedronauck/skills creating-specInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Systematic workflow for creating comprehensive technical specifications that centralize scattered functionality, fill SDK gaps, or plan new feature modules. This skill encodes the proven process used to produce high-quality specs like session-management and tool-registry-bridge specs.
<critical_rules>
You MUST follow these phases in order. Skipping phases or combining them will produce incomplete specs.
Goal: Map the full landscape of existing code across ALL relevant codebases before proposing anything.
Launch parallel exploration agents (4-5 simultaneous) covering:
providers/sdk)providers/runtime)packages/electron/src/agents/, packages/electron/src/looper/)packages/types)Each explorer must report:
MANDATORY: Read the key files directly after exploration to verify findings. Do NOT rely solely on explorer summaries for type signatures or API shapes.
Present findings FIRST — show the user:
FORBIDDEN: Writing any files during Phase 1. Output analysis to chat only.
Goal: Resolve design decisions that affect the spec's architecture.
Use the AskUserQuestion tool to ask 2-4 focused questions about:
Question format:
MANDATORY: Wait for user answers before proceeding. Do NOT assume defaults.
FORBIDDEN: Asking more than 4 questions at once. Keep it focused on decisions that materially affect the spec.
Goal: Write a comprehensive specification at the right level of abstraction — behavioral contracts and architectural decisions, not implementation code.
Check existing spec format — Read any previous specs in the same directory (e.g., tasks/prd-sdk/1_*.md, tasks/prd-sdk/2_*.md) to match the established style and structure.
Write the spec following the template structure below.
MANDATORY sections (all must be present):
Goal: Verify all code snippets in the spec follow Effect-TS patterns before presenting to the user.
MANDATORY: After writing the spec, audit every code snippet against the effect-ts and effect-ts skills. Check:
import * as Module from "effect/Module", never import { X } from "effect"Schema.String.pipe(Schema.brand("X")). Check existing protocol/branded.ts for established patterns.Schema.Class for records, Schema.TaggedClass for discriminated variants (events, status types). Check how existing events in protocol/events.ts are defined and match exactly.Schema.Unknown: Use JsonValue, JsonObject (from protocol/shared.ts), or Schema.Defect (for wrapping external errors). Never Schema.Unknown or bare unknown in types.Schema.Enums: Use Schema.Literal("a", "b", "c") for string literal unions. Schema.Enums is only for TypeScript enum types.Schema.suspend: Only for recursive types. Not needed for referencing other schemas.Context.Tag with static factory methods and static layer. Never module-scoped functions for service logic or layer factories.MyHelpers.resolve()), not module-scoped export const functions.Effect.fn tracing: All service method implementations must specify Effect.fn("ServiceName.methodName") for observability. Note this requirement explicitly in the spec.Schema.TaggedError. Unknown external errors wrapped with Schema.Defect. No unknown in error channels.Redacted.Redacted, not plain string.Clock.currentTimeMillis instead of Date.now() or raw clock callbacks. Effect's TestClock handles test time control.Ref or SynchronizedRef, not mutable Map/Set. Prefer HashMap.HashMap from Effect.Schema.Class types, always use new ClassName({...}) constructors, not plain object literals.Goal: Ensure the new spec doesn't contradict or duplicate definitions from other specs.
MANDATORY: Before finalizing, check against all existing specs in the same directory:
ProviderFamilyId, Spec N+1 must not call it OpenResponsesProviderFamily.CompozyCallProviderOptions), list ALL fields from all specs, not just yours.ProviderId growing from 3 to 11 values), document this dependency explicitly in the Implementation Order section.src/path/file.ts (defined in Spec N)".Goal: Show concrete consumer-facing API examples that demonstrate how the final result works.
Include in the spec a "High-Level Implementation Overview" section with:
If user asks for this separately, present it as a concise chat response with annotated code blocks.
</critical_rules>
<spec_template>
Follow this structure for every spec. Sections are numbered for cross-referencing.
# [Feature Name] for [Target Package]
## Problem Statement
- What systems currently exist (list each with location)
- What duplication exists (table format: concern | location A | location B | location C)
- What this costs today (concrete pain points, not abstract)
## Design: [Design Name]
- Architecture diagram (ASCII art showing data flow)
- Key principle (e.g., "fully automatic", "opt-in", "plug-in")
## New Files
- Directory tree of new files to create
## 1-N. Detailed Specifications
- Each major component gets its own numbered section
- Include full TypeScript interfaces with JSDoc
- Show Effect service tags, Layer factories
- Specify error types
## N+1. What This Replaces
- Table: Current File | What Moves | What's Eliminated
- Separate tables per codebase (runtime, agents, looper)
## N+2. Interaction With Existing Systems
- How new code coexists with existing services
- What changes vs. what stays the same
## N+3. Public API Surface
- Explicit export lists from sub-path and main entry
## N+4. High-Level Implementation Overview
- Consumer-facing code examples (setup, usage, customization)
- Before/after dependency graph
## N+5. Testing Strategy
- Unit test plan per module
- Integration test plan
- Migrated tests from existing codebases
## N+6. Implementation Order
- Numbered steps with dependency column and parallelization notes
- Table format: Step | What | Depends On | Parallelizable
## N+7. Migration Path
- Phased rollout (Phase 1, 2, 3...)
- Each phase: what changes, what re-exports, what gets deleted
## N+8. What Does NOT Move
- Table: Concern | Location | Why It Stays
- Be explicit about boundaries
</spec_template>
<quality_standards>
Before considering a spec complete, verify:
tasks/prd-sdk/N_feature-name.md)Specs must describe WHAT the system does and WHY, not HOW it does it line-by-line. Apply this test to every code block:
Schema.Class, interfaces, branded types)BLOATED (131 lines of 8 env builders):
export const buildZaiEnvVars = (config: ZaiConfig): Record<string, string> => {
const env: Record<string, string> = {};
env.ANTHROPIC_BASE_URL = "https://api.zai.com/v1";
if (config.apiKey) env.ANTHROPIC_AUTH_TOKEN = config.apiKey;
// ... 15 more lines
};
export const buildOpenRouterEnvVars = (config: OpenRouterConfig): ... => { ... };
// ... 6 more builders, same pattern
CORRECT (table + 1 example):
Key decision: Env vars are built fresh per-request (not pre-computed at construction).
| Provider | Base URL | Auth Var | Extra Vars | Clears API_KEY? |
|----------|----------|----------|------------|-----------------|
| zai | https://api.zai.com/v1 | ANTHROPIC_AUTH_TOKEN | — | Yes |
| openrouter | https://openrouter.ai/api/v1 | ANTHROPIC_AUTH_TOKEN | — | Yes |
| ... | ... | ... | ... | ... |
All builders follow the same pattern. Reference: buildZaiEnvVars (shown above).
</quality_standards>
<anti_patterns>
RegistryState with exact Map key formats is an implementation detail. Describe the behavioral contract ("caches bridges by tool-set signature").Schema.Unknown — use JsonValue, JsonObject, or Schema.DefectSchema.String.pipe(Schema.brand("X"))Schema.Class for events — discriminated variants (events with type field) must use Schema.TaggedClassSchema.Enums for string literals — use Schema.Literal("a", "b", "c")new ClassName({...}) constructorsClock instead of clock?: () => number)as unknown as X double casts — use spread syntax or Schema.encoderesolveProviderMetadata get independently spec'd by multiple gap specs.ProviderFamilyId vs OpenResponsesProviderFamily caused confusion. Pick one name and use it everywhere.apiKey to an options type and Spec 2 extends that type, include apiKey or explicitly note its removal.ProviderId growing from 3 to 11 values), document the dependency in your Implementation Order section.</anti_patterns>
development
Guides a founder through the full Y Combinator batch application end-to-end. A 10-phase workflow that captures the live YC form, profiles the founders, stress-tests the idea via an embedded grill loop, runs a mandatory 5-agent parallel external research pass on the startup, drafts every form field with anti-pattern and accepted-example checks, produces founder-video bullet notes (no script), runs a final adversarial gate, generates paste-ready submission answers, unlocks an interview-prep simulator after invite, and supports reapplicant delta tracking and post-decision post-mortems. Writes a documented markdown trail under a user-chosen workspace. Use when a founder wants to prepare a YC batch application, build their founder video, drill mock YC interview questions, or reapply with delta evidence. Don't use for pitch-deck design unrelated to YC, generic startup advice without applying, or post-funding work.
development
Authors engineering blog posts end-to-end: launch deep-dives, incident postmortems, architecture migrations, performance case studies, tutorials, AI/agent system writeups, security disclosures, and research-to-product translations. Picks the correct archetype, plans the abstraction ladder, enforces an evidence cadence (diagrams, benchmarks, profiles, traces, code, ablations), tunes voice against publisher house styles (Datadog, Vercel, GitHub, AWS, Meta, Cloudflare, Jane Street), and runs a pre-publish gate for narrative momentum and disclosure ethics. Use when drafting a new engineering post, restructuring a draft that feels flat, deciding which evidence form belongs where, validating that depth and product context are balanced, or preparing a postmortem, migration, or performance narrative for external publication. Do not use for API reference documentation, README authoring, marketing copy, release notes, generic SEO content, ghost-written executive thought leadership, or non-engineering long-form essays.
tools
Provides guardrails for user-facing UI work: usability heuristics, accessibility floors, design-system discipline, component states, microcopy, motion, dark mode, responsive behavior, and human-AI UX. Use when designing, generating, reviewing, or refactoring visible product surfaces such as components, pages, dashboards, forms, dialogs, loading/empty/error states, or AI interfaces. Do not use for backend-only work, infrastructure, CLI/TUI design, or pure documentation editing.
tools
Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex type logic, creating reusable type utilities, or ensuring compile-time type safety in TypeScript projects. Don't use for plain JavaScript, runtime validation libraries (Zod, Yup), or basic TypeScript syntax questions.