refactor: enforce layer responsibilities across all skills
Rewrote docs/standard.md as the single source of truth for skill structure (menu/tools/recipes/manual analogy). Trimmed all SKILL.md files to pure routers, moved recruitment workflow out of SKILL.md into workflows/recruitment.md, removed duplicated standards from workflow files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,43 +1,104 @@
|
||||
# Skill Authoring Guide
|
||||
# Skill Authoring Standard
|
||||
|
||||
## Skill Structure
|
||||
## Anatomy of a Skill
|
||||
|
||||
A skill is a directory with the following layout:
|
||||
A skill is a directory with up to four layers:
|
||||
|
||||
```
|
||||
{skill-name}/SKILL.md # Required — skill description and usage
|
||||
{skill-name}/scripts/ # Optional — executable scripts
|
||||
{skill-name}/workflows/ # Optional — process guides
|
||||
{skill-name}/docs/ # Optional — supplementary documentation
|
||||
{skill-name}/
|
||||
SKILL.md # Required — the menu
|
||||
scripts/ # Optional — the kitchen tools
|
||||
workflows/ # Optional — the recipes
|
||||
docs/ # Optional — the reference manual
|
||||
```
|
||||
|
||||
## Writing Requirements
|
||||
Each layer has a single responsibility:
|
||||
|
||||
**SKILL.md must start with a YAML frontmatter block:**
|
||||
| Layer | Role | Analogy | Contains | Does NOT contain |
|
||||
|-------|------|---------|----------|------------------|
|
||||
| **SKILL.md** | Router | Menu | What's available + when to use it | Process details, standards, how-tos |
|
||||
| **scripts/** | Automation | Kitchen tools | Fixed-logic executables | Judgment calls, contextual decisions |
|
||||
| **workflows/** | Process guide | Recipes | Step-by-step procedures requiring judgment | Standards, naming rules, structure specs |
|
||||
| **docs/** | Reference | Reference manual | Facts, standards, specifications | Procedures, step-by-step instructions |
|
||||
|
||||
```yaml
|
||||
### How they relate
|
||||
|
||||
```
|
||||
Agent reads SKILL.md
|
||||
→ finds the right script or workflow
|
||||
→ workflow references docs/ for standards when needed
|
||||
```
|
||||
|
||||
## SKILL.md — The Menu
|
||||
|
||||
SKILL.md is the first thing an agent reads. It answers two questions: **what's available** and **when to use it**.
|
||||
|
||||
### Format
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: {skill-name}
|
||||
description: {when-to-use}
|
||||
description: {one-line description of when to use this skill}
|
||||
---
|
||||
|
||||
> Execution notes (e.g., "All scripts must be executed via pcexec")
|
||||
|
||||
## Scripts
|
||||
|
||||
List each script with invocation syntax and a one-line description.
|
||||
Group related scripts under a subheading if needed.
|
||||
|
||||
## Workflows
|
||||
|
||||
List each workflow file path with the trigger condition (when to use it).
|
||||
|
||||
## Reference
|
||||
|
||||
Point to docs/ if the skill has reference material.
|
||||
```
|
||||
|
||||
**SKILL.md body should be concise.** It serves as a table of contents for workflows — list each workflow file path with the scenario that triggers it. For supplementary documentation, use `docs/`.
|
||||
### Rules
|
||||
|
||||
> **All skill-related documentation must be written in English.**
|
||||
- **Concise.** One-line descriptions per script/workflow. No multi-paragraph explanations.
|
||||
- **No process details.** Don't describe how to do something — that belongs in workflows/.
|
||||
- **No standards or rules.** Don't define naming conventions or structure — that belongs in docs/.
|
||||
- **Warnings and prerequisites** are allowed as short callouts (e.g., "do not run unless explicitly requested").
|
||||
|
||||
## When to Use Scripts vs Workflows
|
||||
## scripts/ — The Kitchen Tools
|
||||
|
||||
Both scripts and workflows are parts of a skill — scripts live in `{skill-name}/scripts/`, workflows in `{skill-name}/workflows/`.
|
||||
Scripts handle operations that are **completely fixed** — the steps are predictable, the logic doesn't change based on context.
|
||||
|
||||
- **Scripts** — handle logic that is completely fixed. When the steps are predictable and always the same, encode them in a script.
|
||||
- **Workflows** — handle flexible situations. When context matters, decisions are needed, or the process is nuanced, describe it in a workflow document.
|
||||
### Rules
|
||||
|
||||
## Script Hint
|
||||
- Each script has a single responsibility
|
||||
- Must be executable (`chmod +x`)
|
||||
- Must be called via `pcexec` unless documented otherwise
|
||||
- Use `AGENT_ID`, `AGENT_WORKSPACE` environment variables when behavior varies by agent
|
||||
- Use `ego-mgr get <field>` for agent identity info inside scripts
|
||||
|
||||
When a script needs to behave differently based on the calling agent, use these environment variables:
|
||||
## workflows/ — The Recipes
|
||||
|
||||
- `AGENT_ID` — the agent ID executing the script
|
||||
- `AGENT_WORKSPACE` — the workspace of the agent executing the script
|
||||
Workflows guide operations that **require judgment** — the steps vary depending on context, or decisions need to be made along the way.
|
||||
|
||||
For more agent info, call `ego-mgr get <column>` inside the script.
|
||||
### Rules
|
||||
|
||||
- Each workflow is a standalone markdown file
|
||||
- Must be self-contained enough to follow independently
|
||||
- Reference docs/ for standards (e.g., `> See docs/standard.md for naming conventions`) — don't repeat them inline
|
||||
- Focus on **steps and decision points**, not rules
|
||||
|
||||
## docs/ — The Reference Manual
|
||||
|
||||
Docs hold **facts and standards** that don't change based on who's reading or what task they're doing.
|
||||
|
||||
### Rules
|
||||
|
||||
- Reference material only — no step-by-step procedures
|
||||
- Standards, specifications, naming conventions, structure definitions
|
||||
- Referenced by workflows and SKILL.md, never duplicated into them
|
||||
|
||||
## General Requirements
|
||||
|
||||
- **Language:** All skill documentation must be written in English
|
||||
- **Naming:** Skill directories use kebab-case (e.g., `git-hangman-lab`)
|
||||
- **Frontmatter:** SKILL.md must start with a YAML frontmatter block containing `name` and `description`
|
||||
|
||||
Reference in New Issue
Block a user