{"id":"9a2e8d41-bf17-4411-885b-ec2f2f7098dd","shortId":"KfK6s7","kind":"skill","title":"feature-gated-command-registry-loading","tagline":"Assemble the command registry so optional modules only load when their feature flag is enabled and the registry is accessed.","description":"# SKILL: Feature-Gated Command Registry Loading\n**Domain:** Command Architecture  \n**Trigger:** Use when a command registry must gate optional commands behind feature flags and only initialize them when the registry is actually requested.  \n**Source Pattern:** Distilled from reviewed command-surface, feature-gating, and lazy-registry implementations.\n\n## Core Method\nList the baseline commands normally, but place optional commands behind explicit feature checks so their modules do not load unless the feature is enabled. Build the registry lazily and cache the result after first access so startup does not pay for configuration reads or heavyweight command wiring. If you maintain companion registries such as internal-only or hidden commands, derive them from the same gated entries instead of rebuilding the logic in parallel.\n\n## Key Rules\n- Wrap each optional command in a feature check or runtime gate before loading its module.\n- Build the registry inside a lazy cached function rather than at module scope.\n- For any auxiliary command lists (internal, plugin, or plugin-derived), reuse the same filtered, feature-gated entries instead of recomputing or hardcoding duplicates.\n- Keep metadata like `commandName`/`description` stable in the base list so the gating decision can focus solely on the inclusion of a `require`.\n\n## Example Application\nIf you add an advanced `/insights` command, keep it behind a feature gate and load it only when the gate is enabled and the registry is requested. Users without that feature never pay the startup cost of the heavy module.\n\n## Anti-Patterns (What NOT to do)\n- Don’t unconditionally `import './commands/insights.js'` at the top level, which loads a massive module even when the feature is disabled.\n- Don’t build the full registry during module initialization; that forces configuration reads and spills all commands into every consumer.\n- Don’t create separate standalone registries per feature; use one memoized array and gate entries inside it to keep lookups predictable.","tags":["feature","gated","command","registry","loading","cskill","agents","ychampion","agent-skills","ai-agents","cli","coding-agents"],"capabilities":["skill","source-ychampion","skill-feature-gated-command-registry-loading","topic-agent-skills","topic-ai-agents","topic-cli","topic-coding-agents","topic-context-engineering","topic-developer-tools","topic-mcp","topic-multi-agent","topic-terminal-ui"],"categories":["cskill-agents"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/ychampion/cskill-agents/feature-gated-command-registry-loading","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add ychampion/cskill-agents","source_repo":"https://github.com/ychampion/cskill-agents","install_from":"skills.sh"}},"qualityScore":"0.467","qualityRationale":"deterministic score 0.47 from registry signals: · indexed on github topic:agent-skills · 34 github stars · SKILL.md body (2,031 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T06:56:48.931Z","embedding":null,"createdAt":"2026-04-18T22:20:24.114Z","updatedAt":"2026-04-22T06:56:48.931Z","lastSeenAt":"2026-04-22T06:56:48.931Z","tsv":"'/commands/insights.js':283 '/insights':237 'access':26,112 'actual':58 'add':234 'advanc':236 'anti':273 'anti-pattern':272 'applic':231 'architectur':36 'array':330 'assembl':7 'auxiliari':184 'base':215 'baselin':80 'behind':47,87,241 'build':102,169,301 'cach':107,175 'check':90,161 'command':4,9,31,35,41,46,66,81,86,123,137,157,185,238,315 'command-surfac':65 'commandnam':210 'companion':128 'configur':119,310 'consum':318 'core':76 'cost':267 'creat':321 'decis':220 'deriv':138,192 'descript':211 'disabl':298 'distil':62 'domain':34 'duplic':206 'enabl':21,101,253 'entri':144,200,333 'even':293 'everi':317 'exampl':230 'explicit':88 'featur':2,18,29,48,69,89,99,160,198,243,262,296,326 'feature-g':28,68,197 'feature-gated-command-registry-load':1 'filter':196 'first':111 'flag':19,49 'focus':222 'forc':309 'full':303 'function':176 'gate':3,30,44,70,143,164,199,219,244,251,332 'hardcod':205 'heavi':270 'heavyweight':122 'hidden':136 'implement':75 'import':282 'inclus':226 'initi':52,307 'insid':172,334 'instead':145,201 'intern':133,187 'internal-on':132 'keep':207,239,337 'key':152 'lazi':73,174 'lazili':105 'lazy-registri':72 'level':287 'like':209 'list':78,186,216 'load':6,15,33,96,166,246,289 'logic':149 'lookup':338 'maintain':127 'massiv':291 'memoiz':329 'metadata':208 'method':77 'modul':13,93,168,180,271,292,306 'must':43 'never':263 'normal':82 'one':328 'option':12,45,85,156 'parallel':151 'pattern':61,274 'pay':117,264 'per':325 'place':84 'plugin':188,191 'plugin-deriv':190 'predict':339 'rather':177 'read':120,311 'rebuild':147 'recomput':203 'registri':5,10,24,32,42,56,74,104,129,171,256,304,324 'request':59,258 'requir':229 'result':109 'reus':193 'review':64 'rule':153 'runtim':163 'scope':181 'separ':322 'skill':27 'skill-feature-gated-command-registry-loading' 'sole':223 'sourc':60 'source-ychampion' 'spill':313 'stabl':212 'standalon':323 'startup':114,266 'surfac':67 'top':286 'topic-agent-skills' 'topic-ai-agents' 'topic-cli' 'topic-coding-agents' 'topic-context-engineering' 'topic-developer-tools' 'topic-mcp' 'topic-multi-agent' 'topic-terminal-ui' 'trigger':37 'uncondit':281 'unless':97 'use':38,327 'user':259 'wire':124 'without':260 'wrap':154","prices":[{"id":"31a12eeb-25c3-492e-be92-789aa97ae196","listingId":"9a2e8d41-bf17-4411-885b-ec2f2f7098dd","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"ychampion","category":"cskill-agents","install_from":"skills.sh"},"createdAt":"2026-04-18T22:20:24.114Z"}],"sources":[{"listingId":"9a2e8d41-bf17-4411-885b-ec2f2f7098dd","source":"github","sourceId":"ychampion/cskill-agents/feature-gated-command-registry-loading","sourceUrl":"https://github.com/ychampion/cskill-agents/tree/main/skills/feature-gated-command-registry-loading","isPrimary":false,"firstSeenAt":"2026-04-18T22:20:24.114Z","lastSeenAt":"2026-04-22T06:56:48.931Z"}],"details":{"listingId":"9a2e8d41-bf17-4411-885b-ec2f2f7098dd","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"ychampion","slug":"feature-gated-command-registry-loading","github":{"repo":"ychampion/cskill-agents","stars":34,"topics":["agent-skills","ai-agents","cli","coding-agents","context-engineering","developer-tools","mcp","multi-agent","terminal-ui"],"license":"mit","html_url":"https://github.com/ychampion/cskill-agents","pushed_at":"2026-04-04T14:13:23Z","description":"Agent skills for coding CLIs, multi-agent runtimes, context engines, MCP extensions, and terminal tooling. Instead of using claude code's source code, give your agent skills to create your own!","skill_md_sha":"4d51cfa301ffe0b9ff028d58b19a8f0fd59e7827","skill_md_path":"skills/feature-gated-command-registry-loading/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/ychampion/cskill-agents/tree/main/skills/feature-gated-command-registry-loading"},"layout":"multi","source":"github","category":"cskill-agents","frontmatter":{"name":"feature-gated-command-registry-loading","description":"Assemble the command registry so optional modules only load when their feature flag is enabled and the registry is accessed."},"skills_sh_url":"https://skills.sh/ychampion/cskill-agents/feature-gated-command-registry-loading"},"updatedAt":"2026-04-22T06:56:48.931Z"}}