一键导入
prd-task
Convert markdown PRDs to executable JSON format. Use after creating a PRD with the prd skill to generate the prd.json for autonomous task completion.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Convert markdown PRDs to executable JSON format. Use after creating a PRD with the prd skill to generate the prd.json for autonomous task completion.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Survey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute. Strictly read-only on source code — never implements, fixes, or refactors anything itself. Use when asked to audit a codebase, find improvement opportunities (bugs, security, performance, test coverage, tech debt, migrations, DX), suggest features or where to take the project next (roadmap, product direction), or generate handoff plans for another agent to implement.
Create a custom skill for this project. Determines skill type, writes SKILL.md (and optional references/scripts) to .opencode/skills/<name>/, commits and pushes. Load FIRST before writing any skill.
Import a bitmap image (PNG/JPEG/GIF) from a URL into a Figma file as a frame. Use whenever an image needs to land in Figma — AI mockups, photos, renders, artwork, screenshots. Bypasses use_figma sandbox limits that block the obvious paths (fetch, atob, createImageAsync, REST upload). If you skip this skill and try the obvious paths, you will lose 30+ minutes. Triggers on: import image to Figma, add image to Figma, put image in Figma, Figma image import, bitmap to Figma.
Generate images, videos, and music using AI models (Imagen, Flux, Veo, Runway, Kling, Sora, Suno, ElevenLabs, etc.). Use when user asks to create, generate, edit, upscale, or produce any visual or audio media.
Install a skill from a GitHub URL or local path. Copies SKILL.md (and references/scripts) into the project's .opencode/skills/ directory and creates the companion command. Use when user wants to add an existing skill to their project.
Creates and maintains Figma Code Connect template files that map Figma components to code snippets. Use when the user mentions Code Connect, Figma component mapping, design-to-code translation, or asks to create/update .figma.js files.
| name | prd-task |
| description | Convert markdown PRDs to executable JSON format. Use after creating a PRD with the prd skill to generate the prd.json for autonomous task completion. |
Convert markdown PRDs to executable JSON format for autonomous task completion.
The PRD defines the end state via tasks with verification steps. The agent decides HOW to get there.
Based on Anthropic's research on long-running agents.
.opencode/state/<prd-name>/ directory.opencode/state/<prd-name>/prd.md.opencode/state/<prd-name>/prd.json.opencode/state/<prd-name>/progress.txtBefore converting PRD tasks, exhaustively analyze the current project. This ensures tasks account for existing state, patterns, and constraints.
AGENTS.md (root and subdirectories) - coding standards, patterns, constraintsspecs/ directory - detailed specifications, best practices, conventions (e.g., testing strategy, data access patterns, framework-specific guides)README.md - project overview, setup, architectureCONTRIBUTING.md - contribution guidelinesdocs/ directory - additional documentationcontext.patterns based on discovered patternscontext.keyFiles that are relevantAfter analysis, the context object should include:
{
"context": {
"patterns": ["discovered patterns from codebase analysis"],
"keyFiles": ["files relevant to PRD tasks"],
"nonGoals": ["from PRD"],
"projectConstraints": ["constraints from AGENTS.md, README, etc."],
"existingImplementation": ["what already exists that relates to PRD"]
}
}
State folder structure:
.opencode/state/<prd-name>/
├── prd.md # Original markdown PRD (moved from project root)
├── prd.json # Converted JSON for task execution
└── progress.txt # Empty file to track progress
Expects markdown PRD with end-state focus:
# PRD: <Feature Name>
## End State
- [ ] Users can register
- [ ] Users can log in
- [ ] Auth is secure
## Tasks
### User Registration [functional]
User can register with email and password.
**Verification:**
- POST /api/auth/register with valid email/password
- Verify 201 response with user object
- Verify password not in response
- Attempt duplicate email, verify 409
### User Login [functional]
User can log in and receive JWT token.
**Verification:**
- POST /api/auth/login with valid credentials
- Verify 200 response with token
- Attempt invalid credentials, verify 401
## Context
### Patterns
- API routes: `src/routes/items.ts`
### Key Files
- `src/db/schema.ts`
### Non-Goals
- OAuth/social login
- Password reset
Move PRD and generate JSON in .opencode/state/<prd-name>/:
prd.md - Original markdown (moved from source location)prd.json - Converted JSON:{
"prdName": "<prd-name>",
"tasks": [
{
"id": "functional-1",
"category": "functional",
"description": "User can register with email and password",
"steps": [
"POST /api/auth/register with valid email/password",
"Verify 201 response with user object",
"Verify password not in response",
"Attempt duplicate email, verify 409"
],
"passes": false
}
],
"context": {
"patterns": ["API routes: src/routes/items.ts"],
"keyFiles": ["src/db/schema.ts"],
"nonGoals": ["OAuth/social login", "Password reset"],
"projectConstraints": ["from AGENTS.md and project docs"],
"existingImplementation": ["what already exists relevant to tasks"]
}
}
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier, e.g. "db-1", "api-auth", "setup-deps" |
category | string | Grouping: "functional", "ui", "api", "security", "testing", etc. |
description | string | What the task does when complete |
steps | string[] | Verification steps - how to test it works |
passes | boolean | Set to true when ALL steps verified |
<category>-<number> or descriptive like "api-auth", "db-schema"Keep tasks small and focused:
Quality over speed. Small steps compound into big progress.
### Title [category] becomes a taskid as <category>-<number> (e.g., "db-1", "api-2") or descriptive slugdescription**Verification:** become stepspasses always starts as falsecontext.patterns - existing code patterns to follow (from PRD + discovered)context.keyFiles - files to explore first (from PRD + discovered)context.nonGoals - explicit scope boundariescontext.projectConstraints - constraints from AGENTS.md, README, etc.context.existingImplementation - what already exists relevant to PRDThis codebase will outlive you. Every shortcut becomes someone else's burden. Every hack compounds into technical debt that slows the whole team down.
You are not just writing code. You are shaping the future of this project. The patterns you establish will be copied. The corners you cut will be cut again.
Fight entropy. Leave the codebase better than you found it.
READ-ONLY except:
passes: Set to true when ALL verification steps passNEVER edit or remove tasks - This could lead to missing functionality.
Derive from PRD title:
# PRD: User Authentication -> "prdName": "user-authentication"Tell the user:
PRD converted and moved to .opencode/state/<prd-name>/
- prd.md (moved from <original-path>)
- prd.json (generated)
- progress.txt (empty)
PRD: <prd-name>
Tasks: X total (Y already passing)
- functional: N
- testing: N
Project Analysis:
- Constraints found: <count from AGENTS.md, etc.>
- Existing implementation: <what already exists>
- Patterns discovered: <key patterns>
Non-goals (excluded): <list>
Conflicts/Notes: <any PRD vs project conflicts>
To complete tasks:
/complete-next-task <prd-name>
This will:
1. Get bearings (read progress, check history, verify environment)
2. Choose a task to implement
3. Implement until all verification steps pass
4. Commit and update progress
# PRD: User Favorites
## End State
- [ ] Users can favorite items
- [ ] Favorites persist
- [ ] Users can list favorites
## Tasks
### Favorites Storage [db]
Database table for storing favorites.
**Verification:**
- Favorites table exists with userId, itemId, createdAt
- Unique constraint prevents duplicates
- Foreign keys reference users and items tables
### Add Favorite [api]
User can add an item to favorites.
**Verification:**
- POST /api/favorites with itemId
- Verify 201 response
- Verify item appears in database
- Attempt duplicate, verify 409
- Attempt without auth, verify 401
### List Favorites [api]
User can retrieve their favorites.
**Verification:**
- GET /api/favorites returns array
- Results are paginated (20 per page)
- Results sorted by createdAt desc
- Only returns current user's favorites
## Context
### Patterns
- API routes: `src/routes/items.ts`
- Auth middleware: `src/middleware/auth.ts`
### Key Files
- `src/db/schema.ts`
### Non-Goals
- Favorite folders
- Sharing favorites
prd.md - Moved from prd-favorites.md
progress.txt - Empty file for tracking progress
prd.json:
{
"prdName": "user-favorites",
"tasks": [
{
"id": "db-1",
"category": "db",
"description": "Database table for storing favorites",
"steps": [
"Favorites table exists with userId, itemId, createdAt",
"Unique constraint prevents duplicates",
"Foreign keys reference users and items tables"
],
"passes": false
},
{
"id": "api-1",
"category": "api",
"description": "User can add an item to favorites",
"steps": [
"POST /api/favorites with itemId",
"Verify 201 response",
"Verify item appears in database",
"Attempt duplicate, verify 409",
"Attempt without auth, verify 401"
],
"passes": false
},
{
"id": "api-2",
"category": "api",
"description": "User can retrieve their favorites",
"steps": [
"GET /api/favorites returns array",
"Results are paginated (20 per page)",
"Results sorted by createdAt desc",
"Only returns current user's favorites"
],
"passes": false
}
],
"context": {
"patterns": [
"API routes: src/routes/items.ts",
"Auth middleware: src/middleware/auth.ts",
"Zod validation on all inputs (discovered)",
"Drizzle ORM for DB (discovered)"
],
"keyFiles": [
"src/db/schema.ts",
"src/lib/validation.ts (discovered)",
"src/routes/items.ts (reference pattern)"
],
"nonGoals": ["Favorite folders", "Sharing favorites"],
"projectConstraints": [
"No any types (from AGENTS.md)",
"All API routes require auth middleware"
],
"existingImplementation": [
"User table exists with id, email, createdAt",
"Items table exists with id, name, userId"
]
}
}