# titanwings/colleague-skill architecture

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

- Interactive diagram: https://gitdiagram.com/titanwings/colleague-skill
- Repository: https://github.com/titanwings/colleague-skill

## Overview

1. **What this repository is**
   - `colleague.skill` is not a conventional app; it is an **AgentSkills/Claude Code skill package** that generates other skills.
   - The repository’s output is a per-person “colleague skill” made of two parts: **Work Skill** and **Persona**.

2. **Primary entry point**
   - `SKILL.md` is the skill entry point consumed by Claude Code / AgentSkills.
   - The repo is designed to be installed under `.claude/skills/create-colleague`, which makes the skill available as `/create-colleague`.

3. **Core generation pipeline**
   - The flow is: **collect source material → analyze work/persona → build skill files → write into `colleagues/` → archive versions**.
   - The generated artifacts are the actual runtime output of the system; everything else supports producing and evolving them.

4. **Source ingestion layer**
   - The repo supports multiple input boundaries:
     - **Feishu**: API-based auto collection and browser/MCP-based collection
     - **DingTalk**: browser-based collection
     - **Slack**: API-based collection
     - **Email**: `.eml` / `.mbox` parsing
     - **Manual inputs**: PDF, images/screenshots, JSON export, Markdown, pasted text
     - **WeChat exports**: parsed from external open-source export formats
   - These are handled by the scripts in `tools/`, each targeting a different external source shape.

5. **Normalization and parsing boundary**
   - Collectors and parsers convert heterogeneous source material into a common form suitable for prompting.
   - This boundary is important because the system is explicitly designed to mix **chat logs, docs, spreadsheets, screenshots, and subjective descriptions** into one downstream synthesis process.

6. **Analysis layer**
   - The `prompts/` directory contains the system’s reasoning templates:
     - `intake.md` for guided information gathering
     - `work_analyzer.md` for extracting technical/work behavior
     - `persona_analyzer.md` for extracting personality traits and translating tags
     - `correction_handler.md` for applying conversational corrections
   - This layer is where the system separates **capability modeling** from **style/personality modeling**.

7. **Skill construction layer**
   - `work_builder.md` and `persona_builder.md` define how analyzed material becomes the final skill contents.
   - The resulting skill is intentionally split into:
     - **Work Skill**: knowledge, standards, workflows, and domain habits
     - **Persona**: a five-layer behavioral model from hard rules to interpersonal tone
   - This split is central to the architecture because execution is described as: **persona decides attitude, work skill executes, output is in their voice**.

8. **Incremental update and merge logic**
   - `merger.md` defines how new evidence is appended without overwriting prior conclusions.
   - The repo treats new inputs as **deltas** rather than full regenerations, which preserves accumulated knowledge and allows the skill to evolve over time.

9. **Versioning and rollback**
   - `tools/version_manager.py` provides archive/rollback behavior.
   - Every update can be versioned, and older versions can be restored, making the generated skills behave more like a maintained knowledge base than a one-shot export.

10. **Generated skill storage**
    - `colleagues/` contains example/generated colleague skill directories.
    - Each skill directory follows the same internal shape: metadata plus separate `persona.md` and `work.md` content, which mirrors the two-part architecture described above.

11. **Automation and service integration**
    - The `tools/` directory is the operational layer:
      - Feishu: `feishu_auto_collector.py`, `feishu_browser.py`, `feishu_mcp_client.py`, `feishu_parser.py`
      - DingTalk: `dingtalk_auto_collector.py`
      - Slack: `slack_auto_collector.py`
      - Email: `email_parser.py`
      - Skill output writing: `skill_writer.py`
    - These scripts are the bridge between external collaboration systems and the generated skill repository.

12. **Documentation and product surface**
    - `docs/PRD.md`, `README`s in multiple languages, `INSTALL.md`, and `ROADMAP.md` define the product boundaries and intended workflow, but they are not runtime components.
    - The repo also includes CI (`.github/workflows/ci.yml`) and contribution templates, indicating a community-maintained generator rather than a closed internal tool.

