# frankxai/prompt-engine architecture

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

- Interactive diagram: https://gitdiagram.com/frankxai/prompt-engine
- Repository: https://github.com/frankxai/prompt-engine

## Overview

Prompt Engine is a Claude Code prompt-workflow system: the user’s request is routed by the Conductor into a canonical flow, which coordinates specialist agents to produce, evaluate, curate, or introspect on prompts. Separately, its local CLI composes task packets from catalogs and can prepare—but never dispatch—GitHub issue payloads. Flow sequences and agent roles are documented in the README; CLI-to-packet calls are visible in source. Flow implementations and several agent definitions were not sampled, so their internal interactions are shown only where documented.

Main entry points: [`agents/prompt-conductor.md`](https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-conductor.md) (Prompt Conductor), [`flows`](https://github.com/frankxai/prompt-engine/tree/main/flows) (Design flow), [`lib/cli.mjs`](https://github.com/frankxai/prompt-engine/blob/main/lib/cli.mjs) (Prompt Engine CLI), [`agents/prompt-evaluator.md`](https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-evaluator.md) (Prompt Evaluator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Workflow orchestration"]
  node_conductor["Prompt Conductor"]
  node_design["Design flow"]
  node_optimize["Optimize flow"]
  node_evaluate["Evaluate flow"]
  node_harvest["Harvest flow"]
  node_curate["Curate flow"]
  node_introspect["Introspect flow"]
  node_profile["Profile flow"]
  node_knowledge["Knowledge-base flow"]
end

subgraph group_craft["Prompt craft"]
  node_architect["Prompt Architect"]
  node_optimizer["Prompt Optimizer"]
  node_claude["Claude Specialist"]
  node_gpt["GPT Specialist"]
  node_gemini["Gemini Specialist"]
  node_oss["Open-source Specialist"]
end

subgraph group_quality["Quality and library"]
  node_evaluator["Prompt Evaluator"]
  node_redteam["Red Team<br/>[prompt-red-team.md]"]
  node_librarian["Prompt Librarian"]
  node_harvester["Prompt Harvester"]
end

subgraph group_psyche["Psyche profiles"]
  node_cartographer["Psyche Cartographer"]
  node_psychometrist["Psychometrist"]
end

subgraph group_packets["Task packets"]
  node_cli["Prompt Engine CLI<br/>[cli.mjs]"]
  node_packet["Packet composer<br/>[task-packets.mjs]"]
  node_catalog["Task catalog"]
end

node_user(("Prompt user"))
node_github(("GitHub issue destination"))

node_user -->|"submits request"| node_conductor
node_conductor -->|"routes request"| node_design
node_conductor -->|"routes request"| node_optimize
node_conductor -->|"routes request"| node_evaluate
node_conductor -->|"routes request"| node_harvest
node_conductor -->|"routes request"| node_curate
node_conductor -->|"routes request"| node_introspect
node_conductor -->|"routes request"| node_profile
node_conductor -->|"routes request"| node_knowledge
node_design -->|"invokes first"| node_architect
node_design -->|"uses lab specialist"| node_claude
node_design -->|"invokes next"| node_redteam
node_design -->|"invokes last"| node_evaluator
node_optimize -->|"invokes first"| node_optimizer
node_optimize -->|"uses lab specialist"| node_claude
node_optimize -->|"invokes last"| node_evaluator
node_evaluate -->|"invokes first"| node_evaluator
node_evaluate -->|"invokes next"| node_redteam
node_harvest -->|"invokes first"| node_harvester
node_harvest -->|"invokes next"| node_redteam
node_harvest -->|"invokes last"| node_librarian
node_curate -->|"invokes first"| node_librarian
node_curate -->|"invokes next"| node_optimizer
node_curate -->|"invokes last"| node_evaluator
node_introspect -->|"invokes solo"| node_cartographer
node_profile -->|"invokes first"| node_psychometrist
node_profile -->|"invokes next"| node_cartographer
node_knowledge -->|"invokes first"| node_architect
node_knowledge -->|"invokes next"| node_librarian
node_knowledge -->|"invokes last"| node_evaluator
node_user -->|"runs command"| node_cli
node_cli -->|"composes packet"| node_packet
node_cli -->|"reads receipt"| node_packet
node_catalog -->|"supplies catalog path"| node_cli
node_cli -->|"prepares dry run"| node_github

click node_conductor "https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-conductor.md"
click node_design "https://github.com/frankxai/prompt-engine/tree/main/flows"
click node_optimize "https://github.com/frankxai/prompt-engine/tree/main/flows"
click node_evaluate "https://github.com/frankxai/prompt-engine/tree/main/flows"
click node_harvest "https://github.com/frankxai/prompt-engine/tree/main/flows"
click node_curate "https://github.com/frankxai/prompt-engine/tree/main/flows"
click node_introspect "https://github.com/frankxai/prompt-engine/tree/main/flows"
click node_profile "https://github.com/frankxai/prompt-engine/tree/main/flows"
click node_knowledge "https://github.com/frankxai/prompt-engine/tree/main/flows"
click node_architect "https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-architect.md"
click node_optimizer "https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-optimizer.md"
click node_claude "https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-claude-specialist.md"
click node_gpt "https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-gpt-specialist.md"
click node_gemini "https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-gemini-specialist.md"
click node_oss "https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-oss-specialist.md"
click node_evaluator "https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-evaluator.md"
click node_redteam "https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-red-team.md"
click node_librarian "https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-librarian.md"
click node_harvester "https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-harvester.md"
click node_cartographer "https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-psyche-cartographer.md"
click node_psychometrist "https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-psychometrist.md"
click node_cli "https://github.com/frankxai/prompt-engine/blob/main/lib/cli.mjs"
click node_packet "https://github.com/frankxai/prompt-engine/blob/main/lib/task-packets.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_conductor,node_design,node_optimize,node_evaluate,node_harvest,node_curate,node_introspect,node_profile,node_knowledge,node_user toneBlue
class node_architect,node_optimizer,node_claude,node_gpt,node_gemini,node_oss toneAmber
class node_evaluator,node_redteam,node_librarian,node_harvester toneMint
class node_cartographer,node_psychometrist toneRose
class node_cli,node_packet,node_catalog,node_github toneIndigo
```

## Components

### Workflow orchestration

- [Prompt Conductor](https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-conductor.md): `agents/prompt-conductor.md`
- [Design flow](https://github.com/frankxai/prompt-engine/tree/main/flows): `flows`
- [Optimize flow](https://github.com/frankxai/prompt-engine/tree/main/flows): `flows`
- [Evaluate flow](https://github.com/frankxai/prompt-engine/tree/main/flows): `flows`
- [Harvest flow](https://github.com/frankxai/prompt-engine/tree/main/flows): `flows`
- [Curate flow](https://github.com/frankxai/prompt-engine/tree/main/flows): `flows`
- [Introspect flow](https://github.com/frankxai/prompt-engine/tree/main/flows): `flows`
- [Profile flow](https://github.com/frankxai/prompt-engine/tree/main/flows): `flows`
- [Knowledge-base flow](https://github.com/frankxai/prompt-engine/tree/main/flows): `flows`

### Prompt craft

- [Prompt Architect](https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-architect.md): `agents/prompt-architect.md`
- [Prompt Optimizer](https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-optimizer.md): `agents/prompt-optimizer.md`
- [Claude Specialist](https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-claude-specialist.md): `agents/prompt-claude-specialist.md`
- [GPT Specialist](https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-gpt-specialist.md): `agents/prompt-gpt-specialist.md`
- [Gemini Specialist](https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-gemini-specialist.md): `agents/prompt-gemini-specialist.md`
- [Open-source Specialist](https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-oss-specialist.md): `agents/prompt-oss-specialist.md`

### Quality and library

- [Prompt Evaluator](https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-evaluator.md): `agents/prompt-evaluator.md`
- [Red Team](https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-red-team.md): `agents/prompt-red-team.md`
- [Prompt Librarian](https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-librarian.md): `agents/prompt-librarian.md`
- [Prompt Harvester](https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-harvester.md): `agents/prompt-harvester.md`

### Psyche profiles

- [Psyche Cartographer](https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-psyche-cartographer.md): `agents/prompt-psyche-cartographer.md`
- [Psychometrist](https://github.com/frankxai/prompt-engine/blob/main/agents/prompt-psychometrist.md): `agents/prompt-psychometrist.md`

### Task packets

- [Prompt Engine CLI](https://github.com/frankxai/prompt-engine/blob/main/lib/cli.mjs): `lib/cli.mjs`
- [Packet composer](https://github.com/frankxai/prompt-engine/blob/main/lib/task-packets.mjs): `lib/task-packets.mjs`
- **Task catalog**

### Other components

- **Prompt user**
- **GitHub issue destination**

## Connections

- Prompt user → Prompt Conductor: submits request (evidence: `README.md`)
- Prompt Conductor → Design flow: routes request (evidence: `README.md`)
- Prompt Conductor → Optimize flow: routes request (evidence: `README.md`)
- Prompt Conductor → Evaluate flow: routes request (evidence: `README.md`)
- Prompt Conductor → Harvest flow: routes request (evidence: `README.md`)
- Prompt Conductor → Curate flow: routes request (evidence: `README.md`)
- Prompt Conductor → Introspect flow: routes request (evidence: `README.md`)
- Prompt Conductor → Profile flow: routes request (evidence: `README.md`)
- Prompt Conductor → Knowledge-base flow: routes request (evidence: `README.md`)
- Design flow → Prompt Architect: invokes first (evidence: `README.md`)
- Design flow → Claude Specialist: uses lab specialist (evidence: `README.md`)
- Design flow → Red Team: invokes next (evidence: `README.md`)
- Design flow → Prompt Evaluator: invokes last (evidence: `README.md`)
- Optimize flow → Prompt Optimizer: invokes first (evidence: `README.md`)
- Optimize flow → Claude Specialist: uses lab specialist (evidence: `README.md`)
- Optimize flow → Prompt Evaluator: invokes last (evidence: `README.md`)
- Evaluate flow → Prompt Evaluator: invokes first (evidence: `README.md`)
- Evaluate flow → Red Team: invokes next (evidence: `README.md`)
- Harvest flow → Prompt Harvester: invokes first (evidence: `README.md`)
- Harvest flow → Red Team: invokes next (evidence: `README.md`)
- Harvest flow → Prompt Librarian: invokes last (evidence: `README.md`)
- Curate flow → Prompt Librarian: invokes first (evidence: `README.md`)
- Curate flow → Prompt Optimizer: invokes next (evidence: `README.md`)
- Curate flow → Prompt Evaluator: invokes last (evidence: `README.md`)
- Introspect flow → Psyche Cartographer: invokes solo (evidence: `README.md`)
- Profile flow → Psychometrist: invokes first (evidence: `README.md`)
- Profile flow → Psyche Cartographer: invokes next (evidence: `README.md`)
- Knowledge-base flow → Prompt Architect: invokes first (evidence: `README.md`)
- Knowledge-base flow → Prompt Librarian: invokes next (evidence: `README.md`)
- Knowledge-base flow → Prompt Evaluator: invokes last (evidence: `README.md`)
- Prompt user → Prompt Engine CLI: runs command (evidence: `README.md`)
- Prompt Engine CLI → Packet composer: composes packet (evidence: `lib/cli.mjs`)
- Prompt Engine CLI → Packet composer: reads receipt (evidence: `lib/cli.mjs`)
- Task catalog → Prompt Engine CLI: supplies catalog path (evidence: `README.md`)
- Prompt Engine CLI → GitHub issue destination: prepares dry run (evidence: `README.md`)
