skills/agent-onboard/SKILL.md
Onboard new or modified agents to ensure they are project-context aware and follow toolkit conventions. Triggers on: onboard agent, new agent setup, agent conventions, agent context loading.
npx skillsauth add mdmagnuson-creator/yo-go agent-onboardInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Onboard new or modified agents to ensure they are project-context aware and follow the established conventions for the AI toolkit.
When users create or modify agents in ~/.config/opencode/agents/, this skill ensures the agent:
docs/project.json, docs/CONVENTIONS.md)<project>/docs/agents//agent-onboard <agent-name>| Input | Required | Description |
|-------|----------|-------------|
| agent_path | Yes | Path to the agent file (e.g., ~/.config/opencode/agents/my-agent.md) |
| create_template | No | Whether to also create an agent template (default: false) |
| force | No | Overwrite existing project context section (default: false) |
# Check the agent file exists
cat <agent_path>
Verify:
Check if the agent already has project context awareness:
Look for these indicators of project awareness:
docs/project.jsondocs/CONVENTIONS.md~/.config/opencode/projects.jsonClassify the agent:
Analyze the agent to determine its type:
| Type | Characteristics | Action | |------|-----------------|--------| | Primary | Entry point agent (planner, builder) | Add full startup sequence | | Router | Dispatches to other agents (critic, tester) | Add project agent check + context injection | | Specialist | Does specific work (react-dev, go-tester) | Add project context loading | | Utility | Helper functions (session-status) | Minimal or no changes needed |
Based on agent type, generate the appropriate section:
## Startup
**CRITICAL: You must load project context before doing ANYTHING else.**
1. **Read the project registry:**
```bash
cat ~/.config/opencode/projects.json
If activeProject is set, load project context:
<project>/docs/project.json for stack configuration<project>/docs/CONVENTIONS.md for coding standards<project>/docs/agents/ for project-specific agent overridesAdapt your behavior based on the loaded context:
#### For Router Agents
```markdown
## Project Context Loading
Before dispatching to any specialist agent:
1. **Load project context:**
```bash
cat ~/.config/opencode/projects.json
Check for project-specific agents:
<project>/docs/agents/ for project-specific versions~/.config/opencode/agents/Inject project context into the dispatched agent's prompt:
docs/project.jsondocs/CONVENTIONS.md
#### For Specialist Agents
```markdown
## Project Context
Before starting work, load the project context:
1. **Read project configuration:**
```bash
cat ~/.config/opencode/projects.json
If activeProject is set:
<project>/docs/project.json for stack-specific settings<project>/docs/CONVENTIONS.md for coding standardsApply project conventions to all code you write or review.
### Step 5: Insert Section into Agent
Insert the generated section after the agent's title/description but before its main instructions.
**Placement rules:**
1. After the `# Agent Title` header
2. After any brief description paragraph
3. Before `## Capabilities`, `## Workflow`, or similar sections
4. If no clear structure, add after the first paragraph
### Step 6: Validate Changes
After modification, verify:
- [ ] Agent file is still valid markdown
- [ ] No duplicate sections were created
- [ ] The section is properly integrated with existing content
- [ ] Agent's core functionality is preserved
### Step 7: Create Template (Optional)
If `create_template` is true and the agent is framework-agnostic:
1. Copy the agent to `~/.config/opencode/agent-templates/<agent-name>.md.hbs`
2. Replace hardcoded values with template variables:
- Framework references → `{{PROJECT.stack.frontend.framework}}`
- Language references → `{{PROJECT.stack.language}}`
- Database references → `{{PROJECT.stack.database.type}}`
3. Add conditional sections for stack-specific behavior
### Step 8: Report Results
Output a summary:
═══════════════════════════════════════════════════════════════════════ AGENT ONBOARDING COMPLETE ═══════════════════════════════════════════════════════════════════════
Agent: my-agent.md Type: Specialist Status: ✅ Now project-aware
Changes Made: ✓ Added Project Context section ✓ Added project.json loading ✓ Added CONVENTIONS.md loading
Template: ❌ Not created (use --create-template to generate)
═══════════════════════════════════════════════════════════════════════
## Standard Project Context Block
All agents should include this minimal block (customize based on agent type):
```markdown
## Project Context
This agent is project-context aware. On startup:
1. Load `~/.config/opencode/projects.json` to find the active project
2. Load `<project>/docs/project.json` for stack configuration
3. Load `<project>/docs/CONVENTIONS.md` for coding standards
4. Check `<project>/docs/agents/` for project-specific overrides
Apply all project conventions to your work.
/agent-onboard ~/.config/opencode/agents/vue-dev.md
Before:
# Vue.js Developer Agent
Implements Vue.js components and features.
## Capabilities
- Create Vue 3 components with Composition API
- Implement Pinia stores
...
After:
# Vue.js Developer Agent
Implements Vue.js components and features.
## Project Context
Before starting work, load the project context:
1. **Read project configuration:**
```bash
cat ~/.config/opencode/projects.json
If activeProject is set:
<project>/docs/project.json for stack-specific settings<project>/docs/CONVENTIONS.md for coding standardsApply project conventions to all code you write or review.
### Example 2: Onboard and Create Template
/agent-onboard ~/.config/opencode/agents/api-dev.md --create-template
Creates both the updated agent AND `~/.config/opencode/agent-templates/api-dev.md.hbs`.
## Error Handling
| Error | Resolution |
|-------|------------|
| Agent file not found | Verify path and try again |
| Agent already compliant | Report status, no changes needed |
| Cannot determine agent type | Ask user to specify type |
| Template variable conflicts | Manual review required |
## Related Skills
- `agent-audit` - Scan all agents for compliance
- `project-bootstrap` - Set up new projects with agent support
data-ai
Generate verification contracts before delegating tasks to sub-agents, defining how success will be measured. Triggers on: verification contract, delegation contract, task verification, contract-first delegation.
testing
Verify that Vercel environment variables point to the correct Supabase project for each environment to prevent staging/production cross-wiring. Triggers on: vercel supabase check, environment alignment, env var check, supabase environment.
development
Manage codebase and database vectorization for semantic search. Use when initializing, refreshing, or querying the vector index. Triggers on: vectorize init, vectorize refresh, vectorize search, semantic search, vector index, enable vectorization.
testing
Patterns for XCUITest UI tests for native Apple apps (macOS/iOS). Use when writing or reviewing XCUITest tests for Swift apps. Triggers on: XCUITest, xcuitest, native app testing, Apple UI tests, SwiftUI tests, AppKit tests, UIKit tests.