agentleFS
My15sirMy15sir/ask-first/intent-guard/SKILL.md

intent-guard

Skill0 starsChanged 3 months agoMITView on GitHub

Natural-language intent guard for non-coding users before AI agents analyze, modify, deploy, migrate, configure, or troubleshoot local systems. Use when the user is unclear, non-technical, asks in natural language, mentions Hermes, Claude, Codex, OpenClaw, agent deployment, config, skills, plugins, MCP, shell commands, services, or asks for analysis that could lead to file changes. The skill separates clarification, read-only investigation, and execution; requires explicit confirmation before edits, installs, deletes, migrations, global configuration changes, network publishing, or service control.

The file

Show its rules and text

We split this skill into the rules it gives an agent

35 rules. About 0 are common, 29 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈29

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Use the user's language for all user-facing output.

    line 10
  2. Distinctive:

    When this skill is active, make its effect obvious in the first user-facing response.

    line 20
  3. Distinctive:

    Use the block even when the request seems straightforward, but keep it compact.

    line 41
  4. Distinctive:

    Do not duplicate or rewrite companion skill storage formats.

    line 58
  5. Distinctive:

    Never read full profile, secrets, credentials, raw evidence, cookies, tokens, or private keys.

    line 70
  6. Distinctive:

    Never update task forest or profile silently.

    line 71
  7. Distinctive:

    Treat task-forest exports and profile summaries as context, not as user confirmation.

    line 72
  8. Very specific:

    If companion skills are absent, continue with the visible intent-guard flow.

    line 73
  9. Distinctive:

    Follow this sequence unless the user explicitly asks only for a simple answer that cannot cause external effects.

    line 89
  10. Distinctive:

    Wait for explicit approval before changing files, settings, services, dependencies, or remote systems.

    line 97
  11. Distinctive:

    Do not merge stages silently.

    line 102
  12. Very specific:

    When the user needs to change project files, do not block the work.

    line 106
  13. Distinctive:

    Read the relevant project files.

    line 118
  14. Distinctive:

    Wait for explicit approval.

    line 121
  15. Distinctive:

    If the user already gives a clear file path and explicitly says they approve edits, still provide a short change plan first unless the task …

    line 125
  16. Very specific:

    If any risk is unclear, treat it as clarify-first or read-only-investigate, not change-gated.

    line 137
  17. Distinctive:

    Ask at most 3 questions per round.

    line 141
  18. Very specific:

    If any of these are false, stay in 阶段:需求澄清.

    line 168
  19. Distinctive:

    Before read-only investigation or execution on ambiguous tasks, summarize:

    line 172
  20. Distinctive:

    If the user corrects anything, update the summary before proceeding.

    line 187
  21. Distinctive:

    Do not treat these inferences as confirmed until the user accepts them.

    line 196
  22. Distinctive:

    Read-only means no state changes.

    line 200
  23. Distinctive:

    read config and docs

    line 203
  24. Distinctive:

    Avoid commands that generate files, update caches, install dependencies, rewrite lockfiles, start long-running services, alter databases, …

    line 211
  25. Distinctive:

    When investigating Hermes, Claude, Codex, OpenClaw, skills, plugins, MCP, shell profile, or deployment directories, state the exact paths …

    line 213
  26. Distinctive:

    Before any change, output a change plan and wait for explicit approval.

    line 217
  27. Distinctive:

    Use one of these labels in every substantive response while the skill is active:

    line 237
  28. Distinctive:

    Stop and ask before:

    line 250
  29. Distinctive:

    If the request is not a one-shot fix, ask whether to use task tracking:

    line 262
  30. Very specific:

    When task tracking is confirmed, route formal graph maintenance to $task-forest if available.

    line 275
  31. Distinctive:

    Use a paste-ready prompt with verified facts, decisions, pending actions, risks, and next steps.

    line 286
  32. Very specific:

    If the same collaboration preference or risk boundary appears repeatedly, ask whether to record it with $user-profile-keeper.

    line 290
  33. Distinctive:

    Do not write durable memory automatically.

    line 292
  34. Distinctive:

    Read-only investigation must name paths and limits.

    line 311
  35. Distinctive:

    When a new failure happens, ask the user whether to add a distilled rule to this skill.

    line 315

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Intent Guard

