/add-modernizer-skill
Guides creation of a new pipeline phase. Follows strict priority order — each step must be complete before the next begins.
Required Input
Ask the user for:
- Phase name: e.g.
migrate-ddl,validate-schema,cost-estimate - Purpose: What this phase does in one sentence
- Needs LLM?: Whether this phase requires LLM judgment (yes/no)
- Input: What artifacts from previous phases it reads
- Output: What it produces
Phase 1: Contract (MUST complete first)
-
Create
src/contracts/{phase_name}_output.py -
Define the output Pydantic model with:
- Clear field descriptions
- Appropriate types and constraints
- Validators where needed
-
If LLM is needed, define the LLM output model separately (keep it minimal — only what requires judgment)
-
Verify:
uv run python -c "from src.contracts.{phase_name}_output import *; print('OK')"
STOP: Do not proceed until the contract compiles and the user approves the field design.
Phase 2: Deterministic Logic
-
Create
src/agents/{phase_name}/handler.py -
Implement
run_{phase_name}_deterministic(input) -> contract -
If LLM is needed, implement:
prepare_{phase_name}_llm_input(contract, input) -> dictapply_{phase_name}_llm_output(contract, llm_typed) -> updated_contract
-
Write tests in
tests/agents/test_{phase_name}.py -
Verify:
uv run pytest tests/agents/test_{phase_name}.py -v
STOP: Do not proceed until tests pass.
Phase 3: Script
-
Create
scripts/run_{phase_name}.py -
Must support:
--job-id,--db,--llm-mode(none/external/bedrock),--finalize,--artifact-root -
In external mode, inject
output_schema:llm_request["output_schema"] = LlmModel.model_json_schema() -
In finalize mode, deserialize through Pydantic:
llm_typed = LlmModel.model_validate(llm_response) updated = apply_llm_output(contract, llm_typed) -
Output JSON to stdout:
{"status": "complete"}or{"status": "awaiting_llm", "llm_request": "..."}or{"status": "validation_failed", "errors": [...]} -
Verify deterministic mode works:
uv run python scripts/run_{phase_name}.py --job-id test --db test --llm-mode none
STOP: Do not proceed until the script runs successfully.
Phase 4: Domain Expertise (if LLM phase exists)
- Create
src/skills/{phase_name}-expertise.md - Write the domain knowledge the LLM needs to make good decisions
- Keep it focused — principles and anti-patterns, not implementation details
Phase 5: Skill
- Create
.claude/skills/{phase_name}/SKILL.md - Follow this exact template:
---
name: {phase_name}
description: {one-line purpose}
---
# /{phase_name}
{Brief description.}
## Prerequisites
- {What must be true}
## Steps
1. **Run phase**
```bash
uv run python scripts/run_{phase_name}.py --job-id {job_id} --db {database_name} --llm-mode external
-
If status is
awaiting_llm: a. Read:.artifacts/{database_name}/{job_id}/llm_requests/{phase_name}.json- Contains context data and
output_schemab. Read:src/skills/{phase_name}-expertise.mdc. Produce JSON conforming tooutput_schemad. Write to:.artifacts/{database_name}/{job_id}/llm_responses/{phase_name}.jsone. Finalize:
uv run python scripts/run_{phase_name}.py --job-id {job_id} --db {database_name} --finalizeIf validation fails, fix errors and retry up to 3 times.
- Contains context data and
-
Update state Set
phase_status.{phase_name}= "complete"
3. Validate:
```bash
uv run python scripts/validate_skills.py
Phase 6: Integration
-
Add the new phase to the
/modernizeorchestrator skill if it belongs in the main pipeline -
Update
.claude/skills/modernize/SKILL.mdwith the new step in the correct position -
Run the pre-commit hook to verify everything links up:
uv run python scripts/validate_skills.py
Rules
- NEVER skip a phase. Each phase depends on the previous.
- NEVER put contract details in the skill. The script injects
output_schema. - NEVER reference Python source files from skills.
- Keep LLM output contracts minimal. If logic can be deterministic, it MUST be.
- The script is the source of truth for validation — the skill just runs it.
Next.js App Router Expert
Development
A skill that turns Claude into a Next.js App Router expert.
README Generator
Development
Creates professional and comprehensive README.md files for your projects.
API Documentation Writer
Development
Generates comprehensive API documentation in OpenAPI/Swagger format.