Skip to content

Architecture

Systematic is designed as a lightweight yet powerful extension for OpenCode. It leverages native plugin hooks to inject structured workflows and specialized agents into your development environment.

The plugin is divided into two main parts:

  1. TypeScript Source (src/): The core logic that handles plugin registration, asset discovery, and conversion.
  2. Bundled Assets (skills/ and agents/): Battle-tested engineering content that is automatically discovered and registered by the plugin.

Systematic utilizes three primary OpenCode plugin hooks to integrate seamlessly:

The config hook is responsible for discovery and merging. It recursively walks the bundled asset directories (skills/ and agents/) and merges their definitions into your active OpenCode configuration. This ensures that agents like @architecture-strategist are available without manual setup.

The plugin registers a custom tool called systematic_skill. This tool is used by the AI to load the full content of bundled skills on demand. While OpenCode has a native skill tool, systematic_skill provides optimized access to the plugin’s bundled content.

This hook allows Systematic to inject a “bootstrap” instruction into the AI’s system prompt at the start of every conversation. This instruction (from the using-systematic skill) teaches the AI how to:

  • Discover available workflows.
  • Use the systematic_skill tool.
  • Follow the “invoke before response” discipline.

For developers looking to contribute or understand the implementation, here are the key modules:

SymbolRoleLocation
SystematicPluginMain plugin factorysrc/index.ts
createConfigHandlerImplements the config hook logicsrc/lib/config-handler.ts
createSkillToolImplements the systematic_skill toolsrc/lib/skill-tool.ts
getBootstrapContentHandles system prompt injectionsrc/lib/bootstrap.ts
convertContentHandles CEP to OpenCode format conversionsrc/lib/converter.ts
findSkillsInDirDiscovers bundled skillssrc/lib/skills.ts

Systematic is built with modern web technologies:

  • Runtime: Bun (Node.js API compatible)
  • Language: TypeScript 5.7+ in strict mode
  • Modules: ESM ("type": "module")
  • Linter: Biome
  • Testing: bun:test