DevClaw is an OpenClaw plugin for multi-project dev/qa pipeline orchestration with GitHub/GitLab integration, developer tiers, and audit logging.
index.ts— Plugin entry point, registers 23 tools, CLI, services, and hookslib/context.ts—PluginContextDI container (created once inregister(), threaded everywhere)lib/dispatch/— Task dispatch logic, bootstrap hook, attachment hook, notificationslib/providers/— GitHub and GitLab issue providers (viagh/glabCLI)lib/services/heartbeat/— Heartbeat service (health, review, queue passes)lib/services/— Pipeline (completion rules), tick (queue scan), queuelib/setup/— Agent creation, workspace management, CLI, version trackinglib/tools/tasks/— Task lifecycle and management toolslib/tools/admin/— Project admin, channel management, config, setup toolslib/tools/worker/— Worker-side tools (work_finish)lib/workflow/— State machine types, defaults, labels, querieslib/projects/— Project state (projects.json) I/O, mutations, slotslib/config/— Three-layer config resolution with Zod validationlib/roles/— Role registry, model selection, level resolution
- Separation of concerns — Each module, function, and class should have a single, clear responsibility. Don't mix I/O with business logic, or UI with data processing.
- Keep functions small and focused — If a function does more than one thing, split it up.
- Meaningful names — Variables, functions, and files should clearly describe their purpose. Avoid abbreviations unless they're universally understood.
- No dead code — Remove unused imports, variables, and unreachable code paths.
- Favor readability over cleverness — Straightforward code beats compact one-liners. The next reader (human or agent) should understand the intent without re-reading.
- Never import
child_processdirectly — the OpenClaw security scanner flags it. UserunCommandfromPluginContext(lib/context.ts), which wrapsapi.runtime.system.runCommandWithTimeout. - Functions that call
runCommand()must be async.
npm run build && openclaw gateway restartWait 3 seconds, then check logs:
openclaw logsExpect: [plugins] DevClaw plugin registered (23 tools, 1 CLI command group, 1 service, 3 hooks)