{"id":"78d8079c-52c9-416a-aabb-95e53de8acc6","shortId":"9upyuz","kind":"skill","title":"nested-memory-trigger-consume-and-clear","tagline":"Process every nested-memory trigger before wiping the trigger set so subsequent iterations only see new paths.","description":"# SKILL: Nested Memory Trigger Consume and Clear\n**Domain:** context-management  \n**Trigger:** Apply when a worker must fetch nested memory attachments whose trigger list can be cleared only after all paths are handled.\n**Source Pattern:** Distilled from reviewed context, compaction, and memory-governance patterns.\n\n## Core Method\nTreat the trigger set as authoritative input, not a mutable queue that shrinks mid-processing. First return with an empty list if no triggers exist so render-bound helpers like `getAppState()` never run unnecessarily. Once you know work is required, snapshot the triggers, iterate over every path to gather nested attachments holding onto shared app state, append all results to the response, and only after the loop completes clear the trigger set. This prevents stale triggers from re-running in future turns while ensuring concurrent iterations do not drop paths that were just discovered.\n\n## Key Rules\n- Guard the expensive `getAppState()` call with an early return whenever `nestedMemoryAttachmentTriggers` is empty.\n- Iterate through every trigger before clearing the set so no pending path disappears mid-loop.\n- Collect nested attachments with the shared `appState` object to avoid repeated renders.\n- Clear the trigger set explicitly after collecting results, not before, so next invocations start fresh.\n\n## Example Application\nWhen multiple nested memories are queued while a thread is still running, fetch them all inside a single `getNestedMemoryAttachments` call, clear the triggers afterward, and then hand the flattened attachment list to the caller.\n\n## Anti-Patterns (What NOT to do)\n- Do not clear the trigger set before iterating; that can make the next call think the paths were already handled.\n- Do not call `getAppState()` when there are no triggers, which wastes React render cycles.","tags":["nested","memory","trigger","consume","and","clear","cskill","agents","ychampion","agent-skills","ai-agents","cli"],"capabilities":["skill","source-ychampion","skill-nested-memory-trigger-consume-and-clear","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/nested-memory-trigger-consume-and-clear","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,842 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-22T00:56:53.039Z","embedding":null,"createdAt":"2026-04-18T22:20:47.225Z","updatedAt":"2026-04-22T00:56:53.039Z","lastSeenAt":"2026-04-22T00:56:53.039Z","tsv":"'afterward':253 'alreadi':289 'anti':265 'anti-pattern':264 'app':129 'append':131 'appli':38 'applic':229 'appstat':207 'attach':46,125,203,259 'authorit':78 'avoid':210 'bound':102 'call':176,249,284,293 'caller':263 'clear':7,32,52,143,190,213,250,273 'collect':201,219 'compact':65 'complet':142 'concurr':160 'consum':5,30 'context':35,64 'context-manag':34 'core':71 'cycl':304 'disappear':197 'discov':169 'distil':61 'domain':33 'drop':164 'earli':179 'empti':93,184 'ensur':159 'everi':9,120,187 'exampl':228 'exist':98 'expens':174 'explicit':217 'fetch':43,242 'first':89 'flatten':258 'fresh':227 'futur':156 'gather':123 'getappst':105,175,294 'getnestedmemoryattach':248 'govern':69 'guard':172 'hand':256 'handl':58,290 'helper':103 'hold':126 'input':79 'insid':245 'invoc':225 'iter':21,118,161,185,278 'key':170 'know':111 'like':104 'list':49,94,260 'loop':141,200 'make':281 'manag':36 'memori':3,12,28,45,68,233 'memory-govern':67 'method':72 'mid':87,199 'mid-loop':198 'mid-process':86 'multipl':231 'must':42 'mutabl':82 'nest':2,11,27,44,124,202,232 'nested-memori':10 'nested-memory-trigger-consume-and-clear':1 'nestedmemoryattachmenttrigg':182 'never':106 'new':24 'next':224,283 'object':208 'onto':127 'path':25,56,121,165,196,287 'pattern':60,70,266 'pend':195 'prevent':148 'process':8,88 'queu':235 'queue':83 're':153 're-run':152 'react':302 'render':101,212,303 'render-bound':100 'repeat':211 'requir':114 'respons':136 'result':133,220 'return':90,180 'review':63 'rule':171 'run':107,154,241 'see':23 'set':18,76,146,192,216,276 'share':128,206 'shrink':85 'singl':247 'skill':26 'skill-nested-memory-trigger-consume-and-clear' 'snapshot':115 'sourc':59 'source-ychampion' 'stale':149 'start':226 'state':130 'still':240 'subsequ':20 'think':285 'thread':238 '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':73 'trigger':4,13,17,29,37,48,75,97,117,145,150,188,215,252,275,299 'turn':157 'unnecessarili':108 'wast':301 'whenev':181 'whose':47 'wipe':15 'work':112 'worker':41","prices":[{"id":"2db0859d-5b4c-4c2f-94c0-a4dc9396aa4d","listingId":"78d8079c-52c9-416a-aabb-95e53de8acc6","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:47.225Z"}],"sources":[{"listingId":"78d8079c-52c9-416a-aabb-95e53de8acc6","source":"github","sourceId":"ychampion/cskill-agents/nested-memory-trigger-consume-and-clear","sourceUrl":"https://github.com/ychampion/cskill-agents/tree/main/skills/nested-memory-trigger-consume-and-clear","isPrimary":false,"firstSeenAt":"2026-04-18T22:20:47.225Z","lastSeenAt":"2026-04-22T00:56:53.039Z"}],"details":{"listingId":"78d8079c-52c9-416a-aabb-95e53de8acc6","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"ychampion","slug":"nested-memory-trigger-consume-and-clear","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":"578f08c16d4b3f1ad9b4497edf0e013ffee7e8d0","skill_md_path":"skills/nested-memory-trigger-consume-and-clear/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/ychampion/cskill-agents/tree/main/skills/nested-memory-trigger-consume-and-clear"},"layout":"multi","source":"github","category":"cskill-agents","frontmatter":{"name":"nested-memory-trigger-consume-and-clear","description":"Process every nested-memory trigger before wiping the trigger set so subsequent iterations only see new paths."},"skills_sh_url":"https://skills.sh/ychampion/cskill-agents/nested-memory-trigger-consume-and-clear"},"updatedAt":"2026-04-22T00:56:53.039Z"}}