The
generate-architecture prompt models your system from the code and config it can inspect, not from a questionnaire. Run the agent from the repository you want to model so it can read your source.What you’ll use
| Piece | Type | Role |
|---|---|---|
generate-architecture | Prompt | Briefs the agent to infer a Threagile model from the codebase (or a scope) and save it. |
update-use-case-architecture | Tool | Validates the model against the Threagile schema and saves it to a use case. |
analyze-use-case-architecture | Tool | Runs Threagile security analysis + RCM compliance checks and returns fixable issues. |
keldyn://threagile-schema | Resource | The authoritative schema for allowed properties and enum values. |
Before you start
Connect the MCP server
Follow Keldyn MCP server to connect your AI tool and sign in to the team that owns the target use case.
Open the repository
Start the agent from the repo (or monorepo) you want to model, so it can list and read your files.
1. Generate the model
Invoke thegenerate-architecture prompt. It accepts three optional arguments:
| Argument | Purpose |
|---|---|
useCaseId | The use case to save to. Omit it and the agent runs list-use-cases and asks you which one. |
scope | A path, glob, or monorepo package to base the model on (e.g. apps/keldyn-api). Defaults to the whole repository. |
instructions | Extra product/architecture hints to honor while modeling. |
Map the system from code
List tracked files (e.g.
git ls-files), then read entrypoints, service boundaries, APIs, data stores, auth, queues, external integrations, and infra/config — restricted to your scope if you set one.Use the real schema for enums
Read the
keldyn://threagile-schema resource for allowed property names and enum values (rather than guessing), including production-required root fields like business_criticality.2. Analyze the architecture
Once a model is saved, runanalyze-use-case-architecture to threat-model it and check it against your frameworks in one pass.
- Security risks (from Threagile) — each with
severity,CWE,STRIDEcategory, and the affected asset. - Compliance failures (failed RCM architecture checks) — each with the
frameworkNameandrcmIdit violates.
proposedEdit: a natural-language remediation the agent can turn into an architecture change.
| Argument | Purpose |
|---|---|
useCaseId | The use case to analyze. Omit to use the first listed use case. |
run | true (default) runs a fresh Threagile analysis (can take up to ~3 minutes). Set false to read the last stored analysis instead. RCM compliance checks are always computed live. |
Analysis requires a saved architecture — run
generate-architecture / update-use-case-architecture first. Issues are capped at 32 per call; when more remain, the result flags truncated with a remainingIssues count so you fix a batch at a time.3. Remediate and re-verify
Architecture hardening is a loop: fix a batch of issues, save, and re-run to confirm they cleared and fetch the next batch.Turn proposed edits into model changes
For each issue, convert its
proposedEdit into a concrete change to the architecture object (e.g. add an encryption protocol on a link, introduce a trust boundary, tag a data asset).Keeping the model current
Re-rungenerate-architecture (or targeted update-use-case-architecture edits) after significant changes — new services, data stores, or integrations — so the threat model and compliance checks stay accurate. Pair this with the controls-to-code workflow: an up-to-date architecture is what drives the architecture-based control checks you close there.
Next steps
From controls to code
Read your controls, analyze code for evidence, and close gaps with tasks.
Keldyn MCP server
Connect your AI tool and see the full catalog of tools and prompts.
Working with a use case
Explore the Architecture Workspace and track control progress in the app.
Frameworks & controls
See how architecture checks feed control coverage and maturity.