# emiliosbs/rustify architecture

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

- Interactive diagram: https://gitdiagram.com/emiliosbs/rustify
- Repository: https://github.com/emiliosbs/rustify

## Overview

rustify is a portable agent skill for converting Python or C into idiomatic Rust while minimizing output tokens. Its documented workflow starts with source investigation, then Decompose → Map → Emit; the skill also provides language-specific translation tables, idiom and compression guidance, worked examples, and a crate-skeleton helper. The graph follows README-documented relationships only; no source excerpts were available to verify implementation-level calls.

Main entry points: [`SKILL.md`](https://github.com/emiliosbs/rustify/blob/main/SKILL.md) (Agent skill), [`examples/README.md`](https://github.com/emiliosbs/rustify/blob/main/examples/README.md) (Worked examples), [`references/python_to_rust.md`](https://github.com/emiliosbs/rustify/blob/main/references/python_to_rust.md) (Python mappings), [`references/c_to_rust.md`](https://github.com/emiliosbs/rustify/blob/main/references/c_to_rust.md) (C mappings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Conversion workflow"]
  node_skill["Agent skill<br/>[SKILL.md]"]
  node_investigate["Investigate<br/>[SKILL.md]"]
  node_decompose["Decompose<br/>[SKILL.md]"]
  node_map["Map<br/>[SKILL.md]"]
  node_emit["Emit Rust<br/>[SKILL.md]"]
end

subgraph group_knowledge["Translation knowledge"]
  node_python["Python mappings<br/>[python_to_rust.md]"]
  node_c["C mappings<br/>[c_to_rust.md]"]
  node_idioms["Rust idioms<br/>[idioms.md]"]
  node_efficiency["Token rules"]
end

subgraph group_support["Supporting resources"]
  node_examples["Worked examples<br/>[README.md]"]
  node_skeleton["Crate skeleton<br/>[emit_skeleton.sh]"]
end

node_agent(("Coding agent"))
node_rust["Rust code"]

node_agent -->|"loads"| node_skill
node_skill -->|"analyzes source"| node_investigate
node_investigate -->|"then decomposes"| node_decompose
node_decompose -->|"then maps"| node_map
node_map -->|"then emits"| node_emit
node_skill -->|"consults"| node_python
node_skill -->|"consults"| node_c
node_skill -->|"uses guidance"| node_idioms
node_skill -->|"uses rules"| node_efficiency
node_examples -->|"illustrates"| node_skill
node_emit -->|"outputs"| node_rust
node_agent -.->|"may run"| node_skeleton

click node_skill "https://github.com/emiliosbs/rustify/blob/main/SKILL.md"
click node_investigate "https://github.com/emiliosbs/rustify/blob/main/SKILL.md"
click node_decompose "https://github.com/emiliosbs/rustify/blob/main/SKILL.md"
click node_map "https://github.com/emiliosbs/rustify/blob/main/SKILL.md"
click node_emit "https://github.com/emiliosbs/rustify/blob/main/SKILL.md"
click node_python "https://github.com/emiliosbs/rustify/blob/main/references/python_to_rust.md"
click node_c "https://github.com/emiliosbs/rustify/blob/main/references/c_to_rust.md"
click node_idioms "https://github.com/emiliosbs/rustify/blob/main/references/idioms.md"
click node_efficiency "https://github.com/emiliosbs/rustify/blob/main/references/token_efficiency.md"
click node_examples "https://github.com/emiliosbs/rustify/blob/main/examples/README.md"
click node_skeleton "https://github.com/emiliosbs/rustify/blob/main/scripts/emit_skeleton.sh"

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_investigate,node_decompose,node_map,node_emit toneBlue
class node_python,node_c,node_idioms,node_efficiency toneAmber
class node_examples,node_skeleton toneMint
class node_agent,node_rust toneIndigo
```

## Components

### Conversion workflow

- [Agent skill](https://github.com/emiliosbs/rustify/blob/main/SKILL.md): `SKILL.md`
- [Investigate](https://github.com/emiliosbs/rustify/blob/main/SKILL.md): `SKILL.md`
- [Decompose](https://github.com/emiliosbs/rustify/blob/main/SKILL.md): `SKILL.md`
- [Map](https://github.com/emiliosbs/rustify/blob/main/SKILL.md): `SKILL.md`
- [Emit Rust](https://github.com/emiliosbs/rustify/blob/main/SKILL.md): `SKILL.md`

### Translation knowledge

- [Python mappings](https://github.com/emiliosbs/rustify/blob/main/references/python_to_rust.md): `references/python_to_rust.md`
- [C mappings](https://github.com/emiliosbs/rustify/blob/main/references/c_to_rust.md): `references/c_to_rust.md`
- [Rust idioms](https://github.com/emiliosbs/rustify/blob/main/references/idioms.md): `references/idioms.md`
- [Token rules](https://github.com/emiliosbs/rustify/blob/main/references/token_efficiency.md): `references/token_efficiency.md`

### Supporting resources

- [Worked examples](https://github.com/emiliosbs/rustify/blob/main/examples/README.md): `examples/README.md`
- [Crate skeleton](https://github.com/emiliosbs/rustify/blob/main/scripts/emit_skeleton.sh): `scripts/emit_skeleton.sh`

### Other components

- **Coding agent**
- **Rust code**

## Connections

- Coding agent → Agent skill: loads (evidence: `README.md`)
- Agent skill → Investigate: analyzes source (evidence: `README.md`)
- Investigate → Decompose: then decomposes (evidence: `README.md`)
- Decompose → Map: then maps (evidence: `README.md`)
- Map → Emit Rust: then emits (evidence: `README.md`)
- Agent skill → Python mappings: consults (evidence: `README.md`)
- Agent skill → C mappings: consults (evidence: `README.md`)
- Agent skill → Rust idioms: uses guidance (evidence: `README.md`)
- Agent skill → Token rules: uses rules (evidence: `README.md`)
- Worked examples → Agent skill: illustrates (evidence: `README.md`)
- Emit Rust → Rust code: outputs (evidence: `README.md`)
- Coding agent → Crate skeleton: may run (evidence: `README.md`)
