|
| 1 | +--- |
| 2 | +description: Plan and create a repetitive task automation (prompt.md + tasks.json pair) |
| 3 | +allowed-tools: Read, Write, Edit, Glob, Grep, Bash(mkdir:*), Bash(ls:*), AskUserQuestion |
| 4 | +--- |
| 5 | + |
| 6 | +# Task Planner - Create Automated Task Workflows |
| 7 | + |
| 8 | +You are setting up a new **repetitive task automation** for Claude Code. The goal is to create a folder in `.ai/<featurename>/` containing: |
| 9 | +- `prompt.md` - Detailed instructions for the autonomous agent |
| 10 | +- `tasks.json` - List of tasks with completion tracking |
| 11 | + |
| 12 | +This pair can then be executed via `node .claude/iterate.js <featurename>`. |
| 13 | + |
| 14 | +## Your Workflow |
| 15 | + |
| 16 | +### 1. Understand the Goal |
| 17 | + |
| 18 | +First, understand what the user wants to automate. Ask clarifying questions using AskUserQuestion if needed: |
| 19 | +- What is the overall goal/feature being implemented? |
| 20 | +- What are the individual tasks involved? |
| 21 | +- Are there dependencies between tasks? |
| 22 | +- What files/areas of the codebase are involved? |
| 23 | +- Are there any reference examples or patterns to follow? |
| 24 | + |
| 25 | +### 2. Choose a Feature Name |
| 26 | + |
| 27 | +The `<featurename>` should be: |
| 28 | +- Short (1-2 words, lowercase, hyphen-separated) |
| 29 | +- Easy to type on command line |
| 30 | +- Descriptive of the work being done |
| 31 | +- Not already used in `.ai/` |
| 32 | + |
| 33 | +Check existing folders: |
| 34 | +```bash |
| 35 | +ls .ai/ |
| 36 | +``` |
| 37 | + |
| 38 | +Suggest a name to the user or let them specify one directly via $ARGUMENTS. |
| 39 | + |
| 40 | +### 3. Use /ultrathink for Planning |
| 41 | + |
| 42 | +Before writing the prompt, use `/ultrathink` to carefully plan: |
| 43 | +- The structure of the prompt |
| 44 | +- What context the autonomous agent needs |
| 45 | +- How tasks should be broken down |
| 46 | +- What patterns/examples to include |
| 47 | +- Edge cases and error handling |
| 48 | + |
| 49 | +### 4. Create the Folder and Files |
| 50 | + |
| 51 | +Create `.ai/<featurename>/`: |
| 52 | + |
| 53 | +**prompt.md** should include: |
| 54 | +- Overview of what we're doing |
| 55 | +- Architecture/context needed |
| 56 | +- Step-by-step instructions for each task type |
| 57 | +- Code patterns and examples |
| 58 | +- Build/test commands |
| 59 | +- Commit message format (see below) |
| 60 | + |
| 61 | +### Commit Message Guidelines |
| 62 | + |
| 63 | +All prompts should specify commit message length requirements: |
| 64 | +- **Soft limit**: ~50 characters (ideal length for first line) |
| 65 | +- **Hard limit**: 76 characters (must not exceed) |
| 66 | + |
| 67 | +Example instruction for prompt.md: |
| 68 | +``` |
| 69 | +## Commit Format |
| 70 | +
|
| 71 | +First line: Short summary (aim for ~50 chars, max 76 chars) |
| 72 | +
|
| 73 | +<Optional body with details> |
| 74 | +
|
| 75 | +IMPORTANT: Never try to commit files in .ai/ |
| 76 | +``` |
| 77 | + |
| 78 | +**tasks.json** format: |
| 79 | +```json |
| 80 | +{ |
| 81 | + "tasks": [ |
| 82 | + { |
| 83 | + "id": "task-id", |
| 84 | + "title": "Short task title", |
| 85 | + "description": "Detailed description of what to do", |
| 86 | + "started": false, |
| 87 | + "completed": false, |
| 88 | + "dependencies": ["other-task-id"] |
| 89 | + } |
| 90 | + ] |
| 91 | +} |
| 92 | +``` |
| 93 | + |
| 94 | +### 5. Iterate with the User |
| 95 | + |
| 96 | +After creating initial files, the user may want to: |
| 97 | +- Add more tasks to tasks.json |
| 98 | +- Refine the prompt with more details |
| 99 | +- Add examples or patterns |
| 100 | +- Clarify instructions |
| 101 | + |
| 102 | +Keep refining until the user is satisfied. |
| 103 | + |
| 104 | +## Arguments |
| 105 | + |
| 106 | +If `$ARGUMENTS` is provided, it's the feature name to use: |
| 107 | +- `$ARGUMENTS` = "$ARGUMENTS" |
| 108 | + |
| 109 | +If empty, you'll need to determine/suggest a name based on the discussion. |
| 110 | + |
| 111 | +## Examples |
| 112 | + |
| 113 | +### Example 1: Settings Migration |
| 114 | +``` |
| 115 | +/taskplanner settings-upgrade |
| 116 | +``` |
| 117 | +Creates `.ai/settings-upgrade/` with prompt and tasks for migrating settings sections. |
| 118 | + |
| 119 | +### Example 2: Open-ended |
| 120 | +``` |
| 121 | +/taskplanner |
| 122 | +``` |
| 123 | +Starts a conversation to understand what needs to be automated, then creates the appropriate folder. |
| 124 | + |
| 125 | +## Starting Point |
| 126 | + |
| 127 | +Let's begin! Please describe: |
| 128 | +1. What repetitive coding task do you want to automate? |
| 129 | +2. What is the end goal? |
| 130 | +3. Do you have initial tasks in mind, or should we discover them together? |
0 commit comments