English (this file) · 日本語
Architecture as code for understanding and evolving real systems.
karasu is a text-based architecture modeling language and toolchain. It keeps a system's logical structure, physical deployment, and team ownership in one model that people, code, and AI agents can all read and evolve.
Documentation · Guides · Syntax reference · Examples · VS Code
Architecture is more than a diagram. You need to understand what the system does, how it runs, who owns it, and how those boundaries change together.
| Perspective | What it describes |
|---|---|
| Logical | Systems, services, domains, use cases, entities, and dependencies |
| Physical | Deployments, runtimes, databases, queues, and storage |
| Organizational | Teams and ownership |
The .krs text is the source of truth. Humans can edit it, the CLI can derive it
from existing artifacts, and AI agents can create or refine it from source code.
karasu renders the same model as focused diagrams with continuous drill-down,
instead of forcing every level of a system into one overloaded picture.
Open the web app to edit a model, navigate its diagrams, and follow the built-in tutorial. Nothing needs to be installed.
To work in your editor instead, install the VS Code extension:
code --install-extension karasu-tools.karasu-vscodeAlready have Docker Compose, Kubernetes manifests, an OpenAPI schema, or SQL
DDL? karasu translate turns it into an editable .krs starting point:
npx --yes karasu@latest translate --from compose docker-compose.yml > architecture.krs
npx --yes karasu@latest serve .Use --from k8s, --from openapi, or --from db for the other supported
inputs. See Using the CLI for the
full command reference.
Two agent skills drive the karasu CLI for you:
karasu-authorbuilds and updates a model of your own system through conversation: it interviews you one layer at a time, reads the code to skip questions the code answers, and checks every change withkarasu check.reverse-architecturehas a repository-aware agent inspect an existing codebase and build a model, combining agent judgment for domain structure with deterministic CLI extraction and validation. See the guide for what it costs and how to review the result.
The skills drive the karasu CLI, so install that too with npm i -g karasu.
In Claude Code, install them as a plugin:
/plugin marketplace add kompiro/karasu
/plugin install karasu@karasu
For other agents, copy them into the directory your agent reads skills from:
npx karasu skill install --dir .agents/skillsThe result is a map to review and evolve, not a claim of perfect ground truth. karasu remains useful without AI: the model is plain text, editable by hand, and independent of the agent that produced it.
system Shop {
user Customer [human]
service Storefront {
domain Ordering
}
service Payment [external]
Customer -> Storefront "Place an order"
Storefront -> Payment "Charge"
}
deploy Production {
oci WebApp {
runtime "Node.js"
realizes Storefront
}
}
organization Product {
team Commerce {
owns Storefront
}
}
Open it in the web app or run npx --yes karasu@latest serve . to move between
the System, Deploy, and Org views and drill into the details.
- Architecture that can evolve with the system — review text changes in Git, compare diagrams, and keep architecture close to engineering work.
- Logical, physical, and organizational boundaries together — discuss service design, deployment, and ownership in the same vocabulary.
- Progressive disclosure — start with a scoped overview, then drill down only where detail is useful.
- A shared model for people and tools — hand-edit
.krs, generate a scaffold from structured inputs, or let an AI agent propose changes without making the model dependent on AI.
karasu takes inspiration from C4 Model, Structurizr, and Mermaid. Read Core concepts for the design rationale and the guides for modeling service and team boundaries, onboarding, and architectural evolution.
karasu is a personal learning project, maintained on a best-effort basis with no
SLA. The .krs / .krs.style language specification is v1.0 and keeps backward
compatibility; the TypeScript API remains v0.x and may change between minor
releases. See ADR-1314 for the language
compatibility commitment.
Issues and pull requests are welcome. See CONTRIBUTING.md and the Code of Conduct. Report vulnerabilities through private vulnerability reporting, not a public issue; see SECURITY.md.
Licensed under the Apache License, Version 2.0.

