Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions .opencode/docs/CLAUDE-local-template.md

This file was deleted.

2 changes: 1 addition & 1 deletion .opencode/docs/context-management.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Context Management

Context is the most critical resource in a Claude Code session. Manage it actively.
Context is the most critical resource in an OpenCode session. Manage it actively.

## File-Backed State (Primary Strategy)

Expand Down
22 changes: 6 additions & 16 deletions .opencode/docs/coordination-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ high-stakes output; otherwise leave unset (Sonnet).
This project uses two distinct multi-agent patterns:

### Subagents (current, always active)
Spawned via `Task` within a single Claude Code session. Used by all `team-*` skills
Spawned via `Task` within a single OpenCode session. Used by all `team-*` skills
and orchestration skills. Subagents share the session's permission context, run
sequentially or in parallel within the session, and return results to the parent.

Expand All @@ -45,23 +45,13 @@ needs the other's output to begin), spawn both Task calls simultaneously rather
than waiting. Example: `/review-all-gdds` Phase 1 (consistency) and Phase 2
(design theory) are independent — spawn both at the same time.

### Agent Teams (experimental — opt-in)
Multiple independent Claude Code *sessions* running simultaneously, coordinated
### Agent Teams (future)
Multiple independent OpenCode *sessions* running simultaneously, coordinated
via a shared task list. Each session has its own context window and token budget.
Requires `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` environment variable.
OpenCode does not currently support this pattern.

**Use agent teams when**:
- Work spans multiple subsystems that will not touch the same files
- Each workstream would take >30 minutes and benefits from true parallelism
- A senior agent (technical-director, producer) needs to coordinate 3+ specialist
sessions working on different epics simultaneously

**Do not use agent teams when**:
- One session's output is required as input for another (use sequential subagents)
- The task fits in a single session's context (use subagents instead)
- Cost is a concern — each team member burns tokens independently

**Current status**: Not yet used in this project. Document usage here when first adopted.
**Use subagents instead** — the `Task` tool spawns agents within a single session
and supports both sequential and parallel execution. See the Subagents section above.

## Parallel Task Protocol

Expand Down
2 changes: 1 addition & 1 deletion .opencode/docs/director-gates.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ All gates return one of three verdicts. Skills must handle all three:
| Verdict | Meaning | Default action |
|---------|---------|----------------|
| **APPROVE / READY** | No issues. Proceed. | Continue the workflow |
| **CONCERNS [list]** | Issues present but not blocking. | Surface to user via `AskUserQuestion` — options: `Revise flagged items` / `Accept and proceed` / `Discuss further` |
| **CONCERNS [list]** | Issues present but not blocking. | Surface to user via `question` — options: `Revise flagged items` / `Accept and proceed` / `Discuss further` |
| **REJECT / NOT READY [blockers]** | Blocking issues. Do not proceed. | Surface blockers to user. Do not write files or advance stage until resolved. |

**Escalation rule**: When multiple directors are spawned in parallel, apply the
Expand Down
53 changes: 34 additions & 19 deletions .opencode/docs/hooks-reference.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
# Active Hooks

Hooks are configured in `.opencode/settings.json` and fire automatically:

| Hook | Event | Trigger | Action |
| ---- | ----- | ------- | ------ |
| `validate-commit.sh` | PreToolUse (Bash) | `git commit` commands | Validates design doc sections, JSON data files, hardcoded values, TODO format |
| `validate-push.sh` | PreToolUse (Bash) | `git push` commands | Warns on pushes to protected branches (develop/main) |
| `validate-assets.sh` | PostToolUse (Write/Edit) | Asset file changes | Checks naming conventions and JSON validity for files in `assets/` |
| `session-start.sh` | SessionStart | Session begins | Loads sprint context, milestone, git activity; detects and previews active session state file for recovery |
| `detect-gaps.sh` | SessionStart | Session begins | Detects fresh projects (suggests /start) and missing documentation when code/prototypes exist, suggests /reverse-document or /project-stage-detect |
| `pre-compact.sh` | PreCompact | Context compression | Dumps session state (active.md, modified files, WIP design docs) into conversation before compaction so it survives summarization |
| `post-compact.sh` | PostCompact | After compaction | Reminds Claude to restore session state from `active.md` checkpoint |
| `notify.sh` | Notification | Notification event | Shows Windows toast notification via PowerShell |
| `session-stop.sh` | Stop | Session ends | Summarizes accomplishments and updates session log |
| `log-agent.sh` | SubagentStart | Agent spawned | Audit trail start — logs subagent invocation with timestamp |
| `log-agent-stop.sh` | SubagentStop | Agent stops | Audit trail stop — completes subagent record |
| `validate-skill-change.sh` | PostToolUse (Write/Edit) | Skill file changes | Advises running `/skill-test` after any `.opencode/skills/` file is written or edited |

Hook reference documentation: `.opencode/docs/hooks-reference/`
Hook input schema documentation: `.opencode/docs/hooks-reference/hook-input-schemas.md`
All 12 bash hooks from CCGS are ported to a single TypeScript plugin
at **`.opencode/plugins/ccgs-hooks.ts`**. Hooks fire automatically
via OpenCode's plugin event system:

