{"id":"70d2979a-3ada-4739-af18-c798841258f0","shortId":"Yv4xyA","kind":"skill","title":"ansi-safe-border-caption-embedding","tagline":"Embed captions into terminal borders while preserving alignment, clipping, and color/dim semantics.","description":"# SKILL: ANSI-Safe Border Caption Embedding\n**Domain:** output-rendering\n**Trigger:** Apply when you must insert text into a border line (top or bottom) while preserving the border characters, colors, and alignment, even if the caption is wider than available space.\n**Source Pattern:** Distilled from reviewed terminal rendering, layout, animation, and accessibility implementations.\n\n## Core Method\nTreat the border as a sequence of uniformly repeated characters, compute the textual width, and trim or center the caption before joining it back into the border; this keeps the corners intact. Use the helper that calculates string width (respecting wide characters), convert `position` into an absolute column, and split the border into before/text/after fragments so colors/dim states can be reapplied independently.\n\n## Key Rules\n- Always compute string width on the caption and the border to avoid breaking wide glyphs when aligning.\n- Guard with max width: if text length border length 2, cut the caption so it fits without overwriting corner glyphs.\n- Reapply color/dim styling separately to the prefix, caption, and suffix before writing to the output buffer so ANSI escapes stay symmetric.\n- Support `start`, `end`, and `center` alignments plus `offset` adjustments so captions can hug either edge without manual math.\n\n## Example Application\nWhen labeling a dialog border, call this method with `position:'top'`, `align:'center'`, and the pre-rendered caption string; clip it if the window narrows, and keep the corner and side glyphs in place so the divider stays crisp.\n\n## Anti-Patterns (What NOT to do)\n- Do not blur characters by writing the caption directly into the border string without recalculating width; wide glyphs will be truncated incorrectly.\n- Do not drop color/dim styling while embedding text, which makes the caption disappear under multi-colored borders.","tags":["ansi","safe","border","caption","embedding","cskill","agents","ychampion","agent-skills","ai-agents","cli","coding-agents"],"capabilities":["skill","source-ychampion","skill-ansi-safe-border-caption-embedding","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/ansi-safe-border-caption-embedding","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 (1,885 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:44.615Z","embedding":null,"createdAt":"2026-04-18T22:19:42.169Z","updatedAt":"2026-04-22T06:56:44.615Z","lastSeenAt":"2026-04-22T06:56:44.615Z","tsv":"'2':165 'absolut':121 'access':71 'adjust':205 'align':14,51,155,202,228 'alway':139 'anim':69 'ansi':2,21,193 'ansi-saf':20 'ansi-safe-border-caption-embed':1 'anti':258 'anti-pattern':257 'appli':31 'applic':216 'avail':59 'avoid':150 'back':98 'before/text/after':128 'blur':266 'border':4,11,23,39,47,77,101,126,148,163,221,275,303 'bottom':43 'break':151 'buffer':191 'calcul':111 'call':222 'caption':5,8,24,55,94,145,168,183,207,235,271,297 'center':92,201,229 'charact':48,84,116,267 'clip':15,237 'color':49,302 'color/dim':17,177,289 'colors/dim':131 'column':122 'comput':85,140 'convert':117 'core':73 'corner':105,174,246 'crisp':256 'cut':166 'dialog':220 'direct':272 'disappear':298 'distil':63 'divid':254 'domain':26 'drop':288 'edg':211 'either':210 'emb':7 'embed':6,25,292 'end':199 'escap':194 'even':52 'exampl':215 'fit':171 'fragment':129 'glyph':153,175,249,281 'guard':156 'helper':109 'hug':209 'implement':72 'incorrect':285 'independ':136 'insert':35 'intact':106 'join':96 'keep':103,244 'key':137 'label':218 'layout':68 'length':162,164 'line':40 'make':295 'manual':213 'math':214 'max':158 'method':74,224 'multi':301 'multi-color':300 'must':34 'narrow':242 'offset':204 'output':28,190 'output-rend':27 'overwrit':173 'pattern':62,259 'place':251 'plus':203 'posit':118,226 'pre':233 'pre-rend':232 'prefix':182 'preserv':13,45 'reappli':135,176 'recalcul':278 'render':29,67,234 'repeat':83 'respect':114 'review':65 'rule':138 'safe':3,22 'semant':18 'separ':179 'sequenc':80 'side':248 'skill':19 'skill-ansi-safe-border-caption-embedding' 'sourc':61 'source-ychampion' 'space':60 'split':124 'start':198 'state':132 'stay':195,255 'string':112,141,236,276 'style':178,290 'suffix':185 'support':197 'symmetr':196 'termin':10,66 'text':36,161,293 'textual':87 'top':41,227 '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':75 'trigger':30 'trim':90 'truncat':284 'uniform':82 'use':107 'wide':115,152,280 'wider':57 'width':88,113,142,159,279 'window':241 'without':172,212,277 'write':187,269","prices":[{"id":"0c8ddb91-7d30-4389-875d-e4436008c183","listingId":"70d2979a-3ada-4739-af18-c798841258f0","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:19:42.169Z"}],"sources":[{"listingId":"70d2979a-3ada-4739-af18-c798841258f0","source":"github","sourceId":"ychampion/cskill-agents/ansi-safe-border-caption-embedding","sourceUrl":"https://github.com/ychampion/cskill-agents/tree/main/skills/ansi-safe-border-caption-embedding","isPrimary":false,"firstSeenAt":"2026-04-18T22:19:42.169Z","lastSeenAt":"2026-04-22T06:56:44.615Z"}],"details":{"listingId":"70d2979a-3ada-4739-af18-c798841258f0","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"ychampion","slug":"ansi-safe-border-caption-embedding","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":"29e86e12bc4c297db5404fb7283c70641a40793c","skill_md_path":"skills/ansi-safe-border-caption-embedding/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/ychampion/cskill-agents/tree/main/skills/ansi-safe-border-caption-embedding"},"layout":"multi","source":"github","category":"cskill-agents","frontmatter":{"name":"ansi-safe-border-caption-embedding","description":"Embed captions into terminal borders while preserving alignment, clipping, and color/dim semantics."},"skills_sh_url":"https://skills.sh/ychampion/cskill-agents/ansi-safe-border-caption-embedding"},"updatedAt":"2026-04-22T06:56:44.615Z"}}