{"id":"5e1a8517-8202-4e2c-b488-aef9275aee9d","shortId":"L6KEF8","kind":"skill","title":"canonical-worktree-path-normalization","tagline":"Resolve repo-relative paths against the canonical checkout root so shared state stays stable across Git worktrees.","description":"# SKILL: Canonical Worktree Path Normalization\n**Domain:** git-worktree\n**Trigger:** Use when repo-relative paths are written into shared or user-global state and the same project may be opened from multiple worktrees.\n**Source Pattern:** Distilled from reviewed permission, shell-safety, and worktree-management implementations.\n\n## Core Method\nNormalize relative paths against the repository’s canonical root rather than the current worktree directory before persisting them into shared state. This prevents each worktree session from rewriting the same logical source to a different absolute path, and it avoids leaving dead install locations behind when a temporary worktree disappears. Keep the normalization local to the persistence boundary so upstream callers can continue using project-relative configuration naturally.\n\n## Key Rules\n- Resolve relative project paths at the point where they are compared against or written into shared state.\n- Prefer the canonical Git root over the active worktree path whenever the stored state outlives a single checkout.\n- Preserve already-absolute paths as-is; normalization is for relative project references only.\n- Use the same normalized path for both comparison and write decisions so diff logic stays stable.\n- Treat this as a stability contract for shared metadata, not merely a convenience for path formatting.\n\n## Example Application\nIf plugin sources are declared as marketplace inside repository settings but stored in a global config file as absolute paths, resolve them against the main checkout root. Opening the repo from a feature worktree then compares equal to the existing entry instead of churning the stored path on every session.\n\n## Anti-Patterns (What NOT to do)\n- Do not persist worktree-specific absolute paths into user-global registries when the logical source belongs to the repo as a whole.\n- Do not normalize only on writes but compare against raw relative paths on reads; the system will oscillate between equivalent representations.","tags":["canonical","worktree","path","normalization","cskill","agents","ychampion","agent-skills","ai-agents","cli","coding-agents","context-engineering"],"capabilities":["skill","source-ychampion","skill-canonical-worktree-path-normalization","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/canonical-worktree-path-normalization","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,012 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:46.594Z","embedding":null,"createdAt":"2026-04-18T22:20:00.734Z","updatedAt":"2026-04-22T06:56:46.594Z","lastSeenAt":"2026-04-22T06:56:46.594Z","tsv":"'absolut':110,184,248,293 'across':21 'activ':170 'alreadi':183 'already-absolut':182 'anti':281 'anti-pattern':280 'applic':229 'as-i':186 'avoid':114 'behind':119 'belong':304 'boundari':132 'caller':135 'canon':2,13,25,82,165 'canonical-worktree-path-norm':1 'checkout':14,180,255 'churn':273 'compar':156,265,318 'comparison':203 'config':245 'configur':142 'continu':137 'contract':217 'conveni':224 'core':73 'current':87 'dead':116 'decis':206 'declar':234 'diff':208 'differ':109 'directori':89 'disappear':124 'distil':61 'domain':29 'entri':270 'equal':266 'equival':330 'everi':278 'exampl':228 'exist':269 'featur':262 'file':246 'format':227 'git':22,31,166 'git-worktre':30 'global':47,244,298 'implement':72 'insid':237 'instal':117 'instead':271 'keep':125 'key':144 'leav':115 'local':128 'locat':118 'logic':105,209,302 'main':254 'manag':71 'marketplac':236 'may':53 'mere':222 'metadata':220 'method':74 'multipl':57 'natur':143 'normal':5,28,75,127,189,199,313 'open':55,257 'oscil':328 'outliv':177 'path':4,10,27,39,77,111,149,172,185,200,226,249,276,294,322 'pattern':60,282 'permiss':64 'persist':91,131,289 'plugin':231 'point':152 'prefer':163 'preserv':181 'prevent':97 'project':52,140,148,193 'project-rel':139 'rather':84 'raw':320 'read':324 'refer':194 'registri':299 'relat':9,38,76,141,147,192,321 'repo':8,37,259,307 'repo-rel':7,36 'repositori':80,238 'represent':331 'resolv':6,146,250 'review':63 'rewrit':102 'root':15,83,167,256 'rule':145 'safeti':67 'session':100,279 'set':239 'share':17,43,94,161,219 'shell':66 'shell-safeti':65 'singl':179 'skill':24 'skill-canonical-worktree-path-normalization' 'sourc':59,106,232,303 'source-ychampion' 'specif':292 'stabil':216 'stabl':20,211 'state':18,48,95,162,176 'stay':19,210 'store':175,241,275 'system':326 'temporari':122 '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':212 'trigger':33 'upstream':134 'use':34,138,196 'user':46,297 'user-glob':45,296 'whenev':173 'whole':310 'worktre':3,23,26,32,58,70,88,99,123,171,263,291 'worktree-manag':69 'worktree-specif':290 'write':205,316 'written':41,159","prices":[{"id":"3a0aae84-0fea-4486-ac88-7cab92923fc6","listingId":"5e1a8517-8202-4e2c-b488-aef9275aee9d","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:00.734Z"}],"sources":[{"listingId":"5e1a8517-8202-4e2c-b488-aef9275aee9d","source":"github","sourceId":"ychampion/cskill-agents/canonical-worktree-path-normalization","sourceUrl":"https://github.com/ychampion/cskill-agents/tree/main/skills/canonical-worktree-path-normalization","isPrimary":false,"firstSeenAt":"2026-04-18T22:20:00.734Z","lastSeenAt":"2026-04-22T06:56:46.594Z"}],"details":{"listingId":"5e1a8517-8202-4e2c-b488-aef9275aee9d","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"ychampion","slug":"canonical-worktree-path-normalization","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":"25c72d79b33a1e3d81bb47d8654be6ecb3c93357","skill_md_path":"skills/canonical-worktree-path-normalization/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/ychampion/cskill-agents/tree/main/skills/canonical-worktree-path-normalization"},"layout":"multi","source":"github","category":"cskill-agents","frontmatter":{"name":"canonical-worktree-path-normalization","description":"Resolve repo-relative paths against the canonical checkout root so shared state stays stable across Git worktrees."},"skills_sh_url":"https://skills.sh/ychampion/cskill-agents/canonical-worktree-path-normalization"},"updatedAt":"2026-04-22T06:56:46.594Z"}}