animated-aws-arch
Produce a light-background, left-to-right, animated AWS architecture SVG: official
AWS service icons (white glyph on a brand-color tile), orthogonal connectors that flow
as marching-ants dashes, colored dots that ride real request journeys, numbered spine
steps, and dashed containment boundaries (AWS Cloud region ⊃ VPC / event-driven box).
One .svg file, no external assets, opens in any browser, and animates inside a GitHub
README image embed.
You author a small JSON spec (nodes + edges + groups + journeys); the bundled
generator computes the SVG. You never hand-type SVG XML.
When to use
- Default for any architecture / system / infra diagram. Prefer this over a static
image whenever the diagram represents things that move (requests, events, jobs, data).
- Contrast with
~/.claude/reference/architecture-diagrams.md (draw.io): reach for
draw.io only when the user explicitly wants a purely static, editable .drawio
source, or an official-repo static PNG. Otherwise use this skill.
Workflow
- Author the spec. Copy
references/example-chatops-agent.json and edit it. That
file is the canonical, working example — a complete Chat-app × Bedrock AgentCore
reference architecture. Read it first; it shows every field in use.
- Render:
python3 scripts/gen_arch.py <spec>.json <out>.svg
(write the spec to a temp path; the deliverable is only the .svg).
- Verify (mandatory). Headless-render to PNG and read the PNG — the generator can't
see label collisions or off-canvas labels:
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --headless --disable-gpu \
--screenshot=/tmp/arch.png --window-size=1480,920 --hide-scrollbars \
--default-background-color=FFFFFFFF "file://$(pwd)/<out>.svg"
Check: no label clipped at the right/top edge, no diagonal connectors (all segments
orthogonal), every boundary fully contains its members, edge labels not sitting on
top of each other. Fix by editing the JSON (move a node, add mids, nudge lxy) and
re-render. Usually 2–4 rounds.
- Deliver the
.svg. Tell the user it opens in any browser and animates.
Spec schema (see the example for a full instance)
{
"title": "...", "subtitle": "...", "footer": "...",
"canvas": {"w": 1480, "h": 900},
"nodes": [
{"id": "runtime", "x": 800, "y": 408, "icon": "agentcore",
"label": "AgentCore Runtime", "sub": "Claude Agent SDK"}
],
"groups": [
{"kind": "region|subnet|event", "x": .., "y": .., "w": .., "h": ..,
"label": "...", "lx": .., "ly": .., "labelPos": "bottom"} // lx/ly/labelPos optional
],
"edges": [
{"from": "a", "fs": "r", "to": "b", "ts": "l", "flow": "request",
"label": "...", "lxy": [x, y], "mids": [[x,y]], "static": false}
],
"journeys": [
{"flow": "request", "dur": 2.6, "reverse": false, "hops": [["a","b"],["b","c"]]}
],
"steps": [["a","b",1]], // numbered ①.. badges on the midpoint of an edge
"legend": ["request","reply","schedule","ambient","garden","tool"]
}
fs/ts = exit/enter side of the icon: l r t b (edge stops at the 46px icon edge).
mids = orthogonal waypoints. Keep every segment horizontal or vertical — no diagonals.
A segment is diagonal iff consecutive points differ in both x and y; insert a waypoint.
flow picks the color + animation: request blue, reply teal, schedule green,
ambient violet, garden amber, tool sky, aux grey. "static": true draws a quiet
dotted line (no marker, no animation) — use for cross-cutting deps (Secrets/KMS: draw ONE
representative line, not one per consumer).
journeys are the animated dots. reverse: true sends the dot backward along a forward
edge's path (used for the reply traveling right→left on the spine). 3–5 journeys total.
Layout conventions (this is what keeps it clean)
Left-to-right on a fixed grid. The example uses three horizontal bands:
- Spine row (
y≈408): the main request path, left→right, one straight line:
client → API Gateway → webhook → compute → gateway → model. Put the steps ①.. here.
- Top band (
y≈168): event-driven / async producers (EventBridge + its Lambdas),
wrapped in an event group box.
- Bottom row (
y≈660): data stores (memory, DynamoDB, S3) + Secrets Manager.
Rules that prevent spaghetti:
- Align nodes on shared x (vertical edges) and shared y (horizontal edges) so those
edges are dead straight. Columns in the example line up across bands (e.g. webhook and
Dispatcher share x=576 → a straight vertical
deliver).
- A vertical edge must not pass through an intermediate node on that column — route it
up/over via a
mids lane in clear space.
- External (non-AWS) systems sit outside the region box (client on the left, third
parties on the right).
Icons
icon is a filename key in icons/ (56 official AWS icons bundled). Common keys:
lambda apigateway agentcore bedrock dynamodb s3 cloudwatch ecr cloudfront xray eventbridge secretsmanager sqs stepfunctions ec2 ecs eks rds kms iam cognito vpc route53 elb nat sagemaker opensearch glue athena waf guardduty efs ebs connect. Run ls icons/ for the full list.
- The core set (lambda, apigateway, bedrock, dynamodb, s3, cloudwatch, ecr, cloudfront,
agentcore, xray) are the newer flat official icons; the rest are the gradient
generation, auto-flattened to their flat AWS category color by the generator's
FLATTEN
map. To add a service: drop Arch_*.svg (or any official icon SVG) into icons/ as
<key>.svg; if it uses a gradient tile, add "<key>": "#<flatcolor>" to FLATTEN in
scripts/gen_arch.py.
- Non-AWS nodes use built-in tiles instead of a file:
tile:lark (chat bubble),
tile:gateway (router chevrons, for LiteLLM/proxies), tile:external (magnifier, for
Exa / third-party APIs), tile:generic.
- AgentCore rule: AgentCore Runtime and Memory both use
agentcore (the official
Bedrock-AgentCore icon). AWS ships no per-sub-feature icons; the label distinguishes them.
Never draw AgentCore Memory as a database cylinder — it reads as a plain DB.
Boundaries
region = amber/teal dashed (AWS Cloud / Region / account / VPC-as-region); subnet =
purple dashed (VPC / private subnet / security group, nested inside a region); event =
pink dotted (an event-driven job cluster). Label top-left by default; set "labelPos": "bottom" when the top is crowded. A boundary must clear its members by ≥20px on all sides.
GitHub animation — the important caveat
- In a README (
 embed): it animates. Same mechanism as the popular
