# cyberxiaowan/cyber-xiaowan architecture

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

- Interactive diagram: https://gitdiagram.com/cyberxiaowan/cyber-xiaowan
- Repository: https://github.com/cyberxiaowan/cyber-xiaowan

## Overview

Cyber Xiaowan is a public, agent-hosted thinking skill whose main workflow selects a proportionate response—listen, clarify, audit, structure, or act—and can branch into business/content judgment or diagnostic preparation. A separate experimental desktop pet reflects Codex and DSH activity through a local server and UI. The README documents the skill’s capabilities and progressive reference loading; sampled pet source shows its runtime calls. Other reference content and the pet UI were not sampled, so their internal behavior is not expanded.

Main entry points: [`SKILL.md`](https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/SKILL.md) (Mode Selection), [`pet/server.mjs`](https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/pet/server.mjs) (Local Pet Server), [`pet/runtime-paths.mjs`](https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/pet/runtime-paths.mjs) (Runtime Paths), [`pet/cli.mjs`](https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/pet/cli.mjs) (Pet CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_skill["Thinking Skill"]
  node_skill_entry["Skill Entry<br/>[SKILL.md]"]
  node_mode_router["Mode Selection<br/>[SKILL.md]"]
end

subgraph group_knowledge["Scenario Guidance"]
  node_conversation["Conversation Support<br/>[conversation.md]"]
  node_judgment["Business Judgment"]
  node_content_editor["Content Editing<br/>[content-editor.md]"]
  node_diagnosis["Diagnosis Pack"]
  node_privacy["Privacy Boundaries<br/>[privacy.md]"]
  node_public_views["Public Perspectives"]
end

subgraph group_pet["Desktop Pet"]
  node_pet_cli["Pet CLI<br/>[cli.mjs]"]
  node_pet_server["Local Pet Server<br/>[server.mjs]"]
  node_pet_ui["Pet Interface<br/>[index.html]"]
  node_pet_manifest["Pet States<br/>[pets.json]"]
  node_pet_runtime["Runtime Paths<br/>[runtime-paths.mjs]"]
end

subgraph group_bridges["Agent Bridges"]
  node_codex_bridge["Codex Notifications<br/>[codex-notify.mjs]"]
  node_dsh_bridge["DSH Watcher<br/>[dsh-watch.mjs]"]
end

node_user(("User"))
node_agent(("Agent Host"))
node_codex(("Codex"))
node_dsh[("DSH Sessions")]

node_user -->|"submits concern"| node_agent
node_agent -->|"invokes skill"| node_skill_entry
node_skill_entry -->|"routes response"| node_mode_router
node_mode_router -->|"loads guidance"| node_conversation
node_mode_router -->|"loads guidance"| node_judgment
node_mode_router -->|"loads guidance"| node_content_editor
node_mode_router -->|"loads guidance"| node_diagnosis
node_mode_router -->|"loads guidance"| node_privacy
node_mode_router -->|"loads guidance"| node_public_views
node_user -->|"starts or commands"| node_pet_cli
node_pet_cli -->|"starts server"| node_pet_server
node_pet_cli -->|"reads runtime path"| node_pet_runtime
node_pet_server -->|"gets runtime home"| node_pet_runtime
node_pet_server -->|"reads states"| node_pet_manifest
node_pet_server -->|"serves interface"| node_pet_ui
node_pet_ui -.->|"uses local API"| node_pet_server
node_codex -->|"sends events"| node_codex_bridge
node_codex_bridge -->|"reads runtime path"| node_pet_runtime
node_codex_bridge -->|"posts state"| node_pet_server
node_dsh -->|"provides session activity"| node_dsh_bridge
node_dsh_bridge -->|"reads runtime path"| node_pet_runtime
node_dsh_bridge -->|"posts state"| node_pet_server

click node_skill_entry "https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/SKILL.md"
click node_mode_router "https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/SKILL.md"
click node_conversation "https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/references/conversation.md"
click node_judgment "https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/references/business-content.md"
click node_content_editor "https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/references/content-editor.md"
click node_diagnosis "https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/references/diagnosis-pack-template.md"
click node_privacy "https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/references/privacy.md"
click node_public_views "https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/references/public-perspectives.md"
click node_pet_cli "https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/pet/cli.mjs"
click node_pet_server "https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/pet/server.mjs"
click node_pet_ui "https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/pet/public/index.html"
click node_pet_manifest "https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/pet/pets.json"
click node_pet_runtime "https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/pet/runtime-paths.mjs"
click node_codex_bridge "https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/pet/integrations/codex-notify.mjs"
click node_dsh_bridge "https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/pet/integrations/dsh-watch.mjs"

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_skill_entry,node_mode_router,node_user toneBlue
class node_conversation,node_judgment,node_content_editor,node_diagnosis,node_privacy,node_public_views,node_dsh toneAmber
class node_pet_cli,node_pet_server,node_pet_ui,node_pet_manifest,node_pet_runtime toneMint
class node_codex_bridge,node_dsh_bridge toneRose
class node_agent,node_codex toneIndigo
```

## Components

### Thinking Skill

- [Skill Entry](https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/SKILL.md): `SKILL.md`
- [Mode Selection](https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/SKILL.md): `SKILL.md`

### Scenario Guidance

- [Conversation Support](https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/references/conversation.md): `references/conversation.md`
- [Business Judgment](https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/references/business-content.md): `references/business-content.md`
- [Content Editing](https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/references/content-editor.md): `references/content-editor.md`
- [Diagnosis Pack](https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/references/diagnosis-pack-template.md): `references/diagnosis-pack-template.md`
- [Privacy Boundaries](https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/references/privacy.md): `references/privacy.md`
- [Public Perspectives](https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/references/public-perspectives.md): `references/public-perspectives.md`

### Desktop Pet

- [Pet CLI](https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/pet/cli.mjs): `pet/cli.mjs`
- [Local Pet Server](https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/pet/server.mjs): `pet/server.mjs`
- [Pet Interface](https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/pet/public/index.html): `pet/public/index.html`
- [Pet States](https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/pet/pets.json): `pet/pets.json`
- [Runtime Paths](https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/pet/runtime-paths.mjs): `pet/runtime-paths.mjs`

### Agent Bridges

- [Codex Notifications](https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/pet/integrations/codex-notify.mjs): `pet/integrations/codex-notify.mjs`
- [DSH Watcher](https://github.com/cyberxiaowan/cyber-xiaowan/blob/main/pet/integrations/dsh-watch.mjs): `pet/integrations/dsh-watch.mjs`

### Other components

- **User**
- **Agent Host**
- **Codex**
- **DSH Sessions**

## Connections

- User → Agent Host: submits concern (evidence: `README.md`)
- Agent Host → Skill Entry: invokes skill (evidence: `README.md`)
- Skill Entry → Mode Selection: routes response (evidence: `README.md`)
- Mode Selection → Conversation Support: loads guidance (evidence: `README.md`)
- Mode Selection → Business Judgment: loads guidance (evidence: `README.md`)
- Mode Selection → Content Editing: loads guidance (evidence: `README.md`)
- Mode Selection → Diagnosis Pack: loads guidance (evidence: `README.md`)
- Mode Selection → Privacy Boundaries: loads guidance (evidence: `README.md`)
- Mode Selection → Public Perspectives: loads guidance (evidence: `README.md`)
- User → Pet CLI: starts or commands (evidence: `README.md`)
- Pet CLI → Local Pet Server: starts server (evidence: `pet/cli.mjs`)
- Pet CLI → Runtime Paths: reads runtime path (evidence: `pet/cli.mjs`)
- Local Pet Server → Runtime Paths: gets runtime home (evidence: `pet/server.mjs`)
- Local Pet Server → Pet States: reads states (evidence: `pet/server.mjs`)
- Local Pet Server → Pet Interface: serves interface (evidence: `pet/server.mjs`)
- Pet Interface → Local Pet Server: uses local API
- Codex → Codex Notifications: sends events (evidence: `README.md`)
- Codex Notifications → Runtime Paths: reads runtime path (evidence: `pet/integrations/codex-notify.mjs`)
- Codex Notifications → Local Pet Server: posts state (evidence: `pet/integrations/codex-notify.mjs`)
- DSH Sessions → DSH Watcher: provides session activity (evidence: `pet/integrations/dsh-watch.mjs`)
- DSH Watcher → Runtime Paths: reads runtime path (evidence: `pet/integrations/dsh-watch.mjs`)
- DSH Watcher → Local Pet Server: posts state (evidence: `pet/integrations/dsh-watch.mjs`)
