Skip to content

Commit af98fce

Browse files
committed
docs: improve onboarding and add AGENTS contract
1 parent 99578f7 commit af98fce

File tree

2 files changed

+148
-1
lines changed

2 files changed

+148
-1
lines changed

AGENTS.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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`

README.md

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@
22

33
Portable OpenCode + Codex setup inspired by `my-claude-setup`.
44

5-
This repository is a practical starter for:
5+
This repository is for people who use OpenCode and want a reproducible, versioned setup they can reuse across machines:
66
- reusable agents
77
- structured skills
88
- workspace-aware project context
99
- session handover workflow
1010
- command-style execution playbooks
1111

12+
## Prerequisites
13+
14+
- OpenCode installed: https://opencode.ai/docs (install script: https://opencode.ai/install)
15+
- `git`, `bash`, and `python3` available on your PATH
16+
- Optional (contributors): `pre-commit`
17+
- Optional (GitHub workflows): `gh` authenticated (`gh auth login`)
18+
1219
## Quick Start
1320

1421
```bash
@@ -18,6 +25,13 @@ chmod +x install.sh
1825
./install.sh
1926
```
2027

28+
Verify it worked:
29+
30+
```bash
31+
./install.sh --status
32+
./scripts/ops-check.sh
33+
```
34+
2135
## Profiles
2236

2337
This setup supports optional profiles:
@@ -67,6 +81,31 @@ Use `--conflict-policy skip` to leave conflicting paths untouched and continue l
6781

6882
`./install.sh --uninstall` removes managed symlinks and profile state.
6983

84+
## Try It Now
85+
86+
```bash
87+
# create a session handover note in ./memory
88+
./scripts/handover.sh
89+
90+
# quick repo-local quality gate detection
91+
./scripts/ops-check.sh
92+
93+
# git helper
94+
./scripts/git-porcelain.sh status
95+
96+
# issue -> branch -> draft PR loop (requires gh auth)
97+
./scripts/issue-pr-loop.sh start 123 main
98+
./scripts/issue-pr-loop.sh pr 123 main
99+
```
100+
101+
If you enabled `council-lite`, you can also run:
102+
103+
```bash
104+
./scripts/council-lite.sh run "Design safe billing webhooks"
105+
./scripts/council-lite.sh list
106+
./scripts/validate-council-lite.sh --latest
107+
```
108+
70109
## Directory Layout
71110

72111
```text
@@ -113,3 +152,23 @@ Use `docs/gpt53-opencode-playbook.md` as the default runbook for GPT-5.3 + OpenC
113152
- launch checklist in `docs/open-source-launch.md`
114153
- friend outreach message in `docs/friend-outreach-template.md`
115154
- onboarding feedback channels in `docs/onboarding-feedback.md`
155+
156+
## Where To Go Next
157+
158+
- Profiles and installer behavior: `docs/profiles.md`
159+
- Common scripts and usage patterns: `docs/workflows-playbook.md`
160+
- Agent pack overview and how to invoke agents: `docs/agents-playbook.md` and `agents/README.md`
161+
- Mapping from Claude setup patterns: `docs/what-maps-what.md` and `docs/migration-from-claude.md`
162+
163+
## Troubleshooting
164+
165+
Conflicts under `~/.config/opencode/`:
166+
- If a managed path already exists and is not a symlink, install fails by default.
167+
- Recommended: move/remove the conflicting path, then rerun `./install.sh`.
168+
- If you want to proceed without replacing conflicting paths, use `./install.sh --conflict-policy skip`.
169+
170+
"I expected files to be copied":
171+
- This repo is designed around symlinks. Editing files in this repo updates your OpenCode config immediately.
172+
173+
"python3 not found":
174+
- Install requires `python3` for profile resolution and state management.

0 commit comments

Comments
 (0)