|
| 1 | +# AGENTS |
| 2 | + |
| 3 | +This repository is a portable OpenCode setup: it provides reusable agents, skills, commands, scripts, and workspace context. |
| 4 | + |
| 5 | +This file is the canonical development contract for both: |
| 6 | +- humans contributing to this repo |
| 7 | +- AI agents operating inside this repo |
| 8 | + |
| 9 | +## Repository Concepts |
| 10 | + |
| 11 | +- `agents/`: agent prompt files (roles like `architect`, `skeptic`, `craftsman`) |
| 12 | +- `skills/`: structured skill docs (repeatable workflows/templates) |
| 13 | +- `commands/`: reusable command docs (often mapped to scripts) |
| 14 | +- `scripts/`: executable workflow helpers |
| 15 | +- `workspaces/`: repo-name keyed context templates that OpenCode can inject |
| 16 | +- `profiles/`: optional capability bundles with a registry + manifests |
| 17 | +- `docs/`: onboarding, playbooks, and reference material |
| 18 | + |
| 19 | +The installer (`install.sh`) symlinks these directories into `~/.config/opencode/`. |
| 20 | + |
| 21 | +## Authoring Contracts |
| 22 | + |
| 23 | +### Skills |
| 24 | + |
| 25 | +Each `skills/*/SKILL.md` should include: |
| 26 | +- Purpose |
| 27 | +- Inputs |
| 28 | +- Process |
| 29 | +- Output Format |
| 30 | +- Quality Checks |
| 31 | + |
| 32 | +Keep skills: |
| 33 | +- practical (focused on reducing rework) |
| 34 | +- composable (usable alongside other skills) |
| 35 | +- stable (avoid needless churn that breaks muscle memory) |
| 36 | + |
| 37 | +### Agents |
| 38 | + |
| 39 | +Each `agents/*.md` should define: |
| 40 | +- mission (what the agent is for) |
| 41 | +- required inputs (what it needs from the user/repo) |
| 42 | +- workflow (ordered steps) |
| 43 | +- tool boundaries (what it must/must not do) |
| 44 | +- output contract (how it reports results) |
| 45 | +- anti-patterns (what to avoid) |
| 46 | + |
| 47 | +Keep agents: |
| 48 | +- narrow (one dominant responsibility) |
| 49 | +- explicit about safety boundaries |
| 50 | +- consistent across runs (avoid prompt drift) |
| 51 | + |
| 52 | +## Local Validation Checklist |
| 53 | + |
| 54 | +Run these before opening a PR: |
| 55 | + |
| 56 | +```bash |
| 57 | +# lightweight repo-wide checks |
| 58 | +python3 -m pip install --user pre-commit |
| 59 | +pre-commit install |
| 60 | +pre-commit run --all-files |
| 61 | + |
| 62 | +# shell script syntax checks |
| 63 | +bash -n install.sh |
| 64 | +bash -n scripts/*.sh |
| 65 | + |
| 66 | +# stack-aware quality gate detection for this repo |
| 67 | +./scripts/ops-check.sh |
| 68 | +``` |
| 69 | + |
| 70 | +If you changed council-lite artifacts or workflows, also run: |
| 71 | + |
| 72 | +```bash |
| 73 | +./scripts/validate-council-lite.sh --latest |
| 74 | +``` |
| 75 | + |
| 76 | +## Safety And Hygiene |
| 77 | + |
| 78 | +- Do not commit secrets or local-only credentials. |
| 79 | +- Prefer minimal diffs; avoid drive-by refactors. |
| 80 | +- Do not use destructive git commands unless explicitly requested. |
| 81 | +- Keep docs accurate: if behavior changes, update `README.md` and the relevant `docs/*.md`. |
| 82 | + |
| 83 | +## References |
| 84 | + |
| 85 | +- Default execution runbook: `docs/gpt53-opencode-playbook.md` |
| 86 | +- Workflows and scripts: `docs/workflows-playbook.md` |
| 87 | +- Agent usage patterns: `docs/agents-playbook.md` |
| 88 | +- Profiles and installer behavior: `docs/profiles.md` |
0 commit comments