{"id":"410bba7e-9849-420c-beb0-5c452a29edbc","shortId":"H5ujY6","kind":"skill","title":"empty-payload-sentinel-guard","tagline":"Guard requests from closing instantly when a tool returns nothing by injecting the sentinel message and logging the event.","description":"# SKILL: Empty Payload Sentinel Guard\n**Domain:** tool-orchestration  \n**Trigger:** Apply this when a tool_result block might legitimately be empty (shell commands with no stdout, MCP commands returning `content: []`, statements that finish silently) so the assistant still sees something to react to.\n**Source Pattern:** Distilled from reviewed tool-loop and result-shaping patterns.\n\n## Core Method\nRun the same emptiness check used inside `isToolResultContentEmpty`: undefined/null, whitespace strings, empty arrays, or arrays whose text blocks are themselves empty count as empty. When the check fires, log `tengu_tool_empty_result` with the sanitized tool name and short-circuit the persistence path by returning the original block with `content: \"({toolName} completed with no output)\"`, guaranteeing the model always sees at least one token even when the tool produced nothing.\n\n## Key Rules\n- Copy the normalized emptiness logic from `isToolResultContentEmpty` so structured arrays and whitespace-only strings are treated identically.\n- Call `sanitizeToolNameForAnalytics` before logging so GrowthBook metrics stay consistent.\n- Only swap the `content`; leave `tool_use_id`, `tool_version`, and other metadata untouched.\n- Keep the sentinel text stable—downstream budgeting, logging, and tests rely on the literal `({toolName} completed with no output)` message.\n\n## Example Application\nInvoke this guard inside `maybePersistLargeToolResult` before any size checks; if the guard fires, it returns the sentinel immediately and prevents the empty `</function_results>` tail from tricking Claude into ending the turn.\n\n## Anti-Patterns (What NOT to do)\n- Don’t reinject a sentinel into non-empty results or structured content; the guard is exclusively for truly empty outputs.\n- Don’t skip the analytics event—without it you lose signals that a tool ran but returned nothing.\n- Don’t persist an empty file just to explain emptiness; the guard rewrites the content in memory without writing disk files.","tags":["empty","payload","sentinel","guard","cskill","agents","ychampion","agent-skills","ai-agents","cli","coding-agents","context-engineering"],"capabilities":["skill","source-ychampion","skill-empty-payload-sentinel-guard","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/empty-payload-sentinel-guard","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,006 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.381Z","embedding":null,"createdAt":"2026-04-18T22:20:18.738Z","updatedAt":"2026-04-22T06:56:48.381Z","lastSeenAt":"2026-04-22T06:56:48.381Z","tsv":"'alway':143 'analyt':282 'anti':251 'anti-pattern':250 'appli':35 'applic':219 'array':95,97,166 'assist':61 'block':41,100,132 'budget':204 'call':175 'check':87,109,228 'circuit':124 'claud':245 'close':9 'command':47,52 'complet':136,213 'consist':183 'content':54,134,187,269,310 'copi':157 'core':81 'count':104 'disk':315 'distil':70 'domain':30 'downstream':203 'empti':2,26,45,86,94,103,106,114,160,241,265,276,300,305 'empty-payload-sentinel-guard':1 'end':247 'even':149 'event':24,283 'exampl':218 'exclus':273 'explain':304 'file':301,316 'finish':57 'fire':110,232 'growthbook':180 'guarante':140 'guard':5,6,29,222,231,271,307 'id':191 'ident':174 'immedi':237 'inject':17 'insid':89,223 'instant':10 'invok':220 'istoolresultcontentempti':90,163 'keep':198 'key':155 'least':146 'leav':188 'legitim':43 'liter':211 'log':22,111,178,205 'logic':161 'loop':75 'lose':287 'maybepersistlargetoolresult':224 'mcp':51 'memori':312 'messag':20,217 'metadata':196 'method':82 'metric':181 'might':42 'model':142 'name':120 'non':264 'non-empti':263 'normal':159 'noth':15,154,295 'one':147 'orchestr':33 'origin':131 'output':139,216,277 'path':127 'pattern':69,80,252 'payload':3,27 'persist':126,298 'prevent':239 'produc':153 'ran':292 'react':66 'reinject':259 'reli':208 'request':7 'result':40,78,115,266 'result-shap':77 'return':14,53,129,234,294 'review':72 'rewrit':308 'rule':156 'run':83 'sanit':118 'sanitizetoolnameforanalyt':176 'see':63,144 'sentinel':4,19,28,200,236,261 'shape':79 'shell':46 'short':123 'short-circuit':122 'signal':288 'silent':58 'size':227 'skill':25 'skill-empty-payload-sentinel-guard' 'skip':280 'someth':64 'sourc':68 'source-ychampion' 'stabl':202 'statement':55 'stay':182 'stdout':50 'still':62 'string':93,171 'structur':165,268 'swap':185 'tail':242 'tengu':112 'test':207 'text':99,201 'token':148 'tool':13,32,39,74,113,119,152,189,192,291 'tool-loop':73 'tool-orchestr':31 'toolnam':135,212 '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':173 'trick':244 'trigger':34 'truli':275 'turn':249 'undefined/null':91 'untouch':197 'use':88,190 'version':193 'whitespac':92,169 'whitespace-on':168 'whose':98 'without':284,313 'write':314","prices":[{"id":"76e48b58-3b73-47d2-9086-534f5e7e91b0","listingId":"410bba7e-9849-420c-beb0-5c452a29edbc","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:18.738Z"}],"sources":[{"listingId":"410bba7e-9849-420c-beb0-5c452a29edbc","source":"github","sourceId":"ychampion/cskill-agents/empty-payload-sentinel-guard","sourceUrl":"https://github.com/ychampion/cskill-agents/tree/main/skills/empty-payload-sentinel-guard","isPrimary":false,"firstSeenAt":"2026-04-18T22:20:18.738Z","lastSeenAt":"2026-04-22T06:56:48.381Z"}],"details":{"listingId":"410bba7e-9849-420c-beb0-5c452a29edbc","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"ychampion","slug":"empty-payload-sentinel-guard","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":"247bbade0f7a50ea3fd83d3b5a53787cde96d962","skill_md_path":"skills/empty-payload-sentinel-guard/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/ychampion/cskill-agents/tree/main/skills/empty-payload-sentinel-guard"},"layout":"multi","source":"github","category":"cskill-agents","frontmatter":{"name":"empty-payload-sentinel-guard","description":"Guard requests from closing instantly when a tool returns nothing by injecting the sentinel message and logging the event."},"skills_sh_url":"https://skills.sh/ychampion/cskill-agents/empty-payload-sentinel-guard"},"updatedAt":"2026-04-22T06:56:48.381Z"}}