- Built-in agents: Build (full access) and Plan (read-only) - Custom agents support prompts, model overrides, tool control - Skills are global, agents access via skill() tool - Permission control per-agent via opencode.json - OpenCode supports Claude-compatible skill paths Closes skills-czz 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
8.7 KiB
Skills Deployment Strategy
Current State
This repository (~/proj/skills) is a development and testing repository for AI agent skills. It is NOT the deployment location.
Actual deployment happens from ~/proj/dotfiles:
- Source:
~/proj/dotfiles/claude/skills/ - Runtime:
~/.claude/skills/and~/.config/opencode/skills/ - Managed by: Home Manager (Nix)
Deployment Model
Global Skills (System-Wide)
Path: ~/proj/dotfiles/claude/skills/<skill-name>/
Deployed to:
~/.claude/skills/<skill-name>/(Claude Code)~/.config/opencode/skills/<skill-name>/(OpenCode)
Who uses: All AI agents, all projects
Examples:
worklog- Document work sessionsupdate-spec-kit- Update spec-kit ecosystem
Project-Local Skills
Path: <project>/.opencode/command/<skill-name>.md
Deployed to: Loaded directly from project directory
Who uses: Only when working in that specific project
Examples:
/testin dotfiles (runsnix flake check)/rebuildin dotfiles (runsnixos-rebuild)/speckit.*in skills repo (spec-kit commands)
Deployment Categories for Our New Skills
1. screenshot-latest (Global)
Category: Global skill
Why: Useful in any project where user takes screenshots
Security: Low risk (just finds existing files)
Deployment path: ~/proj/dotfiles/claude/skills/screenshot-latest/
Usage scenarios:
- Writing documentation with screenshots
- Analyzing UI/UX in any project
- Debugging visual issues
- General screenshot reference
2. niri-window-capture (Global, Security-Sensitive)
Category: Global skill
Why: Window capture capability useful system-wide
Security: HIGH RISK (invisible cross-workspace capture)
Deployment path: ~/proj/dotfiles/claude/skills/niri-window-capture/
Requirements before deployment:
- User must review SECURITY.md
- User must configure niri block-out rules
- User must understand audit logging
- User must trust the AI agent
Usage scenarios:
- Capture window from inactive workspace for analysis
- "Find the window with error message" across all workspaces
- Compare windows side-by-side without switching
- Analyze UI state invisibly
3. Project Commands (This Repo Only)
Category: Project-local
Why: Specific to skills development workflow
Path: ~/proj/skills/.opencode/command/
Potential commands:
/test-skill <name>- Test a skill before deployment/deploy-skill <name>- Copy skill to dotfiles for deployment/security-check <skill>- Run security analysis on skill
Deployment Workflow
For Global Skills
-
Develop in skills repo:
cd ~/proj/skills # Build skill: skills/<skill-name>/ -
Test locally (manual symlink):
ln -s ~/proj/skills/skills/<skill-name> ~/.claude/skills/<skill-name>-test # Test with AI agent rm ~/.claude/skills/<skill-name>-test -
Copy to dotfiles:
cp -r ~/proj/skills/skills/<skill-name> ~/proj/dotfiles/claude/skills/ cd ~/proj/dotfiles -
Add to Home Manager (edit
home/claude.nix):home.file.".claude/skills/<skill-name>" = { source = ../claude/skills/<skill-name>; recursive = true; }; -
Add to OpenCode (edit
home/opencode.nix):home.file.".config/opencode/skills/<skill-name>" = { source = ../claude/skills/<skill-name>; recursive = true; }; -
Rebuild system:
cd ~/proj/dotfiles sudo nixos-rebuild switch --flake .#delpad -
Restart agents:
- OpenCode: Exit and restart
- Claude Code: Restart application
For Project-Local Commands
-
Create in project:
cd ~/proj/skills mkdir -p .opencode/command vim .opencode/command/test-skill.md -
OpenCode loads automatically on next startup in this directory
Version Control Strategy
skills repo (development)
- Purpose: Development, experimentation, version history
- Branch: Feature branches for each skill
- Commits: Detailed development history
- Status: Working code, specs, analysis
dotfiles repo (deployment)
- Purpose: System configuration, stable deployments
- Branch: main (stable only)
- Commits: "Add skill" (deployment markers)
- Status: Production-ready only
Workflow:
skills repo (dev) --[copy]--> dotfiles repo (deploy) --[nix]--> runtime
↓ ↓ ↓
git commit git commit ~/.claude/skills/
version history deployment marker (symlink to nix store)
Security Considerations
Global Skills Deployment
Before deploying globally, ensure:
- ✅ Security analysis documented
- ✅ Risks clearly communicated
- ✅ Audit logging implemented
- ✅ Protection mechanisms documented
- ✅ User can review before using
Do NOT deploy if:
- ❌ Security implications unclear
- ❌ No audit trail
- ❌ High risk without mitigations
- ❌ Requires per-project configuration
niri-window-capture Specific
Additional requirements:
- SECURITY.md must be in deployed skill
- README must have security warning
- SKILL.md must reference security docs
- User must configure niri block-out rules BEFORE deployment
Deployment checklist:
- Review SECURITY.md
- Configure niri window rules:
window-rule { match app-id=r#"^org\.keepassxc\.KeePassXC$"# block-out-from "screen-capture" } - Test audit logging works:
journalctl --user -t niri-capture - Verify blocked windows can't be captured
- Deploy to dotfiles
- Document deployment in dotfiles commit message
OpenCode Agent Functionality
Built-in agents:
- Build - Default primary agent with all tools enabled (file ops, bash, etc.)
- Plan - Restricted agent for analysis/planning without making changes
Custom agents can be created with:
- Custom system prompts
- Model overrides (e.g., faster model for planning)
- Tool access control (per-agent tool enable/disable)
Skills + Agents interaction:
- Skills are global - all agents see available skills in their tool description
- Agents access skills via
skill({ name: "skill-name" })tool - Permission control per-agent via
opencode.jsonor agent frontmatter:{ "permission": { "skill": { "skill-name": "allow", "pattern-*": "deny", "*": "ask" } } }
Skill discovery paths (searched in order):
.opencode/skill/<name>/SKILL.md(project-local)~/.config/opencode/skill/<name>/SKILL.md(global).claude/skills/<name>/SKILL.md(Claude-compatible)
Conclusion: Deploy skills globally to ~/.claude/skills/ (works for both Claude Code
and OpenCode). No agent-specific deployment needed - use permissions to control access.
Current Skills Status
| Skill | Status | Security | Deploy Location | Deployed? |
|---|---|---|---|---|
| screenshot-latest | ✅ Complete | Low risk | Global | ⏸️ No |
| niri-window-capture | ✅ Complete | HIGH RISK | Global | ⏸️ No (awaiting security review) |
| worklog | ✅ Deployed | Low risk | Global | ✅ Yes (in dotfiles) |
| update-spec-kit | ✅ Deployed | Low risk | Global | ✅ Yes (in dotfiles) |
Deployment Commands (Reference)
Test locally:
# Temporary symlink
ln -s ~/proj/skills/skills/<skill-name> ~/.claude/skills/<skill-name>-test
# Test with AI
# ...
# Remove test
rm ~/.claude/skills/<skill-name>-test
Deploy to dotfiles:
# Copy skill
cp -r ~/proj/skills/skills/<skill-name> ~/proj/dotfiles/claude/skills/
# Edit Nix configs
vim ~/proj/dotfiles/home/claude.nix
vim ~/proj/dotfiles/home/opencode.nix
# Rebuild
cd ~/proj/dotfiles
sudo nixos-rebuild switch --flake .#delpad
Verify deployment:
# Check symlinks exist
ls -la ~/.claude/skills/<skill-name>
ls -la ~/.config/opencode/skills/<skill-name>
# Check they point to Nix store
readlink ~/.claude/skills/<skill-name>/SKILL.md
# Should show: /nix/store/.../SKILL.md
Next Steps
- Decide on deployment for screenshot-latest and niri-window-capture
- Review security for niri-window-capture before deploying
- Research OpenCode agents to understand deployment implications
- Create deployment helper (optional): script to copy + update Nix configs
- Document in dotfiles after deployment (update skills README)
References
- Dotfiles deployment:
~/proj/dotfiles/docs/skills-and-commands-workflow.md - Existing skills:
~/proj/dotfiles/claude/skills/ - Home Manager config:
~/proj/dotfiles/home/claude.nix,~/proj/dotfiles/home/opencode.nix - Skills development:
~/proj/skills/README.md