From next-action
Find the next highest-priority action to work on. Scans local TODO files, source code TODO comments, GitHub issues, and unpushed local commits. Checks for blockers, staleness, and priority signals to recommend what to do next. Use when asked "what should I work on next", "next task", "find work", or "what's left to do".
npx claudepluginhub jaeyeom/claude-toolbox --plugin next-actionThis skill uses the workspace's default tool permissions.
Find and suggest the next highest-priority action to work on by scanning
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Find and suggest the next highest-priority action to work on by scanning multiple task sources (TODO files, source code TODO comments, GitHub issues, and unpushed local commits), checking for blockers and staleness, and presenting a recommended action.
This skill suggests only — it does not begin working on the task unless the user explicitly asks.
Check the repository root CLAUDE.md for any documented task source
configuration. Look for sections or comments that reference:
TODO.md, TASKS.md, docs/TODO.md)If no task sources are documented in CLAUDE.md:
Search for common TODO files at the repo root: TODO.md, TODO,
TASKS.md, BACKLOG.md.
Check whether gh CLI is available and authenticated (gh auth status).
If no local TODO file exists and gh is not available, ask the user where
their tasks live. Suggest updating CLAUDE.md with a task source
configuration section like:
## Task Sources
- Local: TODO.md
- GitHub Issues: assigned to me, label "ready"
For each discovered TODO file:
- [ ] ...).## High Priority, ## Medium Priority, ## Low Priority) or inline markers (P0:, P1:, P2:,
URGENT:, HIGH:, MEDIUM:, LOW:).BLOCKED:, BLOCKED BY, WAITING ON, or DEPENDS ON followed by a description or issue reference are
considered blocked.- [~] ... or - [-] ...)IN PROGRESS, WIP, or IN REVIEW markerssrc/auth.go), verify the file
exists with ls.rg to check
it still exists in the codebase.#123), check its state
with gh issue view <number> --json state --jq '.state'. Skip items
referencing closed issues.Run the helper script to scan and score inline TODO comments:
bash "${SKILL_DIR}/scan-code-todos.sh" --limit 20 .
where ${SKILL_DIR} is the directory containing this SKILL.md file.
The script scans for TODO, FIXME, HACK, and XXX comments in source code
(excluding markdown, JSON, lock files, vendored/generated directories), parses
each match into structured JSON with fields: tag, tracker_id, assignee,
description, file, line, and score.
Scoring rules applied by the script:
FIXME / XXX → 80HACK → 60TODO with P0 / URGENT marker → 70TODO with tracker ID → 50TODO → 35security, vulnerability, crash, data loss,
race condition) boost score to 80Post-processing (after receiving script output):
Deduplication — If a TODO comment references a tracker ID that matches a GitHub issue gathered in Step 4, merge them: attach the code location to the GitHub issue candidate rather than creating a duplicate entry. If multiple TODO comments share the same tracker ID, group them as a single candidate with multiple locations.
Staleness check — If a comment references a GitHub issue (#123 in the
tracker_id field), check its state with gh issue view. If the issue is
closed, the TODO is stale — flag it as needing cleanup rather than
recommending it as work.
Run the helper script to fetch and score open GitHub issues:
bash "${SKILL_DIR}/scan-github-issues.sh" --limit 20
where ${SKILL_DIR} is the directory containing this SKILL.md file.
The script handles:
P0, P1, critical, urgent,
high-priority, good first issue, help wanted) and title prefixes
([P0], [URGENT], etc.)- [ ] #123), URL references
(- [ ] https://github.com/.../issues/123), and keywords (blocked by #123,
depends on #123). Each referenced issue is checked; if still open, the
issue is marked blocked.in progress, wip, in-progress,
or in review labels, and issues with linked open pull requests.+15 assignment bonus.Output: JSON array sorted by score (descending), each entry:
{"number": 7, "title": "...", "labels": [...], "score": 55, "status": "ready", "blocked_by": [], "assignees": [...]}
Status values: "ready", "blocked", "in_progress".
Post-processing (after receiving script output):
Staleness check — For each issue with status "ready", search the
codebase for references:
rg '#<issue-number>\b' .
rg 'issues/<issue-number>\b' .
If the issue references specific files, functions, or code paths in its body, verify they still exist. Flag issues whose context has significantly changed.
Check for commits on the current branch that have not been pushed to the remote. These represent completed work that still needs to be pushed, or issues that were addressed locally but whose corresponding GitHub issues remain open.
Detect unpushed commits by running the helper script:
bash "${SKILL_DIR}/unpushed-commits.sh"
where ${SKILL_DIR} is the directory containing this SKILL.md file.
The script tries three strategies in order: the upstream tracking ref, the same branch name on origin, and the remote default branch. This handles local branches that have no upstream configured — a common case for new feature branches.
If the script produces no output, there are no unpushed commits — skip this step.
For each unpushed commit, extract the commit subject and check:
#123, fixes #123, closes #123, resolves #123), record the
association. These issues may be resolved locally but not yet closed on
GitHub because the commits haven't been pushed.feat(auth): ..., fix(parser): ...) to understand what area was changed.Cross-reference unpushed commits with GitHub issues:
gh issue view <number> --json state --jq '.state'
This lookup is self-contained — it does not depend on the GitHub issue
candidates gathered in Step 4. This allows /next-action unpushed to
work as a standalone mode without running the full GitHub issues scan.fixes #N, closes #N, or resolves #N), mark that issue as
locally resolved — needs push. Do not recommend it as work to do;
instead, surface it as a push action.#N), flag the issue as partially addressed locally —
it may still need additional work.Generate candidates from unpushed commits:
Assign a priority score to each non-blocked, non-stale, non-in-progress candidate:
| Source | Priority signal | Score |
|---|---|---|
| Local TODO | High Priority section / P0 / URGENT | 100 |
| Local TODO | Medium Priority section / P1 | 50 |
| Local TODO | Low Priority section / P2 | 20 |
| Code TODO | FIXME / XXX / security-related | 80 |
| Code TODO | TODO with P0 / URGENT marker | 70 |
| Code TODO | TODO with tracker ID | 50 |
| Code TODO | plain TODO | 35 |
| GitHub Issue | P0 / critical / urgent label | 90 |
| GitHub Issue | P1 / high-priority label | 60 |
| GitHub Issue | assigned to me | +15 |
| GitHub Issue | help wanted / good first issue | 30 |
| GitHub Issue | no priority label | 40 |
| Unpushed Commit | closes/fixes/resolves an issue | 85 |
| Unpushed Commit | no issue reference (batch push) | 45 |
Sort candidates by score (descending). Break ties by preferring local TODO items over GitHub issues, and older items over newer ones.
Display the top recommendation in a visually prominent block that stands out from the rest of the output:
## Next Action
> ### Recommended
>
> **[Source]** description-of-task
>
> | Priority | Score | Status |
> |----------|-------|------------------|
> | High | 100 | Ready to work on |
>
> **Context:** Brief summary of what the task involves and any relevant
> pointers.
The blockquote with a bold heading ensures the recommendation is immediately identifiable at a glance, visually separated from the runner-up list below.
Then list up to 4 runners-up in a compact table (the recommended item also appears as row #1 for consistent scanning):
### All candidates
| # | Source | Priority | Description |
|-----|--------|----------|--------------------------|
| 1 → | TODO | High | **Fix auth crash** (recommended) |
| 2 | TODO | Medium | Refactor auth module |
| 3 | GH #42 | P1 | Fix pagination bug |
The → marker and bold text on row #1 reinforce which item is the primary
recommendation.
If any items were flagged as blocked, stale, or in-progress, list them in a separate section:
### Blocked / Stale / In-progress items
- **TODO**: "Migrate to new API" — BLOCKED BY #15 (still open)
- **GH #23**: "Fix login flow" — STALE: references `src/old-auth.go` which no longer exists
- **Code TODO**: `src/auth.go:42` — STALE: references closed issue #15
- **TODO**: "Add retry logic" — IN PROGRESS (likely being handled by another session)
- **GH #17**: "Refactor auth" — IN PROGRESS: has linked open PR #31
If any unpushed commits were found, list them in a dedicated section:
### Unpushed commits
- **Push to close #9** — `cc11f06 docs: add vibecoding setup guide` (closes #9, needs push)
- **3 unpushed commits** — routine delivery, no issue references
For issues marked as locally resolved — needs push, do not list them under "Other candidates" — show them only in the "Unpushed commits" section to avoid confusion.
If Step 1 found no task source configuration in CLAUDE.md, suggest appending
a task source section based on what was discovered:
## Task Sources
- Local: TODO.md
- GitHub Issues: assigned to @me, state open
Explain why this helps: future invocations of /next-action will skip the
discovery step and use the configured sources directly.
Do not modify CLAUDE.md without user confirmation.
/next-action todo,
/next-action code, /next-action github, or /next-action unpushed),
limit the scan to that source only.CLAUDE.md task source configuration
(e.g., specific labels, milestone, Jira project).