| # | Original Hook | 🔌 OpenCode Event | 🧪 Tests |
|---|-----------|-------------------|:--------:|
| 1 | `session-start.sh` | `session.created` | **18** |
| 2 | `session-stop.sh` | `session.idle` / `server.instance.disposed` | **10** |
| 3 | `detect-gaps.sh` | `session.created` | **15** |
| 4 | `log-agent.sh` | `tool.execute.before` (task) | **5** |
| 5 | `log-agent-stop.sh` | `tool.execute.after` (task) | **4** |
| 6 | `validate-assets.sh` | `tool.execute.after` | **16** |
| 7 | `validate-commit.sh` | `tool.execute.before` (git commit) | **17** |
| 8 | `validate-push.sh` | `tool.execute.before` (git push) | **13** |
| 9 | `validate-skill-change.sh` | `tool.execute.after` | **12** |
| 10 | `pre-compact.sh` | `experimental.session.compacting` | **14** |
| 11 | `post-compact.sh` | `experimental.compaction.autocontinue` | **5** |
| 12 | `notify.sh` | Utility (`showNotification`) | — |

## Running Tests

Run a test suite against the hooks plugin:

```bash
node .opencode/plugins/tests/test-<name>.mjs
```

For example, to run the commit validation tests:

```bash
node .opencode/plugins/tests/test-validate-commit.mjs
```

For a complete list of test suites, see the [README](/README.md#-hooks-plugin) Hooks Plugin section.
2 changes: 1 addition & 1 deletion .opencode/docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## What Is This?

This is a complete Claude Code agent architecture for game development. It
This is a complete OpenCode agent architecture for game development. It
organizes 48 specialized AI agents into a studio hierarchy that mirrors
real game development teams, with defined responsibilities, delegation
rules, and coordination protocols. It includes engine-specialist agents
Expand Down
63 changes: 0 additions & 63 deletions .opencode/docs/settings-local-template.md

This file was deleted.

52 changes: 23 additions & 29 deletions .opencode/docs/setup-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,82 +4,76 @@ This template requires a few tools to be installed for full functionality.
All hooks fail gracefully if tools are missing — nothing will break, but
you'll lose validation features.

> **New projects:** After cloning this template, run `/init-template` before anything else. It customizes the template with your game name, engine choice, and team preferences, and cleans out example files.
> **New projects:** After cloning this template, run `/start` before anything else. It customizes the template with your game name, engine choice, and team preferences, and cleans out example files.

## Required

| Tool | Purpose | Install |
| ---- | ---- | ---- |
| **Git** | Version control, branch management | [git-scm.com](https://git-scm.com/) |
| **Claude Code** | AI agent CLI | `npm install -g @anthropic-ai/claude-code` |
| **OpenCode** | AI agent CLI | `npm install -g opencode` |

## Recommended

| Tool | Used By | Purpose | Install |
| ---- | ---- | ---- | ---- |
| **jq** | Hooks (4 of 8) | JSON parsing in commit/push/asset/agent hooks | See below |
| **Python 3** | Hooks (2 of 8) | JSON validation for data files | [python.org](https://www.python.org/) |
| **Bash** | All hooks | Shell script execution | Included with Git for Windows |
| **Node.js 18+** | Hooks plugin | Runtime for the CCGS TypeScript hooks plugin | [nodejs.org](https://nodejs.org/) |

### Installing jq
### Installing Node.js

**Windows** (any of these):
```
winget install jqlang.jq
choco install jq
scoop install jq
winget install OpenJS.NodeJS.LTS
choco install nodejs-lts
scoop install nodejs
```

**macOS**:
```
brew install jq
brew install node
```

**Linux**:
```
sudo apt install jq # Debian/Ubuntu
sudo dnf install jq # Fedora
sudo pacman -S jq # Arch
sudo apt install nodejs npm # Debian/Ubuntu
sudo dnf install nodejs # Fedora
sudo pacman -S nodejs npm # Arch
```

## Platform Notes

### Windows
- Git for Windows includes **Git Bash**, which provides the `bash` command
used by all hooks in `settings.json`
- Git for Windows includes **Git Bash**, which provides `bash`
- Ensure Git Bash is on your PATH (default if installed via the Git installer)
- Hooks use `bash .opencode/hooks/[name].sh` — this works on Windows because
Claude Code invokes commands through a shell that can find `bash.exe`
- OpenCode runs natively in PowerShell, CMD, Git Bash, and Windows Terminal

### macOS / Linux
- Bash is available natively
- Install `jq` via your package manager for full hook support
- Node.js and npm are available via your package manager
- OpenCode works in any standard terminal

## Verifying Your Setup

Run these commands to check prerequisites:

```bash
git --version # Should show git version
bash --version # Should show bash version
jq --version # Should show jq version (optional)
python3 --version # Should show python version (optional)
node --version # Should show Node.js 18+
npx opencode --version # Should show OpenCode version
```

## What Happens Without Optional Tools

| Missing Tool | Effect |
| ---- | ---- |
| **jq** | Commit validation, push protection, asset validation, and agent audit hooks silently skip their checks. Commits and pushes still work. |
| **Python 3** | JSON data file validation in commit and asset hooks is skipped. Invalid JSON can be committed without warning. |
| **Both** | All hooks still execute without error (exit 0) but provide no validation. You're flying without safety nets. |
| **Node.js** | The hooks plugin (`ccgs-hooks.ts`) cannot execute. All hook events silently pass through. Commits, pushes, and all other operations still work. |

## Recommended IDE

Claude Code works with any editor, but the template is optimized for:
- **VS Code** with the Claude Code extension
- **Cursor** (Claude Code compatible)
- Terminal-based Claude Code CLI
OpenCode works with any editor:
- **VS Code** with the OpenCode CLI
- **Cursor** (OpenCode compatible)
- **Terminal** — `opencode` CLI directly in any shell
- **JetBrains IDEs** — via the terminal

## Optional Engine Dependencies

Expand Down
Loading
Loading