# fengshao1227/ccg-workflow architecture

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

- Interactive diagram: https://gitdiagram.com/fengshao1227/ccg-workflow
- Repository: https://github.com/fengshao1227/ccg-workflow

## Overview

CCG is a Claude Code development-workflow system, with a parallel DeepSeek Harness plugin. The main documented journey is a user request routed by Claude through project/task analysis, strategy selection, optional model analysis, approval, implementation, quality and cross-review, and reporting. Hooks preserve workflow and task context; the Go wrapper runs external backend work and can stream it to a local web UI. Setup and configuration are a separate product branch. The README documents workflow stages not present in the sampled source; those links reflect documentation, not inspected implementation wiring.

Main entry points: [`dsh-ccg/src/index.js`](https://github.com/fengshao1227/ccg-workflow/blob/main/dsh-ccg/src/index.js) (DSH plugin), [`src/commands/init.ts`](https://github.com/fengshao1227/ccg-workflow/blob/main/src/commands/init.ts) (Setup commands), [`templates/hooks`](https://github.com/fengshao1227/ccg-workflow/tree/main/templates/hooks) (Workflow engine), [`codeagent-wrapper/main.go`](https://github.com/fengshao1227/ccg-workflow/blob/main/codeagent-wrapper/main.go) (Backend wrapper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Setup and config"]
  node_cli["CCG CLI<br/>[ccg.mjs]"]
  node_commands["Setup commands<br/>[init.ts]"]
  node_installer["Install workflows<br/>[installer.ts]"]
  node_config["Routing config<br/>[config.ts]"]
end

subgraph group_workflow["Claude workflow"]
  node_workflow["Workflow engine"]
  node_skilltools["Skill tools"]
end

subgraph group_hooks["Context hooks"]
  node_task["Task context<br/>[task-utils.js]"]
  node_statehook["State injection<br/>[workflow-state.js]"]
  node_skillrouter["Skill routing<br/>[skill-router.js]"]
  node_subagent["Agent context"]
end

subgraph group_models["Model execution"]
  node_wrapper["Backend wrapper<br/>[main.go]"]
  node_executor["Backend executor<br/>[executor.go]"]
  node_webui["Live output UI<br/>[server.go]"]
end

subgraph group_harness["DeepSeek Harness"]
  node_dshplugin["DSH plugin<br/>[index.js]"]
  node_roles["Role routing<br/>[roles.js]"]
  node_dshapi["Team API<br/>[api.js]"]
end

node_user(("Developer"))
node_claude(("Claude Code"))
node_providers{{"AI backends"}}
node_dshhost(("DeepSeek Harness"))
node_dshmodels{{"Provider APIs"}}

node_user -->|"starts setup"| node_cli
node_cli -->|"dispatches"| node_commands
node_commands -->|"installs workflows"| node_installer
node_commands -->|"configures routing"| node_config
node_user -->|"requests work"| node_claude
node_claude -->|"orchestrates"| node_workflow
node_workflow -->|"reads task state"| node_task
node_workflow -->|"dispatches model work"| node_wrapper
node_wrapper -->|"runs backend"| node_executor
node_executor -->|"calls"| node_providers
node_wrapper -.->|"streams output"| node_webui
node_statehook -->|"reads task state"| node_task
node_skillrouter -->|"loads skill content"| node_skilltools
node_subagent -->|"reads task context"| node_task
node_claude -->|"spawns agents"| node_subagent
node_dshhost -->|"mounts plugin"| node_dshplugin
node_dshplugin -->|"resolves roles"| node_roles
node_dshplugin -->|"registers team route"| node_dshapi
node_dshplugin -->|"delegates by API"| node_dshmodels

click node_cli "https://github.com/fengshao1227/ccg-workflow/blob/main/bin/ccg.mjs"
click node_commands "https://github.com/fengshao1227/ccg-workflow/blob/main/src/commands/init.ts"
click node_installer "https://github.com/fengshao1227/ccg-workflow/blob/main/src/utils/installer.ts"
click node_config "https://github.com/fengshao1227/ccg-workflow/blob/main/src/utils/config.ts"
click node_workflow "https://github.com/fengshao1227/ccg-workflow/tree/main/templates/hooks"
click node_task "https://github.com/fengshao1227/ccg-workflow/blob/main/templates/hooks/task-utils.js"
click node_statehook "https://github.com/fengshao1227/ccg-workflow/blob/main/templates/hooks/workflow-state.js"
click node_skillrouter "https://github.com/fengshao1227/ccg-workflow/blob/main/templates/hooks/skill-router.js"
click node_subagent "https://github.com/fengshao1227/ccg-workflow/blob/main/templates/hooks/subagent-context.js"
click node_wrapper "https://github.com/fengshao1227/ccg-workflow/blob/main/codeagent-wrapper/main.go"
click node_executor "https://github.com/fengshao1227/ccg-workflow/blob/main/codeagent-wrapper/executor.go"
click node_webui "https://github.com/fengshao1227/ccg-workflow/blob/main/codeagent-wrapper/server.go"
click node_skilltools "https://github.com/fengshao1227/ccg-workflow/tree/main/templates/skills/tools"
click node_dshplugin "https://github.com/fengshao1227/ccg-workflow/blob/main/dsh-ccg/src/index.js"
click node_roles "https://github.com/fengshao1227/ccg-workflow/blob/main/dsh-ccg/src/roles.js"
click node_dshapi "https://github.com/fengshao1227/ccg-workflow/blob/main/dsh-ccg/src/api.js"

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_cli,node_commands,node_installer,node_config toneBlue
class node_workflow,node_skilltools toneAmber
class node_task,node_statehook,node_skillrouter,node_subagent,node_dshmodels toneMint
class node_wrapper,node_executor,node_webui toneRose
class node_dshplugin,node_roles,node_dshapi,node_user,node_claude,node_providers,node_dshhost toneIndigo
```

## Components

### Setup and config

- [CCG CLI](https://github.com/fengshao1227/ccg-workflow/blob/main/bin/ccg.mjs): `bin/ccg.mjs`
- [Setup commands](https://github.com/fengshao1227/ccg-workflow/blob/main/src/commands/init.ts): `src/commands/init.ts`
- [Install workflows](https://github.com/fengshao1227/ccg-workflow/blob/main/src/utils/installer.ts): `src/utils/installer.ts`
- [Routing config](https://github.com/fengshao1227/ccg-workflow/blob/main/src/utils/config.ts): `src/utils/config.ts`

### Claude workflow

- [Workflow engine](https://github.com/fengshao1227/ccg-workflow/tree/main/templates/hooks): `templates/hooks`
- [Skill tools](https://github.com/fengshao1227/ccg-workflow/tree/main/templates/skills/tools): `templates/skills/tools`

### Context hooks

- [Task context](https://github.com/fengshao1227/ccg-workflow/blob/main/templates/hooks/task-utils.js): `templates/hooks/task-utils.js`
- [State injection](https://github.com/fengshao1227/ccg-workflow/blob/main/templates/hooks/workflow-state.js): `templates/hooks/workflow-state.js`
- [Skill routing](https://github.com/fengshao1227/ccg-workflow/blob/main/templates/hooks/skill-router.js): `templates/hooks/skill-router.js`
- [Agent context](https://github.com/fengshao1227/ccg-workflow/blob/main/templates/hooks/subagent-context.js): `templates/hooks/subagent-context.js`

### Model execution

- [Backend wrapper](https://github.com/fengshao1227/ccg-workflow/blob/main/codeagent-wrapper/main.go): `codeagent-wrapper/main.go`
- [Backend executor](https://github.com/fengshao1227/ccg-workflow/blob/main/codeagent-wrapper/executor.go): `codeagent-wrapper/executor.go`
- [Live output UI](https://github.com/fengshao1227/ccg-workflow/blob/main/codeagent-wrapper/server.go): `codeagent-wrapper/server.go`

### DeepSeek Harness

- [DSH plugin](https://github.com/fengshao1227/ccg-workflow/blob/main/dsh-ccg/src/index.js): `dsh-ccg/src/index.js`
- [Role routing](https://github.com/fengshao1227/ccg-workflow/blob/main/dsh-ccg/src/roles.js): `dsh-ccg/src/roles.js`
- [Team API](https://github.com/fengshao1227/ccg-workflow/blob/main/dsh-ccg/src/api.js): `dsh-ccg/src/api.js`

### Other components

- **Developer**
- **Claude Code**
- **AI backends**
- **DeepSeek Harness**
- **Provider APIs**

## Connections

- Developer → CCG CLI: starts setup
- CCG CLI → Setup commands: dispatches
- Setup commands → Install workflows: installs workflows
- Setup commands → Routing config: configures routing
- Developer → Claude Code: requests work
- Claude Code → Workflow engine: orchestrates
- Workflow engine → Task context: reads task state
- Workflow engine → Backend wrapper: dispatches model work
- Backend wrapper → Backend executor: runs backend
- Backend executor → AI backends: calls
- Backend wrapper → Live output UI: streams output
- State injection → Task context: reads task state
- Skill routing → Skill tools: loads skill content
- Agent context → Task context: reads task context
- Claude Code → Agent context: spawns agents
- DeepSeek Harness → DSH plugin: mounts plugin
- DSH plugin → Role routing: resolves roles
- DSH plugin → Team API: registers team route
- DSH plugin → Provider APIs: delegates by API
