architecture

architecture is a cursor rule for Cursor from mordilion/ai-instructions-and-prompts. It costs 0 tokens per session (456 once invoked), scanned A, original, MIT.

A set of Bash shell-script architecture rules covering script structure, configuration, command-line inputs, portability, and exit codes.

In plain words
What is it for?
Use it when designing or reviewing Bash scripts, especially their main function, helper libraries, flags, configuration, file paths, and failure handling.
Why use it?
It helps keep scripts focused, understandable, portable, and clear about how they receive input and report errors.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when designing or reviewing Bash scripts, especially their main function, helper libraries, flags, configuration, file paths, and failure handling.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/mordilion/ai-instructions-and-prompts/architecture
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.

Clone the repo
git clone --depth 1 https://github.com/mordilion/ai-instructions-and-prompts

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 architecture

README.md
[![agentmods](https://agentmods.dev/badge/rules/mordilion/ai-instructions-and-prompts/architecture/github.svg)](https://agentmods.dev/rules/mordilion/ai-instructions-and-prompts/architecture)
Your own site
<a href="https://agentmods.dev/rules/mordilion/ai-instructions-and-prompts/architecture"><img src="https://agentmods.dev/badge/rules/mordilion/ai-instructions-and-prompts/architecture/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for architecture

Your own site · 80×15
<a href="https://agentmods.dev/rules/mordilion/ai-instructions-and-prompts/architecture"><img src="https://agentmods.dev/badge/rules/mordilion/ai-instructions-and-prompts/architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 456 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00000 $0.00456
Opus 5 $0.00000 $0.00228
Sonnet 5 $0.00000 $0.00091
Haiku 4.5 $0.00000 $0.00046

Measured 10d ago against content hash 2392731177b7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

architecture 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 10d 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.

.cursor/rules/bash/architecture.mdc · 40 lines

What it actually says

Bash Architecture

Scope: Apply these rules ONLY when working with shell scripts (*.sh, *.bash, *.zsh, *.ksh, *.bats). These extend the general architecture guidelines.

1. Core Principles

  • Single responsibility: One script = one job. Split reusable logic into libraries.
  • Predictability: Prefer explicit inputs/outputs, clear exit codes, and deterministic behavior.
  • Portability: Default to Bash; avoid relying on non-standard tools unless explicitly required.

2. Script Layout

  • Entry point: Prefer a main() function and call it at the bottom.
  • Sections order:
    1. Shebang + metadata/comments
    2. Strict mode + globals (constants)
    3. Helper functions
    4. main() (or command dispatcher)
    5. main "$@"
  • Libraries: Put reusable functions in scripts/lib/*.sh (or lib/) and source them explicitly.

3. Configuration & Inputs

  • Config: Prefer env vars and flags; allow config files only when necessary.
  • CLI: Use getopts for flags; document usage in usage() and return exit code 2 for CLI misuse.
  • I/O: Prefer explicit files/paths; avoid implicit cwd assumptions.

4. Exit Codes & Error Boundaries

  • Exit codes: Use 0 success, 1 generic failure, 2 usage/validation errors.
  • Error boundaries: Fail fast; validate prerequisites early (required commands, files, permissions).
  • Logging: Standardize log_info, log_warn, log_error and write errors to stderr.

5. Composition

  • Pipelines: Avoid deep pipelines; break into named functions for readability.
  • Idempotency: For provisioning/deploy scripts, prefer idempotent steps (safe to re-run).
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. 10d ago First seen · 40 lines · 0 tokens per session scan A 2392731177b7

Subscribe to this mod's changes

architecture is a cursor rule published in the GitHub repository mordilion/ai-instructions-and-prompts (1 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 456 tokens. 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-31.