代理指示
- 作者仓库星标 0
- 作者仓库 skills-registry
- 领域
- 人工智能
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @tomevault-io · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需手动接入
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- Docker
- 运行环境要求
- Docker
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 读取环境变量
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
# Agent Instructions Skill
A skill for generating, maintaining, and converting agent instruction files into `AGENTS.md` — the permanent context file that helps any AI coding agent orient quickly and work efficiently in this repository.
## When to Use This Skill
- User asks to create or update `AGENTS.md`
- User wants to convert an existing instruction file (`.github/copilot-instructions.md`, `CLAUDE.md`, `.cursorrules`, etc.) into `AGENTS.md`
- User wants to initialize agent context for a repository
- User asks to "add agent instructions" or "set up agent context"
- User wants to improve agent quality by providing standing codebase context
## Constraints (Always Apply)
- **Length**: The finished file must fit within **two printed pages** — roughly 80–120 lines. Be ruthless about brevity. Every sentence must earn its place.
- **Not task-specific**: Do not include instructions about a current bug, feature, or PR. The file describes the codebase permanently, not a transient task.
- **No duplication of tool output**: Never reproduce what `--help`, `make help`, or a schema already provides authoritatively. Reference the command instead.
- **Plain markdown only**: No frontmatter, no HTML. The file is read verbatim by agents, so keep formatting clean and skimmable.
## Research Phase — Do This Before Writing
Before writing a single line, gather the following. **Take your time here** — thorough research produces dramatically better instructions.
### 1. Understand what the repo does
- Read `README.md` (purpose, audience, key features)
- Read any top-level docs (`docs/`, `CONTRIBUTING.md`, `ARCHITECTURE.md`) if present
- Scan entry points (`main.*`, `cmd/`, `app/`, `src/index.*`, `lib/`) to confirm the README matches reality
### 2. Identify languages, frameworks, and tooling
- Check for: `go.mod`, `package.json`, `Cargo.toml`, `pyproject.toml`/`setup.py`, `Gemfile`, `pom.xml`, `build.gradle`
- Note key frameworks, major libraries, and runtime versions where specified
- Identify infrastructure tooling: Docker, Terraform, Helm, etc.
### 3. Map the build and validation workflow
- Look for `Makefile`, `Taskfile`, `justfile`, `.github/workflows/`, `scripts/`
- Identify the commands used in CI for: building, testing, linting, formatting
- Note any required env vars or one-time setup steps documented in the README or CONTRIBUTING
### 4. Map the layout and architecture
- Note top-level directory purposes (a single sentence each is enough)
- Identify where the main entry points live
- Note any non-obvious conventions: generated code directories, vendored code, monorepo structure
- Identify where configuration lives (env files, config packages, infrastructure definitions)
- Note where tests live and how they are organized (unit vs integration, co-located vs separate)
### 5. Check for existing AI context files
Other AI tools often have their own context files that may already contain accurate, well-considered descriptions of the codebase. **Read all of these before writing** — they are high-signal sources and should be mined heavily. When the user asks to convert one of these files, it becomes the primary source. If `AGENTS.md` already exists in the repo, treat it as the primary source and update it rather than recreating it from scratch.
| File | Tool | What it typically contains |
|------|------|---------------------------|
| `CLAUDE.md` | Anthropic Claude | Architecture, conventions, build commands, gotchas |
| `AGENTS.md` | OpenAI Codex / custom agents | Agent-specific workflow instructions |
| `GEMINI.md` | Google Gemini | Repo context and task guidance |
| `.cursor/rules` or `.cursorrules` | Cursor | Coding style, conventions, file structure |
| `.github/copilot-instructions.md` | GitHub Copilot | Repo instructions to consolidate into AGENTS.md |
For each file found: extract facts about purpose, tech stack, conventions, build steps, and architecture. Prefer information from these files over your own inference — they were written by someone who knows the repo.
Where sources conflict: **stop and surface each conflict to the user before writing**. Present the differing values, which files they came from, and ask the user which one is correct. Do not resolve conflicts by assumption.
## Writing the File
### Required Sections (in order)
```markdown
# Agent Instructions
## Overview
One to three sentences: what this project does and who uses it.
## Tech Stack
Bullet list: language(s) + version, primary framework(s), key libraries, infra tooling.
## Build & Validate
Shell commands only — no prose duplication of what `--help` says.
Format each step as a fenced code block with the shell command.
## Repository Layout
Short table or bullet list mapping top-level directories to their purpose.
Only list directories that are non-obvious. Skip `README.md`, `LICENSE`, etc.
## Architecture Notes
A few sentences or bullets on non-obvious design decisions, patterns, or constraints
an agent should know before making changes. Examples:
- "All database queries go through the repository layer in internal/store/"
- "Proto definitions live in api/; generated code in gen/ — never edit gen/ directly"
- "Config is loaded once at startup from environment variables; no config files at runtime"
## Key Conventions
Bullet list of 3–8 hard rules or patterns the agent must follow.
Focus on things that are easy to get wrong and costly to fix.
```
### Optional Sections (include only if genuinely useful)
```markdown
## External Dependencies
Services, APIs, or credentials an agent needs to know about (not secrets — just names/roles).
## Known Landmines
Specific files, directories, or patterns to avoid touching or to treat with extra care.
```
### Tone and Style Rules
- Write for a capable software engineer reading for the first time, not a beginner
- Use imperative voice for conventions: "Always wrap errors", not "Errors should be wrapped"
- Prefer concrete examples over abstract descriptions when space allows
- Use backticks for all file paths, commands, directory names, and symbol names
- Keep each bullet to one line where possible; two lines maximum
## Listen for Standard Updates
If at any point the user says something like:
- "every AGENTS.md should have a X section"
- "add Y to the required sections"
- "we should always include Z"
**Do not update `SKILL.md` immediately.** Instead:
1. Acknowledge the suggestion
2. Propose the addition: show exactly what it would look like in `SKILL.md`
3. Note whether it should be required or optional (and if optional, the qualifying condition)
4. Wait for explicit confirmation before modifying
5. After confirmation, update `SKILL.md` at `~/dotfiles/copilot/skills/agent-instructions/SKILL.md`
6. Tell the user to commit the change to `~/dotfiles` and run `skills-sync` to persist it
## Output
1. Write the file to `AGENTS.md` at the repository root (create it if it does not exist)
2. If `.github/copilot-instructions.md` was the source of a conversion, delete it automatically after writing `AGENTS.md`. For any other converted instruction file, note which file was converted and offer to delete or archive it.
3. If updating an existing `AGENTS.md`, show a brief diff summary of what changed and why
4. Tell the user: length (line count), what was included, and any gaps you could not fill due to missing documentation
---
> Source: [dan9186/dotfiles](https://github.com/dan9186/dotfiles) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-23 -->
章节与文件索引
按说明文件中的顺序排列。
何时使用此技能
约束(始终适用)
研究阶段——在写作之前进行此操作
1.了解repo的作用
2. 确定语言、框架和工具
文件/命令 -> AGENTS.md · .github/copilot-instructions.md · CLAUDE.md · .cursorrules · --help · make help · README.md · docs/
内容校验值 -> b19821d8acf8
当前原文的自动摘译,尚未人工审校。
何时使用此技能
用户要求创建或更新
AGENTS.md用户想要将现有指令文件(.github/copilot-instructions.md、CLAUDE.md、.cursorrules等)转换为AGENTS.md用户想要初始化存储库的代理上下文 用户要求“添加代理指令”或“设置代理上下文” 用户希望通过提供常设代码库上下文来提高代理质量约束(始终适用)
长度:完成的文件必须在两个打印页内 - 大约 80-120 行。对简洁要毫不留情。每句话都必须赢得它的位置。不特定于任务:不包含有关当前错误、功能或 PR 的说明。该文件永久地描述了代码库,而不是临时任务。没有重复的工具输出:永远不要重现
--help、make help或模式已经提供的权威内容。请改为引用该命令。研究阶段——在写作之前进行此操作
在编写一行之前,请收集以下内容。慢慢来——彻底的研究会产生更好的指导。
1.了解repo的作用
阅读
README.md(目的、受众、主要功能) 阅读任何顶级文档(docs/、CONTRIBUTING.md、ARCHITECTURE.md)(如果有) 扫描入口点 (main.*、cmd/、app/、src/index.*、lib/)确认自述文件与实际相符2. 确定语言、框架和工具
检查:
go.mod、package.json、Cargo.toml、pyproject.toml/setup.py、Gemfile、pom.xml、build.gradle注意指定的关键框架、主要库和运行时版本 识别基础设施工具:Docker、Terraform、Helm 等。