# frugalnico/niw-guru architecture

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

- Interactive diagram: https://gitdiagram.com/frugalnico/niw-guru
- Repository: https://github.com/frugalnico/niw-guru

## Overview

niw-guru is a Bash launcher and Claude Code workflow that turns a petitioner’s read-only materials into researched, sourced NIW draft materials. The documented six stages profile the petitioner, research national importance, harvest evidence and quotes, propose future endeavors, synthesize a partial petition letter, and summarize gaps. The repository authors the orchestrator and two skills; other named skills are installed externally. Edges reflect the README’s documented pipeline; source excerpts were unavailable, so internal calls beyond that description are not asserted.

Main entry points: [`.claude/commands/niw-run.md`](https://github.com/frugalnico/niw-guru/blob/main/.claude/commands/niw-run.md) (Six-stage workflow), [`.claude/skills/niw-federal-evidence-harvester/SKILL.md`](https://github.com/frugalnico/niw-guru/blob/main/.claude/skills/niw-federal-evidence-harvester/SKILL.md) (Evidence harvester), [`src/niw-guru.in`](https://github.com/frugalnico/niw-guru/blob/main/src/niw-guru.in) (CLI launcher), [`.claude/skills/niw-future-endeavors/SKILL.md`](https://github.com/frugalnico/niw-guru/blob/main/.claude/skills/niw-future-endeavors/SKILL.md) (Future endeavors)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Run orchestration"]
  node_launcher["CLI launcher<br/>[niw-guru.in]"]
  node_claude["Claude CLI"]
  node_pipeline["Six-stage workflow<br/>[niw-run.md]"]
end

subgraph group_research["Evidence and drafting"]
  node_profile["Profile materials"]
  node_research_stage["Source research"]
  node_harvester["Evidence harvester<br/>[SKILL.md]"]
  node_future["Future endeavors<br/>[SKILL.md]"]
  node_letter["Petition synthesis<br/>[niw-run.md]"]
  node_summary["Summary and gaps<br/>[niw-run.md]"]
end

subgraph group_deliverables["Run outputs"]
  node_pdfs["Federal source PDFs"]
  node_quotes["Importance quotes"]
  node_endeavors["Endeavor draft"]
  node_petition_draft["Partial petition draft"]
  node_run_summary["Run summary"]
end

node_petitioner["Petitioner materials"]

node_petitioner -->|"provides source"| node_launcher
node_launcher -->|"drives"| node_claude
node_claude -->|"runs workflow"| node_pipeline
node_pipeline -->|"profiles"| node_profile
node_pipeline -->|"researches"| node_research_stage
node_pipeline -->|"harvests evidence"| node_harvester
node_pipeline -->|"plans endeavors"| node_future
node_pipeline -->|"synthesizes stages"| node_letter
node_pipeline -->|"summarizes gaps"| node_summary
node_harvester -->|"downloads"| node_pdfs
node_harvester -->|"produces quotes"| node_quotes
node_future -->|"produces plan"| node_endeavors
node_letter -->|"produces draft"| node_petition_draft
node_summary -->|"produces summary"| node_run_summary

click node_launcher "https://github.com/frugalnico/niw-guru/blob/main/src/niw-guru.in"
click node_pipeline "https://github.com/frugalnico/niw-guru/blob/main/.claude/commands/niw-run.md"
click node_harvester "https://github.com/frugalnico/niw-guru/blob/main/.claude/skills/niw-federal-evidence-harvester/SKILL.md"
click node_future "https://github.com/frugalnico/niw-guru/blob/main/.claude/skills/niw-future-endeavors/SKILL.md"
click node_letter "https://github.com/frugalnico/niw-guru/blob/main/.claude/commands/niw-run.md"
click node_summary "https://github.com/frugalnico/niw-guru/blob/main/.claude/commands/niw-run.md"
click node_pdfs "https://github.com/frugalnico/niw-guru/tree/main/output"
click node_quotes "https://github.com/frugalnico/niw-guru/blob/main/templates/national_importance_quotes.template.md"
click node_endeavors "https://github.com/frugalnico/niw-guru/blob/main/templates/future_endeavors.template.md"
click node_petition_draft "https://github.com/frugalnico/niw-guru/blob/main/templates/partial_petition_letter_draft.template.md"
click node_run_summary "https://github.com/frugalnico/niw-guru/tree/main/output"

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_launcher,node_claude,node_pipeline toneBlue
class node_profile,node_research_stage,node_harvester,node_future,node_letter,node_summary toneAmber
class node_pdfs,node_quotes,node_endeavors,node_petition_draft,node_run_summary toneMint
class node_petitioner toneIndigo
```

## Components

### Run orchestration

- [CLI launcher](https://github.com/frugalnico/niw-guru/blob/main/src/niw-guru.in): `src/niw-guru.in`
- **Claude CLI**
- [Six-stage workflow](https://github.com/frugalnico/niw-guru/blob/main/.claude/commands/niw-run.md): `.claude/commands/niw-run.md`

### Evidence and drafting

- **Profile materials**
- **Source research**
- [Evidence harvester](https://github.com/frugalnico/niw-guru/blob/main/.claude/skills/niw-federal-evidence-harvester/SKILL.md): `.claude/skills/niw-federal-evidence-harvester/SKILL.md`
- [Future endeavors](https://github.com/frugalnico/niw-guru/blob/main/.claude/skills/niw-future-endeavors/SKILL.md): `.claude/skills/niw-future-endeavors/SKILL.md`
- [Petition synthesis](https://github.com/frugalnico/niw-guru/blob/main/.claude/commands/niw-run.md): `.claude/commands/niw-run.md`
- [Summary and gaps](https://github.com/frugalnico/niw-guru/blob/main/.claude/commands/niw-run.md): `.claude/commands/niw-run.md`

### Run outputs

- [Federal source PDFs](https://github.com/frugalnico/niw-guru/tree/main/output): `output`
- [Importance quotes](https://github.com/frugalnico/niw-guru/blob/main/templates/national_importance_quotes.template.md): `templates/national_importance_quotes.template.md`
- [Endeavor draft](https://github.com/frugalnico/niw-guru/blob/main/templates/future_endeavors.template.md): `templates/future_endeavors.template.md`
- [Partial petition draft](https://github.com/frugalnico/niw-guru/blob/main/templates/partial_petition_letter_draft.template.md): `templates/partial_petition_letter_draft.template.md`
- [Run summary](https://github.com/frugalnico/niw-guru/tree/main/output): `output`

### Other components

- **Petitioner materials**

## Connections

- Petitioner materials → CLI launcher: provides source (evidence: `README.md`)
- CLI launcher → Claude CLI: drives (evidence: `README.md`)
- Claude CLI → Six-stage workflow: runs workflow (evidence: `README.md`)
- Six-stage workflow → Profile materials: profiles (evidence: `README.md`)
- Six-stage workflow → Source research: researches (evidence: `README.md`)
- Six-stage workflow → Evidence harvester: harvests evidence (evidence: `README.md`)
- Six-stage workflow → Future endeavors: plans endeavors (evidence: `README.md`)
- Six-stage workflow → Petition synthesis: synthesizes stages (evidence: `README.md`)
- Six-stage workflow → Summary and gaps: summarizes gaps (evidence: `README.md`)
- Evidence harvester → Federal source PDFs: downloads (evidence: `README.md`)
- Evidence harvester → Importance quotes: produces quotes (evidence: `README.md`)
- Future endeavors → Endeavor draft: produces plan (evidence: `README.md`)
- Petition synthesis → Partial petition draft: produces draft (evidence: `README.md`)
- Summary and gaps → Run summary: produces summary (evidence: `README.md`)
