Channels
Gjc Discord
OpenClaw plugin that bridges Discord workflows to GJC Coordinator MCP.
Configuration Example
{
"name": "@openclaw/gjc-discord",
"version": "0.0.0-stage1",
"private": true,
"license": "Apache-2.0"
}
README
<h1 align="center">OpenClaw GJC Discord Plugin</h1>
<p align="center">
<strong>Use GJC from OpenClaw Discord without turning this repo into GJC.</strong><br />
A default-disabled OpenClaw plugin adapter for forwarding Discord-facing <code>/gjc</code> requests to GJC Coordinator MCP.
</p>
<p align="center">
<a href="LICENSE"><img alt="Apache-2.0 license" src="https://img.shields.io/badge/license-Apache--2.0-green?style=flat-square"></a>
<a href="https://github.com/kimdogyeom/openclaw-gjc-discord/actions/workflows/test.yml"><img alt="test workflow" src="https://img.shields.io/github/actions/workflow/status/kimdogyeom/openclaw-gjc-discord/test.yml?branch=main&style=flat-square&label=test"></a>
<img alt="stage" src="https://img.shields.io/badge/status-stage1-orange?style=flat-square">
<img alt="runtime" src="https://img.shields.io/badge/runtime-Bun-black?style=flat-square&logo=bun">
</p>
<p align="center">
<a href="README.ko.md">ํ๊ตญ์ด</a>
</p>
> This repository is an OpenClaw Discord integration plugin. It is not GJC core, not a GJC fork, not a standalone Discord bot, and not a replacement for the `gjc` CLI.
## What this repository is
`openclaw-gjc-discord` helps an OpenClaw Discord setup expose a safe `/gjc` command surface and connect that command to GJC Coordinator MCP.
```text
Discord
-> OpenClaw Discord integration / command event
-> this OpenClaw plugin
-> GJC Coordinator MCP
-> installed GJC runtime/session
```
GJC still owns the coding-agent runtime, workflows, tools, `.gjc` artifacts, Coordinator MCP server, and actual session execution. This repository owns only the adapter layer around OpenClaw/Discord input.
## What this repository is not
| Not this | Use instead |
| --- | --- |
| GJC source repository | [`Yeachan-Heo/gajae-code`](https://github.com/Yeachan-Heo/gajae-code) |
| GJC fork or patchset | Keep GJC installed and updated separately. |
| Standalone Discord bot | Run it through OpenClaw and its Discord integration. |
| General MCP server | It starts/calls GJC Coordinator MCP; it does not implement GJC itself. |
| Execution approval bypass | It preserves repo alias, mutation, and approval boundaries. |
## Adapter responsibilities
This plugin is intentionally narrow. It owns:
- OpenClaw plugin manifest and configuration schema.
- Discord-facing `/gjc` command parsing for OpenClaw.
- repo alias validation so Discord users do not pass raw absolute paths.
- OpenClaw config -> `GJC_COORDINATOR_MCP_*` environment mapping.
- Coordinator MCP client-side tool/root/mutation checks.
- readiness and contract smoke checks.
- plugin-side durable state helpers for questions, approvals, execution handoffs, and final-report recovery.
- compatibility documentation for checking this plugin after GJC updates.
It does not bundle GJC, Discord credentials, provider credentials, or an OpenClaw host runtime.
## Current stage
The package is marked `0.0.0-stage1` and `private: true` to prevent accidental npm publication. The repository is suitable for GitHub publication and local OpenClaw plugin loading, but package distribution is intentionally not finalized.
## Command surface
```text
/gjc help
/gjc status
/gjc health
/gjc repo:<alias> goal:"<goal>" acceptance:"<acceptance criteria>" scope:"<scope>"
```
Example:
```text
/gjc repo:commerce goal:"Fix payment failure recovery" acceptance:"Relevant tests pass" scope:"payment flow only"
```
Required fields for a complete request:
| Field | Meaning |
| --- | --- |
| `repo` | Configured repo alias. Raw absolute paths are rejected. |
| `goal` | User-facing objective to send toward GJC. |
| `acceptance` / `acceptance_criteria` / `criteria` | Observable done condition. |
| `scope` | Bounded work area for the request. |
Incomplete requests are triaged as clarification-needed instead of being treated as execution approval.
## Package
```json
{
"name": "@openclaw/gjc-discord",
"version": "0.0.0-stage1",
"private": true,
"license": "Apache-2.0"
}
```
## Repository layout
```text
.
โโโ openclaw.plugin.json # OpenClaw plugin manifest and config schema
โโโ src/ # Plugin adapter implementation
โโโ test/ # Stage-based Bun tests
โโโ docs/ # Compatibility and maintenance docs
โโโ .github/workflows/test.yml # GitHub Actions test workflow
โโโ CONTRIBUTING.md
โโโ SECURITY.md
โโโ NOTICE.md
โโโ LICENSE
```
Key modules:
| File | Responsibility |
| --- | --- |
| `src/index.ts` | OpenClaw plugin registration and readiness gate. |
| `src/config.ts` | Config normalization and Coordinator MCP environment construction. |
| `src/coordinator-mcp-client.ts` | JSON-RPC/MCP client and required tool contract. |
| `src/command.ts` | `/gjc` parsing, help/status handling, and triage. |
| `src/state.ts` | Durable SQLite-backed plugin state. |
| `src/deep-interview-bridge.ts` | Plugin-side clarification/deep-interview bridge records. |
| `src/ralplan-approval.ts` | Plugin-side ralplan approval capture and token handling. |
| `src/approval-execution.ts` | Plugin-side post-approval execution handoff. |
| `src/final-report.ts` | Final report/evidence recovery helper. |
| `src/observability.ts` | Health/status/smoke observability. |
| `src/smoke.ts` | Contract smoke and fake lifecycle smoke checks. |
## Configuration
The plugin is disabled by default. Enable it through the OpenClaw plugin entry configuration:
```json
{
"plugins": {
"entries": {
"gjc-discord": {
"enabled": true,
"repoAliases": {
"commerce": "/absolute/path/to/commerce"
},
"coordinator": {
"command": "gjc",
"args": ["mcp-serve", "coordinator"],
"profile": "openclaw-gjc-discord",
"repo": "commerce",
"allowedRoots": ["/absolute/path/to/commerce"],
"mutationClasses": ["sessions", "questions", "reports"],
"sessionCommand": "gjc",
"artifactByteCap": 65536,
"smokeTimeoutMs": 5000
}
}
}
}
}
```
The plugin maps this configuration into Coordinator MCP environment variables:
| Environment variable | Source |
| --- | --- |
| `GJC_COORDINATOR_MCP_WORKDIR_ROOTS` | `coordinator.allowedRoots` |
| `GJC_COORDINATOR_MCP_MUTATIONS` | `coordinator.mutationClasses` |
| `GJC_COORDINATOR_MCP_SESSION_COMMAND` | `coordinator.sessionCommand` |
| `GJC_COORDINATOR_MCP_PROFILE` | `coordinator.profile` |
| `GJC_COORDINATOR_MCP_REPO` | `coordinator.repo` |
| `GJC_COORDINATOR_MCP_STATE_ROOT` | `coordinator.stateRoot` |
| `GJC_COORDINATOR_MCP_ARTIFACT_BYTE_CAP` | `coordinator.artifactByteCap` |
## Install / load
This repository is intended to be loaded as an OpenClaw plugin. Until a package publication flow is finalized, keep the checkout in the OpenClaw plugins workspace or use your OpenClaw local plugin flow.
Typical local development location:
```text
~/.openclaw/plugins/openclaw-gjc-discord
```
## Verification
Run the plugin test suite from the repository root:
```bash
bun test
```
Optional GJC Coordinator MCP smoke checks:
```bash
gjc coordinator check --json
gjc coordinator tools --json
gjc coordinator doctor --json
```
`doctor` checks the current shell environment. A bare shell may return `ok:false` when Coordinator MCP environment variables are not set; plugin runtime injects those variables from OpenClaw configuration.
To simulate a configured plugin environment manually:
```bash
GJC_COORDINATOR_MCP_WORKDIR_ROOTS="$PWD" \
GJC_COORDINATOR_MCP_MUTATIONS="sessions,questions,reports" \
GJC_COORDINATOR_MCP_SESSION_COMMAND="gjc" \
GJC_COORDINATOR_MCP_PROFILE="openclaw-gjc-discord" \
GJC_COORDINATOR_MCP_REPO="local" \
gjc coordinator doctor --json
```
## Test map
| Test | Coverage |
| --- | --- |
| `test/stage1-contract.test.ts` | Manifest/package contract. |
| `test/stage1-fake-lifecycle.test.ts` | Fake lifecycle readiness. |
| `test/stage2-command.test.ts` | `/gjc` parser, help/status, repo alias restrictions. |
| `test/stage3-state.test.ts` | Durable state schema and constraints. |
| `test/stage3-approval-token.test.ts` | Approval token stability. |
| `test/stage4-deep-interview-bridge.test.ts` | deep-interview bridge records. |
| `test/stage5-ralplan-approval.test.ts` | ralplan approval records. |
| `test/stage6-approval-execution.test.ts` | post-approval execution handoff. |
| `test/stage7-final-report-recovery.test.ts` | final report recovery behavior. |
| `test/stage8-observability.test.ts` | health/status/observability. |
## GJC update compatibility
Use the compatibility guide whenever GJC is updated:
```text
docs/gjc-update-compatibility-guide.md
docs/gjc-update-compatibility-guide.ko.md
```
The guide covers Coordinator MCP tool/schema checks, mutation policy, workflow compatibility, state/event compatibility, smoke commands, stage tests, patch rules, and an update analysis template.
## Development
```bash
bun install
bun test
```
For focused work, run the stage test closest to the changed behavior:
```bash
bun test test/stage2-command.test.ts
bun test test/stage6-approval-execution.test.ts
```
Before publishing or opening a pull request, record:
- the focused test command used,
- full `bun test` result,
- any relevant `gjc coordinator check/tools/doctor --json` output,
- whether GJC compatibility was checked against a fresh GJC source clone.
## Good to read together
- [Gajae-Code](https://github.com/Yeachan-Heo/gajae-code) โ upstream GJC project.
- [`docs/README.md`](docs/README.md) / [`docs/README.ko.md`](docs/README.ko.md) โ documentation index.
- [`docs/codebase-overview.md`](docs/codebase-overview.md) / [`docs/codebase-overview.ko.md`](docs/codebase-overview.ko.md) โ architecture-oriented repository map.
- [`docs/discord-integration.md`](docs/discord-integration.md) / [`docs/discord-integration.ko.md`](docs/discord-integration.ko.md) โ Discord/OpenClaw integration guide.
- [`docs/external-control-readiness.md`](docs/external-control-read
... (truncated)
channels
Comments
Sign in to leave a comment