# wdubilly/drwil architecture

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

- Interactive diagram: https://gitdiagram.com/wdubilly/drwil
- Repository: https://github.com/wdubilly/drwil

## Overview

DRWIL is a CLI governance layer and project kit for checking evidence against declared obligations in agent-produced work. The main workflow is human intent and contracts, agent-produced work and evidence, `drwil verify` producing a verdict, then explicit human attestation where automated proof is insufficient. The CLI also diagnoses installations and formats results for agents; the kit supplies project guidance and optional capabilities. Some template internals were not sampled, so their connections are shown only where documented or directly evidenced.

Main entry points: [`packages/drwil/src/verify.ts`](https://github.com/wdubilly/drwil/blob/master/packages/drwil/src/verify.ts) (Verification), [`packages/drwil/bin/drwil.js`](https://github.com/wdubilly/drwil/blob/master/packages/drwil/bin/drwil.js) (DRWIL CLI), [`packages/drwil/src/attest.ts`](https://github.com/wdubilly/drwil/blob/master/packages/drwil/src/attest.ts) (Human attestation), [`docs/contrats.md`](https://github.com/wdubilly/drwil/blob/master/docs/contrats.md) (Contracts and intent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Governance workflow"]
  node_contracts["Contracts and intent<br/>[contrats.md]"]
  node_work["Work and evidence<br/>[evidence]"]
  node_verdict["Governance verdict"]
end

subgraph group_runtime["CLI and runtime"]
  node_cli["DRWIL CLI<br/>[drwil.js]"]
  node_kit_init["Kit installation<br/>[index.ts]"]
  node_verify["Verification<br/>[verify.ts]"]
  node_attest["Human attestation<br/>[attest.ts]"]
  node_agent_output["Agent guidance<br/>[agent.ts]"]
  node_doctor["Installation diagnostics<br/>[doctor.ts]"]
  node_stack["Stack detection<br/>[stack.ts]"]
end

subgraph group_kit["Project kit"]
  node_control_engine["Controls engine<br/>[moteur.mjs]"]
  node_contract_reader["Contract reader<br/>[contrats.mjs]"]
  node_project_guidance["Project guidance<br/>[ia-first.md]"]
  node_tool_adapters["Agent tool adapters"]
end

subgraph group_extensions["Optional capabilities"]
  node_dashboard["Progress dashboard"]
  node_front_quality["Front quality checks"]
  node_release["Release helper<br/>[creer-release.mjs]"]
end

node_human(("Human"))
node_agent(("AI agent"))

node_human -->|"defines obligations"| node_contracts
node_agent -->|"produces work"| node_work
node_work -->|"provides evidence"| node_verify
node_cli -->|"runs verification"| node_verify
node_verify -->|"loads controls"| node_control_engine
node_verify -->|"loads reader"| node_contract_reader
node_contracts -->|"declares obligations"| node_verify
node_verify -->|"produces verdict"| node_verdict
node_verify -->|"identifies manual work"| node_attest
node_human -->|"confirms attestation"| node_attest
node_attest -->|"records attestation"| node_work
node_cli -->|"invokes attestation"| node_attest
node_cli -->|"formats for agent"| node_agent_output
node_agent_output -->|"formats result"| node_verdict
node_cli -->|"runs diagnostics"| node_doctor
node_doctor -->|"loads project config"| node_verify
node_cli -->|"runs kit commands"| node_kit_init
node_kit_init -.->|"installs templates"| node_project_guidance
node_kit_init -.->|"installs integrations"| node_tool_adapters
node_cli -.->|"detects project stack"| node_stack
node_contracts -.->|"summarizes progress"| node_dashboard
node_project_guidance -.->|"documents optional checks"| node_front_quality
node_project_guidance -.->|"documents release helper"| node_release

click node_contracts "https://github.com/wdubilly/drwil/blob/master/docs/contrats.md"
click node_work "https://github.com/wdubilly/drwil/tree/master/.drwil/evidence"
click node_cli "https://github.com/wdubilly/drwil/blob/master/packages/drwil/bin/drwil.js"
click node_kit_init "https://github.com/wdubilly/drwil/blob/master/packages/drwil/src/index.ts"
click node_verify "https://github.com/wdubilly/drwil/blob/master/packages/drwil/src/verify.ts"
click node_control_engine "https://github.com/wdubilly/drwil/blob/master/packages/drwil/templates/common/base/.githooks/moteur.mjs"
click node_contract_reader "https://github.com/wdubilly/drwil/blob/master/packages/drwil/templates/common/base/.githooks/contrats.mjs"
click node_attest "https://github.com/wdubilly/drwil/blob/master/packages/drwil/src/attest.ts"
click node_agent_output "https://github.com/wdubilly/drwil/blob/master/packages/drwil/src/agent.ts"
click node_doctor "https://github.com/wdubilly/drwil/blob/master/packages/drwil/src/doctor.ts"
click node_stack "https://github.com/wdubilly/drwil/blob/master/packages/drwil/src/stack.ts"
click node_project_guidance "https://github.com/wdubilly/drwil/blob/master/packages/drwil/templates/fr/base/docs/ia-first.md"
click node_tool_adapters "https://github.com/wdubilly/drwil/tree/master/packages/drwil/templates/fr/tools"
click node_dashboard "https://github.com/wdubilly/drwil/blob/master/packages/drwil/templates/common/optional/tableau-de-bord/tableau-de-bord.mjs"
click node_front_quality "https://github.com/wdubilly/drwil/tree/master/packages/drwil/templates/common/optional/front-quality"
click node_release "https://github.com/wdubilly/drwil/blob/master/packages/drwil/templates/common/optional/creer-une-release/creer-release.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_contracts,node_work,node_verdict toneBlue
class node_cli,node_kit_init,node_verify,node_attest,node_agent_output,node_doctor,node_stack toneAmber
class node_control_engine,node_contract_reader,node_project_guidance,node_tool_adapters toneMint
class node_dashboard,node_front_quality,node_release toneRose
class node_human,node_agent toneIndigo
```

## Components

### Governance workflow

- [Contracts and intent](https://github.com/wdubilly/drwil/blob/master/docs/contrats.md): `docs/contrats.md`
- [Work and evidence](https://github.com/wdubilly/drwil/tree/master/.drwil/evidence): `.drwil/evidence`
- **Governance verdict**

### CLI and runtime

- [DRWIL CLI](https://github.com/wdubilly/drwil/blob/master/packages/drwil/bin/drwil.js): `packages/drwil/bin/drwil.js`
- [Kit installation](https://github.com/wdubilly/drwil/blob/master/packages/drwil/src/index.ts): `packages/drwil/src/index.ts`
- [Verification](https://github.com/wdubilly/drwil/blob/master/packages/drwil/src/verify.ts): `packages/drwil/src/verify.ts`
- [Human attestation](https://github.com/wdubilly/drwil/blob/master/packages/drwil/src/attest.ts): `packages/drwil/src/attest.ts`
- [Agent guidance](https://github.com/wdubilly/drwil/blob/master/packages/drwil/src/agent.ts): `packages/drwil/src/agent.ts`
- [Installation diagnostics](https://github.com/wdubilly/drwil/blob/master/packages/drwil/src/doctor.ts): `packages/drwil/src/doctor.ts`
- [Stack detection](https://github.com/wdubilly/drwil/blob/master/packages/drwil/src/stack.ts): `packages/drwil/src/stack.ts`

### Project kit

- [Controls engine](https://github.com/wdubilly/drwil/blob/master/packages/drwil/templates/common/base/.githooks/moteur.mjs): `packages/drwil/templates/common/base/.githooks/moteur.mjs`
- [Contract reader](https://github.com/wdubilly/drwil/blob/master/packages/drwil/templates/common/base/.githooks/contrats.mjs): `packages/drwil/templates/common/base/.githooks/contrats.mjs`
- [Project guidance](https://github.com/wdubilly/drwil/blob/master/packages/drwil/templates/fr/base/docs/ia-first.md): `packages/drwil/templates/fr/base/docs/ia-first.md`
- [Agent tool adapters](https://github.com/wdubilly/drwil/tree/master/packages/drwil/templates/fr/tools): `packages/drwil/templates/fr/tools`

### Optional capabilities

- [Progress dashboard](https://github.com/wdubilly/drwil/blob/master/packages/drwil/templates/common/optional/tableau-de-bord/tableau-de-bord.mjs): `packages/drwil/templates/common/optional/tableau-de-bord/tableau-de-bord.mjs`
- [Front quality checks](https://github.com/wdubilly/drwil/tree/master/packages/drwil/templates/common/optional/front-quality): `packages/drwil/templates/common/optional/front-quality`
- [Release helper](https://github.com/wdubilly/drwil/blob/master/packages/drwil/templates/common/optional/creer-une-release/creer-release.mjs): `packages/drwil/templates/common/optional/creer-une-release/creer-release.mjs`

### Other components

- **Human**
- **AI agent**

## Connections

- Human → Contracts and intent: defines obligations (evidence: `README.md`)
- AI agent → Work and evidence: produces work (evidence: `README.md`)
- Work and evidence → Verification: provides evidence (evidence: `README.md`)
- DRWIL CLI → Verification: runs verification (evidence: `packages/drwil/bin/drwil.js`)
- Verification → Controls engine: loads controls (evidence: `packages/drwil/src/verify.ts`)
- Verification → Contract reader: loads reader (evidence: `packages/drwil/src/verify.ts`)
- Contracts and intent → Verification: declares obligations (evidence: `README.md`)
- Verification → Governance verdict: produces verdict (evidence: `README.md`)
- Verification → Human attestation: identifies manual work (evidence: `packages/drwil/src/attest.ts`)
- Human → Human attestation: confirms attestation (evidence: `packages/drwil/src/attest.ts`)
- Human attestation → Work and evidence: records attestation (evidence: `packages/drwil/src/attest.ts`)
- DRWIL CLI → Human attestation: invokes attestation (evidence: `packages/drwil/bin/drwil.js`)
- DRWIL CLI → Agent guidance: formats for agent (evidence: `packages/drwil/bin/drwil.js`)
- Agent guidance → Governance verdict: formats result (evidence: `packages/drwil/src/agent.ts`)
- DRWIL CLI → Installation diagnostics: runs diagnostics (evidence: `packages/drwil/bin/drwil.js`)
- Installation diagnostics → Verification: loads project config (evidence: `packages/drwil/src/doctor.ts`)
- DRWIL CLI → Kit installation: runs kit commands (evidence: `packages/drwil/bin/drwil.js`)
- Kit installation → Project guidance: installs templates (evidence: `packages/drwil/src/index.ts`)
- Kit installation → Agent tool adapters: installs integrations (evidence: `packages/drwil/src/index.ts`)
- DRWIL CLI → Stack detection: detects project stack
- Contracts and intent → Progress dashboard: summarizes progress (evidence: `packages/drwil/templates/common/optional/tableau-de-bord/tableau-de-bord.mjs`)
- Project guidance → Front quality checks: documents optional checks (evidence: `packages/drwil/templates/common/optional/front-quality/check-contrast.mjs`)
- Project guidance → Release helper: documents release helper
