Task-new authoring flow with full worksheet and strict validate
Problem
Today plans_cli.task_create only seeds Problem from --description (and optionally Possible Solutions). Context and Plan stay placeholders, and the printed “next steps” tell authors to focus on Problem and Possible Solutions—not Plan. Agents following /plan-task often stop after task create, so queued work lacks an actionable plan.
We also want slash commands namespaced under task (/task-new or /task-plan) instead of plan-task, and validation that can enforce a real worksheet without overloading the word “plan” in the CLI once the consolidated task surface lands.
Context
- Blocking dependency: converge-plans-and-plan-commands-to-a-single-task-cli-surface — this task assumes the converged
task/tasksCLI and docs; new validate flags and examples must use the consolidated invocation (e.g.just task validate, notjust plan task validate). - Implementation touchpoints:
tasks/tools/plans_cli.py(task_create,task_validate, printed next steps),.codex/commands/plan-task.mdand.claude/commands/plan-task.md(rename + expand workflow),AGENTS.md/CLAUDE.mdif they reference the old command name,tests/core/test_plans_cli.py. - Related product direction: prefer editing the generated markdown as the default thorough path for agents; optional CLI flags for
--context/--planif one-shot creation is required without sacrificing depth. - Sibling (parallel): tasks-server-universal-doc-context-chat-sidebar adds in-browser planning chat with tools and manager handoff; it does not replace this authoring/validate work.
Possible Solutions
- A — CLI-only: Add
--context,--plan, and longer--descriptionpatterns so a singletask createcan emit a complete worksheet. Fast for scripts; easy for agents to under-fill if flags are optional. - B — Authoring contract only: Rename slash commands and document a mandatory second step (“open the new file and complete Context → Possible Solutions with Recommended → Plan”) with no code changes beyond messaging. Cheap; enforcement is weak unless validate strict mode exists.
- C — Hybrid (Recommended): Keep
task createas the single file creator. Update slash-command docs to/task-newor/task-planwith a two-step flow: create via CLI, then edit the markdown worksheet in the same session for thoroughness. Add optional--context/--plan(or file-based flags) for automation. Addtask validate --require-worksheet(exact flag name TBD) that rejects placeholder-only Plan and Context, with a policy note thatreadyshould not be set until strict validation passes (grandfather existing tasks or scope strictly to new files if needed). Refresh post-create “next steps” inplans_clito match.
Plan
- Land or rebase on
converge-plans-and-plan-commands-to-a-single-task-cli-surface; use the newtask/taskscommand names in all new docs and validate UX from this task. - Rename
/plan-taskto/task-newor/task-planin.codex/commands/and.claude/commands/; sync any copies; update references in rules and skills. - Extend
task_validatewith an opt-in strict worksheet check (detect empty or comment-only Plan / Context); add tests intests/core/test_plans_cli.py. - Update
task_create“Next steps” output to require Context, Possible Solutions (with Recommended), and Plan; optionally add--context/--planif the implementer agrees it is worth the API surface. - Update AGENTS.md / CLAUDE.md / cli-reference snippets to describe the full authoring flow and strict validate flag.
Implementation Progress
Changes made
-
tasks/tools/task_cli.py: - Added_is_placeholder_section(body, heading)helper — detects empty or HTML-comment-only worksheet sections. -task_validatenow accepts--require-worksheetflag; when set, rejects placeholder-only Context and Plan sections. -task_createaccepts--contextand--planflags to seed those sections at creation time (skipping placeholder comments). - Updated post-create "Next steps" output to list all three worksheet sections (Context, Possible Solutions with Recommended, Plan) and reference--require-worksheetvalidation. -
tests/core/test_task_cli.py— 8 new tests: - Strict worksheet validation: passes with real content, rejects placeholder Context, rejects placeholder Plan, rejects empty Context, passes without flag. - Parser:--require-worksheetflag presence and default. ---contextand--planflags intask_create. - Next-steps messaging mentions full worksheet. -
.claude/commands/task-new.mdand.codex/commands/task-new.md— new/task-newslash command describing the two-step authoring flow (create → fill worksheet → strict validate). -
.claude/commands/task.mdand.codex/commands/task.md— updated to reference--context,--plan,--solutions,--require-worksheet, and/task-new. -
CLAUDE.md— Task Management section updated with--require-worksheet, optional one-shot flags, and/task-newreference.
QA Exploration
N/A — CLI and docs workflow; no browser surface in this task.
- [x] QA exploration completed (or N/A for non-UI tasks)
Review Feedback
- [ ] Review cleared