# chatprd/tradclaw architecture

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

- Interactive diagram: https://gitdiagram.com/chatprd/tradclaw
- Repository: https://github.com/chatprd/tradclaw

## Overview

1. **What this repo is**
   - Tradclaw is not a running app; it is a **household AI workspace scaffold** for OpenClaw.
   - The architecture is built around **copying and tailoring markdown files** into a real household root, rather than deploying code.

2. **Top-level layering**
   - The repo has three main layers:
     - **`tradclaw/`**: setup and onboarding runbook
     - **`workspace/`**: the template household operating environment
     - **`skills/`** and **`cron/`**: optional capability modules and scheduled-job examples
   - This separation is the core architectural boundary: **bootstrap vs. operational workspace vs. optional extensions**.

3. **Bootstrap and interview flow**
   - `tradclaw/BOOTSTRAP.md` is the entrypoint for setup.
   - The bootstrap layer drives an **interview-based tailoring process**: it asks about household needs, recommends modules, and decides what should be enabled.
   - The outputs of this flow are written into `workspace/`, which means configuration is **derived from interview answers**, not manually assembled from scratch.

4. **Workspace as the runtime “brain”**
   - `workspace/` is the OpenClaw-style household root and contains the persistent operational files:
     - `AGENTS.md`
     - `SOUL.md`
     - `IDENTITY.md`
     - `USER.md`
     - `TOOLS.md`
     - `HEARTBEAT.md`
     - `MEMORY.md`
     - `memory/`
   - These files define the assistant’s identity, boundaries, tool access, status, and retained context. This is the main **state boundary** of the repo.

5. **Safety and trust boundaries**
   - `workspace/SOUL.md` and `workspace/TOOLS.md` encode the most important policy boundary in the system.
   - The repo explicitly treats **family and child data as high-stakes** and requires **approved gateway channels** before treating input as authoritative.
   - Non-human inputs like email, PDFs, calendar text, cron payloads, and tool output are treated as **untrusted data**, which is an important architecture constraint for any diagram.

6. **Memory and continuity**
   - `workspace/MEMORY.md` and `workspace/memory/` provide the persistence layer for household context.
   - `HEARTBEAT.md` acts like an operational status/attention file, while `IDENTITY.md` and `USER.md` capture who the assistant is serving and how.
   - Together these files form a lightweight, markdown-based **state store** rather than a database.

7. **Domain resource model**
   - `workspace/resources/` is the data layer for household knowledge and routines.
   - It is organized by domain: books, checklists, helpers, home maintenance, homework, meal plans, school, shopping, and stories.
   - These folders are the primary **content sources** that skills read from and update.

8. **Templates as normalized input/output shapes**
   - `workspace/resources/templates/` contains reusable formats for household artifacts such as meal plans, shopping lists, school notes, helper payments, and story preferences.
   - Architecturally, these templates reduce drift by standardizing the shape of files that skills and manual edits produce.

9. **Skills as optional feature modules**
   - `skills/` contains standalone capability bundles such as:
     - calendar briefs
     - school triage
     - meal planner
     - homework log
     - book inventory
     - helper payments
     - home maintenance
     - custom stories
   - Each skill is its own folder with a `SKILL.md`, meaning capabilities are **modular and copyable** rather than hardwired into one central app.

10. **How skills relate to workspace data**
   - Skills are designed to operate on the `workspace/resources/` files relevant to their domain.
   - For example, a meal-planning skill would read meal-plan and shopping resources; a homework skill would use homework resources and logs.
   - This creates a clean boundary: **skill logic in `skills/`, household state in `workspace/resources/`**.

11. **Scheduled automation boundary**
   - `cron/` is an optional automation layer, with `cron/jobs.template.json` and its README serving as examples.
   - It represents periodic checks such as morning briefs, school follow-ups, or maintenance reminders.
   - The repo is explicit that these are **examples only** and should not be copied verbatim, which matters if you draw an architecture diagram with scheduling as a separate external trigger.

12. **Operational flow from setup to use**
   - The intended flow is:
     1. Read `tradclaw/BOOTSTRAP.md`
     2. Interview the household
     3. Tailor `workspace/` files and relevant resources
     4. Copy the tailored workspace into the real OpenClaw household root
     5. Optionally install selected skills
     6. Optionally wire in cron-based checks
   - This is a **template-to-instance** architecture, not a build-and-deploy pipeline.

