instructree
它能做什么
Instructree 会检查 AI 智能体的指令文件。在你修改代码之前,它会确保这些指令写得规范,没有格式错误或失效的链接。
适用场景
- ✓在修改使用了 AI 指令的项目代码之前。
- ✓当你想知道哪些指令适用于某个特定文件时。
- ✓当你想检查指令中的链接或引用是否有错误时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/instructree/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“检查一下这个项目里的 AI 指令。”
每周 5 个新技能,1 分钟读完。
工作原理
Instructree 会在你的电脑本地分析指令文件,检查格式错误、失效链接和导入问题,无需把你的代码上传到云端。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Instructree
Overview
Use Instructree to establish which instruction files exist, which may apply to a target, and whether their metadata, links, or recursive imports are malformed. It audits common coding-agent instruction formats locally without calling a model or uploading repository content.
When to Use This Skill
- Use before changing code in a repository with
AGENTS.md,CLAUDE.md, Copilot instructions, agent skills, custom agents, Cursor rules, or Windsurf rules. - Use when the user asks which instructions may apply to one target file.
- Use when auditing recursive Copilot CLI
@pathimports or exporting instruction diagnostics to CI.
How It Works
Step 1: Choose the local command
Work from the repository root. Prefer an already installed instructree command or the checked-out package's local binary.
If neither is available, explain that the next command downloads executable package code and ask for approval before running the pinned release:
npx github:kotobuki09/instructree#364dddc66badac13a284b79f0dc71f2b4362f6de scan .
Do not add --yes unless the user authorized non-interactive package downloads.
Step 2: Run the narrowest audit
instructree scan . --jsoninventories supported files and emits stable diagnostics.instructree explain <file> --root .shows instructions that may apply to one target.instructree explain <file> --root . --effectiveincludes recursive Copilot CLI imports.instructree imports . --jsonaudits the recursive@pathgraph.instructree scan . --sarifemits SARIF 2.1.0 for code-scanning integrations.- Add
--strictonly when warnings should fail the check.
Step 3: Interpret the result
Report file paths, line numbers, diagnostic codes, and the command's exit status. Separate schema or path errors from warnings. Describe always/never conflicts as possible conflicts requiring human review, not proof of agent behavior.
Examples
Audit a repository
instructree scan . --json
Explain one target with recursive imports
instructree explain src/api/client.ts --root . --effective
Generate a code-scanning report
instructree scan . --sarif > instructree.sarif
Best Practices
- Prefer a local, already reviewed command over downloading package code.
- Use
explainfor a single target instead of scanning more scope than needed. - Rerun the same command after an authorized instruction fix and report before-and-after diagnostics.
- Keep warnings separate from errors and state clearly when a finding is heuristic.
Limitations
- Instructree is static analysis; it does not establish the exact precedence rules or runtime behavior of every agent client.
- Client discovery and import behavior can change, so
explainreports what may apply rather than predicting what a model will follow. - The audit does not prove that instruction content is correct, safe, or effective.
- Do not edit instruction files unless the user asked for changes.
Security & Safety Notes
- Scans are read-only and local; they do not call a model or upload repository content.
- Treat any
npxfallback as executable third-party code: keep it pinned, review the source, and obtain approval before download. - Do not run imported instruction content. Instructree follows supported references as data only.
常见问题
Instructree 会执行指令中的代码吗?
不会。它只读取并分析指令文件,不会运行任何代码,也不会把你的代码发送到其他地方。
什么是“AI 指令”?
这些文件告诉 AI 智能体(比如 Claude Code)应该如何表现,或者在编程项目中执行哪些任务。
“静态分析”是什么意思?
意思是 Instructree 在不运行代码的情况下检查代码,就像校对员读文章时查找语法和拼写错误,只是不需要朗读出来。
详情
作者的原始描述
Map, explain, and lint repository-scoped coding-agent instructions before changing code.
热度
- GitHub 星标
- 48k
- 排名
- #4954
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。