using-archipy-models

using-archipy-models is a cursor rule for Cursor from SyntaxArc/archipy-plugin. It costs 2,041 tokens per session, scanned A, original, MIT.

A set of rules for organising ArchiPy data models, including database entities, data-transfer objects, types, and domain errors. Data-transfer objects carry structured data between parts of an application.

In plain words
What is it for?
Choosing model folders, naming input and output DTOs, defining repository commands and queries, and creating ArchiPy-based errors.
Why use it?
It keeps data structures separate from input/output work and business rules, making service boundaries and model names consistent.

Cursor rule for Cursor

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

Good fit Choosing model folders, naming input and output DTOs, defining repository commands and queries, and creating ArchiPy-based errors.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/rules/syntaxarc/archipy-plugin/using-archipy-models"><img src="https://agentmods.dev/badge/rules/syntaxarc/archipy-plugin/using-archipy-models.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,041 This file is loaded in full into every session.
When invoked 2,041 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.02041 $0.02041
Opus 5.5 $0.00816 $0.00816
Sonnet 5.5 $0.00408 $0.00408
Haiku 4.5 $0.00204 $0.00204

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

Security

Grade A, and why

using-archipy-models 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 2d 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/using-archipy-models.mdc · 152 lines

How it starts

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

Using ArchiPy Models

Data structures only — no I/O, no business rules.

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

Scaffold: /scaffold-models (composed by /scaffold-domain).

Layout

models/
├── entities/                 # SQLAlchemy BaseEntity subclasses
├── errors/                   # Domain errors extending ArchiPy BaseError hierarchy
├── types/                    # Optional enums / aliases
└── dtos/{domain}/
    ├── domain/v{n}/          # Versioned — cross service boundary
    └── repository/           # Internal — never versioned

DTO Naming

Kind Pattern Example
Domain input {Op}InputDTO UserRegistrationInputDTO
Domain output {Op}OutputDTO UserRegistrationOutputDTO
Repository command {Action}CommandDTO CreateUserCommandDTO
Repository query {Action}QueryDTO GetUserByIdQueryDTO
Repository response {Domain}ResponseDTO UserResponseDTO

DTOs should extend archipy.models.dtos.base_dtos.BaseDTO for ArchiPy's shared Pydantic configuration. Use plain Pydantic BaseModel only when the app needs deliberately different model behavior. Prefer ArchiPy base entities where applicable.

BaseDTO is frozen, strips surrounding string whitespace, validates defaults, and supports from_attributes. Do not mutate DTO instances after validation.

Paged search DTOs: ArchiPy first

Before writing a page, sort, or total shape, use the ArchiPy DTOs from archipy.models.dtos (needs archipy>=5.14.0 for the output ones):

Need Use
Page request PaginationDTO (page, page_size, offset); it rejects page * page_size above PAGINATION.MAX_ITEMS
Sort request SortDTO
Search input (pagination + sort) SearchInputDTO
Search output whose total comes from execute_search_query SearchOutputDTO (adds total_count and the computed total_count_estimated)
Search output whose total the repository counts itself ExactSearchOutputDTO (total_count_estimated is always false)

Read the full file on GitHub · 152 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. 2d ago Changed · +34 lines · +439 tokens per session a8fe4116f911
  2. 12d ago Changed · +55 lines · +931 tokens per session 0b7a80aa91ea
  3. 1mo ago Changed · +2 lines · +19 tokens per session 198077be41d6
  4. 1mo ago Changed · +12 lines · +205 tokens per session 5562184bebdf
  5. 1mo ago First seen · 49 lines · 447 tokens per session scan A 6a960b6599d7

Subscribe to this mod's changes

using-archipy-models is a cursor rule published in the GitHub repository SyntaxArc/archipy-plugin (3 stars, last pushed 2d ago), licensed MIT. It adds 2,041 tokens to every session, about $0.0082 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.