skill-add-example
Add real code examples to .agents/examples/ so other skills can reference them. Use when a new pattern needs to be standardized as a template or agent reference.
- License 许可
- MIT
- 最近更新
- 2026-08-18
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- skill-add-example
- description
- Add real code examples to .agents/examples/ so other skills can reference them. Use when a new pattern needs to be standardized as a template or agent reference.
02 资源文件 3
- 参考文档agents/openai.yaml302 B
- 参考文档references/context.md2.5 KB
- 参考文档templates/checklist.md1.3 KB
03 SKILL.md 正文
Skill: Skill Add Example
Context (Required)
- Scope folder + conventions:
references/context.md - Execution checklist:
templates/checklist.md
Add proven, real code examples to .agents/examples/ so the agent can reference them when executing skills.
Workflow
1. Determine Scope & Target Skill
- Identify the skill that will use this example (e.g.
web-slicing,web-api-integrated) - Pick a descriptive subfolder name (kebab-case): e.g.
use-products
2. Choose Example Location
.agents/examples/
└── {skill-name}/ → folder per skill
└── {subfolder}/ → specific context (framework, domain, etc.)
└── {example-name}/ → example name (kebab-case, descriptive)
├── {file}.ts → real code file
└── {file}.tsx → real code file
Existing locations:
.agents/examples/web-slicing/nextjs-app-router/examples/— basic CRUD.agents/examples/web-api-integrated/hooks/use-examples/— CRUD hooks
3. Write Example Files
- Copy real code from the codebase (not fabricated) — if none exists, build from an established pattern
- Ensure the code is directly usable as a template by the agent
- Replace overly specific business logic with clear placeholders
- Preserve original variable names and structure for clarity
4. Update References in Related Skill
After adding the example, update references/context.md in the skill that uses it:
## Real Code Examples
### Example N — {Example Name}
Location: `.agents/examples/{skill-name}/{subfolder}/{example-name}/`
Pattern: {list of patterns demonstrated}
Files:
- `{file}.tsx` — {short description}
**Use for:** {scenario when this example is relevant}
5. Make Example Discoverable
- Add a comment on the first line of the file:
// Example: {short description} - For multi-file examples, add a brief
README.mdin the example folder (optional, only if complex)
Prohibitions
- FORBIDDEN to add examples that have not been used in real codebases — validate in the project first.
- FORBIDDEN to store secrets, credentials, or sensitive data in example files.
- FORBIDDEN to create examples at the root
.agents/examples/without a skill subfolder. - FORBIDDEN to duplicate existing examples — check first.
- FORBIDDEN to skip updating
references/context.mdin the related skill.
Pre-Completion Checklist
- [ ] Scope and target skill identified
- [ ] Folder location chosen per convention (
{skill-name}/{subfolder}/{example-name}/) - [ ] Example files written — real code, usable as template
- [ ] No secrets or sensitive data in code
- [ ]
references/context.mdin related skill updated with new example entry - [ ] All files end with newline (EOF)
04 同仓库更多 Skills
web-slicing
Convert screenshot/Figma designs into pixel-perfect frontend UI with reusable components. Use when the task focuses on visual and layout implementation.
web-seo-geo-friendly
Optimize public Next.js App Router pages for SEO and GEO (Generative Engine Optimization). Use when the user explicitly requests SEO/GEO optimization on public pages.
web-code-review
Review frontend code with a firm senior-lead standard, focusing on bugs, regressions, architecture risks, and test gaps in apps/web and the shared contracts the frontend depends on.
web-bugfix
Fix frontend bugs with minimum-touch changes, keep other surfaces stable, and sync schema, types, hooks, constants, tests, and related docs when impacted.
web-api-integrated
Integrate API endpoints into the frontend with Zod schemas, response types, constants, and react-query hooks. Use when implementing endpoints from an API contract, Postman, or Swagger.
skill-creator
Create a new skill from scratch with full structure — SKILL.md, references, templates, openai.yaml, Claude wrapper, and registration in manifest + AGENTS.md + CLAUDE.md.