Create a new datestamped planning phase directory with sequential numbering and conventional branch naming
Create a new planning phase directory with a nested datestamped path, sequential numbering, structured prompt template, and state tracking.
/jp-plan <description>
Argument:
<description> -- A concise description of this planning phase (e.g. "auth-refactor", "api-endpoints", "bug-fixes"). Keep it to 2-3 essential words -- omit articles, prepositions, and filler words.Run git rev-parse --show-toplevel to determine the repository root. All .plans/ references in this skill resolve relative to this root (i.e. <repo-root>/.plans/). If the command fails (not a git repository), stop and tell the user this skill requires a git repository.
Ensure the <repo-root>/.plans directory exists. If not, stop and tell the user to run /jp-setup first.
Check the current git branch. If the user is already on a non-main/master branch, skip this step silently and record the current branch name for use in Step 12.
If on main or master, suggest creating a new branch before proceeding. Derive the suggested branch name using a conventional prefix based on keywords in the phase description:
| Keywords in description | Suggested prefix |
|---|---|
| fix, bug, patch, hotfix, repair, resolve | fix/ |
| docs, documentation, readme, changelog | docs/ |
| test, testing, spec, coverage | test/ |
| refactor, restructure, reorganize, cleanup, clean-up | refactor/ |
| chore, config, ci, lint, format, bump, dependency, deps | chore/ |
| (anything else / default) | feat/ |
Match keywords case-insensitively against the description. If multiple prefixes match, prefer the first match in table order.
The suggested branch name format is <prefix><slug> (e.g. feat/auth-implementation, fix/login-crash).
Use AskUserQuestion to present the suggestion and ask the user to choose one of:
Record the active branch name (whether newly created or existing) for use in Step 12.
You are on `main`. I suggest creating a branch for this phase:
Suggested branch: feat/auth-implementation
Options:
1. Create `feat/auth-implementation` (recommended)
2. Enter a different branch name
3. Stay on `main`
If the user chooses option 2:
Enter your preferred branch name:
> fix/auth-session-bug
Creating and switching to `fix/auth-session-bug`...
Get today's date. The date directory uses nested year/month/day format:
.plans/YYYY/MM/DD/
For example, January 15 2026 produces .plans/2026/01/15/.
Create the nested directories if they do not already exist.
List existing subdirectories in the date directory (.plans/YYYY/MM/DD/). Each subdirectory is expected to be prefixed with a two-digit number (e.g. 01-initial-implementation, 02-fixes).
Calculate the next sequential number:
01.02-fixes exists, next is 03).01, 02, 03).Convert the description to a concise, filename-friendly slug:
Create the phase directory and its required subdirectories:
.plans/YYYY/MM/DD/NN-<slug>/
.plans/YYYY/MM/DD/NN-<slug>/reviews/
.plans/YYYY/MM/DD/NN-<slug>/reviews/cycle/
Examples:
.plans/2026/03/01/01-plan-workflow-testing/.plans/2026/01/15/01-auth-implementation/.plans/2026/06/22/01-registration-endpoints/.plans/2026/03/01/01-bug-fixes/Create prompt.md inside the new phase directory with the following structured template:
# Phase: NN-<slug>
## Overview
<!-- Briefly describe what this phase is about and why it is needed. -->
## Goals
<!-- List the specific goals this phase aims to achieve. -->
## Requirements
<!-- Detail the functional and non-functional requirements. -->
## Constraints
<!-- List any technical, time, or resource constraints. -->
## Out of Scope
<!-- Explicitly state what is NOT part of this phase. -->
## References
<!-- Link to related issues, documents, discussions, or prior work. -->
Replace NN-<slug> in the heading with the actual phase directory name (e.g. 01-auth-implementation).
Use AskUserQuestion to ask the user whether they have finished writing their prompt content. Present two options:
If the user chooses to skip, proceed immediately to Step 11 (Initialize State File) without performing Steps 8-10.
If the user confirms they have finished editing, use the Read tool to read the full contents of prompt.md into context before continuing to Step 8.
Perform a lightweight scan of the ingested prompt.md content. For each section (Overview, Goals, Requirements, Constraints, Out of Scope, References), check for:
<!-- Briefly describe what this phase is about and why it is needed. -->).Build a list of identified gaps from these checks.
Important: Do NOT perform deep requirements analysis, suggest additional requirements, question the user's technical decisions, or evaluate the quality of the content. This step is limited to detecting clear omissions and contradictions only.
If no gaps are found, skip Steps 9 and 10 and proceed directly to Step 11 (Initialize State File) with a brief note to the user that the prompt looks complete.
If gaps were identified in Step 8, present them to the user as a brief interview using AskUserQuestion. Group all gaps into a single interaction where possible -- aim for 1-3 questions and never exceed 5. Each question should:
The entire interview must complete in one round of questions and one round of answers. Do not ask follow-up questions or start a second round.
If the user provided content for any gaps during the interview in Step 9, use the Edit tool to update prompt.md in place:
If the user dismissed all gaps (nothing to change), do not modify prompt.md. Note in the final report (Step 12) that the prompt was reviewed but no updates were applied.
Create state.yaml inside the new phase directory with the following content: