# revfactory/harness architecture

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

- Interactive diagram: https://gitdiagram.com/revfactory/harness
- Repository: https://github.com/revfactory/harness

## Overview

#### Purpose and Runtime
Harness is a Claude Code plugin and installable global skill that converts a natural-language domain request into a tailored multi-agent team architecture and reusable skills. It targets Claude Code’s Agent Teams runtime; collaborative execution requires `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`.

Core plugin metadata and marketplace exposure are in `.claude-plugin/plugin.json` and `.claude-plugin/marketplace.json`.

#### Entry Points
The primary user entry point is a Claude Code prompt such as “build a harness for this project.” Claude loads the main skill at `skills/harness/SKILL.md`, which governs the factory workflow.

The plugin may be installed from the marketplace or copied as a global Claude skill. This repository itself is declarative Markdown/plugin content, not an independently hosted application or service.

#### Factory Workflow
The skill drives a six-stage control flow:
1. Analyze the target domain and requirements.
2. Select an agent-team topology or simpler subagent execution.
3. Generate `.claude/agents/` definitions in the target project.
4. Generate `.claude/skills/` skill packages.
5. Define orchestration, data handoffs, failure handling, and review gates.
6. Validate triggers and generated artifacts through dry-run/comparison testing.

The controlling specification is `skills/harness/SKILL.md`; generated output belongs to the consumer project, not this repository.

#### Architecture Selection Layer
Harness selects among six predefined coordination models: pipeline, fan-out/fan-in, expert pool, producer-reviewer, supervisor, and hierarchical delegation. Pattern semantics and selection guidance are centralized in `skills/harness/references/agent-design-patterns.md`.

This is the principal design boundary: it chooses collaboration/control topology based on task dependencies, need for parallelism, review requirements, and delegation depth rather than implementing domain work itself.

#### Agent and Skill Construction
Agent definitions encode specialized roles, while generated skills package role procedures using progressive disclosure: a primary `SKILL.md` plus optional references. Authoring conventions are supplied by `skills/harness/references/skill-writing-guide.md` and representative complete team structures by `skills/harness/references/team-examples.md`.

The output contract is Claude-native filesystem structure: `.claude/agents/*.md` and `.claude/skills/<skill>/SKILL.md`, allowing generated teams to be loaded by Claude Code.

#### Orchestration Boundary
For multi-agent work, generated orchestrators use Claude Code Agent Teams primitives—TeamCreate, SendMessage, and TaskCreate—to coordinate shared tasks and pass artifacts between agents. For isolated, one-off work, the factory can specify direct subagent invocation instead.

Reusable orchestration templates are in `skills/harness/references/orchestrator-template.md`. Claude Code is the material runtime and external dependency; Harness does not provide a separate scheduler, persistence layer, API, or hosted infrastructure.

#### Quality and Evolution
Validation guidance covers trigger verification, dry runs, and comparisons of behavior with versus without generated skills, defined in `skills/harness/references/skill-testing-guide.md`. QA-agent integration is separately defined in `skills/harness/references/qa-agent-guide.md`.

Project documentation is surfaced through `README.md` and `docs/quickstart.md`; the static `index.html` and `privacy.html` are ancillary public-facing pages rather than factory runtime components.

