# yubuhui/opencode-self-evolving architecture

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

- Interactive diagram: https://gitdiagram.com/yubuhui/opencode-self-evolving
- Repository: https://github.com/yubuhui/opencode-self-evolving

## Overview

This repository is a skills-centered configuration kit that equips OpenCode (and compatible agents) with self-improvement guidance and engineering standards. Its documented task workflow runs from plan review through phased implementation and test verification, then feeds reusable learning back into the skill index. Separate skills define quality, rule-writing, and PowerShell encoding practices. Workflow links reflect the README; unsampled skill internals are represented by their exact paths, without inferring implementation details.

Main entry points: [`skills/plan-review/SKILL.md`](https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/plan-review/SKILL.md) (Plan review), [`skills/phased-refactor-and-report/SKILL.md`](https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/phased-refactor-and-report/SKILL.md) (Phased refactor), [`skills/test-verification/SKILL.md`](https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/test-verification/SKILL.md) (Test verification), [`skills/auto-skill-creator/SKILL.md`](https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/auto-skill-creator/SKILL.md) (Auto skill creator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Task workflow"]
  node_plan["Plan review<br/>[SKILL.md]"]
  node_phase["Phased refactor<br/>[SKILL.md]"]
  node_verify["Test verification<br/>[SKILL.md]"]
  node_result["Completion report<br/>[SKILL.md]"]
end

subgraph group_evolution["Skill evolution"]
  node_creator["Auto skill creator<br/>[SKILL.md]"]
  node_index["Skill index<br/>[INDEX.md]"]
end

subgraph group_standards["Engineering standards"]
  node_quality["Quality baseline<br/>[SKILL.md]"]
  node_safe_rules["Safe rule writing<br/>[SKILL.md]"]
  node_utf8["PowerShell UTF-8<br/>[SKILL.md]"]
end

subgraph group_configuration["Agent configuration"]
  node_agents["Always-on guidance<br/>[AGENTS.md]"]
  node_safety_config["Safety permissions"]
end

node_task(("User task"))
node_opencode(("OpenCode"))

node_task -->|"enters review"| node_plan
node_plan -.->|"revise up to twice"| node_plan
node_plan -->|"approves plan"| node_phase
node_phase -->|"requests verification"| node_verify
node_verify -->|"gates completion"| node_result
node_result -->|"captures learning"| node_creator
node_creator -->|"registers skill"| node_index
node_opencode -->|"loads guidance"| node_agents
node_opencode -->|"loads skills"| node_index
node_opencode -.->|"uses permissions"| node_safety_config

click node_plan "https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/plan-review/SKILL.md"
click node_phase "https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/phased-refactor-and-report/SKILL.md"
click node_verify "https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/test-verification/SKILL.md"
click node_result "https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/phased-refactor-and-report/SKILL.md"
click node_creator "https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/auto-skill-creator/SKILL.md"
click node_index "https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/INDEX.md"
click node_quality "https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/quality-baseline/SKILL.md"
click node_safe_rules "https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/white-bear-safe-rules/SKILL.md"
click node_utf8 "https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/powershell-utf8-safety/SKILL.md"
click node_agents "https://github.com/yubuhui/opencode-self-evolving/blob/main/AGENTS.md"
click node_safety_config "https://github.com/yubuhui/opencode-self-evolving/blob/main/opencode.json.example"

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_plan,node_phase,node_verify,node_result toneBlue
class node_creator,node_index toneAmber
class node_quality,node_safe_rules,node_utf8 toneMint
class node_agents,node_safety_config,node_task toneRose
class node_opencode toneIndigo
```

## Components

### Task workflow

- [Plan review](https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/plan-review/SKILL.md): `skills/plan-review/SKILL.md`
- [Phased refactor](https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/phased-refactor-and-report/SKILL.md): `skills/phased-refactor-and-report/SKILL.md`
- [Test verification](https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/test-verification/SKILL.md): `skills/test-verification/SKILL.md`
- [Completion report](https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/phased-refactor-and-report/SKILL.md): `skills/phased-refactor-and-report/SKILL.md`

### Skill evolution

- [Auto skill creator](https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/auto-skill-creator/SKILL.md): `skills/auto-skill-creator/SKILL.md`
- [Skill index](https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/INDEX.md): `skills/INDEX.md`

### Engineering standards

- [Quality baseline](https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/quality-baseline/SKILL.md): `skills/quality-baseline/SKILL.md`
- [Safe rule writing](https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/white-bear-safe-rules/SKILL.md): `skills/white-bear-safe-rules/SKILL.md`
- [PowerShell UTF-8](https://github.com/yubuhui/opencode-self-evolving/blob/main/skills/powershell-utf8-safety/SKILL.md): `skills/powershell-utf8-safety/SKILL.md`

### Agent configuration

- [Always-on guidance](https://github.com/yubuhui/opencode-self-evolving/blob/main/AGENTS.md): `AGENTS.md`
- [Safety permissions](https://github.com/yubuhui/opencode-self-evolving/blob/main/opencode.json.example): `opencode.json.example`

### Other components

- **User task**
- **OpenCode**

## Connections

- User task → Plan review: enters review
- Plan review → Plan review: revise up to twice
- Plan review → Phased refactor: approves plan
- Phased refactor → Test verification: requests verification
- Test verification → Completion report: gates completion
- Completion report → Auto skill creator: captures learning
- Auto skill creator → Skill index: registers skill
- OpenCode → Always-on guidance: loads guidance
- OpenCode → Skill index: loads skills
- OpenCode → Safety permissions: uses permissions
