executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
lov-auto-contextManual 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…
Independent GitHub snapshot · Automated classification · Original documentation governs
name: lov-auto-context
category: Dev Tools
tagline: "Context hygiene operator. Evaluates, writes memory, edits CLAUDE.md, suggests /fork or /compact."
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.
license: MIT
compatibility: >
Claude Code-oriented instruction skill. Agent home must resolve from
SKILL_AUTO_CONTEXT_AGENT_HOME, the shared Skill Publisher skills profile, or
a one-time user answer; do not assume a fixed runtime directory.
depends_on:
Not just a health check — a full operator over everything that shapes context. Three layers by action sensitivity:
| Layer | Examples | Behavior |
|---|---|---|
| Auto-execute | write project memory, update MEMORY.md index | Do it, report path |
| Confirm-first | edit global agent instructions, edit project CLAUDE.md, overwrite/delete existing memory | Show diff, wait for "yes" |
| Suggest-only | /fork, /compact, /btw, new session | Print the exact command to paste |
The harness owns /fork and /compact; this skill cannot invoke them. But
it can do everything else and will.
When the skill-publisher plugin is enabled, a UserPromptSubmit hook monitors
transcript size. Above threshold (40+ entries or 150KB+), it injects a
lightweight <auto-context> reminder.
When you see <auto-context>:
| Context State | Action |
|---|---|
| Mostly relevant | Continue, say nothing |
| Some stale noise | Mentally deprioritize, proceed |
| Mostly irrelevant | Suggest /fork or /btw with exact command |
| Near capacity | Suggest /compact or /fork with exact command |
Rules:
/lov-auto-context [args])Two call shapes:
/lov-auto-context
MEMORY.md. Report the path.
Preferences may include standing authorization when the user explicitly uses
durable language such as “以后默认同意”. Preserve its scope instead of
downgrading it to a one-off confirmation./fork, /compact, /btw)
with the exact command to paste.Keep to 3-5 lines unless taking confirm-first actions.
/lov-auto-context <free-form instruction>
Parse the instruction and route to the right action class:
| Instruction pattern | Action | Sensitivity |
|---|---|---|
| "记到全局 / write to global / 加到全局指令" | edit the configured global instructions file | Confirm-first |
| "记到项目 / 加到项目 CLAUDE.md" | edit project CLAUDE.md | Confirm-first |
| "记住 X / 记到 memory" | write project memory | Auto-execute |
| "忘掉 X / forget X" | remove relevant memory file + index entry | Confirm-first |
| "该分叉了吗 / should I fork" | evaluate + suggest command | Suggest-only |
| "压缩一下 / compact" | suggest /compact with exact syntax | Suggest-only |
A preference can include authorization. When the user explicitly establishes a reusable default, record a standing authorization with all of these fields:
trigger: the user action that activates it, such as explicitly invoking a Skill;action: the high-impact operation being pre-authorized;target and payload: the exact object and data class covered;destination: the external service or local boundary;limits: excluded modes, attachments, accounts, or broader background actions;revocation: a plain way for the user to turn it off.Use surrounding context to resolve short phrases such as “默认同意”. Do not expand “invoking the share Skill authorizes its current sanitized session upload” into “all sessions may be uploaded automatically”. A matching standing authorization removes redundant confirmation; a non-matching action still requires current consent. Never store credentials, tokens, private keys, or approval codes as preferences.
Directory: <resolved-agent-home>/projects/<project-slug>/memory/.
Resolve <resolved-agent-home> from the User Configuration section before
writing. The memory directory should already exist; do not create a new
runtime layout silently.
Procedure:
<type>_<topic>.md (e.g. feedback_output_paths.md).name, description, type).feedback / project types, include **Why:** and
**How to apply:** lines.MEMORY.md with one-line pointer under 150 chars.Target: <resolved-agent-home>/CLAUDE.md.
Procedure:
-/+ lines.Edit. On anything else → abort, optionally
offer to save as project memory instead.Never skip the diff step. CLAUDE.md is user-authored authoritative
config; silent edits erode trust.
Same flow as global, but target is <cwd>/CLAUDE.md (walk up if not at
root). Same diff-then-confirm requirement.
Produce the exact string the user should paste, not a description:
context polluted — paste this to fork:
/fork
or
approaching capacity — compact first, then continue:
/compact
Do not wrap in explanations. The command is the deliverable.
/fork, /compact, /btw, /clear, new session — harness-only./update-config for that.If the user asks for one of these, say so and give them the command to paste.
Every action that writes a file must echo its absolute + relative path (per project-wide output-paths rule). Applies to memory files, CLAUDE.md edits (show final path), and any derived artifacts.
Resolve agent paths in this order:
SKILL_AUTO_CONTEXT_AGENT_HOME.${SKILL_PROFILE_PATH:-$HOME/.skill-publisher/skills/profile.json}
keys: agent.home, claude.home, or runtime.agent_home.For alternate runtimes, set SKILL_AUTO_CONTEXT_AGENT_HOME explicitly or
add the relevant profile key.
运行前读取本 Skill 包的 skill.yaml,由宿主提供 skill-runtime/v1 上下文。字段解析顺序为:当前请求、项目上下文、个人 Preferences、品牌 Profile、通用默认值。
required: true 字段缺失时,按 Manifest 的问题配置向用户提出一个聚焦问题;用户明确同意后再保存回答。context_id、字段路径与来源,诊断内容避开秘密、完整私人路径和原始配置。用户在 Skill 驱动任务中提出修改意见时,继续当前产物前必须执行:
task-specific(仅本次)还是 reusable(可跨任务复用)。task-specific 只修改当前任务,不改 Skill。reusable 先确定作用域:领域规则先更新对应 canonical Skill;适用于所有 Skill 的规则先更新共享规范。reusable 修改会使此前的“确认”“继续”“发吧”失效;完成当前产物修改和回读后必须停下,等待用户下一步指示,不自动进入发布、提交或其他外部写入。