Purpose: Understanding how component tracking and distribution works
Priority: CRITICAL - Load this before working with registry
The registry is a centralized catalog (registry.json) that tracks all components in OpenAgents Control:
Location: registry.json (root directory)
{
"version": "0.5.0",
"schema_version": "2.0.0",
"components": {
"agents": [...],
"subagents": [...],
"commands": [...],
"tools": [...],
"contexts": [...]
},
"profiles": {
"essential": {...},
"developer": {...},
"business": {...}
}
}
{
"id": "frontend-specialist",
"name": "Frontend Specialist",
"type": "agent",
"path": ".opencode/agent/development/frontend-specialist.md",
"description": "Expert in React, Vue, and modern CSS",
"category": "development",
"tags": ["react", "vue", "css", "frontend"],
"dependencies": ["subagent:tester"],
"version": "0.5.0"
}
Fields:
id: Unique identifier (kebab-case)name: Display nametype: Component type (agent, subagent, command, tool, context)path: File path relative to repo rootdescription: Brief descriptioncategory: Category name (for agents)tags: Optional tags for discoverydependencies: Optional dependenciesversion: Version when added/updatedThe auto-detect system scans .opencode/ and automatically updates the registry.
1. Scan .opencode/ directory
2. Find all .md files with frontmatter
3. Extract metadata (description, category, type, tags)
4. Validate paths exist
5. Generate component entries
6. Update registry.json
# Dry run (see what would be added)
./scripts/registry/auto-detect-components.sh --dry-run
# Actually add components
./scripts/registry/auto-detect-components.sh --auto-add
# Force update existing entries
./scripts/registry/auto-detect-components.sh --auto-add --force
✅ Agents - .opencode/agent/{category}/*.md
✅ Subagents - .opencode/agent/subagents/**/*.md
✅ Commands - .opencode/command/**/*.md
✅ Tools - .opencode/tool/**/index.ts
✅ Contexts - .opencode/context/**/*.md
For auto-detect to work, files must have frontmatter:
---
description: "Brief description"
category: "category-name" # For agents
type: "agent" # Or subagent, command, tool, context
tags: ["tag1", "tag2"] # Optional
---
# Validate registry
./scripts/registry/validate-registry.sh
# Verbose output
./scripts/registry/validate-registry.sh -v
✅ Schema - Correct JSON structure
✅ Paths - All paths exist
✅ IDs - Unique IDs
✅ Categories - Valid categories
✅ Dependencies - Dependencies exist
✅ Versions - Version consistency
# Example errors
ERROR: Path does not exist: .opencode/agent/core/missing.md
ERROR: Duplicate ID: frontend-specialist
ERROR: Invalid category: invalid-category
ERROR: Missing dependency: subagent:nonexistent
Profiles are pre-configured component bundles for quick installation.
Purpose: Minimal setup for basic usage
Includes:
"essential": {
"description": "Minimal setup for basic usage",
"components": [
"agent:openagent",
"agent:opencoder",
"command:commit",
"command:test"
]
}
Purpose: Full development setup
Includes:
"developer": {
"description": "Full development setup",
"components": [
"agent:*",
"subagent:*",
"command:*",
"context:core/*",
"context:development/*"
]
}
Purpose: Content and product focus
Includes:
"business": {
"description": "Content and product focus",
"components": [
"agent:openagent",
"agent:copywriter",
"agent:technical-writer",
"context:core/*",
"context:content/*"
]
}
The install system uses the registry to distribute components.
1. User runs install.sh
2. Check for local registry.json (development mode)
3. If not local, fetch from GitHub (production mode)
4. Parse registry.json
5. Show component selection UI
6. Resolve dependencies
7. Download components from GitHub
8. Install to .opencode/
9. Handle collisions (skip/overwrite/backup)
# Test with local registry
REGISTRY_URL="file://$(pwd)/registry.json" ./install.sh --list
# Install with local registry
REGISTRY_URL="file://$(pwd)/registry.json" ./install.sh developer
# Install from GitHub
./install.sh developer
# List available components
./install.sh --list
"dependencies": [
"subagent:tester",
"context:core/standards/code"
]
type:id)User installs: frontend-specialist
↓
Depends on: subagent:tester
↓
Depends on: context:core/standards/tests
↓
Install order:
1. context:core/standards/tests
2. subagent:tester
3. frontend-specialist
When installing components that already exist:
File exists: .opencode/agent/core/openagent.md
[S]kip, [O]verwrite, [B]ackup, [A]ll skip, [F]orce all?
# Skip all collisions
./install.sh developer --skip-existing
# Overwrite all collisions
./install.sh developer --force
# Backup all collisions
./install.sh developer --backup
# Check version consistency
cat VERSION
cat package.json | jq '.version'
cat registry.json | jq '.version'
# All should match
# Bump version
echo "0.X.Y" > VERSION
jq '.version = "0.X.Y"' package.json > tmp && mv tmp package.json
jq '.version = "0.X.Y"' registry.json > tmp && mv tmp registry.json
# .github/workflows/validate-registry.yml
- name: Validate Registry
run: ./scripts/registry/validate-registry.sh
# .github/workflows/update-registry.yml
- name: Update Registry
run: ./scripts/registry/auto-detect-components.sh --auto-add
# .github/workflows/version-bump.yml
- name: Bump Version
run: ./scripts/versioning/bump-version.sh
✅ Add frontmatter - Required for auto-detect
✅ Run auto-detect - Don't manually edit registry
✅ Validate - Always validate after changes
✅ Test locally - Use local registry for testing
✅ Auto-detect first - Let scripts handle updates
✅ Validate often - Catch issues early
✅ Version consistency - Keep versions in sync
✅ CI validation - Automate validation in CI
✅ Explicit dependencies - List all dependencies
✅ Test resolution - Verify dependencies resolve
✅ Avoid cycles - No circular dependencies
Problem: Registry references non-existent path
Solution: Run auto-detect or fix path manually
Problem: Two components with same ID
Solution: Rename one component
Problem: Agent has invalid category
Solution: Use valid category (core, development, content, data, product, learning)
Problem: Dependency doesn't exist in registry
Solution: Add dependency or remove reference
Problem: VERSION, package.json, registry.json don't match
Solution: Update all version files to match
guides/updating-registry.mdguides/adding-agent.mdcore-concepts/categories.mdLast Updated: 2025-12-10
Version: 0.5.0