# sharptoolbox/workbuddy-appbuilderskill architecture

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

- Interactive diagram: https://gitdiagram.com/sharptoolbox/workbuddy-appbuilderskill
- Repository: https://github.com/sharptoolbox/workbuddy-appbuilderskill

## Overview

WorkBuddy App Builder turns business ideas into confirmed requirements, ontology models, and an installable domain skill. Its product workflow moves through requirement exploration and approval, ontology modeling and approval, then skill generation; the generated skill runs a local SQLite-backed API for data entry and read-only querying, with forms and an offline ontology graph. The graph combines README-documented stages with runtime calls visible in the sampled sources. Some generation capabilities are documented but their implementation is not present in the supplied excerpts.

Main entry points: [`SKILL.md`](https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/SKILL.md) (Builder workflow), [`engine/server.py`](https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/engine/server.py) (Local REST server), [`engine/run.py`](https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/engine/run.py) (Engine startup), [`engine/db.py`](https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/engine/db.py) (SQLite schema builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Discovery &amp; Modeling"]
  node_skill_flow["Builder workflow<br/>[SKILL.md]"]
  node_requirement_specs["Exploration guidance"]
  node_ontology_specs["Ontology framework"]
  node_ontology_models["Eleven ontology models"]
end

subgraph group_generation["Skill Generation"]
  node_yaml_json["YAML conversion<br/>[yaml2json.py]"]
  node_graph_data["Ontology graph data"]
  node_graph_html["Offline graph HTML"]
  node_req_html["Requirement HTML"]
  node_scaffold["Deliverable scaffold"]
end

subgraph group_runtime["Domain Runtime"]
  node_runtime_entry["Engine startup<br/>[run.py]"]
  node_model_loader["Ontology loader<br/>[loader.py]"]
  node_schema_db[("SQLite schema builder<br/>[db.py]")]
  node_api_server["Local REST server<br/>[server.py]"]
  node_crud["Object CRUD<br/>[crud.py]"]
  node_query["Read-only query<br/>[query.py]"]
  node_app_db[("Domain database")]
end

subgraph group_outputs["Generated Interfaces"]
  node_entry_forms["Aggregate entry forms"]
  node_nl_query["Natural-language queries"]
  node_knowledge_graph["Offline knowledge graph"]
end

node_user(("Business user"))
node_workbuddy(("WorkBuddy"))

node_user -->|"provides idea"| node_skill_flow
node_workbuddy -->|"runs workflow"| node_skill_flow
node_skill_flow -->|"follows stages"| node_requirement_specs
node_skill_flow -->|"uses framework"| node_ontology_specs
node_skill_flow -->|"models domain"| node_ontology_models
node_user -->|"confirms stages"| node_skill_flow
node_ontology_models -->|"converts YAML"| node_yaml_json
node_ontology_models -->|"builds graph data"| node_graph_data
node_graph_data -->|"embeds graph"| node_graph_html
node_skill_flow -->|"creates templates"| node_scaffold
node_skill_flow -->|"renders requirements"| node_req_html
node_skill_flow -->|"generates domain skill"| node_runtime_entry
node_runtime_entry -->|"loads models"| node_model_loader
node_runtime_entry -->|"builds database"| node_schema_db
node_runtime_entry -->|"starts server"| node_api_server
node_model_loader -->|"provides ontology"| node_schema_db
node_schema_db -->|"creates tables"| node_app_db
node_api_server -->|"dispatches CRUD"| node_crud
node_api_server -->|"dispatches queries"| node_query
node_crud -->|"writes records"| node_app_db
node_query -->|"reads records"| node_app_db
node_entry_forms -->|"calls local API"| node_api_server
node_workbuddy -->|"requests schema"| node_api_server
node_workbuddy -->|"interprets question"| node_nl_query
node_nl_query -->|"submits SQL"| node_api_server
node_api_server -->|"returns results"| node_workbuddy
node_graph_html -->|"produces graph"| node_knowledge_graph

click node_skill_flow "https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/SKILL.md"
click node_requirement_specs "https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/specs/AI%E9%9C%80%E6%B1%82%E6%8E%A2%E7%B4%A2%E4%B8%8E%E7%A1%AE%E8%AE%A4%E6%8F%90%E7%A4%BA%E8%AF%8DV4.0.md"
click node_ontology_specs "https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/specs/ontology_modeling_framework_v6.md"
click node_yaml_json "https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/engine/yaml2json.py"
click node_graph_data "https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/tools/build_knowledge_graph.py"
click node_graph_html "https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/tools/build_graph_html.py"
click node_req_html "https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/requirement-exploration-v10/scripts/md_to_requirement_html.py"
click node_scaffold "https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/requirement-exploration-v10/scripts/scaffold_deliverables.py"
click node_runtime_entry "https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/engine/run.py"
click node_model_loader "https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/engine/loader.py"
click node_schema_db "https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/engine/db.py"
click node_api_server "https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/engine/server.py"
click node_crud "https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/engine/crud.py"
click node_query "https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/engine/query.py"

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_flow,node_requirement_specs,node_ontology_specs,node_ontology_models,node_user toneBlue
class node_yaml_json,node_graph_data,node_graph_html,node_req_html,node_scaffold toneAmber
class node_runtime_entry,node_model_loader,node_schema_db,node_api_server,node_crud,node_query,node_app_db toneMint
class node_entry_forms,node_nl_query,node_knowledge_graph toneRose
class node_workbuddy toneIndigo
```

## Components

### Discovery & Modeling

- [Builder workflow](https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/SKILL.md): `SKILL.md`
- [Exploration guidance](https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/specs/AI%E9%9C%80%E6%B1%82%E6%8E%A2%E7%B4%A2%E4%B8%8E%E7%A1%AE%E8%AE%A4%E6%8F%90%E7%A4%BA%E8%AF%8DV4.0.md): `specs/AI需求探索与确认提示词V4.0.md`
- [Ontology framework](https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/specs/ontology_modeling_framework_v6.md): `specs/ontology_modeling_framework_v6.md`
- **Eleven ontology models**

### Skill Generation

- [YAML conversion](https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/engine/yaml2json.py): `engine/yaml2json.py`
- [Ontology graph data](https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/tools/build_knowledge_graph.py): `tools/build_knowledge_graph.py`
- [Offline graph HTML](https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/tools/build_graph_html.py): `tools/build_graph_html.py`
- [Requirement HTML](https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/requirement-exploration-v10/scripts/md_to_requirement_html.py): `requirement-exploration-v10/scripts/md_to_requirement_html.py`
- [Deliverable scaffold](https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/requirement-exploration-v10/scripts/scaffold_deliverables.py): `requirement-exploration-v10/scripts/scaffold_deliverables.py`

### Domain Runtime

- [Engine startup](https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/engine/run.py): `engine/run.py`
- [Ontology loader](https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/engine/loader.py): `engine/loader.py`
- [SQLite schema builder](https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/engine/db.py): `engine/db.py`
- [Local REST server](https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/engine/server.py): `engine/server.py`
- [Object CRUD](https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/engine/crud.py): `engine/crud.py`
- [Read-only query](https://github.com/sharptoolbox/workbuddy-appbuilderskill/blob/main/engine/query.py): `engine/query.py`
- **Domain database**

### Generated Interfaces

- **Aggregate entry forms**
- **Natural-language queries**
- **Offline knowledge graph**

### Other components

- **Business user**
- **WorkBuddy**

## Connections

- Business user → Builder workflow: provides idea (evidence: `README.md`)
- WorkBuddy → Builder workflow: runs workflow (evidence: `README.md`)
- Builder workflow → Exploration guidance: follows stages (evidence: `README.md`)
- Builder workflow → Ontology framework: uses framework (evidence: `README.md`)
- Builder workflow → Eleven ontology models: models domain (evidence: `README.md`)
- Business user → Builder workflow: confirms stages (evidence: `README.md`)
- Eleven ontology models → YAML conversion: converts YAML (evidence: `README.md`)
- Eleven ontology models → Ontology graph data: builds graph data (evidence: `README.md`)
- Ontology graph data → Offline graph HTML: embeds graph (evidence: `README.md`)
- Builder workflow → Deliverable scaffold: creates templates (evidence: `README.md`)
- Builder workflow → Requirement HTML: renders requirements (evidence: `README.md`)
- Builder workflow → Engine startup: generates domain skill (evidence: `README.md`)
- Engine startup → Ontology loader: loads models (evidence: `engine/run.py`)
- Engine startup → SQLite schema builder: builds database (evidence: `engine/run.py`)
- Engine startup → Local REST server: starts server (evidence: `engine/run.py`)
- Ontology loader → SQLite schema builder: provides ontology (evidence: `engine/db.py`)
- SQLite schema builder → Domain database: creates tables (evidence: `engine/db.py`)
- Local REST server → Object CRUD: dispatches CRUD (evidence: `engine/server.py`)
- Local REST server → Read-only query: dispatches queries (evidence: `engine/server.py`)
- Object CRUD → Domain database: writes records (evidence: `engine/crud.py`)
- Read-only query → Domain database: reads records (evidence: `engine/query.py`)
- Aggregate entry forms → Local REST server: calls local API (evidence: `README.md`)
- WorkBuddy → Local REST server: requests schema (evidence: `README.md`)
- WorkBuddy → Natural-language queries: interprets question (evidence: `README.md`)
- Natural-language queries → Local REST server: submits SQL (evidence: `README.md`)
- Local REST server → WorkBuddy: returns results (evidence: `README.md`)
- Offline graph HTML → Offline knowledge graph: produces graph (evidence: `README.md`)
