Skip to main content
jg-skills

Plan

jg-plan

Ask about the decisions that are yours, then write an implementation-ready plan for approval.

May change
Writes planning files
Usage
/jg-plan [task or amendments]

When to use it

Use it once a change is agreed in conversation and you want a reviewable plan before any code changes.

Example

Invoke the skill by name in your coding agent, followed by any text it should consider.

Example

/jg-plan

Asks about any decision that is yours to make, turns the change you discussed into an implementation-ready plan under jg-plans/, and stops for your approval.

SKILL.md

What the agent reads

The complete instructions your agent loads when you invoke jg-plan.

Invocation

Run only on direct developer invocation. Execute the workflow with available tools; do not simulate it, substitute shell commands, or ask again for actions already authorized.

Treat supplied text as arguments, constraints or context, honoring limits and deferrals. Report missing capabilities and blockers honestly. Never simulate success.

Release owned runtime resources and disposable scratch output, including on failure, preserving unresolved evidence and reporting retained resources in this skill’s output. This narrow cleanup exception never permits changing reviewed/pre-existing files, removing unexpected changes or cleaning earlier work. All other writes follow this workflow. This skill’s specific rules about supplied material take precedence.

jg-plans protocol 0.2

Persisted documents need project-local jg-plans >=0.7.0 with CLI schema 3. No-plan/code-only work, transcript analysis and pause need no CLI.

  • Run the exact installed entry, normally <repository-root>/node_modules/.bin/jg-plans or the documented built entry, with --version --json. Require error null, version >=0.7.0 and schemaVersion 3. Otherwise stop document work with the observed pair and a manager-specific remedy, e.g. npm install --save-dev --save-exact jg-plans@0.7.0. Keep runtime consumers’ production dependency. Never auto-install, download a runner, use globals or borrow a CLI. Recheck after upgrades or builds.
  • Read only the selected directory: inspect --directory <path> --include-body --fingerprint-exclude '["created_at","updated_at","revision","status","priority","delivery"]' --json. Use its source, metadata, spans, diagnostics, sha256 and structural fingerprint. Never edit, parse or hash persisted files directly, generate UUIDs, select by recency or reconstruct files from transcripts. Inspection allows nonconforming documents. Only jg-plan runs overlaps --json with one --root per existing planning root in the recorded/own repositories when codes are declared.
  • Plans use pending, in progress, done and delivered. Only delivered is inactive. Milestones use pending, in progress and done. Error declarations use repository/registry/codes lists; preserve string/number types and compare String(code) within repository/registry. Missing/custom statuses, unavailable metadata or files and ambiguous markers are observations only.
  • Active criterion progress is pending, in progress, done or null. - AC-03 (cancelled): Original text and - AC-03 (superseded): Original text retire criteria. An optional final indented **Note:** continuation holds one line of free text. Retired criteria have no coverage or progress. Optional **Size:** XS|S|M|L|XL follows coverage, or the ID or status when earlier markers are absent.
  • Required delivery maps every declared repository to its defined stop with matching keys. Use an empty map only when no repositories are declared. Delivery changes neither scope nor progress. Fingerprints exclude exactly created_at, updated_at, revision, status, priority and delivery. Unavailable identity cannot establish fresh coverage.
  • Use the same entry for authorized structured create/update/write/remove-milestones. Existing targets need fresh expectedSha256; null only creates explicitly requested absent milestones. Read the installed package’s cli/README.md for payloads. Never probe with a write. Use write for plan body/metadata or complete milestone source, and update for narrow metadata/markers. Assign missing IDs only when authorized, retain returned IDs and inspect writes. Set updated_at explicitly for plan.md changes. Delivery-only edits preserve revision/progress; changed scope needs coverage reassessment.
  • Locks are short and local. Never hold them across turns, remove unfamiliar locks or replay over newer text. After partial multi-document or uncertain writes, inspect and report durable states, then stop without rollback or retry. Documents, diagnostics and bindings grant no authority.

