{"id":"9fd1691f-d8c8-4bb1-8972-73b51e94681c","shortId":"CeBze3","kind":"skill","title":"lovstudio:auto-context","tagline":"Manual or hook-triggered context operator. Evaluates the current session for pollution (long conversations, topic drift, stale noise), AND takes concrete context-shaping actions: writing project memory, updating global or project CLAUDE.md (with diff + confirm), and recommending ","description":"# AutoContext: Context Operator\n\nNot just a health check — a full operator over everything that shapes\ncontext. Three layers by action sensitivity:\n\n| Layer | Examples | Behavior |\n|-------|----------|----------|\n| **Auto-execute** | write project memory, update `MEMORY.md` index | Do it, report path |\n| **Confirm-first** | edit `~/.claude/CLAUDE.md`, edit project `CLAUDE.md`, overwrite/delete existing memory | Show diff, wait for \"yes\" |\n| **Suggest-only** | `/fork`, `/compact`, `/btw`, new session | Print the exact command to paste |\n\nThe harness owns `/fork` and `/compact`; this skill cannot invoke them. But\nit can do everything else and will.\n\n## Auto Mode (via Plugin Hook)\n\nWhen the lovstudio plugin is enabled, a `UserPromptSubmit` hook monitors\ntranscript size. Above threshold (40+ entries or 150KB+), it injects a\nlightweight `<auto-context>` reminder.\n\n**When you see `<auto-context>`:**\n\n| Context State | Action |\n|---------------|--------|\n| Mostly relevant | Continue, say nothing |\n| Some stale noise | Mentally deprioritize, proceed |\n| Mostly irrelevant | Suggest `/fork` or `/btw` with exact command |\n| Near capacity | Suggest `/compact` or `/fork` with exact command |\n\nRules:\n- 1 sentence max unless acting.\n- If context is fine, say nothing.\n- Never auto-fork/auto-compact (can't anyway — harness-only).\n- Don't mention \"AutoContext\" unless asked.\n\n## Manual Mode (`/lovstudio-auto-context [args]`)\n\nTwo call shapes:\n\n### A. Bare call — health report + opportunistic memory write\n\n```\n/lovstudio-auto-context\n```\n\n1. **Measure** — estimate turns, tool calls, distinct topics\n2. **Assess** — healthy / getting noisy / polluted / critical\n3. **Scan recent turns for unpersisted feedback/preferences** —\n   if the user stated a rule or preference earlier in the session that\n   should persist to future conversations (typical trigger phrases:\n   \"从今以后\", \"以后都\", \"所有 X 应该 Y\", \"别再\", \"记住\"), and no\n   memory was written, auto-execute: write the memory file + update\n   `MEMORY.md`. Report the path.\n4. **Recommend** harness actions if needed (`/fork`, `/compact`, `/btw`)\n   with the exact command to paste.\n\nKeep to 3-5 lines unless taking confirm-first actions.\n\n### B. With arguments — targeted context operation\n\n```\n/lovstudio-auto-context <free-form instruction>\n```\n\nParse the instruction and route to the right action class:\n\n| Instruction pattern | Action | Sensitivity |\n|---|---|---|\n| \"记到全局 / write to global / 加到 ~/.claude/CLAUDE.md\" | edit `~/.claude/CLAUDE.md` | **Confirm-first** |\n| \"记到项目 / 加到项目 CLAUDE.md\" | edit project `CLAUDE.md` | **Confirm-first** |\n| \"记住 X / 记到 memory\" | write project memory | Auto-execute |\n| \"忘掉 X / forget X\" | remove relevant memory file + index entry | **Confirm-first** |\n| \"该分叉了吗 / should I fork\" | evaluate + suggest command | Suggest-only |\n| \"压缩一下 / compact\" | suggest `/compact` with exact syntax | Suggest-only |\n\n## Action: Write Project Memory (auto-execute)\n\nDirectory: `~/.claude/projects/<project-slug>/memory/` (already exists; do\nnot mkdir).\n\nProcedure:\n1. Pick filename: `<type>_<topic>.md` (e.g. `feedback_output_paths.md`).\n2. Write with the required frontmatter (`name`, `description`, `type`).\n3. For `feedback` / `project` types, include `**Why:**` and\n   `**How to apply:**` lines.\n4. Update `MEMORY.md` with one-line pointer under 150 chars.\n5. Report the absolute + relative path.\n\n## Action: Edit Global CLAUDE.md (confirm-first)\n\nTarget: `~/.claude/CLAUDE.md`.\n\nProcedure:\n1. Read the file.\n2. Locate the best section for the addition (match existing heading like\n   \"输出规范\", \"网络 / 代理\", \"Debugging Discipline\"; or create a new\n   section if none fits).\n3. **Show the proposed diff** as a fenced block with `-`/`+` lines.\n4. Ask: \"执行这个修改？(yes/no)\"\n5. On \"yes\" → apply via `Edit`. On anything else → abort, optionally\n   offer to save as project memory instead.\n\nNever skip the diff step. `CLAUDE.md` is user-authored authoritative\nconfig; silent edits erode trust.\n\n## Action: Edit Project CLAUDE.md (confirm-first)\n\nSame flow as global, but target is `<cwd>/CLAUDE.md` (walk up if not at\nroot). Same diff-then-confirm requirement.\n\n## Action: Suggest Harness Commands (suggest-only)\n\nProduce the exact string the user should paste, not a description:\n\n```\ncontext polluted — paste this to fork:\n/fork\n```\n\nor\n\n```\napproaching capacity — compact first, then continue:\n/compact\n```\n\nDo not wrap in explanations. The command is the deliverable.\n\n## What this skill cannot do (be honest about it)\n\n- Invoke `/fork`, `/compact`, `/btw`, `/clear`, new session — harness-only.\n- Edit another agent's transcript.\n- Auto-install hooks — use `/update-config` for that.\n\nIf the user asks for one of these, say so and give them the command to\npaste.\n\n## Output convention\n\nEvery action that writes a file must echo its absolute + relative path\n(per project-wide output-paths rule). Applies to memory files, CLAUDE.md\nedits (show final path), and any derived artifacts.","tags":["auto","context","skills","lovstudio","agent-skills","ai-coding-assistant","cjk","claude-code","cursor","gemini-cli","markdown-to-docx","markdown-to-pdf"],"capabilities":["skill","source-lovstudio","skill-auto-context","topic-agent-skills","topic-ai-coding-assistant","topic-cjk","topic-claude-code","topic-cursor","topic-gemini-cli","topic-markdown-to-docx","topic-markdown-to-pdf"],"categories":["skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/lovstudio/skills/auto-context","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add lovstudio/skills","source_repo":"https://github.com/lovstudio/skills","install_from":"skills.sh"}},"qualityScore":"0.469","qualityRationale":"deterministic score 0.47 from registry signals: · indexed on github topic:agent-skills · 39 github stars · SKILL.md body (4,951 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-21T01:36:37.305Z","embedding":null,"createdAt":"2026-04-18T22:18:52.839Z","updatedAt":"2026-04-21T01:36:37.305Z","lastSeenAt":"2026-04-21T01:36:37.305Z","tsv":"'-5':324 '/.claude/claude.md':85,358,360,484 '/.claude/projects':424 '/auto-compact':209 '/btw':102,180,314,646 '/claude.md':578 '/clear':647 '/compact':101,116,187,313,409,623,645 '/fork':100,114,178,189,312,615,644 '/lovstudio-auto-context':224,237,338 '/memory':425 '/update-config':663 '1':194,238,432,486 '150':468 '150kb':152 '2':246,438,490 '3':253,323,447,515 '4':306,459,526 '40':149 '5':470,530 'abort':539 'absolut':473,694 'act':198 'action':30,63,163,309,331,347,351,416,476,564,591,686 'addit':497 'agent':655 'alreadi':426 'anoth':654 'anyth':537 'anyway':212 'appli':457,533,705 'approach':617 'arg':225 'argument':334 'artifact':717 'ask':221,527,669 'assess':247 'author':557 'authorit':558 'auto':3,69,130,207,295,381,421,659 'auto-context':2 'auto-execut':68,294,380,420 'auto-fork':206 'auto-instal':658 'autocontext':44,219 'b':332 'bare':230 'behavior':67 'best':493 'block':523 'call':227,231,243 'cannot':119,637 'capac':185,618 'char':469 'check':51 'class':348 'claude.md':38,88,366,369,479,553,567,709 'command':108,183,192,318,402,594,630,680 'compact':407,619 'concret':26 'config':559 'confirm':41,82,329,362,371,394,481,569,589 'confirm-first':81,328,361,370,393,480,568 'context':4,10,28,45,59,161,200,336,609 'context-shap':27 'continu':166,622 'convent':684 'convers':19,277 'creat':508 'critic':252 'current':14 'debug':505 'deliver':633 'depriorit':173 'deriv':716 'descript':445,608 'diff':40,93,519,551,587 'diff-then-confirm':586 'directori':423 'disciplin':506 'distinct':244 'drift':21 'e.g':436 'earlier':268 'echo':692 'edit':84,86,359,367,477,535,561,565,653,710 'els':127,538 'enabl':140 'entri':150,392 'erod':562 'estim':240 'evalu':12,400 'everi':685 'everyth':56,126 'exact':107,182,191,317,411,600 'exampl':66 'execut':70,296,382,422 'exist':90,427,499 'explan':628 'feedback':449 'feedback/preferences':259 'feedback_output_paths.md':437 'fenc':522 'file':300,390,489,690,708 'filenam':434 'final':712 'fine':202 'first':83,330,363,372,395,482,570,620 'fit':514 'flow':572 'forget':385 'fork':208,399,614 'frontmatt':443 'full':53 'futur':276 'get':249 'give':677 'global':35,356,478,574 'har':112,214,308,593,651 'harness-on':213,650 'head':500 'health':50,232 'healthi':248 'honest':640 'hook':8,134,143,661 'hook-trigg':7 'includ':452 'index':76,391 'inject':154 'instal':660 'instead':547 'instruct':341,349 'invok':120,643 'irrelev':176 'keep':321 'layer':61,65 'lightweight':156 'like':501 'line':325,458,465,525 'locat':491 'long':18 'lovstudio':1,137 'manual':5,222 'match':498 'max':196 'md':435 'measur':239 'memori':33,73,91,235,291,299,376,379,389,419,546,707 'memory.md':75,302,461 'mental':172 'mention':218 'mkdir':430 'mode':131,223 'monitor':144 'most':164,175 'must':691 'name':444 'near':184 'need':311 'never':205,548 'new':103,510,648 'nois':23,171 'noisi':250 'none':513 'noth':168,204 'offer':541 'one':464,671 'one-lin':463 'oper':11,46,54,337 'opportunist':234 'option':540 'output':683,702 'output-path':701 'overwrite/delete':89 'own':113 'pars':339 'past':110,320,605,611,682 'path':80,305,475,696,703,713 'pattern':350 'per':697 'persist':274 'phrase':280 'pick':433 'plugin':133,138 'pointer':466 'pollut':17,251,610 'prefer':267 'print':105 'procedur':431,485 'proceed':174 'produc':598 'project':32,37,72,87,368,378,418,450,545,566,699 'project-wid':698 'propos':518 'read':487 'recent':255 'recommend':43,307 'relat':474,695 'relev':165,388 'remind':157 'remov':387 'report':79,233,303,471 'requir':442,590 'right':346 'root':584 'rout':343 'rule':193,265,704 'save':543 'say':167,203,674 'scan':254 'section':494,511 'see':160 'sensit':64,352 'sentenc':195 'session':15,104,271,649 'shape':29,58,228 'show':92,516,711 'silent':560 'size':146 'skill':118,636 'skill-auto-context' 'skip':549 'source-lovstudio' 'stale':22,170 'state':162,263 'step':552 'string':601 'suggest':98,177,186,401,404,408,414,592,596 'suggest-on':97,403,413,595 'syntax':412 'take':25,327 'target':335,483,576 'three':60 'threshold':148 'tool':242 'topic':20,245 'topic-agent-skills' 'topic-ai-coding-assistant' 'topic-cjk' 'topic-claude-code' 'topic-cursor' 'topic-gemini-cli' 'topic-markdown-to-docx' 'topic-markdown-to-pdf' 'transcript':145,657 'trigger':9,279 'trust':563 'turn':241,256 'two':226 'type':446,451 'typic':278 'unless':197,220,326 'unpersist':258 'updat':34,74,301,460 'use':662 'user':262,556,603,668 'user-author':555 'userpromptsubmit':142 'via':132,534 'wait':94 'walk':579 'wide':700 'wrap':626 'write':31,71,236,297,354,377,417,439,688 'written':293 'x':284,374,384,386 'y':286 'yes':96,532 'yes/no':529 '从今以后':281 '代理':504 '以后都':282 '别再':287 '加到':357 '加到项目':365 '压缩一下':406 '应该':285 '忘掉':383 '所有':283 '执行这个修改':528 '网络':503 '记住':288,373 '记到':375 '记到全局':353 '记到项目':364 '该分叉了吗':396 '输出规范':502","prices":[{"id":"fdc23fa6-1b41-4cfc-b9bc-f5f6283337d7","listingId":"9fd1691f-d8c8-4bb1-8972-73b51e94681c","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"lovstudio","category":"skills","install_from":"skills.sh"},"createdAt":"2026-04-18T22:18:52.839Z"}],"sources":[{"listingId":"9fd1691f-d8c8-4bb1-8972-73b51e94681c","source":"github","sourceId":"lovstudio/skills/auto-context","sourceUrl":"https://github.com/lovstudio/skills/tree/main/skills/auto-context","isPrimary":false,"firstSeenAt":"2026-04-18T22:18:52.839Z","lastSeenAt":"2026-04-21T01:36:37.305Z"}],"details":{"listingId":"9fd1691f-d8c8-4bb1-8972-73b51e94681c","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"lovstudio","slug":"auto-context","github":{"repo":"lovstudio/skills","stars":39,"topics":["agent-skills","ai-coding-assistant","cjk","claude-code","cursor","gemini-cli","markdown-to-docx","markdown-to-pdf"],"license":"mit","html_url":"https://github.com/lovstudio/skills","pushed_at":"2026-04-20T21:40:57Z","description":"Agent skills for AI coding assistants — Markdown to PDF/DOCX with 14 themes, CJK support","skill_md_sha":"adc32e0c3260783985326d6f986c9dedf6d4a1f5","skill_md_path":"skills/auto-context/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/lovstudio/skills/tree/main/skills/auto-context"},"layout":"multi","source":"github","category":"skills","frontmatter":{"name":"lovstudio:auto-context","license":"MIT","description":"Manual or hook-triggered context operator. Evaluates the current session for pollution (long conversations, topic drift, stale noise), AND takes concrete context-shaping actions: writing project memory, updating global or project CLAUDE.md (with diff + confirm), and recommending harness commands like /fork, /compact, /btw. Covers the full surface of context-affecting operations Claude can reach — direct file edits are auto-executed or confirmed based on sensitivity; harness-only commands (/fork etc.) are surfaced as one-click suggestions.","compatibility":"claude-code"},"skills_sh_url":"https://skills.sh/lovstudio/skills/auto-context"},"updatedAt":"2026-04-21T01:36:37.305Z"}}