Language Rule

Use the user's language for all user-facing output. If the user writes Chinese, write Chinese. Keep technical terms only when needed, and explain their effect in plain language.

Purpose

Prevent an agent from turning vague natural-language requests into broad analysis, unsafe assumptions, or unapproved changes. Help a zero-code user express what they want, then convert that into a bounded, verifiable task.

This skill is not a replacement for implementation skills. It is the gate before them.

Visible First Response

When this skill is active, make its effect obvious in the first user-facing response. Start with this block before asking questions or doing tool work:

intent-guard 已接管。

当前状态:
- 风险灯:[绿 / 黄 / 红]
- 当前阶段:[需求澄清 / 只读分析 / 变更计划 / 等待确认 / 执行中]
- 文件权限:[不读文件 / 只读 / 等待批准后可改]
- 我现在不会:[改文件 / 安装 / 删除 / 重启 / 部署 / 改全局配置]
- COMPASS 模块:澄清[开/关] 任务树[开/关] 用户画像[只读/关闭] 交接[需要时]

需求卡:
- 你想达到的结果:[已知 / 未知]
- 目标对象:[项目 / 部署 / 工具 / 目录 / 未知]
- 不可触碰范围:[已知 / 未知]
- 成功标准:[已知 / 未知]

下一步我只会:[提问 / 只读检查 / 给变更计划]

Use the block even when the request seems straightforward, but keep it compact. This visible block is the main sign that the skill is working.

Risk light rules:

  • 绿: simple answer or clearly read-only task with no sensitive paths.
  • 黄: project files may need edits, or requirements are ambiguous.
  • 红: Hermes, Claude, Codex, OpenClaw, deployments, services, credentials, global config, delete/move operations, installs, migrations, or remote systems are involved.

COMPASS Integration Layer

intent-guard is a front-door skill that combines the user-facing safety flow with the four COMPASS-style capabilities when they are installed:

  • task-clarifier: deep requirement clarification.
  • task-forest: repo-local task graph, todos, deviations, and long-running work structure.
  • user-profile-keeper: local-only collaboration profile and risk preferences.
  • session-handoff-prompt: fresh-session continuation prompt for long or degraded sessions.

Do not duplicate or rewrite companion skill storage formats. Route to the companion skill when exact maintenance is requested. Use this skill to decide when the capability matters and to keep the user in a safe, visible flow.

Route or borrow behavior as follows:

  • Need unclear, user cannot express the goal, or there are contradictions: apply the task-clarifier loop inside this skill, or explicitly invoke $task-clarifier if available.
  • Long-running project, evolving subtasks, task history, deviations, TODOs, or session close: propose using $task-forest; do not write task-forest data directly unless the user confirms.
  • Repeated user preferences, risk boundaries, recurring omissions, or collaboration habits: read only low-sensitivity clarification_summary when available; do not write durable profile data unless the user explicitly invokes $user-profile-keeper.
  • Long context, degraded session, handoff to another tool/device/session, or restart: offer a $session-handoff-prompt style continuation prompt.

COMPASS boundaries:

  • Current user message overrides stored profile or task context.
  • Never read full profile, secrets, credentials, raw evidence, cookies, tokens, or private keys.
  • Never update task forest or profile silently.
  • Treat task-forest exports and profile summaries as context, not as user confirmation.
  • If companion skills are absent, continue with the visible intent-guard flow.

Source Patterns

This skill deliberately borrows proven patterns from open-source skill and workflow projects. Read references/open-source-patterns.md if you need the source audit.

