---
description: Create task with mandatory PRD, spec, and review files
agent: build
---

# Create Task with Anti-Hallucination System

**Goal:** Create task structure that enforces constraint validation at every step

## Step 1: Create Backlog Task Entry

Call `backlog_task_create` with:

```typescript
backlog_task_create({
  title: "$ARGUMENTS",
  status: "To Do",
  priority: "medium",
  description: "[User to fill: Brief description of what needs to be done]",
});
```

This returns a task ID (e.g., `task-001`). Use this ID for file structure.

## Step 2: Create Three Mandatory Files

Create directory: `@backlog/tasks/[TASK_ID]/`

**File 1: prd.md**

```
# Task PRD

**Task ID:** [TASK_ID]
**Created:** [DATE]

## Goal

[What is this task trying to achieve? 1-2 sentences, measurable]

## Scope

**In-Scope:**
- [Feature/capability 1]
- [Feature/capability 2]
- [Any explicit inclusions]

**Out-of-Scope:**
- [What's NOT included]
- [What won't be done]
- [Any explicit exclusions]

## Success Criteria

- [ ] [Measurable criterion 1]
- [ ] [Measurable criterion 2]
- [ ] [Measurable criterion 3]

## Constraints

- [Any explicit project constraints]
- [Any team/org constraints]
```

**File 2: spec.md**

```
# Task Spec

**Task ID:** [TASK_ID]
**PRD:** [Link to prd.md]

## Architecture

[High-level design/approach description]

## Constraints

- [Technical constraint 1]
- [Technical constraint 2]
- [Libraries/frameworks allowed/forbidden]
- [Naming conventions]
- [Patterns to follow]

## Edge Cases

1. [Corner case 1 - how will it be handled?]
2. [Corner case 2 - how will it be handled?]
3. [Any error scenarios]

## Testing

[How will success criteria be verified?]
```

**File 3: review.md**

```
# Task Review

**Task ID:** [TASK_ID]
**Date Completed:** [Will fill this]

## What Changed

[After work: List every file modified, every function added]

## What Skipped

[After work: Any intentional limitations or deferred work]

## Inconsistencies

[After work: Any spec deviations and why]

## Validation

[After work: Which success criteria are now complete]
```

## Step 3: User Fills Templates

**Critical:** Before any work can proceed:

1. User must edit `prd.md` with actual goal, scope, success criteria
2. User must edit `spec.md` with actual architecture, constraints, edge cases
3. All success criteria must be measurable (not vague)
4. All constraints must be specific (not generic)

**Incomplete templates CANNOT be used** - agents will reject them.

## Step 4: Task is Ready

Once templates are filled, task can be:

- **Researched:** `/research $ARGUMENTS`
- **Planned:** `/plan $ARGUMENTS`
- **Implemented:** `/research-and-implement $ARGUMENTS` or `/quick-build $ARGUMENTS`

## Validation Rules

**Templates MUST have:**

- PRD with measurable success criteria
- Spec with architecture plan and edge cases
- All sections filled (not left as examples)

**Templates CANNOT have:**

- Placeholder text like "[example]"
- Vague criteria like "works well"
- Missing sections

**Agent enforcement:**

- All agents validate PRD+spec before work
- Agents abort if either file is incomplete
- Code/git tools abort without completed review

## File Locations

```
@backlog/tasks/
├── task-001/
│   ├── prd.md          (User edits: goal, scope, success criteria)
│   ├── spec.md         (User edits: architecture, constraints, edge cases)
│   └── review.md       (Agent fills after work: what changed, skipped, validation)
├── task-002/
├── task-003/
...
```

---

**ANTI-HALLUCINATION SYSTEM: Every task must have constraints defined before any work begins**
