{{!--
  ABOUTME: JSON (prd.json) tracker prompt template (REFERENCE COPY).
  Context-first structure: PRD → Patterns → Task → Workflow

  NOTE: This file is for REFERENCE ONLY. The actual template used at runtime
  is embedded in the code to avoid path resolution issues in bundled distributions.
  See: https://github.com/subsy/ralph-tui/issues/248

  To customize this template, copy it to one of these locations:
  - Project: .ralph-tui/templates/json.hbs
  - Global: ~/.config/ralph-tui/templates/json.hbs
--}}

{{!-- Full PRD for project context (agent studies this first) --}}
{{#if prdContent}}
We are working in a project to implement the following Product Requirements Document (PRD):

{{prdContent}}

---
{{/if}}

{{!-- Task details --}}
## Your Task: {{taskId}} - {{taskTitle}}

{{#if taskDescription}}
### Description
{{taskDescription}}
{{/if}}

{{#if acceptanceCriteria}}
### Acceptance Criteria
{{acceptanceCriteria}}
{{/if}}

{{#if notes}}
### Notes
{{notes}}
{{/if}}

{{#if dependsOn}}
**Prerequisites**: {{dependsOn}}
{{/if}}

{{#if recentProgress}}
## Recent Progress
{{recentProgress}}
{{/if}}

## Workflow
1. Study the PRD context above to understand the bigger picture
2. Study `.ralph-tui/progress.md` to understand overall status, implementation progress, and learnings including codebase patterns and gotchas
3. **BEFORE implementing**: Review the relevant parts of the codebase to understand existing patterns and architecture
4. **Check the original task list**: Verify if there are any related tasks or dependencies that affect this implementation
5. **If something is missing**: If you discover that related functionality needs changes, implement those changes as part of this task
6. Implement this single story following acceptance criteria
7. Run quality checks: typecheck, lint, etc.
{{#if config.autoCommit}}
8. Do NOT create git commits. Changes will be committed automatically by the engine after task completion.
{{else}}
8. Do NOT create git commits. Leave all changes uncommitted for manual review.
{{/if}}
9. Document learnings (see below)
10. Signal completion

## Before Completing
APPEND to `.ralph-tui/progress.md`:
```
## [Date] - {{taskId}}
- What was implemented
- Files changed
- **Learnings:**
  - Patterns discovered
  - Gotchas encountered
---
```

If you discovered a **reusable pattern**, also add it to the `## Codebase Patterns` section at the TOP of progress.md.

## Stop Condition
**IMPORTANT**: If the work is already complete (implemented in a previous iteration or already exists), verify it meets the acceptance criteria and signal completion immediately.

When finished (or if already complete), signal completion with:
<promise>COMPLETE</promise>
