spec-export
Structured spec-to-ticket export pipeline — maps document sections to project management tickets (Linear, GitHub Issues) via MCP, preserving hierarchy and acceptance criteria. Use this skill when the user says "export spec", "push to linear", "create tickets from spec", "spec to issues", or "export to jira".
What this skill does
# Spec Export
Export pipeline that reads all sections from a structured-editor document, uses AI to map them into a ticket hierarchy (epic, stories, tasks), presents a preview for confirmation, and creates tickets in Linear or GitHub Issues via MCP. Created ticket IDs are stored back on document sections as external references.
The pipeline flow:
1. Read all sections from a structured-editor document
2. Use AI to map sections into a ticket hierarchy (epic -> stories -> tasks)
3. Present a preview of tickets to be created
4. User confirms -> tickets created via MCP tools (Linear or GitHub Issues)
5. Created ticket IDs stored back on sections as external references
## Prerequisites
- Next.js app with `src/` directory and App Router
- `ai-mcp` skill installed (provides MCP server connectivity for Linear/GitHub)
- `ai-tasks` skill installed (provides task management infrastructure)
- `structured-editor` skill installed (provides document + sections data model)
- `ai-core` skill installed (provides `getModel()`)
- Auth skill installed (provides `withAuth` from `@/lib/auth-guard`)
- shadcn/ui initialized
## Installation
```bash
bunx shadcn@latest add dialog radio-group checkbox progress
```
No additional npm packages required. Uses `ai`, `zod`, and existing infrastructure from prerequisite skills.
## What Gets Created
```
src/
├── lib/
│ └── spec-export/
│ ├── types.ts # ExportTarget, TicketPreview, ExportResult types
│ ├── mapper.ts # Maps document sections -> ticket hierarchy using AI
│ └── targets/
│ ├── linear.ts # Linear-specific ticket format + MCP tool calls
│ └── github.ts # GitHub Issues format + MCP tool calls
├── app/
│ └── api/
│ └── documents/
│ └── [documentId]/
│ └── export/
│ ├── preview/
│ │ └── route.ts # POST — generates ticket preview from document
│ └── execute/
│ └── route.ts # POST — creates tickets in target system
└── components/
└── editor/
├── export-dialog.tsx # Modal: target picker -> preview -> confirm -> progress
└── export-button.tsx # "Export to..." button that opens export dialog
```
## What Gets Modified
```
src/components/editor/document-editor.tsx # Add export button to toolbar
```
## Setup Steps
### Step 1: Create `src/lib/spec-export/types.ts`
```typescript
export type ExportTarget = "linear" | "github";
export type TicketType = "epic" | "story" | "task";
export type TicketPreview = {
id: string;
type: TicketType;
title: string;
description: string;
labels: string[];
priority: "urgent" | "high" | "medium" | "low" | "none";
parentId: string | null;
sourceSectionId: string;
sourceSectionType: string;
acceptanceCriteria: string[];
};
export type ExportResult = {
ticketId: string;
externalId: string;
externalUrl: string;
status: "created" | "failed";
error?: string;
};
export type ExportPreviewResponse = {
target: ExportTarget;
documentTitle: string;
tickets: TicketPreview[];
totalCount: number;
};
export type ExportExecuteRequest = {
target: ExportTarget;
tickets: TicketPreview[];
};
export type ExportExecuteResponse = {
results: ExportResult[];
successCount: number;
failCount: number;
};
```
### Step 2: Create `src/lib/spec-export/mapper.ts`
```typescript
import { generateObject } from "ai";
import { getModel } from "@/lib/ai";
import { z } from "zod";
import type { TicketPreview } from "./types";
const ticketSchema = z.object({
tickets: z.array(
z.object({
title: z.string(),
type: z.enum(["epic", "story", "task"]),
description: z.string(),
labels: z.array(z.string()),
priority: z.enum(["urgent", "high", "medium", "low", "none"]),
parentIndex: z.number().nullable(),
sourceSectionId: z.string(),
sourceSectionType: z.string(),
acceptanceCriteria: z.array(z.string()),
})
),
});
type DocumentInput = {
title: string;
description: string | null;
};
type SectionInput = {
id: string;
type: string;
title: string;
content: unknown;
};
export async function mapDocumentToTickets(
document: DocumentInput,
sections: SectionInput[]
): Promise<TicketPreview[]> {
const sectionSummary = sections
.map(
(s) =>
`## ${s.title} (type: ${s.type}, id: ${s.id})\n${JSON.stringify(s.content, null, 2)}`
)
.join("\n\n");
const result = await generateObject({
model: getModel(),
schema: ticketSchema,
system: `You are a project management expert. Convert a feature specification into a ticket hierarchy.
Rules:
- Create exactly ONE epic for the overall feature
- Create stories for each user story in the spec
- Create tasks for each acceptance criterion, edge case, error state, and open question
- Tasks belong to their most relevant story (or directly to the epic if no story fits)
- Set priority based on importance signals in the text
- Add labels: section type, "edge-case", "error-handling", "question", etc.
- Keep titles concise (under 80 chars)
- Descriptions should include enough context to implement independently
- Include acceptance criteria from the spec on relevant stories
- For parentIndex, use the array index of the parent ticket (null for the epic)
- sourceSectionId must match one of the provided section IDs
- sourceSectionType must match the type of the source section`,
prompt: `Feature: ${document.title}
${document.description ? `Description: ${document.description}` : ""}
Sections:
${sectionSummary}`,
});
return result.object.tickets.map((ticket, index) => ({
id: `ticket-${index}`,
type: ticket.type,
title: ticket.title,
description: ticket.description,
labels: ticket.labels,
priority: ticket.priority,
parentId:
ticket.parentIndex !== null ? `ticket-${ticket.parentIndex}` : null,
sourceSectionId: ticket.sourceSectionId,
sourceSectionType: ticket.sourceSectionType,
acceptanceCriteria: ticket.acceptanceCriteria,
}));
}
```
### Step 3: Create `src/lib/spec-export/targets/linear.ts`
```typescript
import type { TicketPreview, ExportResult } from "../types";
type LinearIssuePayload = {
title: string;
description: string;
priority: number;
labelNames: string[];
parentId?: string;
};
export function formatLinearIssue(ticket: TicketPreview): LinearIssuePayload {
const descriptionParts: string[] = [ticket.description];
if (ticket.acceptanceCriteria.length > 0) {
descriptionParts.push(
`\n## Acceptance Criteria\n${ticket.acceptanceCriteria.map((c) => `- [ ] ${c}`).join("\n")}`
);
}
return {
title: ticket.title,
description: descriptionParts.filter(Boolean).join("\n"),
priority: mapPriority(ticket.priority),
labelNames: ticket.labels,
};
}
function mapPriority(priority: TicketPreview["priority"]): number {
const map: Record<TicketPreview["priority"], number> = {
urgent: 1,
high: 2,
medium: 3,
low: 4,
none: 0,
};
return map[priority];
}
type LinearCreateResponse = {
id: string;
url: string;
};
export async function createLinearTickets(
tickets: TicketPreview[],
mcpFetch: (toolName: string, args: Record<string, unknown>) => Promise<unknown>
): Promise<ExportResult[]> {
const results: ExportResult[] = [];
const idMap = new Map<string, string>();
// Sort so epics are created first, then stories, then tasks
const typeOrder: Record<string, number> = { epic: 0, story: 1, task: 2 };
const sorted = [...tickets].sort(
(a, b) => (typeOrder[a.type] ?? 2) - (typeOrder[b.type] ?? 2)
);
for (const ticket of sorted) {
try {
const payload = formatLinearIssue(ticket);
// If this ticket has a parent, resolve the external ID
if (ticket.parentId && idMap.has(ticket.parentId)) {
payload.parentId = idMap.get(ticket.parentId);
}
const respRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.