Main entry points: [`skills/harness/SKILL.md`](https://github.com/revfactory/harness/blob/main/skills/harness/SKILL.md) (Harness workflow), [`.claude-plugin/marketplace.json`](https://github.com/revfactory/harness/blob/main/.claude-plugin/marketplace.json) (Plugin marketplace), [`README.md`](https://github.com/revfactory/harness/blob/main/README.md) (Project docs), [`skills/harness/references/agent-design-patterns.md`](https://github.com/revfactory/harness/blob/main/skills/harness/references/agent-design-patterns.md) (Coordination patterns)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_distribution["Distribution"]
  node_marketplace["Plugin marketplace<br/>plugin metadata<br/>[marketplace.json]"]
  node_plugin["Plugin manifest<br/>plugin metadata<br/>[plugin.json]"]
  node_docs["Project docs<br/>documentation<br/>[README.md]"]
end

subgraph group_factory["Harness Factory"]
  node_user_request(("Domain request<br/>user prompt"))
  node_harness_skill["Harness workflow<br/>Claude skill<br/>[SKILL.md]"]
  node_domain_analysis["Domain analysis<br/>workflow stage"]
  node_topology_selection{{"Topology selection<br/>design decision"}}
  node_orchestration_design["Orchestration contract<br/>generated design"]
  node_validation["Dry-run validation<br/>workflow stage"]
end

subgraph group_references["Design References"]
  node_patterns["Coordination patterns<br/>reference guide"]
  node_skill_guide["Skill authoring guide<br/>reference guide"]
  node_team_examples["Team examples<br/>reference guide<br/>[team-examples.md]"]
  node_orchestrator_template["Orchestrator template<br/>reference template"]
  node_testing_guide["Skill testing guide<br/>reference guide"]
  node_qa_guide["QA-agent guide<br/>reference guide<br/>[qa-agent-guide.md]"]
end

subgraph group_consumer["Consumer Project"]
  node_agent_generation["Agent definitions<br/>generated artifact"]
  node_skill_generation["Skill packages<br/>generated artifact"]
end

subgraph group_runtime["Claude Code Runtime"]
  node_claude_code["Claude Code<br/>external runtime"]
  node_agent_teams{{"Agent Teams primitives<br/>runtime API"}}
  node_subagent["Direct subagent execution<br/>runtime mode"]
end

node_marketplace -->|"distributes"| node_plugin
node_docs -.->|"documents usage"| node_harness_skill
node_user_request -->|"invokes"| node_harness_skill
node_claude_code -->|"loads"| node_harness_skill
node_harness_skill -->|"analyzes"| node_domain_analysis
node_domain_analysis -->|"informs"| node_topology_selection
node_patterns -->|"guides"| node_topology_selection
node_topology_selection -->|"specifies roles"| node_agent_generation
node_topology_selection -->|"specifies procedures"| node_skill_generation
node_skill_guide -->|"guides"| node_skill_generation
node_team_examples -.->|"illustrates"| node_agent_generation
node_topology_selection -->|"defines control flow"| node_orchestration_design
node_orchestrator_template -->|"templates"| node_orchestration_design
node_orchestration_design -->|"uses for team work"| node_agent_teams
node_topology_selection -.->|"chooses for isolated work"| node_subagent
node_agent_teams -->|"provided by"| node_claude_code
node_agent_generation -->|"loaded from consumer project"| node_claude_code
node_skill_generation -->|"loaded from consumer project"| node_claude_code
node_harness_skill -->|"validates output"| node_validation
node_testing_guide -->|"guides"| node_validation
node_qa_guide -.->|"adds QA integration"| node_validation

click node_marketplace "https://github.com/revfactory/harness/blob/main/.claude-plugin/marketplace.json"
click node_plugin "https://github.com/revfactory/harness/blob/main/.claude-plugin/plugin.json"
click node_docs "https://github.com/revfactory/harness/blob/main/README.md"
click node_harness_skill "https://github.com/revfactory/harness/blob/main/skills/harness/SKILL.md"
click node_patterns "https://github.com/revfactory/harness/blob/main/skills/harness/references/agent-design-patterns.md"
click node_skill_guide "https://github.com/revfactory/harness/blob/main/skills/harness/references/skill-writing-guide.md"
click node_team_examples "https://github.com/revfactory/harness/blob/main/skills/harness/references/team-examples.md"
click node_orchestrator_template "https://github.com/revfactory/harness/blob/main/skills/harness/references/orchestrator-template.md"
click node_testing_guide "https://github.com/revfactory/harness/blob/main/skills/harness/references/skill-testing-guide.md"
click node_qa_guide "https://github.com/revfactory/harness/blob/main/skills/harness/references/qa-agent-guide.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_marketplace,node_plugin,node_docs toneBlue
class node_user_request,node_harness_skill,node_domain_analysis,node_topology_selection,node_orchestration_design,node_validation toneAmber
class node_patterns,node_skill_guide,node_team_examples,node_orchestrator_template,node_testing_guide,node_qa_guide toneMint
class node_agent_generation,node_skill_generation toneRose
class node_claude_code,node_agent_teams,node_subagent toneIndigo
```

## Components

### Distribution

- [Plugin marketplace](https://github.com/revfactory/harness/blob/main/.claude-plugin/marketplace.json): plugin metadata · Exposes Harness for installation. · `.claude-plugin/marketplace.json`
- [Plugin manifest](https://github.com/revfactory/harness/blob/main/.claude-plugin/plugin.json): plugin metadata · `.claude-plugin/plugin.json`
- [Project docs](https://github.com/revfactory/harness/blob/main/README.md): documentation · Quickstart and repository guidance. · `README.md`

### Harness Factory

- **Domain request**: user prompt · A request to build a tailored harness.
- [Harness workflow](https://github.com/revfactory/harness/blob/main/skills/harness/SKILL.md): Claude skill · Controls the six-stage team factory workflow. · `skills/harness/SKILL.md`
- **Domain analysis**: workflow stage
- **Topology selection**: design decision · Chooses team collaboration or direct subagent execution.
- **Orchestration contract**: generated design · Defines handoffs, failures, and review gates.
- **Dry-run validation**: workflow stage · Verifies triggers and compares generated behavior.

### Design References

- [Coordination patterns](https://github.com/revfactory/harness/blob/main/skills/harness/references/agent-design-patterns.md): reference guide · Defines six team topologies and selection criteria. · `skills/harness/references/agent-design-patterns.md`
- [Skill authoring guide](https://github.com/revfactory/harness/blob/main/skills/harness/references/skill-writing-guide.md): reference guide · `skills/harness/references/skill-writing-guide.md`
- [Team examples](https://github.com/revfactory/harness/blob/main/skills/harness/references/team-examples.md): reference guide · `skills/harness/references/team-examples.md`
- [Orchestrator template](https://github.com/revfactory/harness/blob/main/skills/harness/references/orchestrator-template.md): reference template · `skills/harness/references/orchestrator-template.md`
- [Skill testing guide](https://github.com/revfactory/harness/blob/main/skills/harness/references/skill-testing-guide.md): reference guide · `skills/harness/references/skill-testing-guide.md`
- [QA-agent guide](https://github.com/revfactory/harness/blob/main/skills/harness/references/qa-agent-guide.md): reference guide · `skills/harness/references/qa-agent-guide.md`

### Consumer Project

- **Agent definitions**: generated artifact · Specialized role definitions in the target project.
- **Skill packages**: generated artifact · Role procedures with progressive disclosure in the target project.

### Claude Code Runtime

- **Claude Code**: external runtime · Loads skills and executes generated teams.
- **Agent Teams primitives**: runtime API · TeamCreate, SendMessage, and TaskCreate coordinate multi-agent work.
- **Direct subagent execution**: runtime mode · Used for isolated one-off work.

## Connections

- Plugin marketplace → Plugin manifest: distributes
- Project docs → Harness workflow: documents usage
- Domain request → Harness workflow: invokes
- Claude Code → Harness workflow: loads
- Harness workflow → Domain analysis: analyzes
- Domain analysis → Topology selection: informs
- Coordination patterns → Topology selection: guides
- Topology selection → Agent definitions: specifies roles
- Topology selection → Skill packages: specifies procedures
- Skill authoring guide → Skill packages: guides
- Team examples → Agent definitions: illustrates
- Topology selection → Orchestration contract: defines control flow
- Orchestrator template → Orchestration contract: templates
- Orchestration contract → Agent Teams primitives: uses for team work
- Topology selection → Direct subagent execution: chooses for isolated work
- Agent Teams primitives → Claude Code: provided by
- Agent definitions → Claude Code: loaded from consumer project
- Skill packages → Claude Code: loaded from consumer project
- Harness workflow → Dry-run validation: validates output
- Skill testing guide → Dry-run validation: guides
- QA-agent guide → Dry-run validation: adds QA integration
