# michaelbel/cuckcoder architecture

> Architecture diagram of the GitHub repository michaelbel/cuckcoder, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/michaelbel/cuckcoder
- Repository: https://github.com/michaelbel/cuckcoder

## Overview

Cuckcoder is an AI coding-agent harness for Kotlin, Android, Compose, and KMP, distributed through editor plugins and an MCP server. The main workflow is an agent requesting rules, skills, agent definitions, or workflow material; the MCP server validates and routes requests to bundled content by default, with an optional pinned GitHub source. The repository also supplies agents, multi-agent workflows, rules, skills, and tool-cycle hooks. Source excerpts establish the MCP runtime links; README statements support the broader harness capabilities and their usage.

Main entry points: [`mcp/src/source/github-source.ts`](https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/source/github-source.ts) (GitHub Content), [`mcp/src/server.ts`](https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/server.ts) (MCP Tool Server), [`mcp/src/source/bundled.ts`](https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/source/bundled.ts) (Bundled Content), [`mcp/src/source/index.ts`](https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/source/index.ts) (Source Selector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_harness["Agent Harness"]
  node_rules["Rules"]
  node_skills["Task Skills"]
  node_agents["Subagents"]
  node_workflows["Workflow Sweeps"]
  node_hooks["Guardrail Hooks"]
end

subgraph group_mcp["MCP Runtime"]
  node_server["MCP Tool Server<br/>[server.ts]"]
  node_validation["Name Validation<br/>[validation.ts]"]
  node_search["Rule Skill Search<br/>[search.ts]"]
  node_frontmatter["Frontmatter Parser<br/>[frontmatter.ts]"]
  node_workflow_meta["Workflow Metadata<br/>[workflow-meta.ts]"]
  node_errors["Tool Errors<br/>[errors.ts]"]
end

subgraph group_sources["Content Sources"]
  node_source_factory["Source Selector<br/>[index.ts]"]
  node_source_contract["Source Interface<br/>[types.ts]"]
  node_bundled["Bundled Content<br/>[bundled.ts]"]
end

subgraph group_remote["Remote Access"]
  node_github_source["GitHub Content<br/>[github-source.ts]"]
  node_github_client["GitHub API Client<br/>[github.ts]"]
  node_cache["TTL Cache<br/>[cache.ts]"]
end

node_user_agent(("Coding Agent"))
node_editor["Agent Host"]
node_mcp_client(("MCP Client"))
node_github_service["GitHub"]

node_user_agent -->|"uses"| node_editor
node_editor -->|"invokes"| node_agents
node_user_agent -->|"requests content"| node_mcp_client
node_mcp_client -->|"calls tools"| node_server
node_server -->|"validates names"| node_validation
node_server -->|"searches"| node_search
node_server -->|"creates source"| node_source_factory
node_server -->|"formats errors"| node_errors
node_search -->|"reads content"| node_source_contract
node_source_factory -->|"selects default"| node_bundled
node_source_factory -.->|"selects optionally"| node_github_source
node_bundled -->|"parses metadata"| node_frontmatter
node_bundled -->|"parses workflow"| node_workflow_meta
node_github_source -->|"parses metadata"| node_frontmatter
node_github_source -->|"parses workflow"| node_workflow_meta
node_github_source -->|"fetches content"| node_github_client
node_github_client -->|"caches requests"| node_cache
node_github_client -->|"requests files"| node_github_service
node_workflows -->|"orchestrates"| node_agents
node_user_agent -->|"applies guidance"| node_rules
node_user_agent -->|"requests instructions"| node_skills
node_editor -->|"runs automatically"| node_hooks
node_bundled -->|"reads snapshot"| node_rules
node_bundled -->|"reads snapshot"| node_skills
node_github_source -->|"reads pinned content"| node_rules
node_github_source -->|"reads pinned content"| node_skills
node_github_source -->|"reads definitions"| node_agents
node_github_source -->|"reads definitions"| node_workflows

click node_rules "https://github.com/michaelbel/cuckcoder/tree/main/rules"
click node_skills "https://github.com/michaelbel/cuckcoder/tree/main/skills"
click node_agents "https://github.com/michaelbel/cuckcoder/tree/main/agents"
click node_workflows "https://github.com/michaelbel/cuckcoder/tree/main/workflows"
click node_hooks "https://github.com/michaelbel/cuckcoder/tree/main/hooks"
click node_server "https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/server.ts"
click node_validation "https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/validation.ts"
click node_search "https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/search.ts"
click node_frontmatter "https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/frontmatter.ts"
click node_workflow_meta "https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/workflow-meta.ts"
click node_errors "https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/errors.ts"
click node_source_factory "https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/source/index.ts"
click node_source_contract "https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/source/types.ts"
click node_bundled "https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/source/bundled.ts"
click node_github_source "https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/source/github-source.ts"
click node_github_client "https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/source/github.ts"
click node_cache "https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/source/cache.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_rules,node_skills,node_agents,node_workflows,node_hooks,node_mcp_client toneBlue
class node_server,node_validation,node_search,node_frontmatter,node_workflow_meta,node_errors toneAmber
class node_source_factory,node_source_contract,node_bundled toneMint
class node_github_source,node_github_client,node_cache toneRose
class node_user_agent,node_editor,node_github_service toneIndigo
```

## Components

### Agent Harness

- [Rules](https://github.com/michaelbel/cuckcoder/tree/main/rules): `rules`
- [Task Skills](https://github.com/michaelbel/cuckcoder/tree/main/skills): `skills`
- [Subagents](https://github.com/michaelbel/cuckcoder/tree/main/agents): `agents`
- [Workflow Sweeps](https://github.com/michaelbel/cuckcoder/tree/main/workflows): `workflows`
- [Guardrail Hooks](https://github.com/michaelbel/cuckcoder/tree/main/hooks): `hooks`

### MCP Runtime

- [MCP Tool Server](https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/server.ts): `mcp/src/server.ts`
- [Name Validation](https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/validation.ts): `mcp/src/validation.ts`
- [Rule Skill Search](https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/search.ts): `mcp/src/search.ts`
- [Frontmatter Parser](https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/frontmatter.ts): `mcp/src/frontmatter.ts`
- [Workflow Metadata](https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/workflow-meta.ts): `mcp/src/workflow-meta.ts`
- [Tool Errors](https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/errors.ts): `mcp/src/errors.ts`

### Content Sources

- [Source Selector](https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/source/index.ts): `mcp/src/source/index.ts`
- [Source Interface](https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/source/types.ts): `mcp/src/source/types.ts`
- [Bundled Content](https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/source/bundled.ts): `mcp/src/source/bundled.ts`

### Remote Access

- [GitHub Content](https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/source/github-source.ts): `mcp/src/source/github-source.ts`
- [GitHub API Client](https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/source/github.ts): `mcp/src/source/github.ts`
- [TTL Cache](https://github.com/michaelbel/cuckcoder/blob/main/mcp/src/source/cache.ts): `mcp/src/source/cache.ts`

### Other components

- **Coding Agent**
- **Agent Host**
- **MCP Client**
- **GitHub**

## Connections

- Coding Agent → Agent Host: uses (evidence: `README.md`)
- Agent Host → Subagents: invokes (evidence: `README.md`)
- Coding Agent → MCP Client: requests content (evidence: `README.md`)
- MCP Client → MCP Tool Server: calls tools (evidence: `README.md`)
- MCP Tool Server → Name Validation: validates names (evidence: `mcp/src/server.ts`)
- MCP Tool Server → Rule Skill Search: searches (evidence: `mcp/src/server.ts`)
- MCP Tool Server → Source Selector: creates source (evidence: `mcp/src/server.ts`)
- MCP Tool Server → Tool Errors: formats errors (evidence: `mcp/src/server.ts`)
- Rule Skill Search → Source Interface: reads content (evidence: `mcp/src/search.ts`)
- Source Selector → Bundled Content: selects default (evidence: `mcp/src/source/index.ts`)
- Source Selector → GitHub Content: selects optionally (evidence: `mcp/src/source/index.ts`)
- Bundled Content → Frontmatter Parser: parses metadata (evidence: `mcp/src/source/bundled.ts`)
- Bundled Content → Workflow Metadata: parses workflow (evidence: `mcp/src/source/bundled.ts`)
- GitHub Content → Frontmatter Parser: parses metadata (evidence: `mcp/src/source/github-source.ts`)
- GitHub Content → Workflow Metadata: parses workflow (evidence: `mcp/src/source/github-source.ts`)
- GitHub Content → GitHub API Client: fetches content (evidence: `mcp/src/source/github-source.ts`)
- GitHub API Client → TTL Cache: caches requests (evidence: `mcp/src/source/github.ts`)
- GitHub API Client → GitHub: requests files (evidence: `mcp/src/source/github.ts`)
- Workflow Sweeps → Subagents: orchestrates (evidence: `README.md`)
- Coding Agent → Rules: applies guidance (evidence: `README.md`)
- Coding Agent → Task Skills: requests instructions (evidence: `README.md`)
- Agent Host → Guardrail Hooks: runs automatically (evidence: `README.md`)
- Bundled Content → Rules: reads snapshot (evidence: `mcp/src/source/bundled.ts`)
- Bundled Content → Task Skills: reads snapshot (evidence: `mcp/src/source/bundled.ts`)
- GitHub Content → Rules: reads pinned content (evidence: `mcp/src/source/github-source.ts`)
- GitHub Content → Task Skills: reads pinned content (evidence: `mcp/src/source/github-source.ts`)
- GitHub Content → Subagents: reads definitions (evidence: `mcp/src/source/github-source.ts`)
- GitHub Content → Workflow Sweeps: reads definitions (evidence: `mcp/src/source/github-source.ts`)
