config-field
Skill1 starsChanged 3 months agoMITView on GitHub
Add a new field to HangarConfig correctly — all five touch-points in the right order. Use when adding any new top-level config option: the field must land in the server type, validation, save logic, web type, Settings UI, and README simultaneously. Args: the field name and a one-line description of what it does.
In this repository6 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- aiwf-syncSkill
- docs-updateSkill
- hangar-validateSkill
- releaseSkill
- smokeSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 6
Add a new field to Hangar's config, touching every required location so nothing is half-wired.
- Distinctive: line 20
Read the args. Determine:
- Distinctive: line 29
Add the field with its type and a JSDoc comment explaining what it controls.
- Very specific: line 39
validateConfig: if the field has required constraints (e.g. - Very specific: line 42
saveConfig: add a spread entry to the clean object using the same conditional pattern as existing fields. - Very specific: line 55
Add the identical field + type.
- Distinctive: line 60
Follow the existing control patterns:
- Very specific: line 69
Call api.saveConfig({ ...latest, myField: value }) on change
- Distinctive: line 75
Add a one-liner row or bullet describing the new field, its type, default, and what it does.
- Very specific: line 79
If the field should be visible to new users setting up Hangar for the first time, add it (commented out or with a sensible default) to …
- Distinctive: line 85
Run typecheck before calling it done:
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add a new field to Hangar's config, touching every required location so nothing is half-wired.
The five mandatory touch-points, in order:
server/src/types.ts— the authoritative type (HangarConfig)server/src/config.ts— validation (validateConfig) and serialisation (saveConfig)web/src/types.ts— the mirrored web type (FullConfig)web/src/components/Settings.tsx— the UI controlREADME.md— user-facing documentation
Steps
0. Understand the field
Read the args. Determine:
- The TypeScript type (boolean, number, string, string[], or an interface)
- Whether it's optional (almost always yes — keep backwards-compat with existing configs)
- The default value / fallback when absent
- Whether it's relevant to the Settings UI (most fields are; skip only if it's dev-internal)
1. server/src/types.ts — add to HangarConfig
Add the field with its type and a JSDoc comment explaining what it controls. Keep the comment terse — one line max. Follow the existing optional-field style:
/** One-line description. */
myField?: SomeType;2. server/src/config.ts — wire validation and persistence
validateConfig: if the field has required constraints (e.g. must be positive, must not be
empty when present), add a guard. Optional fields with sensible defaults don't need validation.
saveConfig: add a spread entry to the clean object using the same conditional pattern as
existing fields. The pattern is:
- Boolean:
...(typeof raw.myField === "boolean" ? { myField: raw.myField } : currentConfig?.myField !== undefined ? { myField: currentConfig.myField } : {}) - Number (positive sets, 0 clears, undefined preserves): mirror the
maxTurns/maxBudgetUsdpattern - String (non-empty sets, "" clears, undefined preserves): mirror the
terminalpattern - Array: mirror the
exclusiveAgentspattern (trim + filter)
The rule: an explicit value from raw wins; otherwise preserve currentConfig; otherwise omit
(so the key isn't written to disk unless set).
3. web/src/types.ts — mirror in FullConfig
Add the identical field + type. The web FullConfig is a subset of the server HangarConfig
(it never includes server-only fields like resolved paths). Keep it in sync.
4. web/src/components/Settings.tsx — add a UI control
Follow the existing control patterns:
- Boolean toggle → find the
isolateRunsorbypassPermissionssection; add an analogous<label>+<input type="checkbox">block - Number input → find the
maxTurns/maxBudgetUsdsection; add an analogous<input type="text" inputMode="numeric">block - String input → add a text
<input>wired to local state, callingapi.saveConfigon blur/submit
Each control should:
useEffectto load the initial value fromapi.config()- Call
api.saveConfig({ ...latest, myField: value })on change - Show a brief label + helper text describing the field
5. README.md — document it
Find the configuration reference section (search for nearby fields like maxTurns, bypassPermissions).
Add a one-liner row or bullet describing the new field, its type, default, and what it does.
6. hangar.config.example.json (conditional)
If the field should be visible to new users setting up Hangar for the first time, add it
(commented out or with a sensible default) to hangar.config.example.json. Skip if it's
optional and the default is always correct.
7. Verify
Run typecheck before calling it done:
npm run typecheckFix any errors before reporting completion. List all files you modified.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

