# saleemmbayed-sketch/saleems-ai-factory architecture

> Architecture diagram of the GitHub repository saleemmbayed-sketch/saleems-ai-factory, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/saleemmbayed-sketch/saleems-ai-factory
- Repository: https://github.com/saleemmbayed-sketch/saleems-ai-factory

## Overview

#### Purpose and Entry Points
Saleem’s AI Factory is a Markdown-first catalog of domain-specific AI-agent definitions, installable into multiple coding-agent runtimes. Primary user entry points are `README.md`, `scripts/convert.sh`, and `scripts/install.sh`. It is not a hosted application: its product is curated prompt/persona content plus shell/Python tooling that transforms and deploys it.

#### Canonical Agent Catalog
Each agent is a standalone Markdown specification, organized by business division. These files are the source of truth for identity, workflows, expected deliverables, and operating constraints. Major catalog domains include `engineering/`, `design/`, `marketing/`, `security/`, and `specialized/`; e.g., `engineering/engineering-ai-engineer.md`, `security/security-architect.md`, and `specialized/agents-orchestrator.md`. Directory location encodes the division, while filename conventions provide agent identifiers.

#### Metadata and Selection Model
`divisions.json` centrally defines division membership and supports division-based installation. `tools.json` defines supported target tool formats/capabilities. The installer accepts individual agent names or divisions, making these registries the boundary between the source catalog and user-selected deployment. `scripts/agents-to-install.example` provides a declarative selection input.

#### Conversion and Installation Pipeline
The normal flow is: canonical agent Markdown → conversion for a target runtime → installation into tool-specific user or project locations. `scripts/convert.sh` performs batch conversion; `scripts/install.sh` discovers/selects tools and agents, then installs them. Shared shell behavior is factored into `scripts/lib.sh`. This pipeline isolates source content from generated runtime representations and permits one catalog to target many consumers.

#### Runtime Adapters and External Tools
Integration documentation and target-specific conventions live under `integrations/`, including `integrations/claude-code/README.md`, `integrations/cursor/README.md`, and `integrations/codex/README.md`. Supported external runtimes include Claude Code, GitHub Copilot, Cursor, Gemini CLI, OpenCode, Codex, Aider, Windsurf, Hermes, and others. Hermes has dedicated plugin build/validation logic in `scripts/build-hermes-plugin.py` and `scripts/check-hermes-plugin.py`; MCP memory integration includes setup and an augmented agent at `integrations/mcp-memory/setup.sh` and `integrations/mcp-memory/backend-architect-with-memory.md`.

#### Guided Multi-Agent Workflows
The strategy layer turns individual roles into coordinated delivery processes. `strategy/nexus-strategy.md` and `strategy/QUICKSTART.md` define the operating model; phased playbooks such as `strategy/playbooks/phase-0-discovery.md` and `strategy/playbooks/phase-3-build.md` sequence specialist activation. Scenario runbooks in `strategy/runbooks.json` and `strategy/runbooks/` bind work types—such as startup MVPs or incident response—to those stages. Coordination artifacts in `strategy/coordination/` define handoffs and activation prompts.

#### Content Quality and Repository Governance
Validation is CI-driven GitHub Actions, with workflows such as `.github/workflows/lint-agents.yml`, `.github/workflows/check-divisions.yml`, and `.github/workflows/check-runbooks.yml`. Corresponding scripts—`scripts/lint-agents.sh`, `scripts/check-divisions.sh`, and `scripts/check-runbooks.sh`—enforce catalog consistency, metadata alignment, and workflow integrity before changes merge. Chinese localization is a separate content pipeline under `scripts/i18n/`, preserving canonical agent definitions while enabling localized names.

