write-agents-entry
npx skills add https://github.com/nesnilnehc/ai-cortex --skill write-agents-entry
Agent 安装分布
Skill 文档
Skill: Write Agents Entry
Purpose
Write or revise AGENTS.md at the repo root per the âOutput contractâ section below, so that when an Agent touches the project it has a clear project identity, authoritative sources, and behavioral expectations, and behaves consistently and predictably. The output contract is embedded in this SKILL.md so one load gives the full spec and steps.
Use Cases
- New project: Add an Agent entry for a repo that has no AGENTS.md; produce a first draft following the output contractâs recommended structure and sections.
- Revise existing entry: Audit and complete an existing AGENTS.md (add missing sections such as authoritative sources, behavior, reference table) or fix wording that does not match the contract.
- Adopt the format elsewhere: Other projects can use this skillâs output contract to produce an AGENTS.md with identity, authority, and behavior, then replace asset types and paths for their project.
- Compliance check: Audit an existing AGENTS.md against the contract (§3 sections, §4 content, §6 reference table) and output revision suggestions.
Behavior
- Read the contract first: Before executing, read this fileâs âOutput contractâ section and use it as the only source of truth; do not invent sections or drop recommended elements.
- Gather input: From the user or context get: one-line project positioning, top-level asset types and dirs (e.g. skills/ and spec paths), whether a Raw URL is provided, primary description language. If information is missing, ask per the skillâs interaction policy.
- Produce by section: Output or revise AGENTS.md in the contract §3 order: opening â Project identity â Authoritative sources â Behavioral expectations â Discovery and loading (summary) â Language and communication â Reference table. Section titles may be adjusted but keep the order: identity â authority â behavior â operations summary â language â reference.
- Executable behavior: Use âmust,â âshall,â âmust notâ (or equivalent) so each expectation is actionable; each item can reference a spec or doc. Do not paste full spec/docs into AGENTS.md; only index and summarize.
- Complete reference table: Include at least: spec source, this entryâs Raw URL (if applicable), definition specs, usage and install, entry indexes; use relative paths or resolvable URLs.
- Self-check before submit: After producing or revising, run this skillâs Self-Check; only submit when all pass. If the user asked only for a compliance audit, output a revision list instead of editing the file.
Input & Output
Input
- One-line positioning: What the project is (e.g. âagent-first, governance-ready capability inventoryâ).
- Top-level assets and dirs: Asset types (e.g. Skill), directories, spec paths (e.g. spec/skill.md); if a type is absent, say ânoneâ or omit.
- Optional: AGENTS.md Raw URL, existing AGENTS.md or README excerpt (for revision), primary description language (e.g. English).
Output
- Authoring: Full AGENTS.md that satisfies the output contract (or diff / revised full text).
- Audit: Compliance checklist and revision suggestions per contract §3â§6 (missing sections, reference table gaps, behavior wording); do not force-rewrite the file.
Restrictions
- Do not leave the contract: Do not add sections as ârequiredâ that the contract does not require, or remove any of the seven recommended section types without justification.
- Do not paste full specs: Do not paste full content of spec/skill.md or other specs into AGENTS.md; only summarize and link.
- No vague behavior: Do not use âwhere possible,â âas appropriate,â etc.; use âmust,â âshall,â âmust notâ (or equivalent).
- Do not omit reference table: The table must include spec source, definition/usage/install spec, entry indexes; if the project has no index, say âN/Aâ or omit that row.
Self-Check
- Contract: Was the output contract read and §3 section order followed?
- Three elements: Are project identity, authoritative sources, and behavioral expectations clearly present?
- Sections: Opening, project identity, authoritative sources, behavior, discovery and loading (summary), language and communication, reference table?
- Executable: Does behavior use âmustâ/âshallâ/âmust notâ (or equivalent) with each item mappable to a spec or doc?
- Reference table: At least spec source, this entry Raw URL (if applicable), definition spec, usage and install, entry indexes?
- No duplication: Does AGENTS.md avoid repeating full spec/docs text and only index and summarize?
Examples
Example 1: New project (minimal info)
Input: Project: my-cli. One-line: A CLI for local batch file renaming. Assets: no skills, only README and source. Want an Agent entry; primary language English.
Expected: Produce AGENTS.md with: opening (this file is the Agent entry and contract), project identity (one line + asset table; can be simplified to âdocs/sourceâ etc.), authoritative sources (definitions and catalog from README or docs/), behavioral expectations (several âmustâ items), discovery and loading (summary if INDEX or equivalent exists, else how the Agent should understand the project), language and communication (English), reference table (spec source, this entry Raw if applicable, docs and entry links). Do not invent spec/ paths that do not exist.
Example 2: Edge case â incomplete AGENTS.md
Input: Existing AGENTS.md has only âThis project is XXâ and âRead INDEX,â no authoritative sources, no behavior, no reference table. Project has docs/, README, no skills. Complete per the output contract.
Expected: Keep existing âproject identityâ; add authoritative sources (where definitions and catalog live), behavioral expectations (at least 2â3 executable items, e.g. âFollow README and docs,â âWhen listing capabilities, read index then enumerateâ), discovery and loading (summary), language and communication, reference table. Do not remove correct user wording; if the project has no INDEX, reference table can say âN/Aâ or list README/docs. Output revised full text or diff and state which sections were added.
Output contract: AGENTS.md authoring standard
The following is the standard used by this skill when producing AGENTS.md; it is embedded in this SKILL.md. Projects adopting the âagent-first, governance-ready capability inventory (Spec)â shape can use it; this repoâs AGENTS.md follows it.
1. Purpose and role
- AGENTS.md is the single entry and contract for AI Agents interacting with the project; it is usually at the repo root.
- Purpose: When an Agent touches the project, define project identity, authoritative sources, and behavioral expectations so the Agent behaves consistently and predictably in or when referencing the repo.
- Audience: Agents that can read files (e.g. IDE Agent, CLI Agent); can also be used by consumer repos that reference it via Raw URL.
2. Primary goals
AGENTS.mdâs main goal is not âteach the Agent how to use skillsâ but to establish entry and behavior. That means three things:
| Goal | Description |
|---|---|
| Project identity | One sentence on what the project is; list top-level asset types (e.g. Skills), their directories, and definition specs. |
| Authoritative sources | Where âdefinitionsâ and âcatalog/listâ live; the Agent treats these as truth, not verbal or scattered docs. |
| Behavioral expectations | What the Agent must or must not do in or when referencing the project (e.g. follow spec, self-check before submit, read index then enumerate when listing capabilities). |
3. Recommended structure and sections
Organize in this order for both Agents and humans:
| Order | Section | Content |
|---|---|---|
| 1 | Opening | One sentence: this file is the Agent entry and contract; purpose (identity + authority + behavior). |
| 2 | Project identity | One-line positioning + asset type/dir/spec table + catalog and manifest (if any). |
| 3 | Authoritative sources | Where definitions, catalog/list, and usage contract live; pointers only, no long detail. |
| 4 | Behavioral expectations | Numbered expectations the Agent must follow; each can reference a spec or doc. |
| 5 | Discovery and loading (summary) | Asset root, how to discover, how to inject; details in AGENTS.md §4 or equivalent; avoid repeating in AGENTS.md. |
| 6 | Language and communication | Primary description language and terminology; align with spec/skill or equivalent. |
| 7 | Reference | Table: spec source, this entry Raw URL (if applicable), definition spec, usage and install, entry indexes. |
Section titles and levels can follow project style, but keep the order: identity â authority â behavior â operations summary â language â reference.
4. Content requirements
- Executable expectations: Use âmust,â âshall,â âmust notâ (or equivalent) so the Agent can parse and follow.
- Do not duplicate spec and docs: AGENTS.md indexes and summarizes; point to
spec/ordocs/for full definitions and install. - Stable references: Use relative paths or resolvable URLs to specs and indexes in the repo; if the project can be referenced via Raw URL, provide the canonical Raw URL for AGENTS.md in the reference table.
5. Format and style
- Headings: Short and parseable; optional English subtitle (e.g. âAgent Entryâ).
- Length: Aim for about one page (e.g. 60â80 lines) so the Agent can load and parse in one go.
- Language: Match the projectâs main asset language; if the project uses English, see spec/skill.md language requirements.
- Tables: Use Markdown tables for project identity, authoritative sources, and reference for structured parsing.
6. Reference table
- End with a reference table listing at least: spec source, this entry Raw URL (if Raw reference is supported), definition specs (e.g. spec/skill), entry indexes (e.g. skills/INDEX.md). Usage is in AGENTS.md §4. The table lets Agents and tools jump to authoritative docs without crawling the repo.
7. Relation to other specs
- Usage: Runtime behavior for discovery, injection, and self-check is in AGENTS.md §4; AGENTS.md is the single entry and contract.
- Language: AGENTS.mdâs description and communication expectations should align with spec/skill.md language requirements (if the project uses that spec).
8. Adapting for other projects
Other projects adopting this contract can: keep the three elements (identity, authority, behavior) and the recommended section order; replace âproject identityâ with their one-line positioning and asset table; replace paths and spec names in âauthoritative sources,â âbehavior,â and âdiscovery and loadingâ with their spec/ or equivalent; if the project has no Skills or INDEX, omit or replace with that projectâs top-level assets and dirs, and adjust the reference table accordingly.