{"id":"f4373d06-4db3-42b7-af66-1edf75cefc05","shortId":"4dujaW","kind":"skill","title":"dynamic-skill-insertion-before-builtins","tagline":"Merge runtime-discovered commands into an existing command registry by deduping them against the enabled base surface and inserting them at a stable boundary before built-in commands.","description":"# SKILL: Dynamic Skill Insertion Before Builtins\n**Domain:** Command Architecture\n**Trigger:** Use when commands can be discovered at runtime and must be added to a prebuilt command list without duplicating enabled entries or scrambling the established built-in ordering.\n**Source Pattern:** Distilled from reviewed command-surface, skill-discovery, and CLI capability implementations.\n\n## Core Method\nFirst compute the user-visible base command list, then treat that enabled surface as the dedupe authority for any newly discovered runtime commands. Filter dynamic entries by stable command name against that base set so you only add commands that are truly absent for the current session. Instead of re-sorting or rebuilding the whole registry, locate the first built-in command and splice the new dynamic entries immediately before it. This keeps plugin and external discoveries ahead of the built-in block while preserving the built-ins' internal order and keeping the command surface stable across refreshes.\n\n## Key Rules\n- Deduplicate against the already filtered base surface, not against every raw registered command, so disabled or unavailable commands do not wrongly block a dynamic replacement.\n- Use a stable identity key such as the command name when checking whether a dynamic entry is already present.\n- Keep a fast path that returns the base list unchanged when no dynamic commands exist or when all of them collapse during dedupe.\n- Derive the insertion anchor from the built-in command set, then splice once at that boundary instead of globally reordering the registry.\n- If no built-in boundary exists in the current list, append the dynamic entries so discovery still succeeds without special-case failures.\n\n## Example Application\nIf a CLI can discover new slash commands while scanning the working tree, first build the enabled command list the user can actually run, remove any discovered commands whose names already appear there, then insert the remaining discoveries just before the first built-in help or config command. The runtime additions stay visible near other extensible commands without shuffling the built-in command block on each scan.\n\n## Anti-Patterns (What NOT to do)\n- Do not deduplicate against the raw registry before availability checks; hidden commands will suppress dynamic commands the user should actually see.\n- Do not sort the full command list again after discovery; repeated scans will create unstable ordering and noisy diffs in the command surface.\n- Do not anchor insertion to source load order alone; use an explicit built-in boundary so additive discoveries land in a predictable location.","tags":["dynamic","skill","insertion","before","builtins","cskill","agents","ychampion","agent-skills","ai-agents","cli","coding-agents"],"capabilities":["skill","source-ychampion","skill-dynamic-skill-insertion-before-builtins","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/dynamic-skill-insertion-before-builtins","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,647 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.311Z","embedding":null,"createdAt":"2026-04-18T22:20:17.979Z","updatedAt":"2026-04-22T06:56:48.311Z","lastSeenAt":"2026-04-22T06:56:48.311Z","tsv":"'absent':136 'across':194 'actual':336,409 'ad':58 'add':131 'addit':365,451 'ahead':173 'alon':442 'alreadi':201,240,344 'anchor':268,436 'anti':384 'anti-pattern':383 'appear':345 'append':299 'applic':313 'architectur':45 'author':110 'avail':398 'base':23,99,126,203,249 'block':179,219,379 'boundari':31,281,293,449 'build':328 'built':34,73,155,177,184,272,291,357,376,447 'built-in':33,72,154,176,183,271,290,356,375,446 'builtin':6,42 'capabl':89 'case':310 'check':234,399 'cli':88,316 'collaps':262 'command':11,15,36,44,49,62,82,100,116,122,132,157,191,210,215,231,255,274,321,331,341,362,371,378,401,405,416,432 'command-surfac':81 'comput':94 'config':361 'core':91 'creat':424 'current':139,297 'dedup':18,109,264 'dedupl':198,392 'deriv':265 'diff':429 'disabl':212 'discov':10,52,114,318,340 'discoveri':86,172,304,351,420,452 'distil':78 'domain':43 'duplic':65 'dynam':2,38,118,162,221,237,254,301,404 'dynamic-skill-insertion-before-builtin':1 'enabl':22,66,105,330 'entri':67,119,163,238,302 'establish':71 'everi':207 'exampl':312 'exist':14,256,294 'explicit':445 'extens':370 'extern':171 'failur':311 'fast':244 'filter':117,202 'first':93,153,327,355 'full':415 'global':284 'help':359 'hidden':400 'ident':226 'immedi':164 'implement':90 'in':185 'insert':4,26,40,267,348,437 'instead':141,282 'intern':186 'keep':168,189,242 'key':196,227 'land':453 'list':63,101,250,298,332,417 'load':440 'locat':151,457 'merg':7 'method':92 'must':56 'name':123,232,343 'near':368 'new':161,319 'newli':113 'noisi':428 'order':75,187,426,441 'path':245 'pattern':77,385 'plugin':169 'prebuilt':61 'predict':456 'present':241 'preserv':181 'raw':208,395 're':144 're-sort':143 'rebuild':147 'refresh':195 'regist':209 'registri':16,150,287,396 'remain':350 'remov':338 'reorder':285 'repeat':421 'replac':222 'return':247 'review':80 'rule':197 'run':337 'runtim':9,54,115,364 'runtime-discov':8 'scan':323,382,422 'scrambl':69 'see':410 'session':140 'set':127,275 'shuffl':373 'skill':3,37,39,85 'skill-discoveri':84 'skill-dynamic-skill-insertion-before-builtins' 'slash':320 'sort':145,413 'sourc':76,439 'source-ychampion' 'special':309 'special-cas':308 'splice':159,277 'stabl':30,121,193,225 'stay':366 'still':305 'succeed':306 'suppress':403 'surfac':24,83,106,192,204,433 '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' 'treat':103 'tree':326 'trigger':46 'truli':135 'unavail':214 'unchang':251 'unstabl':425 'use':47,223,443 'user':97,334,407 'user-vis':96 'visibl':98,367 'whether':235 'whole':149 'whose':342 'without':64,307,372 'work':325 'wrong':218","prices":[{"id":"9e71479c-797b-4fc5-bbd4-bfb3d11c46d6","listingId":"f4373d06-4db3-42b7-af66-1edf75cefc05","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:17.979Z"}],"sources":[{"listingId":"f4373d06-4db3-42b7-af66-1edf75cefc05","source":"github","sourceId":"ychampion/cskill-agents/dynamic-skill-insertion-before-builtins","sourceUrl":"https://github.com/ychampion/cskill-agents/tree/main/skills/dynamic-skill-insertion-before-builtins","isPrimary":false,"firstSeenAt":"2026-04-18T22:20:17.979Z","lastSeenAt":"2026-04-22T06:56:48.311Z"}],"details":{"listingId":"f4373d06-4db3-42b7-af66-1edf75cefc05","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"ychampion","slug":"dynamic-skill-insertion-before-builtins","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":"a5698976a74b54def59804aac33e525795bdb258","skill_md_path":"skills/dynamic-skill-insertion-before-builtins/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/ychampion/cskill-agents/tree/main/skills/dynamic-skill-insertion-before-builtins"},"layout":"multi","source":"github","category":"cskill-agents","frontmatter":{"name":"dynamic-skill-insertion-before-builtins","description":"Merge runtime-discovered commands into an existing command registry by deduping them against the enabled base surface and inserting them at a stable boundary before built-in commands."},"skills_sh_url":"https://skills.sh/ychampion/cskill-agents/dynamic-skill-insertion-before-builtins"},"updatedAt":"2026-04-22T06:56:48.311Z"}}