Main entry points: [`engineering/engineering-ai-engineer.md`](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/engineering/engineering-ai-engineer.md) (Agent Specifications), [`scripts/install.sh`](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/scripts/install.sh) (Installer), [`scripts/lint-agents.sh`](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/scripts/lint-agents.sh) (Validation Scripts), [`scripts/convert.sh`](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/scripts/convert.sh) (Batch Converter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Canonical Catalog"]
  node_agents["Agent Specifications<br/>Markdown catalog"]
  node_design["Design Division<br/>catalog division"]
  node_marketing["Marketing Division<br/>catalog division"]
  node_security["Security Division<br/>catalog division"]
  node_specialized["Specialized Division<br/>catalog division"]
  node_divisions[("Division Registry<br/>metadata registry<br/>[divisions.json]")]
end

subgraph group_deployment["Conversion &amp; Deployment"]
  node_tools[("Tool Registry<br/>metadata registry<br/>[tools.json]")]
  node_selection["Selection Manifest<br/>selection input"]
  node_installer["Installer<br/>shell pipeline<br/>[install.sh]"]
  node_converter["Batch Converter<br/>shell pipeline<br/>[convert.sh]"]
  node_shelllib["Shared Shell Library<br/>[lib.sh]"]
  node_integrations["Runtime Integrations<br/>adapter documentation<br/>[README.md]"]
  node_hermes["Hermes Plugin Tooling<br/>Python tooling"]
  node_mcp_memory["MCP Memory Adapter<br/>runtime integration<br/>[setup.sh]"]
end

subgraph group_strategy["Multi-Agent Strategy"]
  node_strategy_model["Nexus Strategy<br/>operating model<br/>[nexus-strategy.md]"]
  node_playbooks["Phased Playbooks<br/>workflow stages"]
  node_runbooks[("Scenario Runbooks<br/>workflow registry<br/>[runbooks.json]")]
  node_coordination["Coordination Artifacts<br/>handoff prompts"]
end

subgraph group_quality["Quality &amp; Governance"]
  node_ci{{"Validation CI<br/>GitHub Actions<br/>[lint-agents.yml]"}}
  node_validators["Validation Scripts<br/>shell validators<br/>[lint-agents.sh]"]
  node_i18n["Chinese Localization<br/>content pipeline<br/>[README.md]"]
end

node_readme["Repository Guide<br/>documentation<br/>[README.md]"]

node_readme -->|"introduces"| node_agents
node_agents -->|"includes"| node_design
node_agents -->|"includes"| node_marketing
node_agents -->|"includes"| node_security
node_agents -->|"includes"| node_specialized
node_divisions -->|"indexes membership"| node_agents
node_selection -->|"selects"| node_installer
node_divisions -->|"resolves divisions"| node_installer
node_tools -->|"defines targets"| node_installer
node_installer -->|"invokes"| node_converter
node_agents -->|"canonical input"| node_converter
node_shelllib -.->|"shared behavior"| node_installer
node_shelllib -.->|"shared behavior"| node_converter
node_converter -->|"generates for"| node_integrations
node_tools -->|"documents targets"| node_integrations
node_hermes -->|"builds plugin"| node_integrations
node_mcp_memory -->|"extends"| node_integrations
node_agents -->|"provides roles"| node_strategy_model
node_strategy_model -->|"defines phases"| node_playbooks
node_runbooks -->|"binds scenarios"| node_playbooks
node_coordination -->|"supports handoffs"| node_playbooks
node_ci -->|"runs"| node_validators
node_validators -->|"validates catalog"| node_agents
node_validators -->|"checks alignment"| node_divisions
node_validators -->|"checks integrity"| node_runbooks
node_i18n -.->|"localizes"| node_agents

click node_readme "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/README.md"
click node_agents "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/engineering/engineering-ai-engineer.md"
click node_design "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/design/design-ui-designer.md"
click node_marketing "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/marketing/marketing-content-creator.md"
click node_security "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/security/security-architect.md"
click node_specialized "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/specialized/agents-orchestrator.md"
click node_divisions "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/divisions.json"
click node_tools "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/tools.json"
click node_selection "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/scripts/agents-to-install.example"
click node_installer "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/scripts/install.sh"
click node_converter "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/scripts/convert.sh"
click node_shelllib "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/scripts/lib.sh"
click node_integrations "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/integrations/README.md"
click node_hermes "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/scripts/build-hermes-plugin.py"
click node_mcp_memory "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/integrations/mcp-memory/setup.sh"
click node_strategy_model "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/strategy/nexus-strategy.md"
click node_playbooks "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/strategy/playbooks/phase-0-discovery.md"
click node_runbooks "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/strategy/runbooks.json"
click node_coordination "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/strategy/coordination/agent-activation-prompts.md"
click node_ci "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/.github/workflows/lint-agents.yml"
click node_validators "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/scripts/lint-agents.sh"
click node_i18n "https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/scripts/i18n/README.md"

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_agents,node_design,node_marketing,node_security,node_specialized,node_divisions toneBlue
class node_tools,node_selection,node_installer,node_converter,node_shelllib,node_integrations,node_hermes,node_mcp_memory toneAmber
class node_strategy_model,node_playbooks,node_runbooks,node_coordination toneMint
class node_ci,node_validators,node_i18n toneRose
class node_readme toneNeutral
```

## Components

### Canonical Catalog

Markdown agent definitions organized by division.

- [Agent Specifications](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/engineering/engineering-ai-engineer.md): Markdown catalog · Canonical identities, workflows, deliverables, and constraints. · `engineering/engineering-ai-engineer.md`
- [Design Division](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/design/design-ui-designer.md): catalog division · `design/design-ui-designer.md`
- [Marketing Division](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/marketing/marketing-content-creator.md): catalog division · `marketing/marketing-content-creator.md`
- [Security Division](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/security/security-architect.md): catalog division · `security/security-architect.md`
- [Specialized Division](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/specialized/agents-orchestrator.md): catalog division · `specialized/agents-orchestrator.md`
- [Division Registry](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/divisions.json): metadata registry · Maps agents to installable divisions. · `divisions.json`

### Conversion & Deployment

Transforms selected agents for coding-agent runtimes.

- [Tool Registry](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/tools.json): metadata registry · Defines supported target formats and capabilities. · `tools.json`
- [Selection Manifest](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/scripts/agents-to-install.example): selection input · Declarative agent and division selection. · `scripts/agents-to-install.example`
- [Installer](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/scripts/install.sh): shell pipeline · Selects agents and tools, then deploys runtime files. · `scripts/install.sh`
- [Batch Converter](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/scripts/convert.sh): shell pipeline · Converts canonical Markdown for a target runtime. · `scripts/convert.sh`
- [Shared Shell Library](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/scripts/lib.sh): shell library · `scripts/lib.sh`
- [Runtime Integrations](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/integrations/README.md): adapter documentation · Target-specific conventions and installation guidance. · `integrations/README.md`
- [Hermes Plugin Tooling](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/scripts/build-hermes-plugin.py): Python tooling · Builds and validates the Hermes plugin. · `scripts/build-hermes-plugin.py`
- [MCP Memory Adapter](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/integrations/mcp-memory/setup.sh): runtime integration · Setup plus a memory-augmented agent. · `integrations/mcp-memory/setup.sh`

### Multi-Agent Strategy

Playbooks and runbooks coordinate specialist roles.

- [Nexus Strategy](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/strategy/nexus-strategy.md): operating model · Defines coordinated multi-agent delivery. · `strategy/nexus-strategy.md`
- [Phased Playbooks](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/strategy/playbooks/phase-0-discovery.md): workflow stages · Sequence specialist activation through delivery phases. · `strategy/playbooks/phase-0-discovery.md`
- [Scenario Runbooks](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/strategy/runbooks.json): workflow registry · Maps work scenarios to staged workflows. · `strategy/runbooks.json`
- [Coordination Artifacts](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/strategy/coordination/agent-activation-prompts.md): handoff prompts · Defines handoffs and activation prompts. · `strategy/coordination/agent-activation-prompts.md`

### Quality & Governance

CI validates catalog and strategy consistency.

- [Validation CI](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/.github/workflows/lint-agents.yml): GitHub Actions · Runs consistency checks before merge. · `.github/workflows/lint-agents.yml`
- [Validation Scripts](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/scripts/lint-agents.sh): shell validators · Check agents, divisions, and runbooks. · `scripts/lint-agents.sh`
- [Chinese Localization](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/scripts/i18n/README.md): content pipeline · Localizes names while preserving canonical definitions. · `scripts/i18n/README.md`

### Other components

- [Repository Guide](https://github.com/saleemmbayed-sketch/saleems-ai-factory/blob/main/README.md): documentation · Primary user entry point. · `README.md`

## Connections

- Repository Guide → Agent Specifications: introduces
- Agent Specifications → Design Division: includes
- Agent Specifications → Marketing Division: includes
- Agent Specifications → Security Division: includes
- Agent Specifications → Specialized Division: includes
- Division Registry → Agent Specifications: indexes membership
- Selection Manifest → Installer: selects
- Division Registry → Installer: resolves divisions
- Tool Registry → Installer: defines targets
- Installer → Batch Converter: invokes
- Agent Specifications → Batch Converter: canonical input
- Shared Shell Library → Installer: shared behavior
- Shared Shell Library → Batch Converter: shared behavior
- Batch Converter → Runtime Integrations: generates for
- Tool Registry → Runtime Integrations: documents targets
- Hermes Plugin Tooling → Runtime Integrations: builds plugin
- MCP Memory Adapter → Runtime Integrations: extends
- Agent Specifications → Nexus Strategy: provides roles
- Nexus Strategy → Phased Playbooks: defines phases
- Scenario Runbooks → Phased Playbooks: binds scenarios
- Coordination Artifacts → Phased Playbooks: supports handoffs
- Validation CI → Validation Scripts: runs
- Validation Scripts → Agent Specifications: validates catalog
- Validation Scripts → Division Registry: checks alignment
- Validation Scripts → Scenario Runbooks: checks integrity
- Chinese Localization → Agent Specifications: localizes
