# rusheekg/never-twice architecture

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

- Interactive diagram: https://gitdiagram.com/rusheekg/never-twice
- Repository: https://github.com/rusheekg/never-twice

## Overview

Never Twice is an IBM Bob custom mode that turns postmortems into repeat-bug checks, tests, guardrails, human-approved fixes, and a prevention report. The principal workflow is documented in the README; the mode configuration and workflow implementation were not excerpted, so documented relationships cite the README rather than implying source-level calls.

Main entry points: [`.bob/custom_modes.yaml`](https://github.com/rusheekg/never-twice/blob/main/.bob/custom_modes.yaml) (Fix verification), [`reports/findings.md`](https://github.com/rusheekg/never-twice/blob/main/reports/findings.md) (Parallel bug findings), [`app`](https://github.com/rusheekg/never-twice/tree/main/app) (Project source), [`guardrails`](https://github.com/rusheekg/never-twice/tree/main/guardrails) (Pattern guardrails)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Workflow"]
  node_bob["IBM Bob"]
  node_mode["Never Twice mode<br/>[custom_modes.yaml]"]
  node_context["Project context detection<br/>[custom_modes.yaml]"]
  node_approval(("Human approval"))
end

subgraph group_analysis["Bug analysis"]
  node_postmortems["Incident postmortems"]
  node_patterns["Bug patterns<br/>[patterns.md]"]
  node_source["Project source"]
  node_findings["Parallel bug findings<br/>[findings.md]"]
end

subgraph group_protection["Prevention checks"]
  node_tests["Regression tests"]
  node_guardrails["Pattern guardrails"]
  node_checklist["Review checklist"]
  node_ci["CI template"]
end

subgraph group_outcomes["Fixes and reporting"]
  node_verification["Fix verification<br/>[custom_modes.yaml]"]
  node_report["Prevention report"]
end

node_team(("Project team"))

node_team -->|"runs mode"| node_bob
node_bob -->|"loads workflow"| node_mode
node_mode -->|"detects context"| node_context
node_context -->|"identifies project"| node_source
node_bob -->|"reads incidents"| node_postmortems
node_bob -->|"extracts patterns"| node_patterns
node_patterns -->|"guides parallel search"| node_findings
node_source -->|"is searched"| node_findings
node_findings -->|"proves bugs"| node_tests
node_findings -->|"defines checks"| node_guardrails
node_guardrails -->|"creates checklist"| node_checklist
node_findings -->|"presents results"| node_approval
node_team -->|"approves changes"| node_approval
node_approval -->|"authorizes fixes"| node_verification
node_verification -->|"applies fixes"| node_source
node_verification -->|"reruns tests"| node_tests
node_verification -->|"reruns checks"| node_guardrails
node_verification -->|"records outcomes"| node_report
node_context -->|"selects template"| node_ci

click node_mode "https://github.com/rusheekg/never-twice/blob/main/.bob/custom_modes.yaml"
click node_context "https://github.com/rusheekg/never-twice/blob/main/.bob/custom_modes.yaml"
click node_postmortems "https://github.com/rusheekg/never-twice/tree/main/postmortems"
click node_patterns "https://github.com/rusheekg/never-twice/blob/main/reports/patterns.md"
click node_source "https://github.com/rusheekg/never-twice/tree/main/app"
click node_findings "https://github.com/rusheekg/never-twice/blob/main/reports/findings.md"
click node_tests "https://github.com/rusheekg/never-twice/tree/main/tests"
click node_guardrails "https://github.com/rusheekg/never-twice/tree/main/guardrails"
click node_checklist "https://github.com/rusheekg/never-twice/blob/main/guardrails/REVIEW_CHECKLIST.md"
click node_verification "https://github.com/rusheekg/never-twice/blob/main/.bob/custom_modes.yaml"
click node_report "https://github.com/rusheekg/never-twice/blob/main/reports/PREVENTION_REPORT.md"
click node_ci "https://github.com/rusheekg/never-twice/tree/main/docs/ci-templates"

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_bob,node_mode,node_context,node_approval toneBlue
class node_postmortems,node_patterns,node_source,node_findings toneAmber
class node_tests,node_guardrails,node_checklist,node_ci toneMint
class node_verification,node_report toneRose
class node_team toneIndigo
```

## Components

### Workflow

- **IBM Bob**
- [Never Twice mode](https://github.com/rusheekg/never-twice/blob/main/.bob/custom_modes.yaml): `.bob/custom_modes.yaml`
- [Project context detection](https://github.com/rusheekg/never-twice/blob/main/.bob/custom_modes.yaml): `.bob/custom_modes.yaml`
- **Human approval**

### Bug analysis

- [Incident postmortems](https://github.com/rusheekg/never-twice/tree/main/postmortems): `postmortems`
- [Bug patterns](https://github.com/rusheekg/never-twice/blob/main/reports/patterns.md): `reports/patterns.md`
- [Project source](https://github.com/rusheekg/never-twice/tree/main/app): `app`
- [Parallel bug findings](https://github.com/rusheekg/never-twice/blob/main/reports/findings.md): `reports/findings.md`

### Prevention checks

- [Regression tests](https://github.com/rusheekg/never-twice/tree/main/tests): `tests`
- [Pattern guardrails](https://github.com/rusheekg/never-twice/tree/main/guardrails): `guardrails`
- [Review checklist](https://github.com/rusheekg/never-twice/blob/main/guardrails/REVIEW_CHECKLIST.md): `guardrails/REVIEW_CHECKLIST.md`
- [CI template](https://github.com/rusheekg/never-twice/tree/main/docs/ci-templates): `docs/ci-templates`

### Fixes and reporting

- [Fix verification](https://github.com/rusheekg/never-twice/blob/main/.bob/custom_modes.yaml): `.bob/custom_modes.yaml`
- [Prevention report](https://github.com/rusheekg/never-twice/blob/main/reports/PREVENTION_REPORT.md): `reports/PREVENTION_REPORT.md`

### Other components

- **Project team**

## Connections

- Project team → IBM Bob: runs mode (evidence: `README.md`)
- IBM Bob → Never Twice mode: loads workflow (evidence: `README.md`)
- Never Twice mode → Project context detection: detects context (evidence: `README.md`)
- Project context detection → Project source: identifies project (evidence: `README.md`)
- IBM Bob → Incident postmortems: reads incidents (evidence: `README.md`)
- IBM Bob → Bug patterns: extracts patterns (evidence: `README.md`)
- Bug patterns → Parallel bug findings: guides parallel search (evidence: `README.md`)
- Project source → Parallel bug findings: is searched (evidence: `README.md`)
- Parallel bug findings → Regression tests: proves bugs (evidence: `README.md`)
- Parallel bug findings → Pattern guardrails: defines checks (evidence: `README.md`)
- Pattern guardrails → Review checklist: creates checklist (evidence: `README.md`)
- Parallel bug findings → Human approval: presents results (evidence: `README.md`)
- Project team → Human approval: approves changes (evidence: `README.md`)
- Human approval → Fix verification: authorizes fixes (evidence: `README.md`)
- Fix verification → Project source: applies fixes (evidence: `README.md`)
- Fix verification → Regression tests: reruns tests (evidence: `README.md`)
- Fix verification → Pattern guardrails: reruns checks (evidence: `README.md`)
- Fix verification → Prevention report: records outcomes (evidence: `README.md`)
- Project context detection → CI template: selects template (evidence: `README.md`)