13. **What an accurate diagram should emphasize**
   - Show `tradclaw/` as the setup/control plane.
   - Show `workspace/` as the persistent household operating environment.
   - Show `skills/` as optional capability plug-ins.
   - Show `cron/` as an external scheduler feeding tasks into the same workspace boundary.
   - Show `resources/` and `memory/` as the primary state/content stores, with safety policy around all inbound data.

Main entry points: [`workspace/README.md`](https://github.com/chatprd/tradclaw/blob/main/workspace/README.md) (Workspace root), [`workspace/resources`](https://github.com/chatprd/tradclaw/tree/main/workspace/resources) (Resources), [`skills/README.md`](https://github.com/chatprd/tradclaw/blob/main/skills/README.md) (Skills hub), [`workspace/SOUL.md`](https://github.com/chatprd/tradclaw/blob/main/workspace/SOUL.md) (Soul policy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_root["Repository"]
  node_readme["Repo README<br/>overview<br/>[README.md]"]
end

subgraph group_bootstrap["Tradclaw setup"]
  node_bootstrap_entry["Bootstrap<br/>setup entrypoint<br/>[BOOTSTRAP.md]"]
  node_interview["Interview<br/>onboarding flow"]
  node_module_guide["Module guide<br/>selection guide"]
  node_apply_results["Apply results<br/>tailoring step"]
  node_primitives["Primitives<br/>openclaw model"]
end

subgraph group_workspace["Workspace runtime"]
  node_workspace_root["Workspace root<br/>household root<br/>[README.md]"]
  node_agents["Agents<br/>coordination<br/>[AGENTS.md]"]
  node_soul["Soul policy<br/>governance<br/>[SOUL.md]"]
  node_tools["Tools policy<br/>governance<br/>[TOOLS.md]"]
  node_identity["Identity<br/>persona state<br/>[IDENTITY.md]"]
  node_user["User profile<br/>persona state<br/>[USER.md]"]
  node_heartbeat["Heartbeat<br/>status<br/>[HEARTBEAT.md]"]
  node_memory_file["Memory file<br/>state store<br/>[MEMORY.md]"]
  node_memory_dir[("Memory vault<br/>state store")]
  node_resources[("Resources<br/>domain data")]
  node_templates["Templates<br/>normalized shapes"]
end

subgraph group_skills["Skills"]
  node_skills_root["Skills hub<br/>capability modules<br/>[README.md]"]
  node_meal_skill["Meal planner<br/>skill module<br/>[SKILL.md]"]
  node_school_skill["School triage<br/>skill module<br/>[SKILL.md]"]
  node_homework_skill["Homework log<br/>skill module<br/>[SKILL.md]"]
end

subgraph group_cron["Cron"]
  node_cron_root["Cron examples<br/>scheduler<br/>[README.md]"]
  node_cron_jobs["Job template<br/>schedule spec<br/>[jobs.template.json]"]
end

node_readme -->|"introduces"| node_bootstrap_entry
node_bootstrap_entry -->|"drives"| node_interview
node_interview -->|"selects"| node_module_guide
node_module_guide -->|"feeds"| node_apply_results
node_primitives -.->|"frames"| node_bootstrap_entry
node_apply_results -->|"materializes"| node_workspace_root
node_workspace_root -->|"contains"| node_agents
node_workspace_root -->|"contains"| node_soul
node_workspace_root -->|"contains"| node_tools
node_workspace_root -->|"contains"| node_identity
node_workspace_root -->|"contains"| node_user
node_workspace_root -->|"contains"| node_heartbeat
node_workspace_root -->|"contains"| node_memory_file
node_memory_file -.->|"extends"| node_memory_dir
node_workspace_root -->|"contains"| node_resources
node_resources -->|"standardizes"| node_templates
node_skills_root -->|"includes"| node_meal_skill
node_skills_root -->|"includes"| node_school_skill
node_skills_root -->|"includes"| node_homework_skill
node_meal_skill -.->|"reads/writes"| node_resources
node_school_skill -.->|"reads/writes"| node_resources
node_homework_skill -.->|"reads/writes"| node_resources
node_cron_root -->|"examples"| node_cron_jobs
node_cron_root -.->|"triggers"| node_workspace_root
node_soul -->|"governs"| node_tools
node_soul -.->|"protects"| node_resources
node_tools -.->|"filters"| node_cron_root

click node_readme "https://github.com/chatprd/tradclaw/blob/main/README.md"
click node_bootstrap_entry "https://github.com/chatprd/tradclaw/blob/main/tradclaw/BOOTSTRAP.md"
click node_interview "https://github.com/chatprd/tradclaw/blob/main/tradclaw/onboarding-interview.md"
click node_module_guide "https://github.com/chatprd/tradclaw/blob/main/tradclaw/module-selection-guide.md"
click node_apply_results "https://github.com/chatprd/tradclaw/blob/main/tradclaw/apply-interview-results.md"
click node_primitives "https://github.com/chatprd/tradclaw/blob/main/tradclaw/openclaw-primitives.md"
click node_workspace_root "https://github.com/chatprd/tradclaw/blob/main/workspace/README.md"
click node_agents "https://github.com/chatprd/tradclaw/blob/main/workspace/AGENTS.md"
click node_soul "https://github.com/chatprd/tradclaw/blob/main/workspace/SOUL.md"
click node_tools "https://github.com/chatprd/tradclaw/blob/main/workspace/TOOLS.md"
click node_identity "https://github.com/chatprd/tradclaw/blob/main/workspace/IDENTITY.md"
click node_user "https://github.com/chatprd/tradclaw/blob/main/workspace/USER.md"
click node_heartbeat "https://github.com/chatprd/tradclaw/blob/main/workspace/HEARTBEAT.md"
click node_memory_file "https://github.com/chatprd/tradclaw/blob/main/workspace/MEMORY.md"
click node_memory_dir "https://github.com/chatprd/tradclaw/tree/main/workspace/memory"
click node_resources "https://github.com/chatprd/tradclaw/tree/main/workspace/resources"
click node_templates "https://github.com/chatprd/tradclaw/tree/main/workspace/resources/templates"
click node_skills_root "https://github.com/chatprd/tradclaw/blob/main/skills/README.md"
click node_meal_skill "https://github.com/chatprd/tradclaw/blob/main/skills/meal-planner/SKILL.md"
click node_school_skill "https://github.com/chatprd/tradclaw/blob/main/skills/school-triage/SKILL.md"
click node_homework_skill "https://github.com/chatprd/tradclaw/blob/main/skills/homework-log/SKILL.md"
click node_cron_root "https://github.com/chatprd/tradclaw/blob/main/cron/README.md"
click node_cron_jobs "https://github.com/chatprd/tradclaw/blob/main/cron/jobs.template.json"

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_readme toneBlue
class node_bootstrap_entry,node_interview,node_module_guide,node_apply_results,node_primitives toneAmber
class node_workspace_root,node_agents,node_soul,node_tools,node_identity,node_user,node_heartbeat,node_memory_file,node_memory_dir,node_resources,node_templates toneMint
class node_skills_root,node_meal_skill,node_school_skill,node_homework_skill toneRose
class node_cron_root,node_cron_jobs toneIndigo
```

## Components

### Repository

Top-level scaffold and documentation

- [Repo README](https://github.com/chatprd/tradclaw/blob/main/README.md): overview · High-level repository orientation · `README.md`

### Tradclaw setup

Interview-driven onboarding and tailoring flow

- [Bootstrap](https://github.com/chatprd/tradclaw/blob/main/tradclaw/BOOTSTRAP.md): setup entrypoint · Primary setup runbook · `tradclaw/BOOTSTRAP.md`
- [Interview](https://github.com/chatprd/tradclaw/blob/main/tradclaw/onboarding-interview.md): onboarding flow · Household needs discovery and tailoring questions · `tradclaw/onboarding-interview.md`
- [Module guide](https://github.com/chatprd/tradclaw/blob/main/tradclaw/module-selection-guide.md): selection guide · Rules for choosing which modules to enable · `tradclaw/module-selection-guide.md`
- [Apply results](https://github.com/chatprd/tradclaw/blob/main/tradclaw/apply-interview-results.md): tailoring step · Translates interview answers into a concrete workspace · `tradclaw/apply-interview-results.md`
- [Primitives](https://github.com/chatprd/tradclaw/blob/main/tradclaw/openclaw-primitives.md): openclaw model · Core concepts used to assemble the household scaffold · `tradclaw/openclaw-primitives.md`

### Workspace runtime

Persistent household operating environment and state

- [Workspace root](https://github.com/chatprd/tradclaw/blob/main/workspace/README.md): household root · Persistent OpenClaw-style operating environment · `workspace/README.md`
- [Agents](https://github.com/chatprd/tradclaw/blob/main/workspace/AGENTS.md): coordination · Operating instructions for assistants in the household · `workspace/AGENTS.md`
- [Soul policy](https://github.com/chatprd/tradclaw/blob/main/workspace/SOUL.md): governance · Identity, permission, and trust boundary · `workspace/SOUL.md`
- [Tools policy](https://github.com/chatprd/tradclaw/blob/main/workspace/TOOLS.md): governance · Approved tools and gateway rules · `workspace/TOOLS.md`
- [Identity](https://github.com/chatprd/tradclaw/blob/main/workspace/IDENTITY.md): persona state · Who the assistant is serving · `workspace/IDENTITY.md`
- [User profile](https://github.com/chatprd/tradclaw/blob/main/workspace/USER.md): persona state · Household user context and preferences · `workspace/USER.md`
- [Heartbeat](https://github.com/chatprd/tradclaw/blob/main/workspace/HEARTBEAT.md): status · Operational attention and current status · `workspace/HEARTBEAT.md`
- [Memory file](https://github.com/chatprd/tradclaw/blob/main/workspace/MEMORY.md): state store · Persistent markdown memory ledger · `workspace/MEMORY.md`
- [Memory vault](https://github.com/chatprd/tradclaw/tree/main/workspace/memory): state store · Structured continuity notes and context · `workspace/memory`
- [Resources](https://github.com/chatprd/tradclaw/tree/main/workspace/resources): domain data · Household knowledge and routine content · `workspace/resources`
- [Templates](https://github.com/chatprd/tradclaw/tree/main/workspace/resources/templates): normalized shapes · Reusable output/input formats for household artifacts · `workspace/resources/templates`

### Skills

Optional modular capabilities

- [Skills hub](https://github.com/chatprd/tradclaw/blob/main/skills/README.md): capability modules · Collection of optional standalone skill bundles · `skills/README.md`
- [Meal planner](https://github.com/chatprd/tradclaw/blob/main/skills/meal-planner/SKILL.md): skill module · Meal planning capability bundle · `skills/meal-planner/SKILL.md`
- [School triage](https://github.com/chatprd/tradclaw/blob/main/skills/school-triage/SKILL.md): skill module · School notices and follow-up triage · `skills/school-triage/SKILL.md`
- [Homework log](https://github.com/chatprd/tradclaw/blob/main/skills/homework-log/SKILL.md): skill module · Homework tracking and reinforcement support · `skills/homework-log/SKILL.md`

### Cron

Optional scheduled automation examples

- [Cron examples](https://github.com/chatprd/tradclaw/blob/main/cron/README.md): scheduler · Optional scheduled automation patterns · `cron/README.md`
- [Job template](https://github.com/chatprd/tradclaw/blob/main/cron/jobs.template.json): schedule spec · Example recurring job configuration · `cron/jobs.template.json`

## Connections

- Repo README → Bootstrap: introduces · Repository overview points to the setup entrypoint
- Bootstrap → Interview: drives · Bootstrap begins an interview-based tailoring flow
- Interview → Module guide: selects · Answers determine which modules should be enabled
- Module guide → Apply results: feeds · Selection guidance is applied to the tailored household root
- Primitives → Bootstrap: frames · Shared concepts define how the scaffold is assembled
- Apply results → Workspace root: materializes · Interview outputs are written into the workspace instance
- Workspace root → Agents: contains · Workspace root includes the operating instructions
- Workspace root → Soul policy: contains · Policy and trust boundary live in the workspace
- Workspace root → Tools policy: contains · Approved tool access is defined here
- Workspace root → Identity: contains · Assistant identity is persisted here
- Workspace root → User profile: contains · User and household profile are stored here
- Workspace root → Heartbeat: contains · Operational attention and status tracking
- Workspace root → Memory file: contains · Markdown memory ledger is part of the state boundary
- Memory file → Memory vault: extends · Structured memory folder complements the flat memory file
- Workspace root → Resources: contains · Household domain content and routines
- Resources → Templates: standardizes · Templates normalize common artifact shapes
- Skills hub → Meal planner: includes · Skills hub exposes modular capability bundles
- Skills hub → School triage: includes · Skills hub exposes modular capability bundles
- Skills hub → Homework log: includes · Skills hub exposes modular capability bundles
- Meal planner → Resources: reads/writes · Meal planning skill operates on meal and shopping resources
- School triage → Resources: reads/writes · School triage skill operates on school resources
- Homework log → Resources: reads/writes · Homework skill operates on homework resources
- Cron examples → Job template: examples · Cron layer is represented by example job definitions
- Cron examples → Workspace root: triggers · Scheduled checks feed tasks into the same workspace boundary
- Soul policy → Tools policy: governs · Policy and gateway rules together enforce trust boundaries
- Soul policy → Resources: protects · Family and child data are treated as high-stakes data
- Tools policy → Cron examples: filters · Inbound cron payloads are treated as untrusted inputs