13. **Architecture summary for a diagram**
    - A clear diagram should show:
      - **External knowledge sources** on the left
      - **Collectors/parsers** in the middle
      - **Prompt-driven analyzers/builders** as the synthesis core
      - **Skill writer + version manager** as persistence/governance
      - **Generated colleague skills** in `colleagues/` as the output layer
    - The key boundary is between **raw human communication artifacts** and **structured, versioned skill artifacts**.

Main entry points: [`prompts/intake.md`](https://github.com/titanwings/colleague-skill/blob/main/prompts/intake.md) (Intake), [`prompts/merger.md`](https://github.com/titanwings/colleague-skill/blob/main/prompts/merger.md) (Merger), [`tools/skill_writer.py`](https://github.com/titanwings/colleague-skill/blob/main/tools/skill_writer.py) (Skill writer), [`colleagues`](https://github.com/titanwings/colleague-skill/tree/main/colleagues) (Colleagues)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sources["External sources"]
  node_feishu(("Feishu<br/>source"))
  node_dingtalk(("DingTalk<br/>source"))
  node_slack(("Slack<br/>source"))
  node_email(("Email<br/>source"))
  node_manual["Manual inputs<br/>source"]
  node_wechat["WeChat exports<br/>source"]
end

subgraph group_ingest["Ingestion"]
  node_feishu_collectors["Feishu tools<br/>collector/parser"]
  node_dingtalk_collector["DingTalk collector"]
  node_slack_collector["Slack collector"]
  node_email_parser["Email parser<br/>[email_parser.py]"]
end

subgraph group_synth["Synthesis"]
  node_intake["Intake<br/>prompt<br/>[intake.md]"]
  node_work_analyzer["Work analyzer<br/>prompt<br/>[work_analyzer.md]"]
  node_persona_analyzer["Persona analyzer<br/>prompt"]
  node_merger["Merger<br/>prompt<br/>[merger.md]"]
  node_work_builder["Work builder<br/>prompt<br/>[work_builder.md]"]
  node_persona_builder["Persona builder<br/>prompt<br/>[persona_builder.md]"]
end

subgraph group_output["Output"]
  node_skill_writer["Skill writer<br/>[skill_writer.py]"]
  node_version_manager["Version manager<br/>governance<br/>[version_manager.py]"]
  node_colleague_skills[("Colleagues<br/>generated skills")]
end

subgraph group_ops["Ops"]
  node_skill_entry["SKILL.md<br/>entrypoint<br/>[SKILL.md]"]
  node_docs["Docs<br/>[PRD.md]"]
  node_ci["CI<br/>workflow<br/>[ci.yml]"]
end

node_feishu -->|"ingest"| node_feishu_collectors
node_dingtalk -->|"ingest"| node_dingtalk_collector
node_slack -->|"ingest"| node_slack_collector
node_email -->|"parse"| node_email_parser
node_manual -->|"prompt"| node_intake
node_wechat -->|"prompt"| node_intake
node_feishu_collectors -->|"normalize"| node_intake
node_dingtalk_collector -->|"normalize"| node_intake
node_slack_collector -->|"normalize"| node_intake
node_email_parser -->|"normalize"| node_intake
node_intake -->|"analyze"| node_work_analyzer
node_intake -->|"analyze"| node_persona_analyzer
node_work_analyzer -->|"delta"| node_merger
node_persona_analyzer -->|"delta"| node_merger
node_merger -->|"build"| node_work_builder
node_merger -->|"build"| node_persona_builder
node_work_builder -->|"write"| node_skill_writer
node_persona_builder -->|"write"| node_skill_writer
node_skill_writer -->|"persist"| node_colleague_skills
node_colleague_skills -->|"archive"| node_version_manager
node_version_manager -.->|"restore"| node_colleague_skills
node_skill_entry -->|"entry"| node_intake
node_docs -.->|"describe"| node_skill_entry
node_ci -.->|"validate"| node_skill_writer

click node_feishu_collectors "https://github.com/titanwings/colleague-skill/blob/main/tools/feishu_auto_collector.py"
click node_dingtalk_collector "https://github.com/titanwings/colleague-skill/blob/main/tools/dingtalk_auto_collector.py"
click node_slack_collector "https://github.com/titanwings/colleague-skill/blob/main/tools/slack_auto_collector.py"
click node_email_parser "https://github.com/titanwings/colleague-skill/blob/main/tools/email_parser.py"
click node_skill_writer "https://github.com/titanwings/colleague-skill/blob/main/tools/skill_writer.py"
click node_version_manager "https://github.com/titanwings/colleague-skill/blob/main/tools/version_manager.py"
click node_intake "https://github.com/titanwings/colleague-skill/blob/main/prompts/intake.md"
click node_work_analyzer "https://github.com/titanwings/colleague-skill/blob/main/prompts/work_analyzer.md"
click node_persona_analyzer "https://github.com/titanwings/colleague-skill/blob/main/prompts/persona_analyzer.md"
click node_merger "https://github.com/titanwings/colleague-skill/blob/main/prompts/merger.md"
click node_work_builder "https://github.com/titanwings/colleague-skill/blob/main/prompts/work_builder.md"
click node_persona_builder "https://github.com/titanwings/colleague-skill/blob/main/prompts/persona_builder.md"
click node_colleague_skills "https://github.com/titanwings/colleague-skill/tree/main/colleagues"
click node_skill_entry "https://github.com/titanwings/colleague-skill/blob/main/SKILL.md"
click node_docs "https://github.com/titanwings/colleague-skill/blob/main/docs/PRD.md"
click node_ci "https://github.com/titanwings/colleague-skill/blob/main/.github/workflows/ci.yml"

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_feishu,node_dingtalk,node_slack,node_email,node_manual,node_wechat toneBlue
class node_feishu_collectors,node_dingtalk_collector,node_slack_collector,node_email_parser toneAmber
class node_intake,node_work_analyzer,node_persona_analyzer,node_merger,node_work_builder,node_persona_builder toneMint
class node_skill_writer,node_version_manager,node_colleague_skills toneRose
class node_skill_entry,node_docs,node_ci toneIndigo
```

## Components

### External sources

Human communication and document inputs collected from collaboration systems and manual artifacts.

- **Feishu**: source · Chat and document source collected via API, browser, or MCP.
- **DingTalk**: source · Messaging source collected through browser automation.
- **Slack**: source · Workspace messages collected through API automation.
- **Email**: source · Mail inputs parsed from EML and MBOX archives.
- **Manual inputs**: source · PDFs, screenshots, JSON exports, markdown, and pasted text.
- **WeChat exports**: source · Imported chat exports from external open-source formats.

### Ingestion

Collectors and parsers that normalize heterogeneous inputs into promptable material.

- [Feishu tools](https://github.com/titanwings/colleague-skill/blob/main/tools/feishu_auto_collector.py): collector/parser · Auto collector, browser, MCP client, and parser for Feishu data. · `tools/feishu_auto_collector.py`
- [DingTalk collector](https://github.com/titanwings/colleague-skill/blob/main/tools/dingtalk_auto_collector.py): collector · Browser-based DingTalk ingestion. · `tools/dingtalk_auto_collector.py`
- [Slack collector](https://github.com/titanwings/colleague-skill/blob/main/tools/slack_auto_collector.py): collector · Slack API ingestion pipeline. · `tools/slack_auto_collector.py`
- [Email parser](https://github.com/titanwings/colleague-skill/blob/main/tools/email_parser.py): parser · Parses mailbox and message files into normalized evidence. · `tools/email_parser.py`

### Synthesis

Prompt-driven analysis and construction of the two-part colleague skill.

- [Intake](https://github.com/titanwings/colleague-skill/blob/main/prompts/intake.md): prompt · Guided information gathering and evidence shaping. · `prompts/intake.md`
- [Work analyzer](https://github.com/titanwings/colleague-skill/blob/main/prompts/work_analyzer.md): prompt · Extracts technical ability, workflows, standards, and habits. · `prompts/work_analyzer.md`
- [Persona analyzer](https://github.com/titanwings/colleague-skill/blob/main/prompts/persona_analyzer.md): prompt · Extracts personality traits and translates tags into a behavioral model. · `prompts/persona_analyzer.md`
- [Merger](https://github.com/titanwings/colleague-skill/blob/main/prompts/merger.md): prompt · Appends new evidence as deltas without overwriting prior conclusions. · `prompts/merger.md`
- [Work builder](https://github.com/titanwings/colleague-skill/blob/main/prompts/work_builder.md): prompt · Converts analyzed work evidence into the final work skill content. · `prompts/work_builder.md`
- [Persona builder](https://github.com/titanwings/colleague-skill/blob/main/prompts/persona_builder.md): prompt · Converts persona analysis into the layered behavioral model. · `prompts/persona_builder.md`

### Output

Generated colleague skill packages and versioned artifacts.

- [Skill writer](https://github.com/titanwings/colleague-skill/blob/main/tools/skill_writer.py): writer · Writes generated persona and work files into colleague skill folders. · `tools/skill_writer.py`
- [Version manager](https://github.com/titanwings/colleague-skill/blob/main/tools/version_manager.py): governance · Archives, restores, and rolls back generated skill versions. · `tools/version_manager.py`
- [Colleagues](https://github.com/titanwings/colleague-skill/tree/main/colleagues): generated skills · Versioned colleague skill packages containing meta, persona, and work files. · `colleagues`

### Ops

Documentation, workflow, and repository governance around the generator.

- [SKILL.md](https://github.com/titanwings/colleague-skill/blob/main/SKILL.md): entrypoint · Claude Code / AgentSkills entry point that exposes /create-colleague. · `SKILL.md`
- [Docs](https://github.com/titanwings/colleague-skill/blob/main/docs/PRD.md): product docs · PRD, install, roadmap, and multilingual README surfaces. · `docs/PRD.md`
- [CI](https://github.com/titanwings/colleague-skill/blob/main/.github/workflows/ci.yml): workflow · Repository automation and validation workflow. · `.github/workflows/ci.yml`

## Connections

- Feishu → Feishu tools: ingest · Feishu data is collected and parsed into normalized evidence.
- DingTalk → DingTalk collector: ingest · DingTalk messages are captured through browser automation.
- Slack → Slack collector: ingest · Slack messages are fetched through API-based collection.
- Email → Email parser: parse · Mailbox artifacts are converted into structured evidence.
- Manual inputs → Intake: prompt · Manual materials are guided into the intake flow.
- WeChat exports → Intake: prompt · WeChat exports are normalized through the intake path.
- Feishu tools → Intake: normalize · Collected Feishu evidence is prepared for prompting.
- DingTalk collector → Intake: normalize · Collected DingTalk evidence is prepared for prompting.
- Slack collector → Intake: normalize · Collected Slack evidence is prepared for prompting.
- Email parser → Intake: normalize · Parsed email evidence enters the shared intake boundary.
- Intake → Work analyzer: analyze · Guided intake feeds work extraction.
- Intake → Persona analyzer: analyze · Guided intake feeds persona extraction.
- Work analyzer → Merger: delta · Work conclusions are merged with prior evidence.
- Persona analyzer → Merger: delta · Persona conclusions are merged with prior evidence.
- Merger → Work builder: build · Merged evidence is shaped into the work skill.
- Merger → Persona builder: build · Merged evidence is shaped into the persona model.
- Work builder → Skill writer: write · Final work content is emitted to skill files.
- Persona builder → Skill writer: write · Final persona content is emitted to skill files.
- Skill writer → Colleagues: persist · Generated colleague skill directories are written to storage.
- Colleagues → Version manager: archive · Generated skills are versioned for rollback and restoration.
- Version manager → Colleagues: restore · Older versions can be recovered into the live output set.
- SKILL.md → Intake: entry · The skill entry point launches the generation workflow.
- Docs → SKILL.md: describe · Product docs define usage, workflow, and boundaries.
- CI → Skill writer: validate · CI checks the generator and emitted artifacts.
