Archinsight
Use this skill when creating, analyzing, or repairing Insight .ai models and
.aiq custom views, or when importing an existing architecture description
into Insight.
Insight is its own typed architecture-as-code language. Do not infer its syntax
from YAML, Mermaid, PlantUML, Structurizr, or C4 DSL.
Codex Usage Notes
Treat this SKILL.md as the entrypoint and load routed reference files only
when the task needs them. Use shell access to run validation. Do not silently
install global npm packages or change machine configuration.
This package was generated by Archinsight CLI {{CLI_VERSION}}. Run
archinsight --version before editing. If the installed version differs,
regenerate the skill so its references, core sources, examples, and built-in
queries match the runtime.
Required Tool
Use the Archinsight CLI as the validation source of truth:
archinsight --help
archinsight link . --format text
If archinsight is not available, read references/cli.md. Do not install
or update packages without the user's authorization.
Task modes
Choose one mode before acting:
- Analyze: stay read-only and follow
references/analysis.md. Inspect
sources, run structure, link, and the relevant query, then separate
authored facts, derived relationships, deployment projections, and rendered
presentation in the findings.
- Repair: reproduce the defect first. For a visual defect, inspect
archinsight query ... --format json before treating the image as evidence
that the model is wrong. Request the current image or rendered output when it
is not available, make the smallest model or query change, and validate the
same semantic path again before rendering.
- Build or rebuild: perform discovery before editing, then model from the
outside inward and validate after each architectural layer.
- Extend an existing model: inventory existing ids, imports, edges, and view
scope; preserve stable identities and compare linked/query results before and
after each focused change.
- Import an existing model: follow
references/importing-models.md.
Establish which source artifacts are authoritative, translate facts rather
than drawing layout, record uncertain mappings, and validate one
architectural layer at a time.
Before any build, rebuild, import, or structural edit, inspect the supplied
context and every relevant source already available through the repository,
attachments, configured skills, MCP integrations, or other authorized tools.
Do not ask the user to repeat information the agent can retrieve reliably on its
own. If a material fact is still missing after those sources are exhausted, ask
one short, non-repetitive message containing only the one or two questions that
could change the model. Do not use a questionnaire or ask about the audience by
default. If the available evidence is sufficient, proceed without a discovery
question. Use retrieved material as the source of truth; do not invent missing
architecture.
Workflow
- Read the existing
.ai and .aiq files before editing.
- Preserve indentation and the project's existing naming style.
- Model architecture from the outside inward: context, external actors/systems,
systems, containers/services, components, project-defined code when needed,
and deployment details.
- Do not ask about deployment depth until the task touches infrastructure,
runtime placement, regions, brokers, gateways, storage, or deployment.
- At that point, decide per system whether pragmatic mixed C2 or explicit
deployment modeling is appropriate. For explicit deployment, attach
placement/storage to systems and containers (including services); components
and code deploy with their container. Attach path infrastructure that needs
$to to wires, and make pub/sub dependencies consumer-owned.
- If a diagram becomes noisy, adjust scope/query before changing a correct
graph model.
- Save reusable custom views as
.aiq. Unless the user specifies another
location, create views/ and write views/<descriptive-name>.aiq.
- Prefer small, focused files connected by
context, import, and extend.
- Keep definition, context, and environment sources in separate files.
- Use
archinsight structure . --format text before broad edits when the
project shape is unclear.
- Validate every Insight change with
archinsight link . --format text.
- For C2, C3, C4, Deployment, or query changes, inspect the selected graph with
archinsight query ... --format json before rendering.
- If validation fails, fix the first real syntax/type/linking error before
adding more model content.
Reference routing
- Read
references/cli.md when the CLI is missing, its version differs from
the generated skill, or the skill package must be regenerated.
- Read
references/modeling.md before creating or extending a
model.
- Read
references/importing-models.md when translating an existing
architecture description, diagram, inventory, or foreign DSL into Insight.
- Read
references/syntax.md before writing unfamiliar Insight syntax.
- Read
references/layered-architecture.md when decomposing a system across
C1, C2, C3, C4, and Deployment views.
- Read
references/c1-context.md when working with system context models.
- Read
references/c2-containers.md when working with containers or services.
- Read
references/c3-components.md when working with component internals.
- Infer and reuse an existing C4 Code vocabulary from the repository. Ask the
user about entity kinds only when creating the Code layer or extending that
vocabulary, unless the current request already makes the choice.
- Read
references/c4-code.md when defining or querying modules, packages,
classes, functions, schemas, or other project-specific code concepts.
- Read
references/deployment.md when working with environments,
deployments, infrastructure inventory, profiles, or placement.
- Read
references/deployment-projections.md when working with physical
paths, projection rules, or a missing or unexpected Deployment edge.
- Read
references/scaling.md when splitting a repository into reusable
framework, environment, profile, system, or view files.
- Read
references/project-structure.md before declaration lookup, imports,
or broad file changes.
- Read
references/core.md and .core/*.ai before assuming built-in types,
constructors, attributes, presentations, or projections.
- Read
references/queries.md before writing queries or interpreting query
JSON.
- Read
references/custom-views.md before creating a saved .aiq view or
overriding a built-in query.
- Read
references/query-recipes.md when a view hides expected content,
returns unexpected content, or needs customization.
- Read
references/validation.md before validating semantic or rendered
results.
- Read
references/analysis.md for read-only architecture analysis,
dependency questions, impact exploration, and the boundary between Insight
queries and analysis of their JSON output.
- Use
examples/layered-architecture.ai as a compact valid model.
1---2name: archinsight3description: Create, edit, import, analyze, repair, validate, inspect, and render Archinsight Insight architecture-as-code models and custom views. Use when working with .ai models or .aiq queries, migrating architecture from another DSL or diagram, C4-style architecture models, system/container/component/code diagrams, deployment projections, or when the user asks to model or diagnose software architecture with Archinsight.4---56# Archinsight78Use this skill when creating, analyzing, or repairing Insight `.ai` models and9`.aiq` custom views, or when importing an existing architecture description10into Insight.1112Insight is its own typed architecture-as-code language. Do not infer its syntax13from YAML, Mermaid, PlantUML, Structurizr, or C4 DSL.1415## Codex Usage Notes1617Treat this `SKILL.md` as the entrypoint and load routed reference files only18when the task needs them. Use shell access to run validation. Do not silently19install global npm packages or change machine configuration.2021This package was generated by Archinsight CLI {{CLI_VERSION}}. Run22`archinsight --version` before editing. If the installed version differs,23regenerate the skill so its references, core sources, examples, and built-in24queries match the runtime.2526## Required Tool2728Use the Archinsight CLI as the validation source of truth:2930```shell31archinsight --help32archinsight link . --format text33```3435If `archinsight` is not available, read `references/cli.md`. Do not install36or update packages without the user's authorization.3738## Task modes3940Choose one mode before acting:4142- **Analyze:** stay read-only and follow `references/analysis.md`. Inspect43 sources, run `structure`, `link`, and the relevant query, then separate44 authored facts, derived relationships, deployment projections, and rendered45 presentation in the findings.46- **Repair:** reproduce the defect first. For a visual defect, inspect47 `archinsight query ... --format json` before treating the image as evidence48 that the model is wrong. Request the current image or rendered output when it49 is not available, make the smallest model or query change, and validate the50 same semantic path again before rendering.51- **Build or rebuild:** perform discovery before editing, then model from the52 outside inward and validate after each architectural layer.53- **Extend an existing model:** inventory existing ids, imports, edges, and view54 scope; preserve stable identities and compare linked/query results before and55 after each focused change.56- **Import an existing model:** follow `references/importing-models.md`.57 Establish which source artifacts are authoritative, translate facts rather58 than drawing layout, record uncertain mappings, and validate one59 architectural layer at a time.6061Before any build, rebuild, import, or structural edit, inspect the supplied62context and every relevant source already available through the repository,63attachments, configured skills, MCP integrations, or other authorized tools.64Do not ask the user to repeat information the agent can retrieve reliably on its65own. If a material fact is still missing after those sources are exhausted, ask66one short, non-repetitive message containing only the one or two questions that67could change the model. Do not use a questionnaire or ask about the audience by68default. If the available evidence is sufficient, proceed without a discovery69question. Use retrieved material as the source of truth; do not invent missing70architecture.717273## Workflow74751. Read the existing `.ai` and `.aiq` files before editing.762. Preserve indentation and the project's existing naming style.773. Model architecture from the outside inward: context, external actors/systems,78 systems, containers/services, components, project-defined code when needed,79 and deployment details.804. Do not ask about deployment depth until the task touches infrastructure,81 runtime placement, regions, brokers, gateways, storage, or deployment.825. At that point, decide per system whether pragmatic mixed C2 or explicit83 deployment modeling is appropriate. For explicit deployment, attach84 placement/storage to systems and containers (including services); components85 and code deploy with their container. Attach path infrastructure that needs86 `$to` to wires, and make pub/sub dependencies consumer-owned.876. If a diagram becomes noisy, adjust scope/query before changing a correct88 graph model.897. Save reusable custom views as `.aiq`. Unless the user specifies another90 location, create `views/` and write `views/<descriptive-name>.aiq`.918. Prefer small, focused files connected by `context`, `import`, and `extend`.929. Keep definition, context, and environment sources in separate files.9310. Use `archinsight structure . --format text` before broad edits when the94 project shape is unclear.9511. Validate every Insight change with `archinsight link . --format text`.9612. For C2, C3, C4, Deployment, or query changes, inspect the selected graph with97 `archinsight query ... --format json` before rendering.9813. If validation fails, fix the first real syntax/type/linking error before99 adding more model content.100101## Reference routing102103- Read `references/cli.md` when the CLI is missing, its version differs from104 the generated skill, or the skill package must be regenerated.105- Read `references/modeling.md` before creating or extending a106 model.107- Read `references/importing-models.md` when translating an existing108 architecture description, diagram, inventory, or foreign DSL into Insight.109- Read `references/syntax.md` before writing unfamiliar Insight syntax.110- Read `references/layered-architecture.md` when decomposing a system across111 C1, C2, C3, C4, and Deployment views.112- Read `references/c1-context.md` when working with system context models.113- Read `references/c2-containers.md` when working with containers or services.114- Read `references/c3-components.md` when working with component internals.115- Infer and reuse an existing C4 Code vocabulary from the repository. Ask the116 user about entity kinds only when creating the Code layer or extending that117 vocabulary, unless the current request already makes the choice.118- Read `references/c4-code.md` when defining or querying modules, packages,119 classes, functions, schemas, or other project-specific code concepts.120- Read `references/deployment.md` when working with environments,121 deployments, infrastructure inventory, profiles, or placement.122- Read `references/deployment-projections.md` when working with physical123 paths, projection rules, or a missing or unexpected Deployment edge.124- Read `references/scaling.md` when splitting a repository into reusable125 framework, environment, profile, system, or view files.126- Read `references/project-structure.md` before declaration lookup, imports,127 or broad file changes.128- Read `references/core.md` and `.core/*.ai` before assuming built-in types,129 constructors, attributes, presentations, or projections.130- Read `references/queries.md` before writing queries or interpreting query131 JSON.132- Read `references/custom-views.md` before creating a saved `.aiq` view or133 overriding a built-in query.134- Read `references/query-recipes.md` when a view hides expected content,135 returns unexpected content, or needs customization.136- Read `references/validation.md` before validating semantic or rendered137 results.138- Read `references/analysis.md` for read-only architecture analysis,139 dependency questions, impact exploration, and the boundary between Insight140 queries and analysis of their JSON output.141- Use `examples/layered-architecture.ai` as a compact valid model.