generate-architecture-doc

generate-architecture-doc is a cursor rule for Cursor from robotaitai/project-bedrock. It costs 33 tokens per session (1,040 once invoked), scanned A, original, MIT.

A procedure for producing a self-contained HTML architecture document for a Cramim ROS2 package. ROS2 is a framework for software components that communicate through messages, services, and actions.

In plain words
What is it for?
Use it to document a package’s purpose, inputs, outputs, dependencies, data flow, startup configuration, and state machine with diagrams.
Why use it?
It turns source code, configuration, dependencies, and communication paths into a clear description of how the package works.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/robotaitai/project-bedrock/generate-architecture-doc
Clone the repo
git clone --depth 1 https://github.com/robotaitai/project-bedrock

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for generate-architecture-doc

README.md
[![agentmods](https://agentmods.dev/badge/rules/robotaitai/project-bedrock/generate-architecture-doc.svg)](https://agentmods.dev/rules/robotaitai/project-bedrock/generate-architecture-doc)
Your own site
<a href="https://agentmods.dev/rules/robotaitai/project-bedrock/generate-architecture-doc"><img src="https://agentmods.dev/badge/rules/robotaitai/project-bedrock/generate-architecture-doc.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,040 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.01040
Opus 5 $0.00016 $0.00520
Sonnet 5 $0.00007 $0.00208
Haiku 4.5 $0.00003 $0.00104

Measured 6d ago against content hash 03c373568b8f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

generate-architecture-doc scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

assets/rules/generate-architecture-doc.mdc · 88 lines

How it starts

The opening of the file, as written. The whole thing — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Generate Architecture HTML Document

When asked to create an architecture document for a Cramim package, produce a self-contained HTML file in architecture_docs/ following this process.

1. Research the Package

Before writing anything, thoroughly investigate the target package:

  • Read all .hpp and .cpp files in the package
  • Read package.xml and CMakeLists.txt for dependencies
  • Read any config/YAML files referenced by launch files
  • Grep for create_publisher, create_subscription, create_service, create_client to find all ROS interfaces
  • Grep for state definitions (State::createStateSharedPtr, enums, or equivalent patterns)
  • Trace the full data flow from inputs to outputs
  • Identify all inter-node communication patterns
  • Read launch files to understand how the node is started and configured

2. Required Content Sections

Every architecture doc must include:

  1. Executive summary — what the component does, 2-3 sentences, with role badges for related components
  2. Table of contents with anchor links
  3. Architecture diagram — where this component fits in the overall Cramim system (Mermaid flowchart)
  4. State machine (if applicable) — Mermaid stateDiagram-v2 with all states and transitions
  5. State detailson_enter, in_state, on_exit callbacks for each state (table per state)
  6. Transition table — every transition with From, To, Condition, Side Effect columns
  7. End-to-end flow — Mermaid sequenceDiagram showing the main operational flow
  8. Topics & services — tables for published topics, subscribed topics, provided services, called services (columns: name, type, description)
  9. Interactions with other nodes — summary cards showing who talks to whom
  10. Key design decisions — bullet list of architectural choices and why
  11. File structure — annotated directory tree in a <pre> block

3. Visual Style

Use the exact dark-theme style from the reference file architecture_docs/dc_behavior_tree_workplan.html:

Read the full file on GitHub · 88 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 88 lines · 33 tokens per session scan A 03c373568b8f

Subscribe to this mod's changes

generate-architecture-doc is a cursor rule published in the GitHub repository robotaitai/project-bedrock (45 stars, last pushed 16d ago), licensed MIT. It adds 33 tokens to every session and 1,040 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.