This repository provides a reusable OpenCode workspace that consuming git
repositories mount as a .opencode submodule. It gives an LLM coding agent a
shared set of rules, commands, skills, helper scripts, and OpenCode runtime
configuration while leaving project-specific behavior in the consuming repo.
opencode.jsonloads the shared instructions, MCP servers, and external-directory permissions expected by OpenCode.opencode.jsoncan load a repository-rootINDEX.mdowned by the consuming repository; the shared.opencodesubmodule does not ship that file. Keep project-specific index content outside.opencode/.rules/contains durable agent rules for command execution, commits, tests, documentation, task workflow, scripting, and related engineering practices.commands/contains reusable slash-command workflows such as/save,/commit,/learn,/git-sync,/rebase,/task,/update-index, and/update-submodules.skills/contains targeted reusable workflows, currentlygh-authandcommit-message-guard.ai-scripts/contains helper scripts used by the commands and skills, such ascommit-message-guard.sh.playwright-mcp.jsoncontains shared browser launch settings used by theplaywrightMCP server inopencode.json.LICENSEcarries the Zero-Clause BSD terms for Codegeist-owned material in this distribution.
The generated release branch is intentionally minimal. During release copy,
this source file is renamed from README_release.md to README.md. The release
branch should contain only runtime files needed by consuming repositories:
.gitignore, LICENSE, README.md, opencode.json, playwright-mcp.json,
ai-scripts/, commands/, rules/, and skills/.
- Removed the shared
/memory-bankand/update-chatcommands together with thechat.mdandmemory-bank.mdinstructions. Shared workflows no longer read or updatedocs/memory-bank/chat.md;/learncontinues to capture durable guidance in rule files. - Consumer action: after updating
.opencode, restart OpenCode so the removed instructions and commands leave the active configuration. Consumer-owned files underdocs/memory-bank/are not part of the submodule update and can be removed separately when no repo-local workflow still uses them. - Changed
/task implto record successfully verified work assolvedinstead ofimplemented, aligning generated task updates with the documented local task lifecycle. - Added the canonical
0BSDLICENSEto generated release bundles so the distributed Codegeist-owned runtime content carries its license. No consumer action is required beyond receiving a future submodule update. - Removed the shared
repomixMCP server while keeping the Repomix CLI available as a standalone analysis tool. - Consumer action: after updating
.opencode, restart OpenCode. Workflows that relied on Repomix MCP tools must use the CLI or a repo-local MCP configuration; standalone Repomix CLI usage is unchanged. - Expanded AI-ready source guidance so non-trivial modules, classes, functions, and blocks carry contract-level comments or docstrings and may link to focused repo-owned Markdown documentation for deeper context.
- Added operation-boundary logging guidance for scripts and source code, with stable structured events, separate diagnostic and payload streams, and explicit requirements for output evaluated by LLMs or automation.
- Consumer action: after updating
.opencode, restart OpenCode so coding agents load the new reviewability rules. No repository migration is required; apply the comment, documentation, and logging contract when creating or changing non-trivial behavior. - Moved Playwright MCP snapshots, console logs, screenshots, and related output
under the workspace-local ignored
.chrome/playwright-mcp/directory instead of creating.playwright-mcp/at the workspace root. - Removed the Graphify OpenCode plugin, instruction, and skill from the shared runtime bundle.
- Consumer action: after updating
.opencode, restart OpenCode. Consumers that relied on Graphify must move that behavior to a repo-local overlay or external tool; consumers that did not use Graphify require no migration. - Explicitly pass Playwright MCP's
--sandboxCLI override in addition to the browser launch option so current@playwright/mcp@latestreleases no longer add the unsupported--no-sandboxChrome argument during config merging. - Clarified
/savebranch behavior: when a local base branch is resolved, the workflow refreshes that local base branch from its configured upstream before using it as a rebase base. Base-branch saves can then push the base branch with a normal non-force push. - Clarified
/savefeature-branch behavior: the current branch is rebased over its own upstream when needed, then rebased onto the refreshed local base branch, and only the current branch is pushed. The feature-branch path must not merge, fast-forward, push, or force-push the local base branch. - Kept the narrow
/savesafety rule for rebased feature branches: use--force-with-leaseonly for the current non-base branch after fetching its upstream, and only when a rebase rewrote commits already present upstream. - Added a shared
playwrightMCP server that starts@playwright/mcp@latestthroughnpxand loads.opencode/playwright-mcp.jsonfor browser launch settings. - Added
.opencode/playwright-mcp.jsonto start visible Chrome through the/usr/local/bin/chromelauncher and suppress Playwright's unsupported--disable-blink-features=AutomationControlleddefault argument when the installed Chrome build warns about it. - Configured the shared Playwright MCP server with
PLAYWRIGHT_MCP_USER_DATA_DIR=.chromeso it uses the consuming repository's workspace-local ignored Chrome profile instead of the removed/mnt/codegeist/chrome-cdp-profilemount. - Updated
/add-agent-kitto acceptconfigas a shared upstream target for repo-agnostic OpenCode configuration changes such asopencode.jsonandplaywright-mcp.jsonupdates. - Updated
/add-agent-kitguidance to use a unique user-owned temporary source checkout path created withmktempinstead of the fixed/tmp/opencodepath, which can be root-owned and unwritable in shared devcontainer environments. - Consumer action: no repository migration is required for the new MCP server or
tool-access rule. After updating
.opencode, restart OpenCode so the updatedopencode.json,playwright-mcp.json, andrules/tools.mdare loaded. Playwright browser workflows requirenpxand achromelauncher at/usr/local/bin/chromein the runtime environment. No/mnt/codegeistmount is required; browser profile state is kept under.chrome/in the opened workspace and should stay ignored by Git. - Added
tools.mdto define Bash and system command access for coding agents: built-in OpenCode tools stay preferred for direct file and workflow operations, but agents may use any available Bash command, shell script, Python code, installed CLI, SSH/OpenSSH utility, or task-appropriate system tool without a per-command allowlist. Shell scripts are preferred for command orchestration when they fit, while Python is appropriate when it better matches the problem. - Update notes for coding agents: check for already-installed tools before
rebuilding equivalent logic; inside a devcontainer, missing packages may be
installed with
apt-getwithout asking first, while package installation outside a devcontainer requires user approval. - Added tool guidance for disposable test repositories and GitHub work: agents
may freely manipulate repositories or sandboxes created for the current test,
and may run task-scoped
gitandghcommands without asking merely because they touch Git or GitHub; direct GitHub state changes still require narrow task scope and careful target inspection. - Added the directory index pattern: agent-owned
INDEX.mdfiles can now be used as compact navigation maps for large directories, with rules for when to create, read, and refresh them. - Added
/update-indexto create or refresh a directoryINDEX.mdwith local search hints, key files, workflows, and update triggers. - Added support for a repository-root
INDEX.mdinstruction so consuming repositories can keep their agent navigation index outside the.opencodesubmodule. - Update notes for coding agents: use the uppercase filename
INDEX.mdfor this pattern, link related directory indexes when useful, and keep the root repositoryINDEX.mdlist current whenever directory indexes are added, moved, or removed. - Consumer action: keep any project-specific root index at
INDEX.mdin the consuming repository root, not inside.opencode/. After updating.opencode, restart OpenCode so the newINDEX.mdanddirectory-index.mdinstructions are loaded by the running agent session. - Release safety: the generated
.opencoderelease intentionally excludesINDEX.md. Do not add.opencode/INDEX.md;opencode.jsonshould keep the instruction path asINDEX.mdso it resolves to the consuming repository root. - Hardened the shared rules,
/update-index, release docs, and release smoke test so future changes keepINDEX.mdout of the generated.opencodesubmodule while still loading a consumer-owned repository-rootINDEX.md. - Replaced the separate task phase commands with one
/taskworkflow that uses onlyspecandimpl, so task specification and implementation can repeat without juggling separate phase commands. - Update notes for coding agents: use
/task spec "<title/context>"to create and collaboratively specify a focused task, then use/task impl <task-ref> [instructions]to implement it. If implementation finds missing specification, clarify with the user and update the same task before editing runtime files. - Added a
## Changelogsection to the released.opencode/README.mdso consumer-visible changes and upgrade notes are shipped with each release. - Removed the source-repository-only
.oc_local/rules/project-release-source.mdinstruction from the releasedopencode.json; release configuration now references only files expected to exist in consuming repositories. - Added local source-repo guidance for maintaining
README_release.mdand made the local release-build workflow require a changelog review before publishing. - Update notes for coding agents: before running the local release-build command, inspect the release-bundle diff, update this changelog with consumer-visible changes, and include migration notes when consuming projects need adjustments.
- Consumer action: after updating
.opencode, no project changes are required unless a consuming repository copied the removed.oc_localinstruction into its own OpenCode configuration; remove that local reference if present.
Add this repository as the .opencode submodule from its generated release
branch:
git submodule add -b release https://github.com/codegeist-ai/codegeist-agent-kit.git .opencode
git submodule update --init --recursiveAfter adding or updating the submodule, commit the parent repository gitlink
change together with the matching .gitmodules change when applicable.
Refresh the submodule to the latest configured release branch commit:
git submodule update --remote .opencode
git status --shortIf the parent repo also uses .devcontainer from the shared workspace family,
prefer the shared command when available:
/update-submodules
The command updates only .opencode and .devcontainer to the branches
configured in .gitmodules, verifies clean submodule states, and reports any
parent gitlink changes that need to be committed.
OpenCode should see this submodule at exactly .opencode/ in the consuming repo
root. The instruction paths in opencode.json intentionally use
.opencode/... prefixes and should not be rewritten to absolute paths.
Project-specific behavior belongs outside this shared submodule, typically in:
.oc_local/commands/*.md.oc_local/rules/*.md.oc_local/skills/*/SKILL.md- repo-owned docs such as
docs/tasks/
Do not add product-specific deployment steps, architecture assumptions, branch
names, or planning rules to the shared .opencode submodule unless they are
intended to apply across all consuming repositories.
This checkout is generated distribution content. Propose generic shared
OpenCode behavior in the
codegeist-agent-kit source repository
from a topic branch based on source main; do not implement it on release or
inside a consuming .opencode/ checkout. Project-specific behavior belongs in
the consuming repository's .oc_local/ overlay.
Use the source repository's
contribution guide,
Issues,
local task guide,
and the Codegeist roadmap.
These links deliberately target source main; contributor docs and local task
specifications are not files in this generated release bundle.
The effective shared policies are the Codegeist
contribution policy,
Code of Conduct,
security policy,
and support guide.
The distributed files are licensed under 0BSD.
The canonical source check is:
task testIt validates a temporary release copy without publishing. Release publication is maintainer-only after source review.
A consuming repository can ask its coding agent to add reusable shared behavior
to this agent kit instead of only creating local .oc_local/ overlays. The
intended command shape is:
/add-agent-kit command|rule|skill|config <description of the shared behavior>
/add-agent-kit move <explicit .oc_local command, rule, or skill path>
This is an upstream change workflow. Do not edit .opencode/ directly as the
implementation path; it is the generated release branch of
codegeist-agent-kit, mounted as a submodule. Shared changes belong in a source
checkout of https://github.com/codegeist-ai/codegeist-agent-kit.git on main.
README_release.md is the source file that becomes .opencode/README.md in
consuming repositories.
Expected autonomous workflow for the agent:
- Inspect the consuming repository state and verify that
.opencodeexists, is a Git submodule, and is configured to track thereleasebranch in.gitmodules. - Clone
https://github.com/codegeist-ai/codegeist-agent-kit.gitinto an explicit user-owned temporary directory outside the consuming repository, unless the user or local workflow provides a trusted source checkout. Prefer a unique directory created withmktemp -d "${TMPDIR:-/tmp}/opencode-agent-kit.XXXXXX"; do not rely on a fixed/tmp/opencodepath because shared environments may create it as root-owned and unwritable to the workspace user. - Implement the requested shared
command,rule,skill, orconfigin the source paths of that temporary checkout:commands/,rules/,skills/,ai-scripts/,opencode.json,playwright-mcp.json, andREADME_release.mdas applicable. Formove, start only from the explicitly selected.oc_local/commands/,.oc_local/rules/, or.oc_local/skills/overlays and rewrite them into repo-agnostic shared form before adding them upstream. Do not move whole.oc_local/directories or infer extra files that the user did not select. - Continue only when the change is generic across repositories with unrelated domains, products, architectures, and deployment models. Shared additions must not encode product-specific services, customer workflows, environment names, domain assumptions, branch policies, or repository layouts beyond the shared OpenCode workspace contract.
- If the behavior is specific to the current consuming repository, stop the upstream workflow and create or update a local overlay in the consuming repository instead. If generic applicability is unclear, ask one short clarification question before editing the source checkout.
- For
move, remove only the selected original.oc_local/overlays after the upstream source change is committed, the release branch is built,.opencodeis updated to the new release, and each replacement shared file is verified in the updated submodule. Leave all unselected local overlays in place. - Run the source repository verification, starting with
task test, and fix failures before continuing. - Commit the source repository change with a focused Conventional Commit message, then push the source branch when the remote is configured and the authenticated session has permission.
- Run
task release-buildin the source repository. This creates and pushes a normal commit on the generatedreleasebranch with only the runtime files that consuming repositories mount as.opencode, preserving release history so the copied changes remain reviewable. - Return to the consuming repository and update only the
.opencodesubmodule to the neworigin/releasecommit, using the same safety checks as/update-submodules: fetch the configured branch, rungit checkout -B release origin/releaseinside.opencode, verify thatHEADmatchesorigin/release, and verify that the submodule status is clean. - Report the new
.opencodecommit and the parent repository gitlink change. If the user requested a full save workflow, commit the parent gitlink update in the consuming repository through/saveor the repo's equivalent commit workflow.
Only use direct edits inside .opencode/ for temporary inspection or debugging;
do not leave them as the implementation path. The agent must not update
unrelated submodules, delete local files inside the consumer checkout, or commit
unrelated parent-repo changes as part of this workflow.
When working inside a consuming repository that uses this submodule:
- Read relevant shared rules under
.opencode/rules/and any local overlays under.oc_local/rules/. - Inspect the affected repository files directly before making assumptions.
- Prefer repo-local commands and overlays when they define a more specific workflow than the shared default.
- Treat
.opencodeas a submodule gitlink, not as ordinary parent-repo files.
/savelearns durable guidance, updates shared submodules, commits, rebases, and pushes the intended branch. On the local base branch it may push that base branch; on a feature branch it updates the base branch from upstream first, then pushes only the current branch./commitreviews the diff and creates a focused conventional commit./git-syncsynchronizes the current branch and local base branch without creating a commit./rebaserebases the current branch onto the local base branch./learncaptures durable workflow guidance in rule files./session-titlecreates a short session title from the current branch and recent result./taskmanages tracked task files underdocs/tasks/withspec,impl,cancel, andbacklogactions when the repo uses that workflow./update-indexcreates or refreshes an agent-owned directoryINDEX.mdfor local navigation and search hints./add-agent-kitadds reusable shared commands, rules, or skills upstream, or moves generic.oc_local/overlays into the shared agent kit, then builds a new release and updates the consuming repo's.opencodesubmodule.
Prefer these commands over reimplementing their shell and git logic in chat, especially for commits, saves, submodule updates, and base-branch sync.
- Follow conventional commit style from
.opencode/rules/commit.mdand.opencode/rules/commit-conventions.md. - Use
.opencode/ai-scripts/commit-message-guard.shor thecommit-message-guardskill when creating commits through the shared workflow. - Keep commit subject and body as separate inputs and use real line breaks in
commit bodies. Do not pass literal
\nescape sequences. - Never commit secrets, unrelated files, or generated noise.
- Never use destructive git commands such as
git reset --hardunless the user explicitly asks for that exact action. - Do not amend commits unless the user explicitly requests it and the active safety rules allow it.
- When a task intentionally changes a submodule, commit the submodule content on the intended branch first, synchronize its upstream when configured, then commit the parent repository gitlink update.
When a task needs GitHub CLI access, verify authentication before using gh:
gh auth statusIf the session is not authenticated, use the gh-auth skill. Do not ask the
user to paste tokens into chat when the browser login flow can complete the
authentication.
- Keep durable repo-owned docs and comments in English. User conversations may use the user's preferred language, but committed project text stays English.
- Update docs in the same task when behavior changes.
- Use
/learnfor reusable guidance that should become a durable rule. - Prefer updating an existing rule over adding broad or duplicative guidance.
The source repository contains development-only files that are not part of the
release submodule. Maintainers and coding agents must make shared-kit changes in
the source repository on main, never directly in a consuming repository's
.opencode/ submodule checkout. Use the Taskfile instead of hand-building the
release branch.
Run the release smoke test:
task testBuild and push the generated release branch:
task release-buildThe release-build task creates a temporary worktree, copies only the release
runtime paths, commits them on the release branch, updates the local release
ref, and pushes it without rewriting existing release history. The first release
for a new remote is bootstrapped as an orphan; later releases are normal commits
so maintainers can inspect which runtime changes were published. The working
branch and dirty worktree are left untouched except for the temporary release
worktree cleanup.
When using this repo's local release workflow, prefer
.oc_local/commands/release-build.md; it runs task release-build, refreshes
the configured shared submodules, and then delegates final commit, rebase, and
sync work to the shared /save workflow.
- If OpenCode does not load shared rules, confirm the submodule path is exactly
.opencode/andopencode.jsonis present at.opencode/opencode.json. - If a shared command seems too generic, check for a consuming-repo overlay under
.oc_local/commands/before changing the shared command. - If submodule updates show a dirty parent repo, commit the intentional gitlink update in the parent repository.
- If a release bundle is missing files, run
task testin this repository and inspectTaskfile.ymlRELEASE_PATHS, theREADME_release.mdtoREADME.mdrename step, andtests/release-copy.sh.