expand-tasks

Expand all TaskMaster tasks with deep research via Perplexity before coding begins. Reads tasks.json, launches parallel research agents per task, writes findings back. Part of the prd-taskmaster toolkit. Use after PRD is parsed into tasks and before implementation begins. Invoke with /expand-tasks or when user says "expand tasks", "research all tasks", or "research before coding for all tasks".

176 stars

Best use case

expand-tasks is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Expand all TaskMaster tasks with deep research via Perplexity before coding begins. Reads tasks.json, launches parallel research agents per task, writes findings back. Part of the prd-taskmaster toolkit. Use after PRD is parsed into tasks and before implementation begins. Invoke with /expand-tasks or when user says "expand tasks", "research all tasks", or "research before coding for all tasks".

Teams using expand-tasks should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/expand-tasks/SKILL.md --create-dirs "https://raw.githubusercontent.com/anombyte93/prd-taskmaster/main/companion-skills/expand-tasks/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/expand-tasks/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How expand-tasks Compares

Feature / Agentexpand-tasksStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Expand all TaskMaster tasks with deep research via Perplexity before coding begins. Reads tasks.json, launches parallel research agents per task, writes findings back. Part of the prd-taskmaster toolkit. Use after PRD is parsed into tasks and before implementation begins. Invoke with /expand-tasks or when user says "expand tasks", "research all tasks", or "research before coding for all tasks".

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Expand Tasks with Research v1.0

Expands TaskMaster tasks with Perplexity research before coding begins.
Deterministic operations handled by `script.py`; AI handles judgment.

**Script location**: `~/.claude/skills/expand-tasks/script.py`
**Part of**: prd-taskmaster toolkit
**Depends on**: research-before-coding skill (pattern), Perplexity MCP proxy

## When to Use

Activate when user says: expand tasks, research tasks, research before coding for all, expand subtasks.
Do NOT activate for: single task research (use /research-before-coding), PRD generation (use /prd-taskmaster).

## Prerequisites

- TaskMaster tasks.json must exist (run /prd-taskmaster first)
- Perplexity proxy must be running at localhost:8765
- At least 1 task in tasks.json

---

## Workflow (5 Steps)

### Step 1: Preflight

```bash
python3 ~/.claude/skills/expand-tasks/script.py read-tasks
```

Returns JSON: `total`, `expanded`, `pending_expansion`, `tasks[]`.

**If `pending_expansion` is 0**: Report all tasks already expanded. Exit skill.

**If Perplexity is down**: Check health first:
```bash
curl -sf http://localhost:8765/health
```
If down, tell user to start it and exit.

---

### Step 2: Choose Scope

Use AskUserQuestion:
- **All tasks** (default): Expand every task that hasn't been researched yet
- **Specific tasks**: User provides task IDs (comma-separated)
- **By dependency level**: Expand tasks with no dependencies first, then next wave

**AI judgment**: Recommend "All tasks" for initial expansion, "By dependency level" for incremental work.

---

### Step 3: Generate Research Prompts

For each task to expand:

```bash
python3 ~/.claude/skills/expand-tasks/script.py gen-prompt --task-id <ID>
```

Returns JSON with `prompt` field containing the full research agent prompt.

**AI judgment**: Review the auto-generated prompt. Customize research questions if the task needs domain-specific queries. Add project context from the PRD or session-context files if relevant.

---

### Step 4: Launch Parallel Research Agents

Launch research agents in parallel waves. Each wave = up to 5 concurrent agents.

**For each task**, spawn a Task agent:

```
Task(
  subagent_type: "general-purpose",
  model: "sonnet",
  description: "Research Task <ID>: <title>",
  run_in_background: true,
  prompt: <prompt from Step 3>
)
```

**Wave strategy**:
- Wave 1: Tasks with no dependencies (they inform downstream tasks)
- Wave 2: Tasks depending on Wave 1
- Wave 3+: Continue until all tasks covered
- Max 5 agents per wave to avoid overwhelming Perplexity proxy

**Wait for each wave to complete before launching the next.**

---

### Step 5: Collect and Write Results

As each agent completes, save its research output:

1. Write agent output to a temp file:
   ```bash
   echo "<agent output>" > /tmp/research-task-<ID>.md
   ```

2. Write research back to tasks.json:
   ```bash
   python3 ~/.claude/skills/expand-tasks/script.py write-research --task-id <ID> --research /tmp/research-task-<ID>.md
   ```

3. After all tasks are written, verify:
   ```bash
   python3 ~/.claude/skills/expand-tasks/script.py status
   ```

**AI judgment**: Review each research result for quality. If a result is too thin (< 5 lines of useful content) or clearly failed, re-run that specific task's research.

---

## Research Agent Prompt Pattern

The `gen-prompt` command generates prompts that follow the research-before-coding pattern:

1. Agent receives task context (title, description, dependencies, subtasks)
2. Agent runs `perplexity_batch` or `mcp__perplexity-api-free__search` with 3-5 targeted queries
3. Agent distills results into structured summary
4. Summary returns to main context (~25-40 lines per task)

**Critical**: Research agents must NEVER use WebSearch or WebFetch. Perplexity MCP only.

