{"id":"ef485b1b-2603-4098-8c75-4c9744edc68e","shortId":"qqd8gc","kind":"skill","title":"time-based-microcompact-trigger","tagline":"Fall back to time-based microcompaction when the idle gap exceeds the configured threshold and directly clear the oldest compactable tool results.","description":"# SKILL: Time-Based Microcompact Trigger\n**Domain:** context-management  \n**Trigger:** Apply when the interval since the last assistant response exceeds the threshold and cached microcompact cannot run.\n**Source Pattern:** Distilled from reviewed context, compaction, and memory-governance patterns.\n\n## Core Method\nMeasure the minutes since the last main-thread assistant message, compare it to `gapThresholdMinutes`, and only fire when the configured trigger is enabled and the caller is the main thread. When triggered, keep the last `keepRecent` tool results and content-clear the rest by replacing their content with the `[Old tool result content cleared]` marker. Log the elapsed gap, tokens saved, and retained count so operators can tune the gap threshold.\n\n## Key Rules\n- Require a specific `querySource` (main thread) before firing so external helpers do not misinterpret delays as triggers.\n- Return `null` unless the gap exceeds the threshold, ensuring callers only run the clearing logic when necessary.\n- Always keep at least one tool result so the model retains some recent state after the purge.\n- Reset cached microcompact state and notify cache deletion after the clearing to keep downstream cache tracking in sync.\n- Emit analytics and debug logs describing the gap, tokens saved, and how many tools were cleared.\n\n## Example Application\nWhen a session sits idle longer than `gapThresholdMinutes`, apply this trigger to replace outdated tool results with `[Old tool result content cleared]`, log the 12-minute gap, and still leave the last tool result so future summaries have some fresh context.\n\n## Anti-Patterns (What NOT to do)\n- Do not run this trigger for non-main-thread sources; the clearing assumes global cache edits.\n- Do not drop all cached tools (keep at least one), or the next turn loses every tool reference and can exceed budget on the first message.","tags":["time","based","microcompact","trigger","cskill","agents","ychampion","agent-skills","ai-agents","cli","coding-agents","context-engineering"],"capabilities":["skill","source-ychampion","skill-time-based-microcompact-trigger","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/time-based-microcompact-trigger","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,886 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:57.615Z","embedding":null,"createdAt":"2026-04-18T22:21:29.272Z","updatedAt":"2026-04-22T00:56:57.615Z","lastSeenAt":"2026-04-22T00:56:57.615Z","tsv":"'12':257 'alway':180 'analyt':216 'anti':275 'anti-pattern':274 'appli':40,241 'applic':232 'assist':47,80 'assum':294 'back':7 'base':3,11,32 'budget':319 'cach':53,198,203,211,296,302 'caller':97,172 'cannot':55 'clear':23,113,126,176,207,230,254,293 'compact':26,63 'compar':82 'configur':19,91 'content':112,119,125,253 'content-clear':111 'context':37,62,273 'context-manag':36 'core':69 'count':136 'debug':218 'delay':160 'delet':204 'describ':220 'direct':22 'distil':59 'domain':35 'downstream':210 'drop':300 'edit':297 'elaps':130 'emit':215 'enabl':94 'ensur':171 'everi':313 'exampl':231 'exceed':17,49,168,318 'extern':155 'fall':6 'fire':88,153 'first':322 'fresh':272 'futur':268 'gap':16,131,142,167,222,259 'gapthresholdminut':85,240 'global':295 'govern':67 'helper':156 'idl':15,237 'interv':43 'keep':104,181,209,304 'keeprec':107 'key':144 'last':46,76,106,264 'least':183,306 'leav':262 'log':128,219,255 'logic':177 'longer':238 'lose':312 'main':78,100,150,289 'main-thread':77 'manag':38 'mani':227 'marker':127 'measur':71 'memori':66 'memory-govern':65 'messag':81,323 'method':70 'microcompact':4,12,33,54,199 'minut':73,258 'misinterpret':159 'model':189 'necessari':179 'next':310 'non':288 'non-main-thread':287 'notifi':202 'null':164 'old':122,250 'oldest':25 'one':184,307 'oper':138 'outdat':246 'pattern':58,68,276 'purg':196 'querysourc':149 'recent':192 'refer':315 'replac':117,245 'requir':146 'reset':197 'respons':48 'rest':115 'result':28,109,124,186,248,252,266 'retain':135,190 'return':163 'review':61 'rule':145 'run':56,174,283 'save':133,224 'session':235 'sinc':44,74 'sit':236 'skill':29 'skill-time-based-microcompact-trigger' 'sourc':57,291 'source-ychampion' 'specif':148 'state':193,200 'still':261 'summari':269 'sync':214 'thread':79,101,151,290 'threshold':20,51,143,170 'time':2,10,31 'time-bas':9,30 'time-based-microcompact-trigg':1 'token':132,223 'tool':27,108,123,185,228,247,251,265,303,314 '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' 'track':212 'trigger':5,34,39,92,103,162,243,285 'tune':140 'turn':311 'unless':165","prices":[{"id":"5f021216-271e-4b35-9545-eadc4490035a","listingId":"ef485b1b-2603-4098-8c75-4c9744edc68e","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:21:29.272Z"}],"sources":[{"listingId":"ef485b1b-2603-4098-8c75-4c9744edc68e","source":"github","sourceId":"ychampion/cskill-agents/time-based-microcompact-trigger","sourceUrl":"https://github.com/ychampion/cskill-agents/tree/main/skills/time-based-microcompact-trigger","isPrimary":false,"firstSeenAt":"2026-04-18T22:21:29.272Z","lastSeenAt":"2026-04-22T00:56:57.615Z"}],"details":{"listingId":"ef485b1b-2603-4098-8c75-4c9744edc68e","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"ychampion","slug":"time-based-microcompact-trigger","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":"a82a290cbfcfbe0b1879c3de90323bdb85301734","skill_md_path":"skills/time-based-microcompact-trigger/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/ychampion/cskill-agents/tree/main/skills/time-based-microcompact-trigger"},"layout":"multi","source":"github","category":"cskill-agents","frontmatter":{"name":"time-based-microcompact-trigger","description":"Fall back to time-based microcompaction when the idle gap exceeds the configured threshold and directly clear the oldest compactable tool results."},"skills_sh_url":"https://skills.sh/ychampion/cskill-agents/time-based-microcompact-trigger"},"updatedAt":"2026-04-22T00:56:57.615Z"}}