| name | mcp-java-dev-tools-regression-plan-crafter |
| description | Create or update deterministic regression plans (`metadata.json`, `contract.json`, `plan.md`) under `.mcpjvm/.../plans/regression`, including ordered trigger steps, optional Watchers for downstream completion checks, and optional external verification for downstream data validity. |
MCP JVM Regression Plan Crafter
Use this skill to author or refine a persisted regression plan spec package before execution/replay.
Execution Mode
This skill must run in two phases:
Research
Craft
Do not skip Research when route/base path evidence is incomplete.
Goal
Produce a deterministic, fail-closed plan package:
.mcpjvm/<project_name>/plans/regression/<regression_name>/metadata.json
.mcpjvm/<project_name>/plans/regression/<regression_name>/contract.json
.mcpjvm/<project_name>/plans/regression/<regression_name>/plan.md
Do not hand-author .mcpjvm/<project_name>/plans/regression/<plan>/runs/<run_id>/... artifacts in this skill. Those are machine-generated during execution.
Use artifact_management (artifactType=regression_plan) as the canonical MCP Tool for read/validate/upsert/list lifecycle operations.
Portable Source of Truth
Always align with:
references/spec-rules.md
references/authoring-checklist.md
references/templates/metadata.template.json
references/templates/contract.template.json
references/templates/plan.template.md
These references are bundled with the skill so it remains installable and usable across repositories.
If user input conflicts with these rules, fail closed and request clarification.
Contract Rules
metadata.execution.intent must be regression.
contract.steps must be strict ordered 1..N with unique order.
steps[].protocol must match a key under steps[].transport (for example protocol=http requires transport.http).
- No hardcoded secrets in
metadata.json, contract.json, or plan.md.
targets[].selectors.fqcn is mandatory for deterministic target identity.
- If runtime pinning is enabled (
probeVerification=true, pinStrictProbeKey=true), each target must provide runtimeVerification.strictProbeKey in FQCN#method:line format.
steps[].when is optional and supports deterministic condition nodes only (all, any, not) and predicates (equals, not_equals, in, exists).
steps[].when.left must reference only context.* or prior step[n].* (where n < current step order).
watchers[] is optional and first-class for bounded downstream completion verification after trigger-step success.
externalVerification[] is optional and first-class for downstream data-validity verification after trigger/watcher convergence.
- Execution Orchestrator resiliency is project-owned:
- do not add plan-level resume/poll knobs
- rely on
.mcpjvm/<project_name>/projects.json workspaces[].defaults.orchestrator.*
- When
correlation.enabled=true, author strictLineExpectations[] for Strict Line evidence that requires persistence. Each expectation has a unique sequenceOrder, strictLineKey, selectorPolicy=exact_instance, count operator (exact|at_least|at_most|range), and bounded expected delta or range. Multi-instance selector policies remain fail-closed until frozen membership execution support is available.
- Use one aggregate expectation for repeated processing (for example a 500-item reindex); do not create one expectation per Line Hit. Pair non-isolated count evidence with a Watcher or external verification.
Plan Authoring Workflow
- Research target and route facts
- Collect target and scope
- Define prerequisites
- Define ordered steps
- Define step expectations
- Define optional watchers
- Define optional external verification
- Generate
plan.md with deterministic verbs
- Validate consistency and fail closed on ambiguity
0) Research target and route facts
Before crafting, gather only provable facts from:
- source mappings
- runtime docs/contracts (for example OpenAPI), if available
- explicit user-provided inputs
Record unresolved route/base-path items as missing context. Do not synthesize guessed prefixes.
1) Collect target and scope
Capture:
- Regression name (
<regression_name>)
- Target type (
class_method, class_scope, module_scope)
- Deterministic selectors:
- required:
fqcn
- optional:
method, signature, sourceRoot
If multi-module ambiguity exists and no deterministic selector is provided, fail closed.
2) Define prerequisites
For each context key:
key
required
secret
provisioning (user_input | discoverable)
discoverySource when provisioning=discoverable (datasource | runtime_context)
- optional
default (non-secret only)
Use prerequisites for reusable runtime inputs (for example tenantId, region, auth.bearer).
3) Define ordered steps
For every executable step:
- assign
order sequentially
- assign stable
id
- point
targetRef
- set
protocol
- define
transport.<protocol> details
- optionally add
extract mappings for cross-step context
- optionally add
when for deterministic conditional execution
Keep steps natural and dependency-aware (for example create before update/delete).
4) Define step expectations
Add deterministic assertions under steps[].expect[] for every step.
Required expectation fields:
id
actualPath
operator
expected (when required by operator)
- optional
required (true by default)
Supported operators:
field_equals
field_exists
field_matches_regex
numeric_gte
numeric_lte
contains
probe_line_hit
outcome_status
5) Define optional watchers
Use watchers[] when the regression must prove downstream completion or readiness beyond the trigger path.
For each watcher:
- assign stable
id
- define
dependency.stepOrder against an earlier trigger step
- define a bounded provider contract
- set deterministic expectations over downstream readiness/completion state
- keep watcher semantics complementary to
Correlation, not a replacement for it
- assume watcher waits may span multiple resumed orchestration passes; author expectations for continuation of the same in-progress plan, not repeated reruns of prior completed plans
6) Define optional external verification
Use externalVerification[] when the regression must prove downstream data validity against an external HTTP or SQL target after trigger-path completion.
For each external verification:
- assign stable
id
- define
provider.type
- define provider request details under
request
- optionally add
extract mappings
- add deterministic expectations against returned HTTP or SQL state
Rules:
- keep secret-bearing provider configuration out of persisted plan defaults
- keep provider contracts vendor-neutral at authoring time
- use canonical
${key} placeholders for context interpolation
- assume external verification may be resumed from an already in-progress plan after prior trigger or watcher completion; do not model it as a separate rerun-capable plan
7) Generate plan.md
Required sections:
Purpose
Targets
Prerequisites
Steps
Expected Outcomes
Required action verbs in Steps:
Executes
Captures
Uses
Sets
WaitsFor
Verifies
Required outcome verbs in Expected Outcomes:
Returns
Emits
Produces
Matches
Passes
8) Validate consistency
Before finalizing, verify:
- Metadata and contract compatibility
- Target selectors are deterministic
- Step ordering and protocol/transport mapping are valid
- Prerequisites cover all referenced context keys
- No secrets are persisted as defaults
plan.md semantics match contract.json
- optional
watchers[] depend only on prior steps and use bounded completion expectations
- optional
externalVerification[] preserve secret-safe provider configuration boundaries
- the plan does not introduce resume policy; long-running continuation depends on project-owned orchestrator defaults
If any check fails, return blocked guidance with exact missing/invalid fields and no speculative defaults.
Required Deliverables Per Craft Request
When user asks to craft a plan, produce or update:
.mcpjvm/<project_name>/plans/regression/<regression_name>/metadata.json
.mcpjvm/<project_name>/plans/regression/<regression_name>/contract.json
.mcpjvm/<project_name>/plans/regression/<regression_name>/plan.md
Never require manual hand-construction when templates can be applied.
Use the template files, then specialize fields from the user context.
Persist through artifact_management with action=upsert after action=validate.
Fail-Closed Cases
Stop and return deterministic blocked guidance when:
- target selector is ambiguous (for example duplicate module candidates with no disambiguator)
- step order is non-sequential or duplicated
- protocol and transport key do not match
- required context keys cannot be determined and no safe default exists
- pinned strict probe key is required but invalid/missing
- user asks to persist secrets as defaults
- base path/prefix is not proven but required to produce executable route steps
- discoverable prerequisite is missing
discoverySource
steps[].when is malformed, uses unsupported operators, or references non-deterministic paths
steps[].when references the same or a future step
- watcher dependency points to the same or a future step
- external verification embeds secret-bearing provider configuration into persisted plan defaults
- plan attempts to author orchestrator resume/poll knobs instead of relying on project-owned defaults
Base Path Policy (No Assumptions)
- Never assume or inject a default route prefix/base path.
- Set base path only when:
- user provided it explicitly, or
- it is proven by source/runtime evidence.
- If base path is unproven:
- leave it unset in crafted plan fields,
- return deterministic
needs_user_input guidance for the missing key.
Output Style
When crafting or updating plans, output:
- Absolute paths changed
- Short summary of deterministic selectors and step ordering
- Any blocked fields that require user input
Non-Goals
- Do not create additional MCP tools beyond the existing
artifact_management path.
- Do not execute regression runs from this skill.
- Do not write
.mcpjvm/<project_name>/plans/regression/<plan>/runs/<run_id> artifacts manually.
Watcher Persistence Contract
Watcher wait policies must resolve to a bounded timeout, retry limit, and polling interval before execution. Scope each Watcher to its dependency step and stable job/scheduler identity when available so a persisted continuation can resume the same Watcher without rerunning its trigger or resetting its deadline.