ワンクリックで
create-prd
// Create and manage prd.json task lists for Ralph AI coding agent. Use when asked to "create tasks", "add task", "create PRD", "break down features", "plan implementation", or when managing Ralph project tasks.
// Create and manage prd.json task lists for Ralph AI coding agent. Use when asked to "create tasks", "add task", "create PRD", "break down features", "plan implementation", or when managing Ralph project tasks.
| name | create-prd |
| description | Create and manage prd.json task lists for Ralph AI coding agent. Use when asked to "create tasks", "add task", "create PRD", "break down features", "plan implementation", or when managing Ralph project tasks. |
| license | MIT |
| metadata | {"author":"chenxin-yan","version":"0.2.0"} |
Create and manage prd.json task lists for Ralph — an AI coding agent that loops through tasks: reads prd.json, picks ONE task, completes it, marks passed: true, repeats until done.
Task quality directly determines agent performance. Follow the rules below strictly.
{
"tasks": [
{
"description": "Clear end-goal of the task",
"subtasks": ["Specific step 1", "Specific step 2", "Verification step"],
"notes": "Context, constraints, references, or tips",
"passed": false
}
]
}
description: What should be achieved when done. Clear and specific.subtasks: Ordered, actionable implementation steps.notes: Context and constraints for the agent. Can be empty string.passed: Always false for new tasks.Each task must be completable in a single agent session (~1-2 hours of human work).
GOOD: "Implement POST /api/auth/register endpoint"
BAD: "Build the authentication system" → split into 4-6 tasks
If it would take a full day, break it down. If it takes 15 minutes, combine with related work.
// GOOD
"subtasks": [
"Create src/models/user.ts with User interface",
"Define fields: id (UUID), email (string), passwordHash (string), createdAt (Date)",
"Add Zod schema for validation",
"Export UserCreate and UserResponse types"
]
// BAD
"subtasks": ["Create user model", "Add fields", "Add validation"]
The final subtasks of every task must include:
npm run typecheck, npx tsc --noEmit)npm run lint, npm run format:check)Check package.json scripts or equivalent config to determine the correct commands.
"subtasks": [
"... implementation steps ...",
"Write tests for success and failure cases",
"Run npm test to verify all tests pass",
"Run npm run typecheck to ensure no type errors",
"Run npm run lint to ensure code quality"
]
If the project lacks these tools, the setup task should configure them. All subsequent tasks must include these checks.
Each task must have clear boundaries. No two tasks should modify the same files or implement the same logic.
// BAD — overlapping
{ "description": "Create User model", "subtasks": ["Define schema", "Add validation", "Create API routes"] },
{ "description": "Build user API", "subtasks": ["Create routes for users", "Add validation"] }
// GOOD — clear boundaries
{ "description": "Create User model and validation schemas", "subtasks": ["Define schema", "Add Zod validation", "Export types"] },
{ "description": "Implement User CRUD API endpoints", "subtasks": ["Create GET /api/users", "Create POST /api/users"] }
Include in notes: references to SPEC.md decisions, constraints, related files, gotchas, edge cases, and context about previous tasks.
Ralph infers task order from the list position. Order tasks as:
Determine workflow from the user's request:
| User Intent | Workflow |
|---|---|
| "Create PRD", "plan the project", "break down the spec" | Full PRD Creation |
| "Add a task", "create a task for X" | Incremental |
| Unclear | Ask the user |
SPEC.md if it exists. Otherwise, use the user's description. If neither exists, explore the codebase (directory structure, manifests, entry files, tests) and summarize your understanding to the user for confirmation.prd.json.prd.json to avoid duplicates and match existing style.prd.json (or create it if it doesn't exist), placing logically based on dependencies.{
"description": "Initialize project with TypeScript, ESLint, and Prettier",
"subtasks": [
"Run npm init -y to create package.json",
"Install TypeScript and initialize with npx tsc --init",
"Configure tsconfig.json with strict mode, ES2022 target, and path aliases",
"Install and configure ESLint with TypeScript plugin",
"Install and configure Prettier with ESLint integration",
"Add scripts to package.json: build, typecheck, lint, format",
"Create src/index.ts with a simple console.log to verify setup",
"Run npm run build && npm run typecheck to verify configuration",
"Run npm run lint && npm run format:check to verify code quality tooling"
],
"notes": "Use ESM modules (type: module in package.json). Target Node.js 18+.",
"passed": false
}
{
"description": "Create User model with Prisma schema and TypeScript types",
"subtasks": [
"Add User model to prisma/schema.prisma with fields: id (UUID), email, passwordHash, name, createdAt, updatedAt",
"Add unique constraint on email, set id default to uuid()",
"Run npx prisma migrate dev --name add-user-model",
"Create src/types/user.ts with User, UserCreate, and UserResponse types",
"Create src/lib/validation/user.ts with Zod schemas for each type",
"Run npx prisma generate to update client",
"Run npm run typecheck to ensure no type errors",
"Run npm run lint to ensure code quality"
],
"notes": "Ensure passwordHash is never included in UserResponse type. Email should be lowercase and trimmed.",
"passed": false
}
{
"description": "Implement POST /api/auth/register endpoint",
"subtasks": [
"Create src/routes/auth/register.ts",
"Add POST handler that accepts { email, password, name }",
"Validate request body using Zod schema from src/lib/validation/user.ts",
"Check if user with email already exists, return 409 if so",
"Hash password with bcrypt (12 rounds)",
"Create user in database with Prisma",
"Return 201 with user data (excluding passwordHash)",
"Write tests in tests/routes/auth/register.test.ts",
"Test: successful registration returns 201",
"Test: duplicate email returns 409",
"Test: invalid email format returns 400",
"Run npm test to verify all tests pass",
"Run npm run typecheck to ensure no type errors",
"Run npm run lint to ensure code quality"
],
"notes": "Follow error response format in src/lib/errors.ts. Use the db client from src/lib/db.ts.",
"passed": false
}
Before finalizing, verify every task meets: