name: mcp-java-dev-tools-project-artifact-manager
description: "Manage .mcpjvm/<project>/projects.json project context artifacts (read/validate/upsert/list) for runtime contexts, external systems, and health checks."
MCP Java Dev Tools Project Artifact Manager
Use this skill to manage project-level artifacts while keeping probe routing in probe-config.json.
Scope
- Initialize
.mcpjvm/<project-name>/projects.json. - Validate deterministic project artifact shape.
- Add/update runtime contexts (
terminal/docker). - Add/update shared scripts used by execution profiles.
- Add/update external systems and health checks.
- Resolve env key references (never env values).
- Use
artifact_managementas the canonical MCP Tool for read/validate/upsert/list artifact lifecycle operations.
Rules
- If project name is missing, ask the user first and do not create files yet.
- Treat
projectNameas the canonical Artifact identity forartifact_managementcalls. - Use
projectRootAbsonly as deterministic scope validation or cross-check input when needed. probe-config.jsonremains authoritative for probes and baseUrl routing.projects.jsonMUST NOT duplicate probe endpoint config.- Persist only env key names (for example
AUTH_BEARER_TOKEN), never resolved token values. - Runtime context
modeis restricted toterminalanddocker. - Runtime context supports
autoStartandautoStopOnFinishbooleans (default true). - For
mode=terminal, providestartups[]entries per app/service withcommand(+ optionalargs[],appdir,env) when auto-start is desired. - Runtime startup entries must start/stop application runtime only; token refresh, seed, validation, and env preparation belong in shared
scripts[]. - Shared scripts are referenced by
executionProfiles[].scriptRefs[]and may declarephase,command,args[],appdir,env, andenvFileArg. - Shared scripts and run-prerequisite scripts must be replayable: use relative paths only (
scriptPath,appdir, and path-likeargs[]); absolute machine paths are invalid. - External system checks may use only deterministic
tcporhttpchecks in v1. - Fail closed on ambiguous discovery; do not guess ports, hosts, or auth keys.
defaults.retryMaxanddefaults.requestTimeoutMsare used by orchestrator runtime operations by default, including health checks, wrapped HTTP execution, and replayable bootstrap/prerequisite scripts unless a narrower timeout is set.sessionExportuses flat defaults forincludeRuntimeStartupandincludeHealthcheckGate.sessionExport.includeResolvedSecretsmust not auto-enable secret export; resolved secrets require explicit request opt-in at export time.
Required Artifact Path
.mcpjvm/<project-name>/projects.json
Required Shape
{
"workspaces": [
{
"projectRoot": "C:\\workspace\\example",
"envFile": ".env",
"variables": {
"bearerTokenEnv": "AUTH_BEARER_TOKEN",
"keycloakClientIdEnv": "KEYCLOAK_CLIENT_ID",
"keycloakClientSecretEnv": "KEYCLOAK_CLIENT_SECRET",
"keycloakUsernameEnv": "KEYCLOAK_USERNAME",
"keycloakPasswordEnv": "KEYCLOAK_PASSWORD"
},
"runtimeContexts": [
{
"name": "terminal-cli",
"mode": "terminal",
"autoStart": true,
"autoStopOnFinish": true,
"startups": [
{
"name": "customers-service",
"command": "java",
"args": ["-jar", "target\\customers.jar"],
"appdir": "spring-petclinic-customers-service"
}
]
},
{
"name": "docker-compose",
"mode": "docker",
"composeFile": "docker-compose.yml"
}
],
"scripts": [
{
"name": "keycloak-token-bootstrap",
"phase": "postHealthcheck",
"command": "powershell",
"args": [
"-NoProfile",
"-ExecutionPolicy",
"Bypass",
"-File",
".mcpjvm\\example\\scripts\\refresh-keycloak-token.ps1"
],
"appdir": ".",
"envFileArg": "-EnvFile"
}
],
"executionProfiles": [
{
"executionProfile": "regression-test-run",
"runtimeContextName": "docker-compose",
"executionPolicy": "stop_on_fail",
"scriptRefs": [
"keycloak-token-bootstrap"
],
"plans": [
{
"order": 1,
"planName": "owners-regression"
}
]
}
],
"externalSystems": [
{
"name": "postgres",
"kind": "database",
"host": "localhost",
"port": 5432,
"healthChecks": [
{
"id": "tcp-open",
"type": "tcp",
"target": "localhost:5432",
"required": true
}
]
}
],
"defaults": {
"requestTimeoutMs": 10000,
"retryMax": 1
},
"sessionExport": {
"includeRuntimeStartup": true,
"includeHealthcheckGate": true,
"includeResolvedSecrets": false
}
}
]
}
Workflow
- Resolve workspace root.
- Ask for project name when missing.
- Call
artifact_managementwithartifactType=project_contextandaction=read|listto load current state. - Normalize and prepare requested changes in-memory.
- Call
artifact_managementwithartifactType=project_contextandaction=validatebefore persistence, passing explicitprojectNameand optionalprojectRootAbsonly when a scope cross-check is required. - Call
artifact_managementwithartifactType=project_contextandaction=upsertto persist. - Validate end-to-end and return deterministic summary.
Misaligned Field Fix Rules
- Always run normalization before validation and write.
- Treat the TypeScript validator contract in
tools/spec/project-artifact-spec/src/project_artifact.util.tsas canonical. - Do not use
templates/projects.terminal.example.jsonas a strict allowlist for field removal. - Optional validator-supported fields are canonical and must not be removed as non-canonical:
executionProfiles[].runtimeConfigexecutionProfiles[].plans[].onFailexecutionProfiles[].plans[].providedContext
- For HTTP health checks, normalize to canonical
urlwhentype=http. - If normalization cannot be done deterministically, fail closed with compact output and do not write partial state.
Validate Action (Keep It Lean)
- Run a dedicated
validatepass before writing updates. - Reuse rules in
references/validation-rules.mdto avoid duplicating logic inSKILL.md. - Return compact fail-closed output:
statusreasonCodechecks[]nextAction
- When creating a new project artifact, prefer starting from
templates/projects.terminal.example.json.
Runtime Health Defaults
defaults.retryMax: retry attempts for required external system checks.defaults.requestTimeoutMs: default timeout for suite-owned runtime operations when a narrower timeout is not set, including required external system checks, wrapped HTTP execution, and replayable bootstrap/prerequisite scripts.- Keep values small and deterministic for fast preflight feedback.
Shared Scripts
- Put reusable setup scripts in workspace-level
scripts[], not insideruntimeContexts[].startups[]. - Use
runtimeContexts[].startups[]only for app/service lifecycle startup. - Reference shared scripts from
executionProfiles[].scriptRefs[]. - Use phases to make execution order explicit:
preRuntime: before runtime startup.postRuntime: after runtime startup command, before health gates.postHealthcheck: after required health gates pass.prePlan: immediately before regression plan transport execution.
- If a script updates an env file, declare
envFileArgso export runners can pass their export-localproject.env. - Export packages copy referenced shared scripts into their own
scripts/folder and invoke the copied script, not the original workspace path.
Implementation Status
projects.jsonmanagement supports declaring sharedscripts[]andexecutionProfiles[].scriptRefs[].- Regression suite runner execution of
executionProfiles[].scriptRefs[]by phase is not implemented yet. - This skill defines the canonical shape for new artifacts; it does not automatically migrate setup scripts from existing
runtimeContexts[].startups[]entries into sharedscripts[].
Extensibility
This skill supports modular external-system discovery guidance in:
README.mdreferences/postgres.mdreferences/dynamodb.mdreferences/keycloak.mdreferences/validation-rules.mdtemplates/projects.terminal.example.json
When adding new systems, extend references/ with one file per system family and keep rules deterministic.
Fail-Closed Reason Codes
project_name_missingproject_artifact_missingproject_artifact_invalidworkspace_root_invalidenv_key_missingruntime_context_unknownexternal_system_invalidexternal_healthcheck_faileddiscovery_ambiguous