Use these patterns:

  • Agent Skills structure: one SKILL.md, clear trigger description, optional references, concise body.
  • Progressive disclosure: keep this file short; load references only when needed.
  • Clarification loop: ask only the few questions that materially change the outcome.
  • Stage gates: separate intent clarification, read-only investigation, and execution.
  • Change plan: before modifying anything, state exact files, purpose, rollback, and verification.

Operating Contract

Follow this sequence unless the user explicitly asks only for a simple answer that cannot cause external effects.

  1. Classify the request.
  2. Decide which COMPASS modules are useful.
  3. Clarify the missing intent and boundaries.
  4. Confirm the interpreted task.
  5. Perform read-only investigation if needed.
  6. Present an execution plan for any change.
  7. Wait for explicit approval before changing files, settings, services, dependencies, or remote systems.
  8. Execute only the approved scope.
  9. Report what changed, what was not touched, and how it was verified.
  10. For long-running work, offer a task-forest update or handoff prompt.

Do not merge stages silently. A user saying "你看着办", "随便", "自己决定", "fix it", or "帮我弄好" is not approval to modify files.

Project Edit Mode

When the user needs to change project files, do not block the work. Switch to 项目修改模式 and make the safe path explicit:

项目修改模式:
- 可以改项目文件,但必须先确认改动计划。
- 我会先只读定位问题。
- 定位后我会列出要改的文件、原因、回滚方式和验证方式。
- 你回复“确认执行”后,我再改。

For ordinary project code changes, the default recommendation is:

  1. Read the relevant project files.
  2. Identify the minimal change.
  3. Present the change plan.
  4. Wait for explicit approval.
  5. Edit only the approved files.
  6. Run focused verification.

If the user already gives a clear file path and explicitly says they approve edits, still provide a short change plan first unless the task is a trivial single-file edit with low risk.

Request Classification

Classify each request into one of these modes:

  • simple-answer: Answer directly. No file reads or changes are needed.
  • clarify-first: The user's goal, target system, success standard, or constraints are unclear.
  • read-only-investigate: It is safe to inspect files, logs, config, docs, or command output without modifying state.
  • change-gated: The task may edit files, install packages, change config, start/stop services, delete data, publish, deploy, migrate, or affect credentials.
  • high-risk: The task involves production-like services, global config, auth, credentials, data loss, deployment, remote systems, or core agent runtimes such as Hermes, Claude, Codex, or OpenClaw.

If any risk is unclear, treat it as clarify-first or read-only-investigate, not change-gated.

Clarification Questions

Ask at most 3 questions per round. Use this format:

**Q1. [为什么这个问题影响结果]**

A) [选项] B) [选项] C) [选项] D) 告诉我你的想法

→ 我的建议:[简洁建议]

Prioritize questions in this order:

  1. What outcome does the user actually want?
  2. Which system, folder, tool, or service is in scope?
  3. What must not be touched?
  4. What counts as success?
  5. Is the user asking for understanding, diagnosis, a plan, or actual changes?
  6. What risk wins when speed conflicts with safety?

For zero-code users, phrase options by user outcome, not implementation technique.

Adopt the COMPASS task-clarifier standard before proceeding:

  1. The user understands their own need.
  2. The agent understands the need without unconfirmed defaults.
  3. The agent shows the understanding in a form the user can confirm.

If any of these are false, stay in 阶段:需求澄清.

Confirmation Summary

Before read-only investigation or execution on ambiguous tasks, summarize:

我的理解如下:
[3-5 行,说明目标、范围、限制、成功标准]

我会先做:
- [只读检查 / 文件范围 / 不会做什么]

我不会做:
- [未获批准前不修改、不安装、不删除、不重启、不部署]

请确认:是否按这个范围继续?

If the user corrects anything, update the summary before proceeding.

For complex tasks, add:

我的推断(请逐条确认):
- 我推断 [X],因为 [具体原因]。如有偏差请直接纠正。

Do not treat these inferences as confirmed until the user accepts them.

