architecture-for-apps

architecture-for-apps is a cursor rule for Cursor from SyntaxArc/archipy-plugin. It costs 701 tokens per session, scanned A, original, MIT.

Rules for organizing an ArchiPy application into layers such as configuration, data models, repositories, business logic, and web or network services.

In plain words
What is it for?
Use them when designing an ArchiPy app, deciding where code belongs, or checking how requests should flow from services to databases.
Why use it?
They prevent unrelated layers from depending on each other in confusing ways and keep business rules separate from frameworks and data access.

Cursor rule for Cursor

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

Good fit Use them when designing an ArchiPy app, deciding where code belongs, or checking how requests should flow from services to databases.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/syntaxarc/archipy-plugin/architecture-for-apps
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/SyntaxArc/archipy-plugin

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-for-apps

README.md
[![agentmods](https://agentmods.dev/badge/rules/syntaxarc/archipy-plugin/architecture-for-apps/github.svg)](https://agentmods.dev/rules/syntaxarc/archipy-plugin/architecture-for-apps)
Your own site
<a href="https://agentmods.dev/rules/syntaxarc/archipy-plugin/architecture-for-apps"><img src="https://agentmods.dev/badge/rules/syntaxarc/archipy-plugin/architecture-for-apps/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-for-apps

Your own site · 80×15
<a href="https://agentmods.dev/rules/syntaxarc/archipy-plugin/architecture-for-apps"><img src="https://agentmods.dev/badge/rules/syntaxarc/archipy-plugin/architecture-for-apps.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 701 This file is loaded in full into every session.
When invoked 701 The same file — it is already loaded in full.
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.00701 $0.00701
Opus 5.5 $0.00280 $0.00280
Sonnet 5.5 $0.00140 $0.00140
Haiku 4.5 $0.00070 $0.00070

Measured 1mo ago against content hash 396b301c4eaa, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

architecture-for-apps 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 1mo 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.

rules/architecture-for-apps.mdc · 68 lines

How it starts

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

Architecture for ArchiPy Apps

Use this when building applications that depend on the archipy package (not when maintaining ArchiPy itself).

Live concepts: https://syntaxarc.github.io/ArchiPy/getting-started/concepts/

Layer Map

your_app/
├── configs/          # BaseConfig subclasses, DI containers
├── models/           # Entities, DTOs, errors, types — data structures only
│   └── dtos/{domain}/
│       ├── domain/v{n}/   # Versioned — cross service boundary
│       └── repository/    # Internal — never versioned
├── repositories/
│   └── {domain}/
│       ├── adapters/              # Domain wrappers around ArchiPy adapters
│       └── {domain}_repository.py # Orchestrate adapters; map to DTOs
├── logics/
│   └── {domain}/         # Use-case / unit-of-work boundaries
└── services/
    └── {domain}/v{n}/    # Transport (HTTP/gRPC routers), versioned

Optional app-local helpers (prefer archipy.helpers first): helpers/{utils,decorators,interceptors}/.

Call Flow

services → logics (atomic UoW) → repositories → adapters → ArchiPy

Plugin shorthand @atomic means a real *_sqlalchemy_atomic — there is no decorator named atomic.

Layer Rules

Layer details live in the matching using-archipy-*.mdc / config-and-di.mdc / testing-bdd-for-apps.mdc rules when those files are open. This always-on rule keeps only the global map:

  • models/ — data only (no I/O, no business rules).
  • repositories/ — domain data access; adapters under repositories/{domain}/adapters/; no cross-domain repo calls. Domain adapters map driver errors with raise ... from e; repository orchestrators consume domain-facing errors.
  • logics/ — business rules + UoW (*_sqlalchemy_atomic); may call other logics; never other domains' repositories; no FastAPI/gRPC.
  • services/ — thin transport; versioned v{n}/; no UoW / business rules.
  • helpers/ — pure only; prefer ArchiPy; no adapter construction at module level.
  • configs/ — extend BaseConfig; set_global once; no secrets in code.

Read the full file on GitHub · 68 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. 1mo ago Changed · -4 tokens per session 396b301c4eaa
  2. 2mo ago Changed · -2 lines · +14 tokens per session ad9573256856
  3. 3mo ago First seen · 70 lines · 691 tokens per session scan A 8e459e7af121

Subscribe to this mod's changes

architecture-for-apps is a cursor rule published in the GitHub repository SyntaxArc/archipy-plugin (3 stars, last pushed 23d ago), licensed MIT. It adds 701 tokens to every session, about $0.0028 per session on Opus 5.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-31.

Related

architecture-for-apps compared with cursor rules from other repositories

architecture-for-apps next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
architecture-for-appsSyntaxArc/archipy-pluginCursor rule323d agoMITA701Cursor
python-flask-json-guide-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A185Cursor
py-fast-apiPatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A720Cursor
python-django-best-practices-cursorrules-prompt-fiPatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A698Cursor
pythonPatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A734Cursor
python-fastapi-best-practices-cursorrules-prompt-fPatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A486Cursor
fastapiPatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A427Cursor