animated-SVG README badges. This is how an animated architecture README shows it moving.
- Opening the standalone
.svg blob page on github.com: usually static — GitHub
sanitizes SMIL in the file viewer. So embed it in markdown; don't tell the user to click
the raw file to see motion.
- Locally / in any browser: full animation.
Delivery
Commit the .svg and embed it in the README with .
Keep the file self-contained (no external refs — the generator inlines every icon).
The spec JSON is a build intermediate; keep it if you want cheap re-renders, but the README
only needs the .svg.
1---2name: animated-aws-arch3description: Draw an animated, light-theme, LEFT-TO-RIGHT AWS architecture diagram as one self-contained SVG — official AWS service icons, marching-ants connectors, and traveling request dots that show data moving through the system. Use this whenever the user asks for an architecture / 架构图 / system / infrastructure / cloud diagram, ESPECIALLY when they want it animated / dynamic / "会动的" / for a README or GitHub, or say "用这个风格 / that style". This is the default style for architecture diagrams. The output SVG animates when embedded in a GitHub README.4---56# animated-aws-arch78Produce a **light-background, left-to-right, animated AWS architecture SVG**: official9AWS service icons (white glyph on a brand-color tile), orthogonal connectors that flow10as marching-ants dashes, colored dots that ride real request journeys, numbered spine11steps, and dashed containment boundaries (AWS Cloud region ⊃ VPC / event-driven box).12One `.svg` file, no external assets, opens in any browser, and **animates inside a GitHub13README image embed**.1415You author a small **JSON spec** (nodes + edges + groups + journeys); the bundled16generator computes the SVG. You never hand-type SVG XML.1718## When to use1920- **Default for any architecture / system / infra diagram.** Prefer this over a static21 image whenever the diagram represents things that move (requests, events, jobs, data).22- Contrast with `~/.claude/reference/architecture-diagrams.md` (draw.io): reach for23 **draw.io only** when the user explicitly wants a purely static, editable `.drawio`24 source, or an official-repo static PNG. Otherwise use this skill.2526## Workflow27281. **Author the spec.** Copy `references/example-chatops-agent.json` and edit it. That29 file is the canonical, working example — a complete Chat-app × Bedrock AgentCore30 reference architecture. Read it first; it shows every field in use.312. **Render:** `python3 scripts/gen_arch.py <spec>.json <out>.svg`32 (write the spec to a temp path; the deliverable is only the `.svg`).333. **Verify (mandatory).** Headless-render to PNG and *read the PNG* — the generator can't34 see label collisions or off-canvas labels:35 ```bash36 "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --headless --disable-gpu \37 --screenshot=/tmp/arch.png --window-size=1480,920 --hide-scrollbars \38 --default-background-color=FFFFFFFF "file://$(pwd)/<out>.svg"39 ```40 Check: no label clipped at the right/top edge, no diagonal connectors (all segments41 orthogonal), every boundary fully contains its members, edge labels not sitting on42 top of each other. Fix by editing the JSON (move a node, add `mids`, nudge `lxy`) and43 re-render. Usually 2–4 rounds.444. **Deliver** the `.svg`. Tell the user it opens in any browser and animates.4546## Spec schema (see the example for a full instance)4748```jsonc49{50 "title": "...", "subtitle": "...", "footer": "...",51 "canvas": {"w": 1480, "h": 900},52 "nodes": [53 {"id": "runtime", "x": 800, "y": 408, "icon": "agentcore",54 "label": "AgentCore Runtime", "sub": "Claude Agent SDK"}55 ],56 "groups": [57 {"kind": "region|subnet|event", "x": .., "y": .., "w": .., "h": ..,58 "label": "...", "lx": .., "ly": .., "labelPos": "bottom"} // lx/ly/labelPos optional59 ],60 "edges": [61 {"from": "a", "fs": "r", "to": "b", "ts": "l", "flow": "request",62 "label": "...", "lxy": [x, y], "mids": [[x,y]], "static": false}63 ],64 "journeys": [65 {"flow": "request", "dur": 2.6, "reverse": false, "hops": [["a","b"],["b","c"]]}66 ],67 "steps": [["a","b",1]], // numbered ①.. badges on the midpoint of an edge68 "legend": ["request","reply","schedule","ambient","garden","tool"]69}70```7172- `fs`/`ts` = exit/enter **side** of the icon: `l r t b` (edge stops at the 46px icon edge).73- `mids` = orthogonal waypoints. **Keep every segment horizontal or vertical — no diagonals.**74 A segment is diagonal iff consecutive points differ in *both* x and y; insert a waypoint.75- `flow` picks the color + animation: `request` blue, `reply` teal, `schedule` green,76 `ambient` violet, `garden` amber, `tool` sky, `aux` grey. `"static": true` draws a quiet77 dotted line (no marker, no animation) — use for cross-cutting deps (Secrets/KMS: draw ONE78 representative line, not one per consumer).79- `journeys` are the animated dots. `reverse: true` sends the dot backward along a forward80 edge's path (used for the reply traveling right→left on the spine). 3–5 journeys total.8182## Layout conventions (this is what keeps it clean)8384Left-to-right on a fixed grid. The example uses three horizontal bands:8586- **Spine row** (`y≈408`): the main request path, left→right, one straight line:87 client → API Gateway → webhook → compute → gateway → model. Put the `steps` ①.. here.88- **Top band** (`y≈168`): event-driven / async producers (EventBridge + its Lambdas),89 wrapped in an `event` group box.90- **Bottom row** (`y≈660`): data stores (memory, DynamoDB, S3) + Secrets Manager.9192Rules that prevent spaghetti:93- **Align nodes on shared x (vertical edges) and shared y (horizontal edges)** so those94 edges are dead straight. Columns in the example line up across bands (e.g. webhook and95 Dispatcher share x=576 → a straight vertical `deliver`).96- A vertical edge must not pass **through** an intermediate node on that column — route it97 up/over via a `mids` lane in clear space.98- External (non-AWS) systems sit **outside** the region box (client on the left, third99 parties on the right).100101## Icons102103`icon` is a filename key in `icons/` (56 official AWS icons bundled). Common keys:104`lambda apigateway agentcore bedrock dynamodb s3 cloudwatch ecr cloudfront xray eventbridge105secretsmanager sqs stepfunctions ec2 ecs eks rds kms iam cognito vpc route53 elb nat sagemaker106opensearch glue athena waf guardduty efs ebs connect`. Run `ls icons/` for the full list.107108- The core set (lambda, apigateway, bedrock, dynamodb, s3, cloudwatch, ecr, cloudfront,109 agentcore, xray) are the **newer flat** official icons; the rest are the gradient110 generation, auto-flattened to their flat AWS category color by the generator's `FLATTEN`111 map. To add a service: drop `Arch_*.svg` (or any official icon SVG) into `icons/` as112 `<key>.svg`; if it uses a gradient tile, add `"<key>": "#<flatcolor>"` to `FLATTEN` in113 `scripts/gen_arch.py`.114- **Non-AWS nodes** use built-in tiles instead of a file: `tile:lark` (chat bubble),115 `tile:gateway` (router chevrons, for LiteLLM/proxies), `tile:external` (magnifier, for116 Exa / third-party APIs), `tile:generic`.117- **AgentCore rule:** AgentCore Runtime **and** Memory both use `agentcore` (the official118 Bedrock-AgentCore icon). AWS ships no per-sub-feature icons; the label distinguishes them.119 **Never draw AgentCore Memory as a database cylinder** — it reads as a plain DB.120121## Boundaries122123`region` = amber/teal dashed (AWS Cloud / Region / account / VPC-as-region); `subnet` =124purple dashed (VPC / private subnet / security group, nested inside a region); `event` =125pink dotted (an event-driven job cluster). Label top-left by default; set `"labelPos":126"bottom"` when the top is crowded. A boundary must clear its members by ≥20px on all sides.127128## GitHub animation — the important caveat129130- **In a README (`` embed): it animates.** Same mechanism as the popular131 animated-SVG README badges. This is how an animated architecture README shows it moving.132- **Opening the standalone `.svg` blob page on github.com: usually static** — GitHub133 sanitizes SMIL in the file viewer. So embed it in markdown; don't tell the user to click134 the raw file to see motion.135- Locally / in any browser: full animation.136137## Delivery138139Commit the `.svg` and embed it in the README with ``.140Keep the file self-contained (no external refs — the generator inlines every icon).141The spec JSON is a build intermediate; keep it if you want cheap re-renders, but the README142only needs the `.svg`.