Tangu treats AI coding agents and automated tooling as first-class citizens. Because code, manifests, schemas, HTML templates, and CSS stylesheets share one delimiter-balanced s-expression grammar—and every compiler pass, linter, refactoring engine, and documentation lookup supports `--json`—agents can inspect, transform, and verify workspaces without fragile regex patching.

## Why homoiconicity matters

1. **Zero syntactic ambiguity**: Every form is explicitly delimited (`(...)`, `[...]`, `{...}`). AST edits are structurally scoped rather than whitespace-sensitive.
2. **Canonical style enforcement**: `tangu format` and 110 static lint rules (`tangu lint` / `tangu fix`) normalize idioms, catch dead or shadowed bindings, and insert missing imports automatically.
3. **Structured machine I/O**: Every diagnostic, AST dump, symbol outline, caller graph, test result, and API doc emits stable JSON when passed `--json`.

## Semantic workspace navigation (`tangu sym`)

Avoid grepping blindly across large repositories when structural queries give exact symbol locations and inferred types:

```sh
# Hierarchical outline of functions, structs, traits, and tests in a directory
tangu sym outline app/ --json

# Workspace symbol search
tangu sym search "handle-" --json

# Inspect definition, references, callers/callees, and inferred hover types
tangu sym def app/routes.tan:18:10 --json
tangu sym refs app/routes.tan:18:10 --json
tangu sym calls handle-login --json
tangu sym hover app/routes.tan:24:15 --json
```

For structural inspection of tokens, AST ranges, macro expansion, or delimiter nesting issues, use `tangu dump`:

```sh
tangu dump --delimiters broken.tan --json
tangu dump --expanded macros.tan --lines 10:40
```

## Safe refactoring (`tangu refactor`)

Rename exported functions, structs, or local bindings and move module files while updating all cross-workspace `(use ...)` import declarations atomically:

```sh
tangu refactor rename old-name new-name --json
tangu refactor move app/old-mod.tan app/domain/new-mod.tan --json
```

## Tight check-fix-test verification loop

Keep iteration cycles fast after each edit by targeting changed files and enabling machine-readable diagnostics:

```sh
# Fast parse, type check, and type/import lints on Git-changed files
tangu check --fast --changed --json

# Apply safe autofixes, unambiguous (use ...) auto-imports, and format changed files
tangu fix --changed --auto-import --json

# Run affected #test suites and filter to failing tests
tangu test --changed --json
tangu test --only verify-user-validation --failed-only --json
```

Inspect detailed remediation advice or opt-out suppression syntax for any lint rule before disabling a warning:

```sh
tangu lint --explain unused-variable --json
```

## Programmatic API & documentation discovery

Query exact standard library signatures, struct fields, and workspace modules locally or over HTTPS:

```sh
# Local CLI introspection (prelude + @standard + workspace modules)
tangu doc --list --json
tangu doc /postgres/client --json
tangu doc --search "hmac" --json
```

For remote agents, IDEs, and retrieval pipelines, `tangu.dev` exposes clean plain-text and pure CommonMark endpoints alongside HTML pages:

- [`/llms.txt`](/llms.txt) — Concise documentation directory linking every guide, reference, and standard library module.
- [`/llms-full.txt`](/llms-full.txt) — Consolidated language manual and API reference in plain Markdown.
- **Per-page Markdown mirrors** — Append `.md` to any guide, reference, or module path (for example `/guides/dsls.md`, `/cli.md`, `/lints.md`, `/stdlib/chrono.md`, `/stdlib/web/app.md`).
