# coji/natural-japanese architecture

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

- Interactive diagram: https://gitdiagram.com/coji/natural-japanese
- Repository: https://github.com/coji/natural-japanese

## Overview

natural-japanese is an agent skill for making Japanese work documents read naturally while preserving their facts and certainty. The main workflow is: an agent reviews a draft, uses deterministic lint findings and document-inspection tools to guide contextual edits, then checks the revision against the original. The repository also provides a separate critical-thinking skill for decision documents, with full and staged review, clarification, and rewrite modes. The README documents these capabilities, but the skill instructions and most critical-thinking implementation are not in the supplied tree; those links are therefore kept at the supported directory level.

Main entry points: [`skills/natural-japanese/scripts/lint.py`](https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/lint.py) (Japanese lint), [`skills/critical-thinking/scripts`](https://github.com/coji/natural-japanese/tree/main/skills/critical-thinking/scripts) (Critical-thinking skill), [`skills/natural-japanese/scripts/newfacts.py`](https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/newfacts.py) (New-fact check), [`skills/natural-japanese/scripts/textcore.py`](https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/textcore.py) (Text analysis core)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_japanese["Japanese editing"]
  node_lint["Japanese lint<br/>[lint.py]"]
  node_textcore["Text analysis core<br/>[textcore.py]"]
end

subgraph group_inspection["Document inspection"]
  node_paragraphs["Paragraph units<br/>[paragraphs.py]"]
  node_outline["Outline report<br/>[outline.py]"]
  node_terms["Term checks<br/>[terms.py]"]
  node_semantic["Semantic checks<br/>[semantic.py]"]
  node_calques["Calque candidates<br/>[calques.py]"]
  node_newfacts["New-fact check<br/>[newfacts.py]"]
  node_calibrate["Calibration<br/>[calibrate.py]"]
end

subgraph group_critical["Critical thinking"]
  node_ctskill["Critical-thinking skill"]
  node_coverage["Coverage analysis<br/>[coverage.py]"]
end

node_writer(("Agent / writer"))
node_draft["Source draft"]
node_revision["Revised document"]

node_draft -->|"requests editing"| node_writer
node_writer -->|"runs detection"| node_lint
node_lint -->|"uses shared analysis"| node_textcore
node_writer -->|"inspects paragraphs"| node_paragraphs
node_writer -->|"inspects structure"| node_outline
node_writer -->|"checks terminology"| node_terms
node_writer -->|"checks calques"| node_calques
node_writer -->|"checks added facts"| node_newfacts
node_writer -.->|"uses semantic checks"| node_semantic
node_writer -.->|"uses calibration"| node_calibrate
node_writer -->|"writes revision"| node_revision
node_revision -->|"compares with source"| node_newfacts
node_writer -->|"runs decision review"| node_ctskill
node_ctskill -.->|"uses coverage tool"| node_coverage

click node_lint "https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/lint.py"
click node_textcore "https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/textcore.py"
click node_paragraphs "https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/paragraphs.py"
click node_outline "https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/outline.py"
click node_terms "https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/terms.py"
click node_semantic "https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/semantic.py"
click node_calques "https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/calques.py"
click node_newfacts "https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/newfacts.py"
click node_calibrate "https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/calibrate.py"
click node_ctskill "https://github.com/coji/natural-japanese/tree/main/skills/critical-thinking/scripts"
click node_coverage "https://github.com/coji/natural-japanese/blob/main/skills/critical-thinking/scripts/coverage.py"

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_lint,node_textcore toneBlue
class node_paragraphs,node_outline,node_terms,node_semantic,node_calques,node_newfacts,node_calibrate toneAmber
class node_ctskill,node_coverage toneMint
class node_writer,node_draft,node_revision toneIndigo
```

## Components

### Japanese editing

- [Japanese lint](https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/lint.py): `skills/natural-japanese/scripts/lint.py`
- [Text analysis core](https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/textcore.py): `skills/natural-japanese/scripts/textcore.py`

### Document inspection

- [Paragraph units](https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/paragraphs.py): `skills/natural-japanese/scripts/paragraphs.py`
- [Outline report](https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/outline.py): `skills/natural-japanese/scripts/outline.py`
- [Term checks](https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/terms.py): `skills/natural-japanese/scripts/terms.py`
- [Semantic checks](https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/semantic.py): `skills/natural-japanese/scripts/semantic.py`
- [Calque candidates](https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/calques.py): `skills/natural-japanese/scripts/calques.py`
- [New-fact check](https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/newfacts.py): `skills/natural-japanese/scripts/newfacts.py`
- [Calibration](https://github.com/coji/natural-japanese/blob/main/skills/natural-japanese/scripts/calibrate.py): `skills/natural-japanese/scripts/calibrate.py`

### Critical thinking

- [Critical-thinking skill](https://github.com/coji/natural-japanese/tree/main/skills/critical-thinking/scripts): `skills/critical-thinking/scripts`
- [Coverage analysis](https://github.com/coji/natural-japanese/blob/main/skills/critical-thinking/scripts/coverage.py): `skills/critical-thinking/scripts/coverage.py`

### Other components

- **Agent / writer**
- **Source draft**
- **Revised document**

## Connections

- Source draft → Agent / writer: requests editing (evidence: `README.md`)
- Agent / writer → Japanese lint: runs detection (evidence: `README.md`)
- Japanese lint → Text analysis core: uses shared analysis (evidence: `skills/natural-japanese/scripts/lint.py`)
- Agent / writer → Paragraph units: inspects paragraphs (evidence: `README.md`)
- Agent / writer → Outline report: inspects structure (evidence: `README.md`)
- Agent / writer → Term checks: checks terminology (evidence: `README.md`)
- Agent / writer → Calque candidates: checks calques (evidence: `README.md`)
- Agent / writer → New-fact check: checks added facts (evidence: `README.md`)
- Agent / writer → Semantic checks: uses semantic checks
- Agent / writer → Calibration: uses calibration
- Agent / writer → Revised document: writes revision (evidence: `README.md`)
- Revised document → New-fact check: compares with source (evidence: `README.md`)
- Agent / writer → Critical-thinking skill: runs decision review (evidence: `README.md`)
- Critical-thinking skill → Coverage analysis: uses coverage tool
