Skip to content
Closed
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
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ COPY scripts/build-config.mjs ./scripts/build-config.mjs
RUN pnpm install --frozen-lockfile --ignore-scripts --no-optional \
&& node scripts/build-config.mjs /build/runtime.json

FROM tools AS i-have-adhd
ARG I_HAVE_ADHD_COMMIT=1ecea1993b7fce257ffbd686c070948b5e07eda6
WORKDIR /build/i-have-adhd
RUN set -eu; \
for file in LICENSE .opencode/plugins/i-have-adhd.mjs \
.opencode/command/i-have-adhd.md skills/i-have-adhd/SKILL.md; do \
mkdir -p "$(dirname "$file")"; \
curl --fail --silent --show-error --location \
"https://raw.githubusercontent.com/ayghri/i-have-adhd/${I_HAVE_ADHD_COMMIT}/$file" \
-o "$file"; \
done

FROM tools

ENV HOME=/data \
Expand All @@ -64,6 +76,7 @@ ENV HOME=/data \
SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt

COPY --from=config /build/runtime.json /etc/opencode/opencode.json
COPY --from=i-have-adhd /build/i-have-adhd /opt/i-have-adhd
COPY AGENTS.md /etc/opencode/AGENTS.md
COPY skills /etc/opencode/skills
COPY --chmod=755 entrypoint.sh healthcheck.sh /usr/local/bin/
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Grafana and Karakeep can connect before their credentials are validated; check a
- **Build** is the default agent and can use all configured tools. **General** can implement and test; **Explore** is read-only. Both subagents may use Context7 but deny Grafana, Lunch Money, Karakeep, Notion, Robinhood, and further delegation. Tool permissions do not sandbox shell access.
- [Superpowers](https://github.com/obra/superpowers) supplies planning, debugging, testing, and review skills. The image also ships [`commit-push-pr` and `go-repo`](skills/). [`AGENTS.md`](AGENTS.md) requires repository edits in `/data/workspace/.worktrees/<repository>/<task>`.
- [OpenCode Quota](https://github.com/slkiser/opencode-quota) provides `/quota` and `/quota_status`.
- [i-have-adhd](https://github.com/ayghri/i-have-adhd) provides `/i-have-adhd` for ADHD-friendly output until you say `stop adhd mode` or `normal mode`. The image bundles a commit-pinned upstream plugin; for [always-on mode](https://github.com/ayghri/i-have-adhd/blob/main/INSTALL.md), run `docker compose exec opencode touch /data/.config/opencode/.i-have-adhd-always`.
- Defaults and pinned plugins live in [`opencode.jsonc`](opencode.jsonc). The image converts it to `/etc/opencode/opencode.json`; project `opencode.json(c)` files can override settings. See the [V2 configuration guide](https://opencode.ai/v2/docs/config).
- Each startup copies the image's [`AGENTS.md`](AGENTS.md) to `/data/.config/opencode/AGENTS.md`, replacing local edits. Change instructions in this repository and rebuild.

Expand Down
3 changes: 2 additions & 1 deletion opencode.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@
"opencode-gemini-auth@2.0.1",
"opencode-wakatime@1.4.0",
"superpowers@git+https://github.com/obra/superpowers.git#bb92a77741419a4ab5f06e711a283343f1ada0c3",
"@slkiser/opencode-quota@5.0.2"
"@slkiser/opencode-quota@5.0.2",
"/opt/i-have-adhd/.opencode/plugins/i-have-adhd.mjs"
],
"experimental": {
"policies": [
Expand Down
10 changes: 10 additions & 0 deletions scripts/smoke-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ docker exec "$name" sh -ec '
OPENCODE_TEST_URL="$url" OPENCODE_PASSWORD="$password" \
node scripts/test-router-integration.mjs

curl --fail --silent --show-error --user "opencode:$password" \
"$url/api/plugin?location%5Bdirectory%5D=/data/workspace" \
| jq -e '.data[] | select(.id == "i-have-adhd") | .state.status == "active"'
curl --fail --silent --show-error --user "opencode:$password" \
"$url/api/skill?location%5Bdirectory%5D=/data/workspace" \
| jq -e '.data[] | select(.id == "i-have-adhd") | .content | contains("## Persistence") and contains("### 10.")'
curl --fail --silent --show-error --user "opencode:$password" \
"$url/api/command?location%5Bdirectory%5D=/data/workspace" \
| jq -e '.data[] | select(.name == "i-have-adhd")'

# Credentials and workspaces must be writable by the non-root runtime user.
docker exec "$name" sh -c 'test "$(id -u)" = 1000 && test -w /data/workspace && test -w /data/.local/share/opencode'

Expand Down
Loading