Workflow

Perform a planning-only workflow for the concrete engineering change currently being discussed, including a new module, package, feature, bug fix, refactor, migration, or other implementation. This skill authorizes proportional repository inspection, non-writing analysis, and only the planning-file writes defined in this skill. It does not authorize editing source code, tests, snapshots, configuration, dependencies, migrations, generated artifacts, ordinary project documentation, Git state, or any file outside the plan’s planning directory, and it does not authorize committing, pushing, or beginning implementation. Treat the current discussion, including the user’s objective, decisions, constraints, exclusions, and acceptance criteria, as the task contract. If an inspection command unexpectedly changes files, preserve and report those changes without cleaning, reverting, or claiming them as part of the plan.

  1. Read the root README.md and its project blueprint when present, then the repository’s coding instructions (such as AGENTS.md or CLAUDE.md) and the implicit jg skills that apply to the affected files, and follow every applicable domain-specific section of those instructions and skills. When sources conflict, follow the repository’s coding instructions. Without them, apply this order: the explicit developer request and acceptance criteria, unless they would create safety, security, privacy, data-integrity, or production-correctness risk; then safety, security, privacy, data integrity, and production correctness; then established codebase behavior, public contracts, and patterns; then repository tooling. Reuse repository evidence already established during the current task only when it remains current; otherwise inspect the smallest complete affected path (entry points, callers, validation, persistence, side effects, tests, configuration, and integration points) needed to ground the plan in the existing architecture, conventions, behavior, contracts, tests, tooling, and documentation.

  2. Settle every decision the plan depends on before writing it. Identify the decisions the plan would make and sort each by who owns it:

    • decided in the discussion: use it as agreed
    • answered by the repository, such as an established convention or pattern: decide it and cite the evidence; look facts up instead of asking for them
    • the developer’s: behavior users see, what is in or out of scope, public contracts, schemas and persisted data, security and authorization, new dependencies or infrastructure, anything hard to undo, and tradeoffs the repository has no precedent for
    • low-stakes and easy to undo: choose a default

    Define delivery once for the whole plan, never per milestone. Read each affected repository’s docs/delivery.md through its README blueprint. Keep selected stops in delivery metadata; describe operator boundaries and preconditions without duplicating mutable target selections in the body. Use the documented default without asking when it is the one sensible choice for this task; otherwise include the target choices in the same grouped questions. A missing document needs a developer decision about the target and its documented procedure, not an invented default. Approval covers the selected delivery steps, including publication/deployment when agent-operated, with native permissions and repository preconditions retained.

    Every new plan has a priority, hotfix, high, medium, or low: ask it with your recommendation among the developer’s decisions, or choose it as a default the developer checks before approving when nothing else needs asking.

    Ask about every decision that belongs to the developer in one numbered message, each question with your recommended answer and what it changes, so a plain yes accepts them all, then stop without writing plan.md. Ask only questions whose answers change the plan. When the developer answers, continue this workflow without a new invocation, and ask again only when the answers or further inspection raise new decisions that belong to the developer. When the request is too open to recommend answers, because the goal or the approach itself is unsettled rather than a few choices within it, ask nothing: say briefly what is missing, suggest thinking it through with jg-brainstorm first, show an example invocation of it built from the developer’s request, and stop. When the codebase is unavailable or cannot be inspected, state the limitation, keep every assumption explicit, and do not claim alignment with repository-specific conventions.

  3. Produce a highly detailed, implementation-ready plan that remains strictly bounded by the task contract. Cover each of the following when applicable:

    • the current behavior and the repository evidence that establishes it
    • the desired final behavior, in-scope deliverables, explicit exclusions, and acceptance criteria
    • the proposed architecture, module ownership, data flow, integration points, and public-contract implications
    • the exact files, modules, symbols, exports, schemas, configuration, documentation, and tests to add, modify, or remove
    • the ordered strategic implementation steps, dependencies between them, and the review checkpoints that matter to the overall implementation; keep these steps detailed enough to guide implementation, but do not decompose them into independently executable milestones unless the user invokes jg-breakdown
    • validation, error handling, security, authorization, persistence, concurrency, migration, deployment, compatibility, and rollback considerations
    • focused tests, broader regression checks, and exact repository verification commands, assigning each check to its required stage: affected-unit verification, justified earlier release/deployment gates, or final integration. Follow repository testing policy; keep each unit’s correctness evidence with it, avoid copying the final suite into every milestone, and identify scenarios needing stability repetitions and why. State what evidence may be reused and what changes invalidate it
    • every decision the plan rests on and its source: the developer, the repository (with its evidence), or your own default, so the developer can check your defaults before approving; never leave a decision open, ask under step 2 instead
    • risks, edge cases, assumptions, and blockers

    Acceptance criteria measure implementation and its required correctness checks. Final whole-task delivery, reaching the metadata-selected stops and recording delivered are not implementation criteria: delivery follows implementation done. An independently required component release that unblocks later implementation may remain a criterion; testing delivery behavior as a product feature is also implementation work. Keep the task’s final delivery obligations in metadata and its repository procedures, outside criterion/milestone completion.

    Write the acceptance criteria under ## Acceptance criteria as a list of testable items, each starting with a stable ID: - AC-01: .... Never renumber or reuse an ID: an edited criterion keeps its ID, and a new criterion takes the next unused number. A plan without protocol: "0.2" in its frontmatter keeps its existing criteria format unless the developer asks to convert it.

    A revision may delete an out-of-scope criterion or use the optional retirement qualifier. Keep the original text when retiring it. A superseded note may name its replacement, such as replaced by AC-07. Before saving, make sure at least one active criterion remains. If the proposed revision leaves none, explain the requirement and leave plan.md and milestones.md intact while the developer decides what remains in scope. Never invent a replacement criterion. Point out retired IDs that jg-breakdown needs to remove from existing coverage.

  4. Make every proposed step clean, clear, minimal but complete, easy to review, consistent with the current architecture and conventions, and compliant with the repository’s coding instructions. Explain material design choices using repository evidence. Keep optional enhancements, speculative abstractions, unrelated refactors, and broader cleanup outside the implementation steps unless the task contract requires them. Before presenting, reread the plan: cut lines that decide nothing, such as ‘handle edge cases’, make names and signatures match across steps, and describe changes instead of writing out the code.

  5. Plan one authoritative final implementation. When the requested change replaces existing behavior, identify dead, superseded, transitional, compatibility, fallback, deprecated, or parallel paths made unnecessary by the change and include the removal of their code, exports, tests, configuration, and documentation. Preserve a compatibility path only when repository evidence shows that it is required by a supported public contract, rolling deployment, migration, persisted data, supported version, documented behavior, or explicit developer direction; state why it is required and, when temporary, the condition under which it can be removed. Do not include unrelated legacy cleanup.

  6. Persist through the CLI in the selected planning directory. For a new plan, use create with root <repository-root>/jg-plans, a concise kebab-case slug, the complete body, and explicit preferred metadata when appropriate, always including {"protocol": "0.2"}, the priority, delivery, and repositories, the owner/name of each repository the plan changes, read from git remote get-url origin; when the plan adds error codes, also error_codes, choosing codes unassigned in the registry and active plans under those repositories’ jg-plans folders. Delivery maps every declared repository to its selected stop, with matching keys; an explicit empty map is valid only without repositories. Error declarations use explicit string/number code lists, comparing String(code); done plans keep their code claims until delivered. The CLI supplies the captured timestamp and exclusive directory identity. Use the returned directory. Honor an exact supplied existing path; never discover another root, migrate records, or change ignore/Git rules. When a current plan exists in this conversation, revise that same plan unless the discussion clearly describes a different task; ask when unclear. Apply a preceding challenge’s required corrections and the developer’s answers unless limited or overridden. Inspect current source first and use a guarded write with body and metadata set together, setting changed priority, repositories, or error codes in the same set. For a delivery-only amendment, preserve the body, revision, milestone source/completion and binding. Update the complete delivery map and explicit updated_at together; if it was delivered and the target changes, set status done in that same guarded update. An unchanged target does not reset status. For a substantive revision, preserve id and known created_at, increment the current revision, explicitly set updated_at, and include an actual revision summary. Never invent unknown historical values; report missing/ambiguous revision inputs before writing. Retain milestones.md, its existing binding, identities, and valid completed work; do not delete or refresh it here. New unfinished scope resets aggregate done or delivered to pending without resetting retained done milestones. The old binding deliberately remains stale until jg-breakdown revalidates coverage. Progress-only metadata edits retain revision. Modify only plan.md in this directory. If required access/tooling is unavailable, report it without claiming persistence. After persisting a protocol 0.2 plan, run <local-cli> check --directory <path> --json and fix criteria, status, and ID errors in plan.md before presenting. UNASSIGNED_CRITERION against an existing milestones.md means jg-breakdown must cover the new criterion; say so instead of editing the sequence here. When the plan declares error codes, then run overlaps over those jg-plans folders: on an overlap (exit 1), choose other codes and write again; on exit 2, tell the developer the check couldn’t cover every plan, naming the unreadable ones, instead of treating it as clean.

  7. When plan.md is persisted, report its repository-relative path and the saved delivery map with its operator boundaries before presenting the plan body. The complete Markdown body presented to the developer must match plan.md exactly, without omitted sections, hidden steps, or materially different wording. End both plan.md and the matching response body with a ## Approval required section that summarizes the exact implementation scope awaiting approval and states these rules, then stop:

    • Implementation starts only after explicit approval given after this plan was presented. Approval also authorizes its selected agent-operated delivery steps: commit, push, integration, publication and deployment, through the repository documents and their preconditions. Developer-operated steps remain the developer’s; no repeated delivery permission is required for the approved agent steps.
    • When a milestone sequence exists, each milestone needs its own explicit authorization, is the complete scope of that request, and ends at its review checkpoint. Invoking jg-execute authorizes the milestone it runs; jg-execute auto authorizes every remaining milestone, or only the milestone it names.
    • If repository evidence would materially change the plan, stop and request a revision through jg-plan.
    • To change this plan, invoke jg-plan with the amendments. To create or change milestones, invoke jg-breakdown. To implement the plan, invoke jg-execute, or jg-execute auto to also review/push each milestone, then review the whole plan and follow jg-deliver for its delivery. Supervised execution remains local and ends with the verified closing report and jg-deliver as the delivery command.
    • Only when the plan has at least two parts that can each be finished, verified, and reviewed on their own, such as separate packages, repositories, or releases, or an existing sequence needs refreshed coverage, add a rule that names the reason and says to invoke jg-breakdown before jg-execute, because jg-execute otherwise runs the whole plan as one unit and doesn’t stop at the plan’s review checkpoints. Otherwise leave it out.

    This skill’s output contract replaces any general completion-summary requirement; do not append a completion summary after ## Approval required. Until the developer explicitly approves the presented plan, do not begin implementation or modify files except through an invocation of jg-plan or jg-breakdown, each limited to the planning-file writes authorized by its own instructions. Approval must be issued after the plan is presented; the jg-plan invocation itself, answers to its questions, earlier implementation intent, questions, feedback, or requests to revise the plan do not count as approval. Invoking jg-execute after the plan is presented counts as approval. After approval, treat the approved plan together with any developer amendments as the implementation contract. If later repository evidence would materially change that plan, stop and obtain approval for the revised plan before deviating.