Skip to content
configure-verification logo

Configure Verification

configure-verification

Auto-detect test, lint, typecheck, and build commands from package.json, Makefile, and other project config. Use during project setup or when build tooling changes. Runs silently — no prompts.

SKILL.md

Full skill instructions

Auto-detect verification commands and write .claude/​verification-config.json. Runs silently with no user prompts — best-effort detection only.

Workflow

Copy this checklist and track progress:

Configure Verification Progress:
- [ ] Detect project directory and context
- [ ] Directory guard
- [ ] Detect package manager
- [ ] Auto-detect commands from project sources
- [ ] Conditional dev server detection
- [ ] Ensure .gitignore protection
- [ ] Write verification-config.json
- [ ] Output one-line summary

Project Directory

Use the current working directory by default.

If $1 is provided, treat $1 as the working directory and read files under $1 instead.

Context Detection

Determine working context:

  1. If the working directory matches */​features/​*:
    • PROJECT_ROOT = parent of parent of working directory
  2. If the working directory matches */​plans/​greenfield*:
    • PROJECT_ROOT = parent of parent of working directory
  3. Otherwise:
    • PROJECT_ROOT = working directory

Directory Guard

Confirm PROJECT_ROOT exists and is writable. If not, stop and report the error.

Detect Package Manager

Determine package manager from lockfile presence (check in this order):

LockfilePackage Manager
pnpm-lock.yamlpnpm
yarn.lockyarn
package-lock.jsonnpm

If none found, default to npm if package.json exists, otherwise no package manager.

Auto-Detect Commands

Scan project sources in priority order. First source wins per command type. Parse files as structured data (JSON for package.json, not grep).

Priority Order

  1. package.json scripts — Parse JSON, check for these script names:

    • test → {pm} test or {pm} run test
    • lint → {pm} run lint
    • typecheck or type-check or tsc → {pm} run typecheck (use actual script name)
    • build → {pm} run build
    • coverage or test:coverage → {pm} run coverage (use actual script name)
    • mutation or test:mutation or stryker → {pm} run {actual-script-name}
  2. Makefile — Look for targets: test, lint, typecheck/check, build, coverage

    • Command format: make {target}
  3. Taskfile.yml — Look for tasks with matching names

    • Command format: task {name}
  4. justfile — Look for recipes with matching names

    • Command format: just {name}
  5. Fallback: README.md / CONTRIBUTING.md — Scan for code blocks containing test/​lint/​build commands. Only use if no structured source found a command.

Important: Only record commands that were actually found. Do not guess or synthesize commands. If a command type is not found in any source, omit it from the config entirely.

Conditional Dev Server Detection

Only run this section if the active execution plan contains BROWSER: criteria.

Resolve the active execution plan in this order:

  1. EXECUTION_PLAN.md in the working directory
  2. plans/​greenfield/​EXECUTION_PLAN.md in the working directory (e.g., BROWSER:DOM, BROWSER:VISUAL, etc.).

If browser criteria exist, look for dev server scripts in package.json:

  • dev → {pm} run dev
  • start → {pm} run start
  • serve → {pm} run serve

If found, include in config:

{
  "devServer": {
    "command": "{pm} run dev",
    "url": "http://localhost:3000",
    "startupSeconds": 10
  }
}

Use port 3000 as default. If the script content in package.json contains a different port (e.g., --port 5173), use that instead.

If no browser criteria in the active execution plan, omit devServer entirely.

Ensure .gitignore Protection

Check and protect verification-related files:

  1. If .gitignore exists, ensure these entries are present:

    • .env.verification
    • .claude/​verification/​auth-state.json
  2. If entries are missing, append them:

    # Verification credentials (never commit)
    .env.verification
    .claude/​verification/​auth-state.json
    
  3. If .gitignore doesn't exist, skip (don't create one just for this).

Write Config

Write .claude/​verification-config.json with only the keys where commands were found. Always include browser.tool: "auto".

Example — full detection:

{
  "commands": {
    "test": "npm test",
    "lint": "npm run lint",
    "typecheck": "npm run typecheck",
    "build": "npm run build",
    "coverage": "npm run coverage"
  },
  "browser": {
    "tool": "auto"
  }
}

Example — partial detection (no typecheck or coverage found):

{
  "commands": {
    "test": "npm test",
    "lint": "npm run lint",
    "build": "npm run build"
  },
  "browser": {
    "tool": "auto"
  }
}

Example — with dev server (browser criteria detected):

{
  "commands": {
    "test": "pnpm test",
    "lint": "pnpm run lint"
  },
  "devServer": {
    "command": "pnpm run dev",
    "url": "http://localhost:5173",
    "startupSeconds": 10
  },
  "browser": {
    "tool": "auto"
  }
}

Example — nothing detected:

{
  "commands": {},
  "browser": {
    "tool": "auto"
  }
}

Do NOT include auth, deployment, or devServer (unless browser criteria detected a dev server). These are deferred to /​phase-checkpoint when needed.

Error Handling

SituationAction
PROJECT_ROOT does not exist or is not writableStop immediately and report the path error to the user
No package.json, Makefile, Taskfile.yml, or justfile foundWrite config with empty commands object; report "no commands detected"
package.json exists but contains invalid JSONReport parse error with file path; skip package.json and try next source
Lockfile detected but package manager binary is missingRecord the detected package manager but warn the user it is not installed
.claude/ directory does not exist for writing configCreate .claude/ directory before writing verification-config.json

Output

Print a single summary line:

Verification config: detected {list of found commands}. Missing: {list of not found}.

Examples:

Verification config: detected test, lint, build. Missing: typecheck, coverage.
Verification config: detected test, lint, typecheck, build, coverage, devServer. Missing: none.
Verification config: no commands detected.