Claude-skill-registry add-config-field
Guide adding a new config field across types, defaults, config.yaml, and optional state/env wiring.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/add-config-field" ~/.claude/skills/majiayu000-claude-skill-registry-add-config-field && rm -rf "$T"
skills/data/add-config-field/SKILL.md- references .env files
You are a guided assistant for adding new configuration fields to the claude-code-reviewer project. You will gather requirements, show current state, and produce an implementation checklist with exact file locations.
Step 1: Gather Requirements
Ask the user for:
- Field name — camelCase (e.g.,
)maxConcurrentReviews - Config section — which interface it belongs to:
,ReviewConfig
,PollingConfig
,WebhookConfig
, or top-levelGithubConfigAppConfig - Type — TypeScript type (e.g.,
,number
,boolean
,string
)string[] - Default value — what the default should be
- Description — one-line description for config.yaml comment
- Is it also a PRState field? — does it need to be tracked per-PR in the state file?
- Is it a ReviewRecord field? — does it need to be stored per-review in the reviews array?
- Needs env override? — should there be an environment variable override (like
)?GITHUB_TOKEN
Step 2: Show Current State
Read and display the relevant sections:
- The target interface from
(e.g.,src/types.ts
)ReviewConfig - The corresponding DEFAULTS section from
src/config.ts - The corresponding section from
config.yaml - If PRState field: show
interface,PRState
defaults, and V2 backfill loop fromgetOrCreatesrc/state/store.ts - If ReviewRecord field: show
interface and the nested backfill loop (ReviewRecord
) infor (const rev of entry.reviews)src/state/store.ts
Step 3: Generate Implementation Checklist
Produce a numbered checklist with exact file paths and locations:
A. Add to interface — src/types.ts
src/types.tsShow the exact line to add the field to the interface, matching existing style (field name, type, with a comment if other fields have comments).
B. Add to DEFAULTS — src/config.ts
src/config.tsShow the exact line to add in the
DEFAULTS constant, matching existing indentation and value format.
C. Document in config.yaml — config.yaml
config.yamlShow the exact line to add under the relevant section, with a trailing comment matching the style of existing entries.
D. (Optional) Add env override — src/config.ts
src/config.tsIf an env override is needed, show the
if (process.env.X) block to add in the env override section of loadConfig(), matching the pattern of existing overrides:
→ string, no validationGITHUB_TOKEN
→ string, no validationWEBHOOK_SECRET
→ numeric, range validation (1-65535)WEBHOOK_PORT
→ numeric,POLLING_INTERVAL
validation>= 1
→ enum, allowed-values validationMODE
Use the appropriate validation pattern for the field's type. Also add a
# or ENV_VAR_NAME env var comment to the field's entry in config.yaml, matching the pattern used for secret and token.
E. (Optional) Add to PRState — src/types.ts
+ src/state/store.ts
src/types.tssrc/state/store.tsIf it's also a PRState field:
- Add to
interface inPRStatesrc/types.ts - Add default in
ingetOrCreate()src/state/store.ts - Add backfill in the V2 backfill loop in
(usingstore.ts
)entry.field ??= defaultValue - Add field in the V1 migration
inmigrateV1()store.ts
F. (Optional) Add to ReviewRecord — src/types.ts
+ src/state/store.ts
src/types.tssrc/state/store.tsIf it's a ReviewRecord field:
- Add to
interface inReviewRecordsrc/types.ts - Add backfill in the nested loop in
(store.ts
)for (const rev of entry.reviews) { rev.field ??= defaultValue; } - Add field in the V1 migration
ReviewRecord object inmigrateV1()store.ts
Step 4: Recommend Verification
After implementation, recommend running
/verify-build to confirm:
- Build passes
- Config defaults are complete
- Config.yaml docs are complete
- State backfill covers the new field (if applicable)
Notes
- Do NOT make the changes yourself — present the checklist for the user to review, then implement only after confirmation
- Match existing code style exactly (indentation, trailing commas, comment format)
- If the field affects review behavior, mention that
ordecisions.ts
may need updates to actually use the fieldreviewer.ts