$npx -y skills add rianvdm/product-ai-public --skill system-file-guardrailsSafety checks for editing system files — commands in .opencode/command/, skills in .opencode/skills/, agents in .opencode/agent/, or AGENTS.md itself. Load when creating or modifying any of these files.
| 1 | # System File Edit Guardrails |
| 2 | |
| 3 | Follow these checks when editing system files: commands (`.opencode/command/`), skills (`.opencode/skills/`), agents (`.opencode/agent/`), or `AGENTS.md` itself. |
| 4 | |
| 5 | ## Before Editing |
| 6 | |
| 7 | | Check | What to verify | |
| 8 | |-------|---------------| |
| 9 | | **Inbound references** | Search for the file's name across `.opencode/command/`, `.opencode/skills/`, `.opencode/agent/`, and `AGENTS.md`. Note files whose assumptions could break if this file changes. | |
| 10 | | **Outbound references** | What skills, agents, or commands does this file reference? Verify each exists on disk. | |
| 11 | |
| 12 | If broken outbound references are found, warn before proceeding (the edit might be fixing them). |
| 13 | |
| 14 | ## After Editing a Command |
| 15 | |
| 16 | | Check | What to verify | |
| 17 | |-------|---------------| |
| 18 | | Frontmatter | `description` present | |
| 19 | | `$ARGUMENTS` | Parsed and handled (if command accepts arguments) | |
| 20 | | Skill loading | Lazy — no loading during research phases | |
| 21 | | Token efficiency | Compact tables over prose. Nothing duplicated from `AGENTS.md` | |
| 22 | | MCP tool references | Correct tool names, fallback behavior if tools are unavailable | |
| 23 | |
| 24 | ## After Editing a Skill or Agent |
| 25 | |
| 26 | | Check | What to verify | |
| 27 | |-------|---------------| |
| 28 | | Frontmatter | `name`, `description` present. Agents: `mode`, `tools` also present | |
| 29 | | Description accuracy | Frontmatter `description` matches what the file actually does | |
| 30 | | Stale references | No references to commands, tools, files, or skills that don't exist | |
| 31 | | Agent quality checklist | Present and covers the agent's actual scope | |
| 32 | |
| 33 | ## Post-Session Coherence |
| 34 | |
| 35 | When 2+ system files are modified in a session, offer a coherence check before wrapping up: |
| 36 | |
| 37 | > "You modified N system files this session — running a quick coherence check." |
| 38 | |
| 39 | | Check | What to verify | |
| 40 | |-------|---------------| |
| 41 | | Cross-references | Do modified files' references to other files still resolve? | |
| 42 | | Scope alignment | If a convention spans multiple files, do they use consistent language? | |
| 43 | | Displaced content | Were any existing sections accidentally removed or overwritten? | |