MINE Plan Create
Create an implementation-ready plan from requirements, current repository evidence, the architecture source of truth, and freshly verified external documentation.
A completed plan is an executable engineering contract, not a brainstorm, backlog, generic checklist, or restatement of the user's request. Make it precise enough that a weak implementation agent can execute it without inventing product decisions, interfaces, algorithms, file ownership, tests, or verification commands.
Integration: MCP tools and CLI fallback
mine-plan-create registers and queries plans through two paths, in this
order of preference:
- MCP tools (preferred) - when the current Agent runtime exposes the
MINE MCP server (
mine mcp serve), call the typed MCP tools. They return
the same DTOs as the JSON CLI and never touch the execution-graph files.
- JSON CLI (deterministic fallback) - when MCP is unavailable, call
mine --format json commands. Never parse human output.
Never invent an MCP tool, CLI command, flag, JSON field, or lifecycle
transition that the current binary does not expose. Never edit
docs/plan/execution-graph.toml or docs/plan/execution-graph.md directly.
The accepted MCP tools mine-plan-create may use:
mine_graph_status (no arguments) - read the current revision, branches,
and plan count (carry data.revision as the expected revision on writes).
mine_graph_validate (no arguments) - validate the graph after registration.
mine_graph_ready (no arguments) - read the ready frontier.
mine_plan_show (id) - look up a plan node.
mine_design_readiness (scope?) - verify that applicable planning-blocking
ADRs and the detailed Design are ready for the requested scope.
mine_adr_show (id) / mine_adr_list / mine_adr_validate - inspect the
digest-bound ADR registry before planning.
mine_plan_add (id, path, title, design_references,
exclusive_write_paths?, hard_predecessors?, planning_scope?) -
register a new DRAFT plan node. planning_scope (ADR-0013) is the
non-empty scope recorded immutably on the node; when omitted, the node
records the configured design root directory (for this repository,
docs/design).
mine_design_validate (no arguments) - confirm design references resolve.
Operations mine-plan-create needs that are intentionally CLI-only (no
MCP tool exposes them, because they are release-gate transitions outside the
registered-add path):
mine plan release --id <id> --format json - move a newly registered
DRAFT plan into the startable frontier (DRAFT -> READY or BLOCKED).
There is no MCP tool for release; mine_plan_add always creates DRAFT,
so release is a mandatory CLI fallback after registration. Release re-runs
planning readiness for the node's persisted planning_scope and records
readiness_checked_at and adr_registry_revision as audit evidence
(ADR-0013); pass --planning-scope <scope> to mine plan add when the
plan's scope differs from the design root.
mine plan withdraw --id <exact-stored-id> --reason <reason> --format json - retire a stale unstarted (DRAFT/BLOCKED/READY) registration
(ADR-0012; CLI only). Use it instead of re-planning over obsolete
registrations; it never applies to a started Plan.
mine workspace open|close - ephemeral plan-workspace lifecycle (CLI only).
When a required operation has no MCP tool, fall back to the JSON CLI and state
the fallback explicitly.
Canonical identity and readiness gate
Before registering a Plan, require mine design readiness --scope <scope>
through the read-only MCP equivalent when available. Stop and report every
applicable unresolved planning-blocking ADR; do not propose or infer approval.
Allocate or validate one canonical ID matching
planNN(?:-NN)*(?:-CNN)?, with two-digit numeric segments and an uppercase
C compensation suffix only at the end. The filename must be exactly
docs/plan/<id>-<lower-kebab-slug>.md; compensation Plans use the next
contiguous sibling C ordinal in the same lineage. Do not register legacy
IDs or create aliases. Use the actual binary's validation error as the
authoritative diagnostic when an ID or path is invalid.
Required repository artifacts
Use these exact repository paths unless an existing repository convention is stricter:
- Design knowledge base root:
docs/design/index.md (progressive disclosure; MINE owns docs/design/)
- Execution plans:
docs/plan/
- Execution graph machine source:
docs/plan/execution-graph.toml
- Generated graph view:
docs/plan/execution-graph.md
- Implementation and review reports:
docs/plan/reports/
- Repository working agreement: root
AGENTS.md
Read the bundled templates before producing artifacts:
- Plan template
- Execution graph template
- Parallel execution protocol template
Do not reference a bundled or repository file unless it actually exists. Links in a completed plan must resolve to a real local path or a real external URL that was opened and verified during this run.
Non-negotiable rules
- Inspect the actual repository evidence relevant to the requested scope before designing. For an explicit-scope invocation, inspection is proportional to that scope.
- Inspect the Design relevant to the requested scope deeply, not just its headings or search snippets. Respect accepted architecture by default; do not broaden into unrelated Design leaves.
- Perform real web search and open the authoritative pages during every substantive planning run, bounded to the requested scope and its real dependencies.
- Prefer official documentation, standards, specifications, source repositories, release notes, and primary research over secondary summaries.
- Record verified links and the exact claim each source supports inside the plan.
- Never finalize an implementation-ready plan when required web research or page fetching is unavailable. Report the missing research capability and leave the plan explicitly
DRAFT or do not create it.
- Respect accepted architecture and Design by default. Inspect SOLID concerns (ownership, dependency direction, new abstraction/interface/component boundaries) only when the requested scope actually crosses a boundary or introduces such a structure. Do not use a plan to silently redesign the system.
- If the target work requires an architecture change, update the
docs/design/ knowledge base first (the affected leaf/index), then make the plan cite the updated design paths and anchors. If planning reveals a material Design gap, stop that portion and route the decision back to mine-arch; do not silently solve it inside the Plan.
- Do not preserve obsolete implementations merely because an earlier plan created them. Unless the user explicitly requires compatibility, change the target implementation directly and schedule cleanup of superseded fields, interfaces, parameters, adapters, migrations, aliases, and shims.
- Preserve unrelated user changes and never invent evidence, commands, files, APIs, tool names, test results, or external behavior.
Scope-first principle
mine-plan-create is scope-first, research-backed, evidence-on-demand:
- Explicit user scope is the authoritative planning boundary. When the
invocation names a requirement, component, previous discussion, Design
change, or implementation target, treat that scope as authoritative. Stay
within it: inspect only the Design, code, tests, configuration, graph
state, reports, and external material needed to make that scope
executable. Do not broaden into unrelated repository areas, audit
unrelated Design leaves, or inspect unrelated accepted reports. Uncertainty
inside the scope may expand evidence collection.
- Bare invocation may enter discovery mode. A bare invocation with no
explicit planning target may perform broader discovery to identify the next
unplanned or actionable Design work - but prefer the smallest coherent
planning frontier. Do not turn every bare invocation into an unconditional
full-repository audit.
- Research stays mandatory and scope-bounded. See Phase 4.
Phase 1: Establish the planning mode
Classify the request before editing:
Explicit-scope mode (primary)
The user supplied a concrete scope. In this mode:
- Resolve the scope: restate the concrete target (requirement, component,
Design change, discussion topic) from the invocation.
- Read the relevant accepted Design (the leaves and necessary parent/index
context that govern the scope) - not the whole tree.
- Inspect the relevant implementation, tests, configuration, graph state,
and predecessor reports only when they materially affect the requested
work.
- Perform mandatory scope-bounded external research (Phase 4).
- Create precise Plan(s) for that scope; register and release them.
Do not: audit unrelated modules, reread the entire Design tree, inspect every
accepted report, research unrelated technologies, or perform a ceremonial
repository-wide review.
Bare-invocation discovery mode
No explicit planning target. In this mode, broader discovery is allowed to
identify what should be planned next:
- Inspect current Design and the execution graph frontier.
- Consider recent accepted work and repository state relevant to the next
unplanned or actionable Design work.
- Identify the smallest coherent planning frontier and plan that.
Zero-plan / initial architecture mode
Treat the repository as zero-plan when one or more of these are true:
- no accepted execution plans exist;
- the execution graph does not exist or contains no accepted baseline;
- architecture is absent, skeletal, contradictory, or not grounded in current code;
- the user is establishing the first implementation sequence for a new project.
In zero-plan mode:
- Ensure
mine-arch has produced or refreshed the architecture source of truth and repository quality gates.
- Prefer multiple bounded research agents in parallel when the host supports subagents, teams, delegation, or isolated agent sessions.
- Research the system broadly enough to establish a coherent baseline before decomposing implementation.
- Produce the initial execution graph and identify the smallest useful accepted baseline.
- Maximize safe parallelism, but do not parallelize unresolved shared contracts or files with unclear ownership.
Incremental mode (within any of the above)
In an established repository with an accepted baseline:
- Identify the accepted baseline and the target plan frontier for the scope.
- Inspect the architecture, reports, interfaces, and code touched by the requested change - not unrelated areas.
- Detect whether the request is a new feature, direct correction, refactor, migration, cleanup, or compensating plan.
- Do not revise an immutable handed-off or executed plan. Update architecture and create a new next-numbered compensating plan only for a
substantial correction (material Design change, replaced core approach, a new independent work package, or major scope expansion). A narrow,
local, fully-verifiable correction — including one discovered during independent review or during release closure — is the reviewer's or
executor's direct fix, documented in its own report, not a new plan. Do not create a plan merely to preserve reviewer/implementer role
purity.
When an immutable IN_PROGRESS Plan is objectively infeasible, do not edit,
replace, or pretend to complete it. Planning may define the approved
stored-anchor/schema recovery and the later compensation sequence only after
Design and any material ADR decision authorize that stored-anchor schema recovery. The stopped
Plan remains frozen until an independent reviewer records canonical evidence
and uses the bounded active-rejection transition; only then register the next contiguous sibling compensation and reuse the existing lineage worktree.
Phase 2: Gather evidence proportional to scope
Read, in order, only what the requested scope requires:
- User requirements and supplied artifacts (the explicit scope is authoritative).
- Root
AGENTS.md.
- The Design leaves governing the requested scope, plus the necessary parent/index context - not the whole tree. In discovery mode, read the index and relevant frontier leaves.
- Query the execution graph through the final
mine MCP tools or mine --format json; use the generated Markdown only as a readable view.
- Predecessor plans and implementation/review reports only when they materially affect the requested work.
- Manifests, lockfiles, toolchain files, CI, deployment files, and Git status relevant to the scope.
- Relevant source code, tests, schemas, and generated artifacts for the scope.
- Current official documentation and best practices fetched from the web (scope-bounded; see Phase 4).
Do not require by default: reading the entire Design tree; reviewing every
accepted Plan or report; auditing every manifest, CI file, deployment file, or
unrelated subsystem; or repository-wide evidence matrices. Expand repository
inspection only when a concrete planning question requires more evidence.
Keep these categories visibly separate:
- current implemented reality;
- accepted architectural target;
- new requested target;
- assumptions;
- unresolved material decisions;
- bounded local implementation decisions.
An evidence matrix is optional and scope-scaled: include one when the scope
spans several areas or subsystems; do not produce a repository-wide matrix by
default.
Phase 3: Parallel research (optional, scope-scaled)
When parallel agents are available and the requested scope genuinely spans
several independent research questions, assign bounded research lanes with
explicit questions and expected output. Useful lanes include:
- Repository reality for the scope.
- Architecture boundaries, ownership, and lifecycle relevant to the scope.
- Official framework/library/API documentation and version constraints.
- Data model, transactions, concurrency, consistency, and migrations relevant to the scope.
- Security, privacy, authorization, secrets, and failure handling relevant to the scope.
- Toolchain, static checks, tests, CI, build, deployment, and observability relevant to the scope.
- Parallel execution decomposition and shared-file collision analysis.
Each lane must return evidence, source links, concrete implications, unresolved decisions, and risks. Synthesize the results yourself; do not paste mutually contradictory subagent reports into the plan.
A single coherent scope does not require parallel lanes. When the host cannot run subagents, perform the needed research sequentially. Do not name or invoke a tool that the host does not expose.
Phase 4: Mandatory external research (scope-bounded)
External research is mandatory for every substantive planning run and is
part of MINE's engineering discipline. It is also bounded to the requested
scope: search for the external technologies, protocols, standards,
services, or architecture patterns the requested scope depends on - not
unrelated repository subsystems.
Research should answer questions such as:
- How is this problem normally solved in mature systems?
- Is there already a standard abstraction, protocol, pattern, or library for this?
- What do the official framework or platform docs recommend?
- How do mature open-source projects implement the same mechanism?
- What failure modes are already well known?
- What implementation conventions should be followed instead of inventing a local mechanism?
The purpose is not to satisfy a documentation ritual: it is to avoid
closed-world design and unnecessary invention. Research compares established
approaches (concurrency control, transactional outbox, retry/backoff,
idempotency, auth/session lifecycle, migration strategies, locking models,
worker scheduling, state machines, test isolation, configuration ownership,
and similar) - not merely to verify API syntax.
For example, a Passkey-login scope reasonably includes WebAuthn/Passkey
standards, the selected framework's integration guidance, credential and
challenge lifecycle, and known security/compatibility constraints - but does
not justify researching unrelated storage, CI, deployment, or observability
subsystems unless the scope actually depends on them.
For each source:
- Open the actual page; do not rely on a search-result snippet.
- Confirm it applies to the repository's selected version or current supported version.
- Record the page title, organization, URL, date accessed, verified claim, and concrete design or implementation implication.
- Prefer sources in this order:
- official product/framework documentation;
- normative standards and specifications;
- official source repositories, examples, release notes, and migration guides;
- primary research;
- reputable secondary sources only when primary material is insufficient.
- Record conflicting guidance rather than hiding it.
- Never cite a source that was not opened.
The plan must contain a Research source register. A raw list of links is insufficient; every link must support a specific plan decision, step, test, or risk.
Responsibility boundary with mine-arch
mine-arch owns: requirements interpretation; target architecture;
durable engineering decisions; component boundaries; public contracts;
important data, lifecycle, security, consistency, deployment, or ownership
decisions; changing accepted Design.
mine-plan-create owns: turning accepted Design into executable
implementation work; resolving bounded implementation details;
decomposing work; determining dependencies and write scopes; defining
verification; identifying safe parallelism.
- If planning reveals a missing decision that materially changes product
behavior, architecture, public API, persistent data semantics, a security,
ownership, or compatibility boundary, deployment topology, or another
durable engineering contract: stop planning that portion and route the
decision back to
mine-arch. Do not silently solve it inside the Plan.
- Research may validate accepted Design, refine implementation details, or
reveal risks and incompatibilities - but it must never silently replace
accepted Design because another project or article uses a different
approach. If research shows accepted Design is materially wrong or
incomplete, report the conflict and return that decision to
mine-arch.
Phase 5: Resolve decisions
Ask the user before finalizing when a decision materially changes any of these:
- product behavior or scope;
- architecture style or component ownership;
- persistent data model, migration, or rebuild policy;
- public API, event, file format, model/tensor, prompt, or tool contract;
- authorization, privacy, safety, secret, or trust boundary;
- compatibility requirements;
- deployment topology, external mutation, cost boundary, or operational responsibility;
- acceptance criteria.
Do not interrupt for bounded implementation choices that do not change those contracts. Resolve such choices using current architecture, official documentation, repository convention, and the smallest maintainable design. Record them under Local decisions made by the planner.
Phase 6: Architecture gate (conditional, no checklist theater)
Respect accepted architecture by default. Before writing implementation steps, verify traceability from the requested scope to its governing architecture, and inspect deeper only when the scope actually crosses a boundary or introduces a new abstraction/interface/component/dependency structure:
- ownership and dependency direction for the affected boundary;
- state ownership, lifecycle, idempotency, concurrency, retries, and failure semantics for the affected component;
- no duplicate source of truth in the new structure;
- no speculative abstraction or interface with only imagined consumers;
- SOLID concerns (Single Responsibility, Open/Closed, Liskov, Interface Segregation, Dependency Inversion) applied to newly introduced or changed abstractions, not as a repository-wide checklist.
Do not require a full SOLID checklist or a repository-wide architecture audit on every Plan. Inspect architecture more deeply when the requested scope crosses a real boundary; check ownership/dependency direction when affected; check SOLID concerns when a new abstraction, interface, component boundary, or dependency structure is actually being introduced or changed.
If the accepted design knowledge base cannot support the request cleanly, update the relevant docs/design/ leaf/index first (or route the decision to mine-arch when it is a material gap). Include exact design paths (and anchors where applicable) in the plan.
Phase 7: Design for parallel execution
When any plan contains parallel implementation lanes, create or update docs/plan/parallel-execution-protocol.md from the bundled template. The protocol is a repository scheduling contract and must name reserved shared files, lane ownership, integration ownership, and duplicate-owner prevention.
Maximize useful parallelism so multiple agents can work efficiently without corrupting shared contracts.
- Build a dependency DAG of work packages.
- Separate contract-defining work from independent implementation work.
- Identify parallel groups and explicit join gates.
- Give each work package a single owner and a non-overlapping primary file scope.
- Assign a single serial owner for shared root files and high-conflict artifacts, including as applicable:
- package manifests and lockfiles;
- workspace configuration;
- central dependency-injection registries;
- database migrations and generated schemas;
- root lint/test configuration;
- shared API specifications and generated clients;
- execution graph and reports.
- State which files an agent may edit, may read but not edit, and must not touch.
- Define the artifact each package hands to downstream packages.
- Define integration order and exact join verification.
- Use isolated branches/worktrees when available. If agents share one worktree, serialize all overlapping files and root configuration changes.
Parallelism is not a goal when it causes duplicated work, conflicting schemas, premature stubs, fake interfaces, or repeated lockfile churn.
Phase 8: Write the executable plan
Create one realistically sized plan for the next coherent increment under docs/plan/ using a numbered kebab-case name, for example:
docs/plan/03-session-storage-and-recovery.md
Use the bundled plan template. Every work package and implementation step must specify:
- purpose and governing architecture sections;
- prerequisites and accepted upstream evidence;
- exact target files, directories, symbols, interfaces, schemas, or generated artifacts;
- current behavior and required final behavior;
- input, output, error, lifecycle, transaction, concurrency, and security semantics;
- algorithm or state transition where non-trivial;
- configuration and dependency changes;
- deletions and cleanup of superseded implementation;
- edge and failure cases;
- deterministic tests and fixtures;
- exact narrow verification commands and broader integration gates;
- expected observable outcome, not merely “tests pass”;
- artifacts delivered to downstream work;
- suggested cohesive commits.
A step such as “implement the service,” “add tests,” “update the API,” or “follow best practices” is invalid unless expanded into concrete files, contracts, behavior, cases, and verification.
Do not guess physical database columns, API responses, source document fields, runtime tool names, framework options, or command flags. Verify them first or mark the plan DRAFT with the exact missing evidence.
Phase 9: Quality and verification matrix
Use the actual project quality gates defined by architecture and AGENTS.md. Do not impose Python-only tools on Go, TypeScript, Rust, or mixed-language projects.
The plan must include a verification matrix:
| Scope |
Command |
Preconditions |
Expected evidence |
Owner/work package |
Cover as applicable:
- formatter and formatting check;
- linter and static analysis;
- type checking;
- unit, integration, contract, migration, end-to-end, security, and smoke tests;
- generated artifacts and schema drift;
- build/package/container validation;
- deployment configuration validation;
- runtime probes for lifecycle, concurrency, error paths, and recovery;
git diff --check and explicit changed-file audit.
Never label an unrun command, timeout, unavailable dependency, ignored diagnostic, or non-zero result as passing.
Phase 10: Register the plan through MINE
Do not edit docs/plan/execution-graph.toml or docs/plan/execution-graph.md directly. After the plan document is complete:
- Read the current graph revision: call
mine_graph_status (MCP) or mine graph status --format json (CLI fallback). The envelope's data.revision
is the current revision; carry it as expected_revision on the write.
Before the registration write, run scoped design readiness and confirm the
requested canonical Plan ID/path. A failed readiness check is a planning
blocker, not permission to register a DRAFT node.
- Register the plan: call
mine_plan_add (MCP) with id, path, title,
design_references, and optional exclusive_write_paths /
hard_predecessors; or mine plan add --format json (CLI fallback) with
--id, --path, --title, at least one --design-ref, and any --write
/ --hard (repeat for multiple values). Registration always creates a
DRAFT node.
- Release the plan (CLI-only - no MCP tool exposes release): call
mine plan release --id <id> --format json to move the new DRAFT node
into the startable frontier (DRAFT -> READY when every hard predecessor
is ACCEPTED; DRAFT -> BLOCKED otherwise). This is a mandatory CLI
fallback because mine_plan_add always creates DRAFT.
- Validate the graph: call
mine_graph_validate (MCP) or mine graph validate --format json (CLI fallback) after registration and release.
- Report the returned revision before/after and the new plan's status
(
DRAFT, READY, or BLOCKED).
The accepted MINE CLI and MCP tools read the current revision themselves
before mutating under the lock, so an explicit expected_revision argument is
not required; every mutation envelope emits revision_before/
revision_after. Never parse human output. Never edit the graph files
directly. If the installed command contract differs from this draft, use the
actual implemented contract and update this Skill before release.
Final review gates
Before finishing, verify all of the following:
- The cited
docs/design/ leaves/anchors exist and every cited section is real.
- Architecture changes were made before the dependent plan; material Design gaps were routed back to
mine-arch, not silently solved.
- Mandatory scope-bounded web research was completed using opened authoritative pages.
- Every external link is real, current enough for the decision, and tied to a claim.
- The plan does not contain a dead local reference.
- Accepted architecture is respected; SOLID/speculative-abstraction concerns were checked where the scope actually introduces or changes a boundary.
- Current reality, target design, assumptions, and decisions are separate.
- Every work package has explicit ownership, file scope, dependencies, output, tests, and join gate.
- Shared files have one serial owner.
- Parallel groups are safe rather than merely numerous.
- Every implementation step is concrete enough to execute without rediscovering design decisions.
- Language-specific checks come from the repository's architecture and actual toolchain.
- Obsolete implementation is removed or explicitly scheduled for removal; no accidental compatibility debt is introduced.
- MINE successfully registered the plan and the validated graph accurately represents dependencies and status.
- No handed-off or executed immutable plan was rewritten.
- No unrelated files are modified or staged; the invocation scope was respected.
Finish with the created or updated architecture sections, plan path, graph status, parallel groups, unresolved gates, and the exact next executable work packages. Do not claim readiness when any required evidence is absent.
Shared toolchains and Plan-isolated mutable outputs
Reuse Root-managed toolchains, dependency downloads, virtual environments, and
only caches proven read-only or safely content-addressed. Do not create a
second .venv, venv, target, node_modules, or equivalent environment or
cache directory in a linked Plan worktree.
Mutable build, test, generation, coverage, packaging, and runner outputs must
use <Root>/.mine/build/<plan-id>/<tool-or-output-class>/. For Rust, set
CARGO_TARGET_DIR to the exact Plan namespace, for example
<Root>/.mine/build/<exact-plan-id>/cargo-target; never use Root target or a
worktree-local target. If a measured output is predictably very large,
record the estimate and pause for explicit owner agreement on serialization,
a coarser exclusive namespace, and cleanup; never fall back automatically to a
globally shared mutable directory.
1---2name: mine-plan-create3description: Create or update an evidence-backed, architecture-governed software implementation plan that is precise enough for independent coding agents to execute without rediscovering design decisions. Scope-first: an explicit user scope defines the planning boundary; research-backed: substantive planning requires mandatory scope-bounded web research comparing established practice; evidence-on-demand: repository inspection is proportional to scope. Use for initial project planning, incremental features, refactors, migrations, agent workflows, data/retrieval/tool contracts, or compensating plans. Routes material Design gaps back to mine-arch; never silently overrides accepted Design.4---56# MINE Plan Create78Create an implementation-ready plan from requirements, current repository evidence, the architecture source of truth, and freshly verified external documentation.910A completed plan is an executable engineering contract, not a brainstorm, backlog, generic checklist, or restatement of the user's request. Make it precise enough that a weak implementation agent can execute it without inventing product decisions, interfaces, algorithms, file ownership, tests, or verification commands.1112## Integration: MCP tools and CLI fallback1314`mine-plan-create` registers and queries plans through two paths, in this15order of preference:16171. **MCP tools (preferred)** - when the current Agent runtime exposes the18 MINE MCP server (`mine mcp serve`), call the typed MCP tools. They return19 the same DTOs as the JSON CLI and never touch the execution-graph files.202. **JSON CLI (deterministic fallback)** - when MCP is unavailable, call21 `mine --format json` commands. Never parse human output.2223Never invent an MCP tool, CLI command, flag, JSON field, or lifecycle24transition that the current binary does not expose. Never edit25`docs/plan/execution-graph.toml` or `docs/plan/execution-graph.md` directly.2627The accepted MCP tools `mine-plan-create` may use:2829- `mine_graph_status` (no arguments) - read the current revision, branches,30 and plan count (carry `data.revision` as the expected revision on writes).31- `mine_graph_validate` (no arguments) - validate the graph after registration.32- `mine_graph_ready` (no arguments) - read the ready frontier.33- `mine_plan_show` (`id`) - look up a plan node.34- `mine_design_readiness` (`scope`?) - verify that applicable planning-blocking35 ADRs and the detailed Design are ready for the requested scope.36- `mine_adr_show` (`id`) / `mine_adr_list` / `mine_adr_validate` - inspect the37 digest-bound ADR registry before planning.38- `mine_plan_add` (`id`, `path`, `title`, `design_references`,39 `exclusive_write_paths`?, `hard_predecessors`?, `planning_scope`?) -40 register a new `DRAFT` plan node. `planning_scope` (ADR-0013) is the41 non-empty scope recorded immutably on the node; when omitted, the node42 records the configured design root directory (for this repository,43 `docs/design`).44- `mine_design_validate` (no arguments) - confirm design references resolve.4546Operations `mine-plan-create` needs that are intentionally **CLI-only** (no47MCP tool exposes them, because they are release-gate transitions outside the48registered-add path):4950- `mine plan release --id <id> --format json` - move a newly registered51 `DRAFT` plan into the startable frontier (`DRAFT` -> `READY` or `BLOCKED`).52 There is **no MCP tool for release**; `mine_plan_add` always creates `DRAFT`,53 so release is a mandatory CLI fallback after registration. Release re-runs54 planning readiness for the node's persisted `planning_scope` and records55 `readiness_checked_at` and `adr_registry_revision` as audit evidence56 (ADR-0013); pass `--planning-scope <scope>` to `mine plan add` when the57 plan's scope differs from the design root.58- `mine plan withdraw --id <exact-stored-id> --reason <reason> --format59 json` - retire a stale unstarted (`DRAFT`/`BLOCKED`/`READY`) registration60 (ADR-0012; CLI only). Use it instead of re-planning over obsolete61 registrations; it never applies to a started Plan.62- `mine workspace open|close` - ephemeral plan-workspace lifecycle (CLI only).6364When a required operation has no MCP tool, fall back to the JSON CLI and state65the fallback explicitly.6667### Canonical identity and readiness gate6869Before registering a Plan, require `mine design readiness --scope <scope>`70through the read-only MCP equivalent when available. Stop and report every71applicable unresolved planning-blocking ADR; do not propose or infer approval.7273Allocate or validate one canonical ID matching74`planNN(?:-NN)*(?:-CNN)?`, with two-digit numeric segments and an uppercase75`C` compensation suffix only at the end. The filename must be exactly76`docs/plan/<id>-<lower-kebab-slug>.md`; compensation Plans use the next77contiguous sibling `C` ordinal in the same lineage. Do not register legacy78IDs or create aliases. Use the actual binary's validation error as the79authoritative diagnostic when an ID or path is invalid.8081## Required repository artifacts8283Use these exact repository paths unless an existing repository convention is stricter:8485- Design knowledge base root: `docs/design/index.md` (progressive disclosure; MINE owns `docs/design/`)86- Execution plans: `docs/plan/`87- Execution graph machine source: `docs/plan/execution-graph.toml`88- Generated graph view: `docs/plan/execution-graph.md`89- Implementation and review reports: `docs/plan/reports/`90- Repository working agreement: root `AGENTS.md`9192Read the bundled templates before producing artifacts:9394- [Plan template](references/plan-template.md)95- [Execution graph template](references/execution-graph-template.md)96- [Parallel execution protocol template](references/parallel-execution-protocol-template.md)9798Do not reference a bundled or repository file unless it actually exists. Links in a completed plan must resolve to a real local path or a real external URL that was opened and verified during this run.99100## Non-negotiable rules1011021. Inspect the actual repository evidence relevant to the requested scope before designing. For an explicit-scope invocation, inspection is proportional to that scope.1032. Inspect the Design relevant to the requested scope deeply, not just its headings or search snippets. Respect accepted architecture by default; do not broaden into unrelated Design leaves.1043. Perform real web search and open the authoritative pages during every substantive planning run, bounded to the requested scope and its real dependencies.1054. Prefer official documentation, standards, specifications, source repositories, release notes, and primary research over secondary summaries.1065. Record verified links and the exact claim each source supports inside the plan.1076. Never finalize an implementation-ready plan when required web research or page fetching is unavailable. Report the missing research capability and leave the plan explicitly `DRAFT` or do not create it.1087. Respect accepted architecture and Design by default. Inspect SOLID concerns (ownership, dependency direction, new abstraction/interface/component boundaries) only when the requested scope actually crosses a boundary or introduces such a structure. Do not use a plan to silently redesign the system.1098. If the target work requires an architecture change, update the `docs/design/` knowledge base first (the affected leaf/index), then make the plan cite the updated design paths and anchors. If planning reveals a material Design gap, stop that portion and route the decision back to `mine-arch`; do not silently solve it inside the Plan.1109. Do not preserve obsolete implementations merely because an earlier plan created them. Unless the user explicitly requires compatibility, change the target implementation directly and schedule cleanup of superseded fields, interfaces, parameters, adapters, migrations, aliases, and shims.11110. Preserve unrelated user changes and never invent evidence, commands, files, APIs, tool names, test results, or external behavior.112113## Scope-first principle114115`mine-plan-create` is **scope-first, research-backed, evidence-on-demand**:116117- **Explicit user scope is the authoritative planning boundary.** When the118 invocation names a requirement, component, previous discussion, Design119 change, or implementation target, treat that scope as authoritative. Stay120 within it: inspect only the Design, code, tests, configuration, graph121 state, reports, and external material needed to make that scope122 executable. Do not broaden into unrelated repository areas, audit123 unrelated Design leaves, or inspect unrelated accepted reports. Uncertainty124 inside the scope may expand evidence collection.125- **Bare invocation may enter discovery mode.** A bare invocation with no126 explicit planning target may perform broader discovery to identify the next127 unplanned or actionable Design work - but prefer the smallest coherent128 planning frontier. Do not turn every bare invocation into an unconditional129 full-repository audit.130- **Research stays mandatory and scope-bounded.** See Phase 4.131132## Phase 1: Establish the planning mode133134Classify the request before editing:135136### Explicit-scope mode (primary)137138The user supplied a concrete scope. In this mode:1391401. Resolve the scope: restate the concrete target (requirement, component,141 Design change, discussion topic) from the invocation.1422. Read the relevant accepted Design (the leaves and necessary parent/index143 context that govern the scope) - not the whole tree.1443. Inspect the relevant implementation, tests, configuration, graph state,145 and predecessor reports only when they materially affect the requested146 work.1474. Perform mandatory scope-bounded external research (Phase 4).1485. Create precise Plan(s) for that scope; register and release them.149150Do not: audit unrelated modules, reread the entire Design tree, inspect every151accepted report, research unrelated technologies, or perform a ceremonial152repository-wide review.153154### Bare-invocation discovery mode155156No explicit planning target. In this mode, broader discovery is allowed to157identify what should be planned next:1581591. Inspect current Design and the execution graph frontier.1602. Consider recent accepted work and repository state relevant to the next161 unplanned or actionable Design work.1623. Identify the smallest coherent planning frontier and plan that.163164### Zero-plan / initial architecture mode165166Treat the repository as zero-plan when one or more of these are true:167168- no accepted execution plans exist;169- the execution graph does not exist or contains no accepted baseline;170- architecture is absent, skeletal, contradictory, or not grounded in current code;171- the user is establishing the first implementation sequence for a new project.172173In zero-plan mode:1741751. Ensure `mine-arch` has produced or refreshed the architecture source of truth and repository quality gates.1762. Prefer multiple bounded research agents in parallel when the host supports subagents, teams, delegation, or isolated agent sessions.1773. Research the system broadly enough to establish a coherent baseline before decomposing implementation.1784. Produce the initial execution graph and identify the smallest useful accepted baseline.1795. Maximize safe parallelism, but do not parallelize unresolved shared contracts or files with unclear ownership.180181### Incremental mode (within any of the above)182183In an established repository with an accepted baseline:1841851. Identify the accepted baseline and the target plan frontier for the scope.1862. Inspect the architecture, reports, interfaces, and code touched by the requested change - not unrelated areas.1873. Detect whether the request is a new feature, direct correction, refactor, migration, cleanup, or compensating plan.1884. Do not revise an immutable handed-off or executed plan. Update architecture and create a new next-numbered compensating plan only for a189 substantial correction (material Design change, replaced core approach, a new independent work package, or major scope expansion). A narrow,190 local, fully-verifiable correction — including one discovered during independent review or during release closure — is the reviewer's or191 executor's direct fix, documented in its own report, not a new plan. Do not create a plan merely to preserve reviewer/implementer role192 purity.193194When an immutable `IN_PROGRESS` Plan is objectively infeasible, do not edit,195replace, or pretend to complete it. Planning may define the approved196stored-anchor/schema recovery and the later compensation sequence only after197Design and any material ADR decision authorize that stored-anchor schema recovery. The stopped198Plan remains frozen until an independent reviewer records canonical evidence199and uses the bounded active-rejection transition; only then register the next contiguous sibling compensation and reuse the existing lineage worktree.200201## Phase 2: Gather evidence proportional to scope202203Read, in order, only what the requested scope requires:2042051. User requirements and supplied artifacts (the explicit scope is authoritative).2062. Root `AGENTS.md`.2073. The Design leaves governing the requested scope, plus the necessary parent/index context - not the whole tree. In discovery mode, read the index and relevant frontier leaves.2084. Query the execution graph through the final `mine` MCP tools or `mine --format json`; use the generated Markdown only as a readable view.2095. Predecessor plans and implementation/review reports only when they materially affect the requested work.2106. Manifests, lockfiles, toolchain files, CI, deployment files, and Git status relevant to the scope.2117. Relevant source code, tests, schemas, and generated artifacts for the scope.2128. Current official documentation and best practices fetched from the web (scope-bounded; see Phase 4).213214Do **not** require by default: reading the entire Design tree; reviewing every215accepted Plan or report; auditing every manifest, CI file, deployment file, or216unrelated subsystem; or repository-wide evidence matrices. Expand repository217inspection only when a concrete planning question requires more evidence.218219Keep these categories visibly separate:220221- current implemented reality;222- accepted architectural target;223- new requested target;224- assumptions;225- unresolved material decisions;226- bounded local implementation decisions.227228An evidence matrix is optional and scope-scaled: include one when the scope229spans several areas or subsystems; do not produce a repository-wide matrix by230default.231232## Phase 3: Parallel research (optional, scope-scaled)233234When parallel agents are available **and** the requested scope genuinely spans235several independent research questions, assign bounded research lanes with236explicit questions and expected output. Useful lanes include:2372381. Repository reality for the scope.2392. Architecture boundaries, ownership, and lifecycle relevant to the scope.2403. Official framework/library/API documentation and version constraints.2414. Data model, transactions, concurrency, consistency, and migrations relevant to the scope.2425. Security, privacy, authorization, secrets, and failure handling relevant to the scope.2436. Toolchain, static checks, tests, CI, build, deployment, and observability relevant to the scope.2447. Parallel execution decomposition and shared-file collision analysis.245246Each lane must return evidence, source links, concrete implications, unresolved decisions, and risks. Synthesize the results yourself; do not paste mutually contradictory subagent reports into the plan.247248A single coherent scope does not require parallel lanes. When the host cannot run subagents, perform the needed research sequentially. Do not name or invoke a tool that the host does not expose.249250## Phase 4: Mandatory external research (scope-bounded)251252External research is **mandatory for every substantive planning run** and is253part of MINE's engineering discipline. It is also **bounded to the requested254scope**: search for the external technologies, protocols, standards,255services, or architecture patterns the requested scope depends on - not256unrelated repository subsystems.257258Research should answer questions such as:259260- How is this problem normally solved in mature systems?261- Is there already a standard abstraction, protocol, pattern, or library for this?262- What do the official framework or platform docs recommend?263- How do mature open-source projects implement the same mechanism?264- What failure modes are already well known?265- What implementation conventions should be followed instead of inventing a local mechanism?266267The purpose is **not** to satisfy a documentation ritual: it is to avoid268closed-world design and unnecessary invention. Research compares established269approaches (concurrency control, transactional outbox, retry/backoff,270idempotency, auth/session lifecycle, migration strategies, locking models,271worker scheduling, state machines, test isolation, configuration ownership,272and similar) - not merely to verify API syntax.273274For example, a Passkey-login scope reasonably includes WebAuthn/Passkey275standards, the selected framework's integration guidance, credential and276challenge lifecycle, and known security/compatibility constraints - but does277not justify researching unrelated storage, CI, deployment, or observability278subsystems unless the scope actually depends on them.279280For each source:2812821. Open the actual page; do not rely on a search-result snippet.2832. Confirm it applies to the repository's selected version or current supported version.2843. Record the page title, organization, URL, date accessed, verified claim, and concrete design or implementation implication.2854. Prefer sources in this order:286 - official product/framework documentation;287 - normative standards and specifications;288 - official source repositories, examples, release notes, and migration guides;289 - primary research;290 - reputable secondary sources only when primary material is insufficient.2915. Record conflicting guidance rather than hiding it.2926. Never cite a source that was not opened.293294The plan must contain a **Research source register**. A raw list of links is insufficient; every link must support a specific plan decision, step, test, or risk.295296## Responsibility boundary with `mine-arch`297298- `mine-arch` owns: requirements interpretation; target architecture;299 durable engineering decisions; component boundaries; public contracts;300 important data, lifecycle, security, consistency, deployment, or ownership301 decisions; changing accepted Design.302- `mine-plan-create` owns: turning accepted Design into executable303 implementation work; resolving bounded implementation details;304 decomposing work; determining dependencies and write scopes; defining305 verification; identifying safe parallelism.306- If planning reveals a missing decision that materially changes product307 behavior, architecture, public API, persistent data semantics, a security,308 ownership, or compatibility boundary, deployment topology, or another309 durable engineering contract: **stop planning that portion and route the310 decision back to `mine-arch`**. Do not silently solve it inside the Plan.311- Research may validate accepted Design, refine implementation details, or312 reveal risks and incompatibilities - but it must **never silently replace313 accepted Design** because another project or article uses a different314 approach. If research shows accepted Design is materially wrong or315 incomplete, report the conflict and return that decision to `mine-arch`.316317## Phase 5: Resolve decisions318319Ask the user before finalizing when a decision materially changes any of these:320321- product behavior or scope;322- architecture style or component ownership;323- persistent data model, migration, or rebuild policy;324- public API, event, file format, model/tensor, prompt, or tool contract;325- authorization, privacy, safety, secret, or trust boundary;326- compatibility requirements;327- deployment topology, external mutation, cost boundary, or operational responsibility;328- acceptance criteria.329330Do not interrupt for bounded implementation choices that do not change those contracts. Resolve such choices using current architecture, official documentation, repository convention, and the smallest maintainable design. Record them under **Local decisions made by the planner**.331332## Phase 6: Architecture gate (conditional, no checklist theater)333334Respect accepted architecture by default. Before writing implementation steps, verify traceability from the requested scope to its governing architecture, and inspect deeper only when the scope actually crosses a boundary or introduces a new abstraction/interface/component/dependency structure:335336- ownership and dependency direction for the affected boundary;337- state ownership, lifecycle, idempotency, concurrency, retries, and failure semantics for the affected component;338- no duplicate source of truth in the new structure;339- no speculative abstraction or interface with only imagined consumers;340- SOLID concerns (Single Responsibility, Open/Closed, Liskov, Interface Segregation, Dependency Inversion) applied to newly introduced or changed abstractions, not as a repository-wide checklist.341342Do not require a full SOLID checklist or a repository-wide architecture audit on every Plan. Inspect architecture more deeply when the requested scope crosses a real boundary; check ownership/dependency direction when affected; check SOLID concerns when a new abstraction, interface, component boundary, or dependency structure is actually being introduced or changed.343344If the accepted design knowledge base cannot support the request cleanly, update the relevant `docs/design/` leaf/index first (or route the decision to `mine-arch` when it is a material gap). Include exact design paths (and anchors where applicable) in the plan.345346## Phase 7: Design for parallel execution347348When any plan contains parallel implementation lanes, create or update `docs/plan/parallel-execution-protocol.md` from the bundled template. The protocol is a repository scheduling contract and must name reserved shared files, lane ownership, integration ownership, and duplicate-owner prevention.349350Maximize useful parallelism so multiple agents can work efficiently without corrupting shared contracts.3513521. Build a dependency DAG of work packages.3532. Separate contract-defining work from independent implementation work.3543. Identify parallel groups and explicit join gates.3554. Give each work package a single owner and a non-overlapping primary file scope.3565. Assign a single serial owner for shared root files and high-conflict artifacts, including as applicable:357 - package manifests and lockfiles;358 - workspace configuration;359 - central dependency-injection registries;360 - database migrations and generated schemas;361 - root lint/test configuration;362 - shared API specifications and generated clients;363 - execution graph and reports.3646. State which files an agent may edit, may read but not edit, and must not touch.3657. Define the artifact each package hands to downstream packages.3668. Define integration order and exact join verification.3679. Use isolated branches/worktrees when available. If agents share one worktree, serialize all overlapping files and root configuration changes.368369Parallelism is not a goal when it causes duplicated work, conflicting schemas, premature stubs, fake interfaces, or repeated lockfile churn.370371## Phase 8: Write the executable plan372373Create one realistically sized plan for the next coherent increment under `docs/plan/` using a numbered kebab-case name, for example:374375`docs/plan/03-session-storage-and-recovery.md`376377Use the bundled [plan template](references/plan-template.md). Every work package and implementation step must specify:378379- purpose and governing architecture sections;380- prerequisites and accepted upstream evidence;381- exact target files, directories, symbols, interfaces, schemas, or generated artifacts;382- current behavior and required final behavior;383- input, output, error, lifecycle, transaction, concurrency, and security semantics;384- algorithm or state transition where non-trivial;385- configuration and dependency changes;386- deletions and cleanup of superseded implementation;387- edge and failure cases;388- deterministic tests and fixtures;389- exact narrow verification commands and broader integration gates;390- expected observable outcome, not merely “tests pass”;391- artifacts delivered to downstream work;392- suggested cohesive commits.393394A step such as “implement the service,” “add tests,” “update the API,” or “follow best practices” is invalid unless expanded into concrete files, contracts, behavior, cases, and verification.395396Do not guess physical database columns, API responses, source document fields, runtime tool names, framework options, or command flags. Verify them first or mark the plan `DRAFT` with the exact missing evidence.397398## Phase 9: Quality and verification matrix399400Use the actual project quality gates defined by architecture and `AGENTS.md`. Do not impose Python-only tools on Go, TypeScript, Rust, or mixed-language projects.401402The plan must include a verification matrix:403404| Scope | Command | Preconditions | Expected evidence | Owner/work package |405|---|---|---|---|---|406407Cover as applicable:408409- formatter and formatting check;410- linter and static analysis;411- type checking;412- unit, integration, contract, migration, end-to-end, security, and smoke tests;413- generated artifacts and schema drift;414- build/package/container validation;415- deployment configuration validation;416- runtime probes for lifecycle, concurrency, error paths, and recovery;417- `git diff --check` and explicit changed-file audit.418419Never label an unrun command, timeout, unavailable dependency, ignored diagnostic, or non-zero result as passing.420421## Phase 10: Register the plan through MINE422423Do not edit `docs/plan/execution-graph.toml` or `docs/plan/execution-graph.md` directly. After the plan document is complete:4244251. Read the current graph revision: call `mine_graph_status` (MCP) or `mine426 graph status --format json` (CLI fallback). The envelope's `data.revision`427 is the current revision; carry it as `expected_revision` on the write.428 Before the registration write, run scoped design readiness and confirm the429 requested canonical Plan ID/path. A failed readiness check is a planning430 blocker, not permission to register a DRAFT node.4312. Register the plan: call `mine_plan_add` (MCP) with `id`, `path`, `title`,432 `design_references`, and optional `exclusive_write_paths` /433 `hard_predecessors`; or `mine plan add --format json` (CLI fallback) with434 `--id`, `--path`, `--title`, at least one `--design-ref`, and any `--write`435 / `--hard` (repeat for multiple values). Registration always creates a436 `DRAFT` node.4373. **Release the plan** (CLI-only - no MCP tool exposes release): call438 `mine plan release --id <id> --format json` to move the new `DRAFT` node439 into the startable frontier (`DRAFT` -> `READY` when every hard predecessor440 is `ACCEPTED`; `DRAFT` -> `BLOCKED` otherwise). This is a mandatory CLI441 fallback because `mine_plan_add` always creates `DRAFT`.4424. Validate the graph: call `mine_graph_validate` (MCP) or `mine graph443 validate --format json` (CLI fallback) after registration and release.4445. Report the returned revision before/after and the new plan's status445 (`DRAFT`, `READY`, or `BLOCKED`).446447The accepted MINE CLI and MCP tools read the current revision themselves448before mutating under the lock, so an explicit `expected_revision` argument is449**not** required; every mutation envelope emits `revision_before`/450`revision_after`. Never parse human output. Never edit the graph files451directly. If the installed command contract differs from this draft, use the452actual implemented contract and update this Skill before release.453454## Final review gates455456Before finishing, verify all of the following:457458- The cited `docs/design/` leaves/anchors exist and every cited section is real.459- Architecture changes were made before the dependent plan; material Design gaps were routed back to `mine-arch`, not silently solved.460- Mandatory **scope-bounded** web research was completed using opened authoritative pages.461- Every external link is real, current enough for the decision, and tied to a claim.462- The plan does not contain a dead local reference.463- Accepted architecture is respected; SOLID/speculative-abstraction concerns were checked where the scope actually introduces or changes a boundary.464- Current reality, target design, assumptions, and decisions are separate.465- Every work package has explicit ownership, file scope, dependencies, output, tests, and join gate.466- Shared files have one serial owner.467- Parallel groups are safe rather than merely numerous.468- Every implementation step is concrete enough to execute without rediscovering design decisions.469- Language-specific checks come from the repository's architecture and actual toolchain.470- Obsolete implementation is removed or explicitly scheduled for removal; no accidental compatibility debt is introduced.471- MINE successfully registered the plan and the validated graph accurately represents dependencies and status.472- No handed-off or executed immutable plan was rewritten.473- No unrelated files are modified or staged; the invocation scope was respected.474475Finish with the created or updated architecture sections, plan path, graph status, parallel groups, unresolved gates, and the exact next executable work packages. Do not claim readiness when any required evidence is absent.476477## Shared toolchains and Plan-isolated mutable outputs478479Reuse Root-managed toolchains, dependency downloads, virtual environments, and480only caches proven read-only or safely content-addressed. Do not create a481second `.venv`, `venv`, `target`, `node_modules`, or equivalent environment or482cache directory in a linked Plan worktree.483484Mutable build, test, generation, coverage, packaging, and runner outputs must485use `<Root>/.mine/build/<plan-id>/<tool-or-output-class>/`. For Rust, set486`CARGO_TARGET_DIR` to the exact Plan namespace, for example487`<Root>/.mine/build/<exact-plan-id>/cargo-target`; never use Root `target` or a488worktree-local `target`. If a measured output is predictably very large,489record the estimate and pause for explicit owner agreement on serialization,490a coarser exclusive namespace, and cleanup; never fall back automatically to a491globally shared mutable directory.