# xkyota/repfix architecture

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

- Interactive diagram: https://gitdiagram.com/xkyota/repfix
- Repository: https://github.com/xkyota/repfix

## Overview

RepFix is an agent-guided debugging skill backed by a local TypeScript/Node.js CLI. The agent uses the skill to inspect a bug, reproduce it, record evidence, diagnose and make a minimal fix when allowed, then verify the original scenario and regressions. The CLI manages sessions, executes and records commands, fingerprints project state, stores attachments, and assesses results into reports. The README documents the broader agent workflow and browser guidance; the source excerpts show the helper implementation, not the skill’s full instructions.

Main entry points: [`src/cli.ts`](https://github.com/xkyota/repfix/blob/main/src/cli.ts) (CLI dispatcher), [`src/report.ts`](https://github.com/xkyota/repfix/blob/main/src/report.ts) (Status assessment), [`src/store.ts`](https://github.com/xkyota/repfix/blob/main/src/store.ts) (Session and artifacts), [`src/runner.ts`](https://github.com/xkyota/repfix/blob/main/src/runner.ts) (Command recorder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Agent workflow"]
  node_skill["RepFix playbook<br/>[SKILL.md]"]
  node_browserguide["Browser guidance<br/>[browser.md]"]
  node_commandsref["Command reference<br/>[commands.md]"]
end

subgraph group_cli["CLI and sessions"]
  node_cli["CLI dispatcher<br/>[cli.ts]"]
  node_session[("Session and artifacts<br/>[store.ts]")]
  node_commandrunner["Command recorder<br/>[runner.ts]"]
end

subgraph group_evidence["Evidence and assessment"]
  node_snapshot["Project fingerprinting<br/>[snapshot.ts]"]
  node_safety["Safety utilities<br/>[safety.ts]"]
  node_assessment["Status assessment<br/>[report.ts]"]
end

subgraph group_host["Agent installation"]
  node_install["Skill installer<br/>[install.ts]"]
end

node_agent(("Coding agent"))
node_project["Target project"]
node_codex(("Codex host"))
node_claude(("Claude Code host"))

node_agent -->|"follows"| node_skill
node_skill -->|"uses guidance"| node_commandsref
node_skill -->|"uses guidance"| node_browserguide
node_agent -->|"investigates and edits"| node_project
node_agent -->|"records workflow"| node_cli
node_cli -->|"dispatches install"| node_install
node_cli -->|"records commands"| node_commandrunner
node_cli -->|"generates report"| node_assessment
node_cli -->|"manages session"| node_session
node_commandrunner -->|"fingerprints project"| node_snapshot
node_commandrunner -->|"stores command logs"| node_session
node_assessment -->|"compares state"| node_snapshot
node_assessment -->|"checks artifacts"| node_session
node_assessment -->|"cleans report text"| node_safety
node_session -->|"captures baseline"| node_snapshot
node_session -->|"confines and validates paths"| node_safety
node_snapshot -->|"hashes and confines paths"| node_safety
node_install -->|"checks destination paths"| node_safety
node_install -->|"installs skill"| node_codex
node_install -->|"installs skill"| node_claude
node_commandrunner -->|"runs project commands"| node_project
node_assessment -->|"returns status report"| node_agent

click node_skill "https://github.com/xkyota/repfix/blob/main/skills/repfix/SKILL.md"
click node_browserguide "https://github.com/xkyota/repfix/blob/main/skills/repfix/references/browser.md"
click node_commandsref "https://github.com/xkyota/repfix/blob/main/skills/repfix/references/commands.md"
click node_cli "https://github.com/xkyota/repfix/blob/main/src/cli.ts"
click node_session "https://github.com/xkyota/repfix/blob/main/src/store.ts"
click node_commandrunner "https://github.com/xkyota/repfix/blob/main/src/runner.ts"
click node_snapshot "https://github.com/xkyota/repfix/blob/main/src/snapshot.ts"
click node_safety "https://github.com/xkyota/repfix/blob/main/src/safety.ts"
click node_assessment "https://github.com/xkyota/repfix/blob/main/src/report.ts"
click node_install "https://github.com/xkyota/repfix/blob/main/src/install.ts"

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_skill,node_browserguide,node_commandsref toneBlue
class node_cli,node_session,node_commandrunner toneAmber
class node_snapshot,node_safety,node_assessment toneMint
class node_install toneRose
class node_agent,node_project,node_codex,node_claude toneIndigo
```

## Components

### Agent workflow

- [RepFix playbook](https://github.com/xkyota/repfix/blob/main/skills/repfix/SKILL.md): `skills/repfix/SKILL.md`
- [Browser guidance](https://github.com/xkyota/repfix/blob/main/skills/repfix/references/browser.md): `skills/repfix/references/browser.md`
- [Command reference](https://github.com/xkyota/repfix/blob/main/skills/repfix/references/commands.md): `skills/repfix/references/commands.md`

### CLI and sessions

- [CLI dispatcher](https://github.com/xkyota/repfix/blob/main/src/cli.ts): `src/cli.ts`
- [Session and artifacts](https://github.com/xkyota/repfix/blob/main/src/store.ts): `src/store.ts`
- [Command recorder](https://github.com/xkyota/repfix/blob/main/src/runner.ts): `src/runner.ts`

### Evidence and assessment

- [Project fingerprinting](https://github.com/xkyota/repfix/blob/main/src/snapshot.ts): `src/snapshot.ts`
- [Safety utilities](https://github.com/xkyota/repfix/blob/main/src/safety.ts): `src/safety.ts`
- [Status assessment](https://github.com/xkyota/repfix/blob/main/src/report.ts): `src/report.ts`

### Agent installation

- [Skill installer](https://github.com/xkyota/repfix/blob/main/src/install.ts): `src/install.ts`

### Other components

- **Coding agent**
- **Target project**
- **Codex host**
- **Claude Code host**

## Connections

- Coding agent → RepFix playbook: follows (evidence: `README.md`)
- RepFix playbook → Command reference: uses guidance (evidence: `README.md`)
- RepFix playbook → Browser guidance: uses guidance (evidence: `README.md`)
- Coding agent → Target project: investigates and edits (evidence: `README.md`)
- Coding agent → CLI dispatcher: records workflow (evidence: `README.md`)
- CLI dispatcher → Skill installer: dispatches install (evidence: `src/cli.ts`)
- CLI dispatcher → Command recorder: records commands (evidence: `src/cli.ts`)
- CLI dispatcher → Status assessment: generates report (evidence: `src/cli.ts`)
- CLI dispatcher → Session and artifacts: manages session (evidence: `src/cli.ts`)
- Command recorder → Project fingerprinting: fingerprints project (evidence: `src/runner.ts`)
- Command recorder → Session and artifacts: stores command logs (evidence: `src/runner.ts`)
- Status assessment → Project fingerprinting: compares state (evidence: `src/report.ts`)
- Status assessment → Session and artifacts: checks artifacts (evidence: `src/report.ts`)
- Status assessment → Safety utilities: cleans report text (evidence: `src/report.ts`)
- Session and artifacts → Project fingerprinting: captures baseline (evidence: `src/store.ts`)
- Session and artifacts → Safety utilities: confines and validates paths (evidence: `src/store.ts`)
- Project fingerprinting → Safety utilities: hashes and confines paths (evidence: `src/snapshot.ts`)
- Skill installer → Safety utilities: checks destination paths (evidence: `src/install.ts`)
- Skill installer → Codex host: installs skill (evidence: `README.md`)
- Skill installer → Claude Code host: installs skill (evidence: `README.md`)
- Command recorder → Target project: runs project commands (evidence: `README.md`)
- Status assessment → Coding agent: returns status report (evidence: `README.md`)
