Skip to content

Skills & Rules

Skills and rules are two ways to shape how agents work. Skills provide deep, task-specific knowledge that agents load on demand. Rules inject behavioral constraints into every agent interaction.

A skill is a directory containing a SKILL.md file — structured instructions that an agent reads when performing a specific type of work.

  • Directorymy-plugin/
    • Directoryskills/
      • Directorybuilding-widgets/
        • SKILL.md — the skill definition (required)
        • Directorytemplates/ — optional reference files
          • widget-template.ts
        • Directoryexamples/ — optional examples
          • basic-widget.ts
# Building Widgets
## When to use
Use this skill when the user asks to create, modify, or debug widgets.
Also use when the build step of the widget-pipeline workflow runs.
## Process
1. Read the widget configuration from `widget.config.json`
2. Check existing widgets in `src/widgets/`
3. Generate the widget using the standard template
4. Register the widget in the manifest
5. Run widget validation tests
## Key Files
- `src/widgets/` — widget implementations
- `widget.config.json` — global widget configuration
- `tests/widgets/` — widget test suite
## Conventions
- Widget IDs must be kebab-case
- Every widget must have a corresponding test file
- Use the `WidgetBase` class for all widgets
## Common Mistakes
- Forgetting to register the widget in the manifest
- Using camelCase for widget IDs (must be kebab-case)
- Not running validation after generation
  1. The agent sees the skill in its catalog via skill_catalog()
  2. When the task matches the skill’s “When to use” description, the agent reads the SKILL.md
  3. The agent follows the process steps and references the key files
  4. Skills can reference other files in their directory (templates, examples)
  1. Be specific about triggers — the “When to use” section determines whether agents load the skill
  2. Include file paths — agents need to know where to look in the codebase
  3. List common mistakes — prevent agents from making known errors
  4. Keep it focused — one skill per task type. Don’t create a 2000-line mega-skill
  5. Include examples — put reference implementations in the skill directory

Rules are markdown files that get injected into agent system prompts. They apply to every interaction, unlike skills which are loaded on demand.

Rules are plain markdown files in the plugin’s rules/ directory:

# Widget Naming Conventions
All widget identifiers must follow these rules:
- Use kebab-case (e.g., `data-table`, not `dataTable`)
- Prefix with the module name (e.g., `charts-bar`, `charts-pie`)
- Maximum 30 characters
- No numbers at the start
When creating or renaming widgets, validate the name against these
rules before proceeding.

Rules declared in a plugin apply when that plugin is enabled. If the plugin is disabled, its rules are removed from agent contexts.

Rules that should always be active (coding standards, safety constraints):

{
"rules": "./rules/"
}

All files in the directory are loaded as rules.

AspectRulesSkills
LoadingAlways injected (when plugin enabled)Loaded on demand by the agent
ScopeAll agent interactionsSpecific task types
SizeShort (< 500 words)Can be longer (process docs)
PurposeConstraints and conventionsTask-specific knowledge
FormatMarkdown fileDirectory with SKILL.md