# rfxlamia/pocketto architecture

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

- Interactive diagram: https://gitdiagram.com/rfxlamia/pocketto
- Repository: https://github.com/rfxlamia/pocketto

## Overview

Pocketto provides structured AI coding workflows as installable skills, with a local-first Core and an optional Enterprise adapter. The documented feature path moves from problem exploration and specification through planning, task structuring, delegated development and review, then gated closure. The repository tree sampled here primarily exposes the CLI and lifecycle machinery behind those workflows, plus Enterprise reconciliation; skill implementation files are not present in this tree. Edges reflect sampled source references or explicit README statements, so some workflow handoffs remain undocumented at code level.

Main entry points: [`cli/lib/lifecycle-transition.js`](https://github.com/rfxlamia/pocketto/blob/main/cli/lib/lifecycle-transition.js) (Lifecycle transitions), [`cli/index.js`](https://github.com/rfxlamia/pocketto/blob/main/cli/index.js) (CLI entry), [`cli/commands/log.js`](https://github.com/rfxlamia/pocketto/blob/main/cli/commands/log.js) (Plan progress log), [`enterprise/dispatch.js`](https://github.com/rfxlamia/pocketto/blob/main/enterprise/dispatch.js) (Event dispatch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core CLI and plans"]
  node_cli["CLI entry<br/>[index.js]"]
  node_planning["Plan structuring<br/>[structure.js]"]
  node_plan_log["Plan progress log<br/>[log.js]"]
  node_git_workflow["Git workflow helpers<br/>[git-worktree.js]"]
end

subgraph group_lifecycle["Lifecycle coordination"]
  node_transition["Lifecycle transitions"]
  node_contract["Event contract"]
  node_state_store[("Lifecycle state store<br/>[lifecycle-store.js]")]
  node_event_log[("Event log<br/>[logjson.js]")]
  node_adapter["Adapter compatibility"]
end

subgraph group_enterprise["Enterprise reconciliation"]
  node_enterprise_cli["Enterprise CLI<br/>[cli.js]"]
  node_dispatch["Event dispatch<br/>[dispatch.js]"]
  node_phase_handler["Phase reconciliation<br/>[phase-handler.js]"]
  node_closure_handler["Plan closeout<br/>[closure-handler.js]"]
  node_enterprise_meta[("Enterprise metadata<br/>[meta.js]")]
end

subgraph group_learning["Standalone support"]
  node_education["Education workflow<br/>[edu.js]"]
end

node_agent(("Coding agent"))
node_github["GitHub"]

node_agent -->|"invokes"| node_cli
node_cli -->|"routes"| node_planning
node_cli -->|"routes"| node_plan_log
node_plan_log -->|"records transitions"| node_transition
node_transition -->|"validates events"| node_contract
node_transition -->|"commits state"| node_state_store
node_transition -->|"projects events"| node_event_log
node_transition -->|"dispatches through"| node_adapter
node_plan_log -->|"reads Git state"| node_git_workflow
node_enterprise_cli -.->|"dispatches events"| node_dispatch
node_dispatch -.->|"routes phase events"| node_phase_handler
node_dispatch -.->|"routes close events"| node_closure_handler
node_phase_handler -->|"reads and writes"| node_enterprise_meta
node_closure_handler -->|"reads metadata"| node_enterprise_meta
node_closure_handler -->|"reconciles remotely"| node_github
node_phase_handler -.->|"reconciles remotely"| node_github
node_agent -->|"opts into learning"| node_education

click node_cli "https://github.com/rfxlamia/pocketto/blob/main/cli/index.js"
click node_planning "https://github.com/rfxlamia/pocketto/blob/main/cli/commands/structure.js"
click node_plan_log "https://github.com/rfxlamia/pocketto/blob/main/cli/commands/log.js"
click node_git_workflow "https://github.com/rfxlamia/pocketto/blob/main/cli/lib/git-worktree.js"
click node_transition "https://github.com/rfxlamia/pocketto/blob/main/cli/lib/lifecycle-transition.js"
click node_contract "https://github.com/rfxlamia/pocketto/blob/main/cli/lib/lifecycle-contract.js"
click node_state_store "https://github.com/rfxlamia/pocketto/blob/main/cli/lib/lifecycle-store.js"
click node_event_log "https://github.com/rfxlamia/pocketto/blob/main/cli/lib/logjson.js"
click node_adapter "https://github.com/rfxlamia/pocketto/blob/main/cli/lib/lifecycle-adapter.js"
click node_enterprise_cli "https://github.com/rfxlamia/pocketto/blob/main/enterprise/cli.js"
click node_dispatch "https://github.com/rfxlamia/pocketto/blob/main/enterprise/dispatch.js"
click node_phase_handler "https://github.com/rfxlamia/pocketto/blob/main/enterprise/phase-handler.js"
click node_closure_handler "https://github.com/rfxlamia/pocketto/blob/main/enterprise/closure-handler.js"
click node_enterprise_meta "https://github.com/rfxlamia/pocketto/blob/main/enterprise/meta.js"
click node_education "https://github.com/rfxlamia/pocketto/blob/main/cli/commands/edu.js"

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_cli,node_planning,node_plan_log,node_git_workflow toneBlue
class node_transition,node_contract,node_state_store,node_event_log,node_adapter toneAmber
class node_enterprise_cli,node_dispatch,node_phase_handler,node_closure_handler,node_enterprise_meta toneMint
class node_education toneRose
class node_agent,node_github toneIndigo
```

## Components

### Core CLI and plans

- [CLI entry](https://github.com/rfxlamia/pocketto/blob/main/cli/index.js): `cli/index.js`
- [Plan structuring](https://github.com/rfxlamia/pocketto/blob/main/cli/commands/structure.js): `cli/commands/structure.js`
- [Plan progress log](https://github.com/rfxlamia/pocketto/blob/main/cli/commands/log.js): `cli/commands/log.js`
- [Git workflow helpers](https://github.com/rfxlamia/pocketto/blob/main/cli/lib/git-worktree.js): `cli/lib/git-worktree.js`

### Lifecycle coordination

- [Lifecycle transitions](https://github.com/rfxlamia/pocketto/blob/main/cli/lib/lifecycle-transition.js): `cli/lib/lifecycle-transition.js`
- [Event contract](https://github.com/rfxlamia/pocketto/blob/main/cli/lib/lifecycle-contract.js): `cli/lib/lifecycle-contract.js`
- [Lifecycle state store](https://github.com/rfxlamia/pocketto/blob/main/cli/lib/lifecycle-store.js): `cli/lib/lifecycle-store.js`
- [Event log](https://github.com/rfxlamia/pocketto/blob/main/cli/lib/logjson.js): `cli/lib/logjson.js`
- [Adapter compatibility](https://github.com/rfxlamia/pocketto/blob/main/cli/lib/lifecycle-adapter.js): `cli/lib/lifecycle-adapter.js`

### Enterprise reconciliation

- [Enterprise CLI](https://github.com/rfxlamia/pocketto/blob/main/enterprise/cli.js): `enterprise/cli.js`
- [Event dispatch](https://github.com/rfxlamia/pocketto/blob/main/enterprise/dispatch.js): `enterprise/dispatch.js`
- [Phase reconciliation](https://github.com/rfxlamia/pocketto/blob/main/enterprise/phase-handler.js): `enterprise/phase-handler.js`
- [Plan closeout](https://github.com/rfxlamia/pocketto/blob/main/enterprise/closure-handler.js): `enterprise/closure-handler.js`
- [Enterprise metadata](https://github.com/rfxlamia/pocketto/blob/main/enterprise/meta.js): `enterprise/meta.js`

### Standalone support

- [Education workflow](https://github.com/rfxlamia/pocketto/blob/main/cli/commands/edu.js): `cli/commands/edu.js`

### Other components

- **Coding agent**
- **GitHub**

## Connections

- Coding agent → CLI entry: invokes
- CLI entry → Plan structuring: routes (evidence: `cli/index.js`)
- CLI entry → Plan progress log: routes (evidence: `cli/index.js`)
- Plan progress log → Lifecycle transitions: records transitions (evidence: `cli/commands/log.js`)
- Lifecycle transitions → Event contract: validates events (evidence: `cli/lib/lifecycle-transition.js`)
- Lifecycle transitions → Lifecycle state store: commits state (evidence: `cli/lib/lifecycle-transition.js`)
- Lifecycle transitions → Event log: projects events (evidence: `cli/lib/lifecycle-transition.js`)
- Lifecycle transitions → Adapter compatibility: dispatches through (evidence: `cli/lib/lifecycle-transition.js`)
- Plan progress log → Git workflow helpers: reads Git state (evidence: `cli/commands/log.js`)
- Enterprise CLI → Event dispatch: dispatches events
- Event dispatch → Phase reconciliation: routes phase events
- Event dispatch → Plan closeout: routes close events
- Phase reconciliation → Enterprise metadata: reads and writes (evidence: `enterprise/phase-handler.js`)
- Plan closeout → Enterprise metadata: reads metadata (evidence: `enterprise/closure-handler.js`)
- Plan closeout → GitHub: reconciles remotely (evidence: `enterprise/closure-handler.js`)
- Phase reconciliation → GitHub: reconciles remotely
- Coding agent → Education workflow: opts into learning