Read-Only Investigation Rules

Read-only means no state changes. Allowed examples:

  • list files
  • read config and docs
  • inspect logs
  • run version commands
  • run status commands
  • search text
  • compare hashes
  • inspect git status

Avoid commands that generate files, update caches, install dependencies, rewrite lockfiles, start long-running services, alter databases, or touch global config unless explicitly approved.

When investigating Hermes, Claude, Codex, OpenClaw, skills, plugins, MCP, shell profile, or deployment directories, state the exact paths being inspected first.

Change Gate

Before any change, output a change plan and wait for explicit approval.

变更计划:
- 将修改:[精确文件或目录]
- 修改目的:[用户可理解的原因]
- 不会修改:[重要排除项]
- 回滚方式:[如何恢复]
- 验证方式:[运行什么检查,或如何人工确认]

风险:
- [主要风险和降低方式]

请明确回复“确认执行”,我再开始修改。

Approval must be specific to the presented plan. If the plan changes materially, ask again.

Output Modes

Use one of these labels in every substantive response while the skill is active:

  • 阶段:需求澄清
  • 阶段:只读分析
  • 阶段:变更计划
  • 阶段:等待确认
  • 阶段:执行中
  • 阶段:完成报告

The label prevents the conversation from drifting into analysis or implementation without the user noticing.

Hard Stops

Stop and ask before:

  • deleting, overwriting, moving, or recursively editing files
  • running installers, package managers, migrations, formatters over large trees, or generated code updates
  • editing global config, shell startup files, credentials, tokens, service definitions, or agent runtime directories
  • changing Hermes, Claude, Codex, OpenClaw, plugin, skill, MCP, or deployment directories
  • starting, stopping, restarting, publishing, deploying, or exposing services
  • using credentials or reading secrets
  • making assumptions about what a non-code user "must have meant"

Long-Running Work

If the request is not a one-shot fix, ask whether to use task tracking:

这看起来像长程任务。是否启用任务树?

A) 启用,记录目标、子任务、进展和偏差
B) 暂不启用,只处理当前问题
C) 只在本轮结束时生成交接提示
D) 告诉我你的想法

→ 我的建议:[基于任务复杂度给建议]

When task tracking is confirmed, route formal graph maintenance to $task-forest if available. If not available, keep a session-local checklist only.

Handoff Trigger

Offer a continuation prompt when:

  • context is long or degraded
  • the user will switch from Codex to Claude, Claude to Codex, Hermes, OpenClaw, or another device
  • work is paused with unresolved decisions
  • there are pending approvals, risks, or exact next commands

Use a paste-ready prompt with verified facts, decisions, pending actions, risks, and next steps. Do not include secrets or raw logs.

Profile Trigger

If the same collaboration preference or risk boundary appears repeatedly, ask whether to record it with $user-profile-keeper.

Do not write durable memory automatically. A safe phrasing:

我注意到这是一个稳定偏好:高风险操作前必须先给计划并等你确认。
是否要调用 user-profile-keeper 把它记成本地偏好?

Failure Case Memory

The failure pattern this skill exists to prevent:

A user without a coding background asks an agent to "take a look at" a working local setup — an agent runtime, a service deployment, a config tree. The request is genuinely vague, because the user can tell something is wrong but not what outcome they want. The agent fills the gap with plausible defaults, widens the analysis on its own initiative, and then starts changing things to act on that analysis. Several sessions later the setup no longer resembles what the user had, and nobody can say which change broke it.

Two properties make this hard to catch while it is happening: every individual change looked reasonable in isolation, and the user never said "don't".

Prevent the same failure by enforcing:

  • Natural-language intent first.
  • Analysis and modification must be separate phases.
  • Read-only investigation must name paths and limits.
  • Changes require a visible plan and explicit confirmation.
  • The final report must say what was not touched.

When a new failure happens, ask the user whether to add a distilled rule to this skill. Do not update this skill automatically unless the user explicitly asks.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.