---

## Error Handling

| Error | Action |
|-------|--------|
| Perplexity proxy down | Exit skill, tell user to start proxy |
| Agent returns empty/failed | Re-run that specific task with different queries |
| tasks.json not found | Exit skill, tell user to run /prd-taskmaster first |
| Task already expanded | Skip silently unless user forces re-expansion |
| Agent timeout | Mark task as failed, continue with others |

---

## Output

After all tasks are expanded, the skill reports:
- Total tasks expanded
- Any failures that need retry
- Next recommended action (usually: begin implementation)

---

## Integration with prd-taskmaster

This skill fits between Step 8 (Parse & Expand Tasks) and Step 11 (Choose Next Action) of the prd-taskmaster workflow. After PRD is parsed into tasks but before execution begins.

```
/prd-taskmaster → generates PRD → parses into tasks
    ↓
/expand-tasks → researches each task → writes findings back
    ↓
Implementation begins (with research context in each task)
```

---

## Tips

- Run after PRD generation but before any implementation
- Research results are stored in `research_notes` field of each task in tasks.json
- Re-running on already-expanded tasks is safe (will skip unless forced)
- For very large task lists (20+), consider expanding in dependency order to save context
- Each research agent costs ~30s of Perplexity time; 15 tasks ≈ 3 waves ≈ 2-3 minutes total

Related Skills

prd-taskmaster

176
from anombyte93/prd-taskmaster

Smart PRD generator with TaskMaster integration. Detects existing PRDs and offers execute/update/replace options. Generates comprehensive technical PRDs optimized for task breakdown, validates with 13 automated checks, and optionally executes tasks autonomously with datetime tracking and rollback support. Use when user requests "PRD", "product requirements", or mentions task-driven development. Defaults to PRD generation with handoff to TaskMaster. Optionally supports autonomous execution with 4 modes.

webiny-api-tasks-catalog

7955
from webiny/webiny-js

api/tasks — 2 abstractions.

hunting-for-suspicious-scheduled-tasks

4032
from mukul975/Anthropic-Cybersecurity-Skills

Hunt for adversary persistence and execution via Windows scheduled tasks by analyzing task creation events, suspicious task properties, and unusual execution patterns that indicate T1053.005 abuse.

detecting-malicious-scheduled-tasks-with-sysmon

4032
from mukul975/Anthropic-Cybersecurity-Skills

Detect malicious scheduled task creation and modification using Sysmon Event IDs 1 (Process Create for schtasks.exe), 11 (File Create for task XML), and Windows Security Event 4698/4702. The analyst correlates task creation with suspicious parent processes, public directory paths, and encoded command arguments to identify persistence and lateral movement via scheduled tasks. Activates for requests involving scheduled task detection, Sysmon persistence hunting, or T1053.005 Scheduled Task/Job analysis.

doing-tasks

3891
from openclaw/skills

Use when executing any task. Work through plans systematically, tracking progress, handling blockers, and coordinating with other skills. The central execution skill.

search-tasks

3891
from openclaw/skills

Search and browse tasks on OpenAnt. Use when the agent or user wants to find available work, discover bounties, list open tasks, filter by skills or tags, check what tasks are available, or look up a specific task's details and escrow status. Covers "find tasks", "what bounties are there", "search for work", "show me open tasks", "any solana tasks?".

my-tasks

3891
from openclaw/skills

View your personal task history and status on OpenAnt. Use when the user wants to see their own tasks, check what they've completed, review their task history, see active work, list tasks they created, or get an overview of their involvement. Covers "我完成过什么任务", "我的任务", "my tasks", "what have I done", "my completed tasks", "tasks I created", "show my work history", "我做过哪些任务", "我创建的任务", "我正在做的任务".

monitor-tasks

3891
from openclaw/skills

Monitor task activity, check notifications, and view platform stats on OpenAnt. Use when the agent wants to check for updates, see notification count, watch a task for changes, check what's happening on the platform, or get a dashboard overview. Covers "check notifications", "any updates?", "platform stats", "what's new", "status update", "watch task". For personal task history and listing, use the my-tasks skill instead.

weeek-tasks

3891
from openclaw/skills

Управление задачами WEEEK через Public API (Task Manager): получать список задач, создавать/обновлять/завершать задачи, перемещать между досками/колонками, получать список досок и колонок. Использовать при интеграции с WEEEK API и работе с задачами/досками/колонками.

ops-tasks

3891
from openclaw/skills

Track tasks with priorities, owners, and statuses for operations teams.

google-tasks

3891
from openclaw/skills

Fetch, display, create, and delete Google Tasks using the Google Tasks API. Use when the user asks to check, view, list, get, add, create, remove, or delete their Google Tasks, to-do lists, or task items. Handles OAuth authentication automatically using bash script with curl and jq.

nx-run-tasks

1875
from tech-leads-club/agent-skills

Execute build, test, lint, serve, and other tasks in an Nx workspace using single runs, run-many, and affected commands. Use when user says "run tests", "build my app", "lint affected", "serve the project", "run all tasks", or "nx affected". Do NOT use for code generation (use nx-generate) or workspace configuration (use nx-workspace).