using-archipy-utils

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

A guide to ArchiPy's reusable helper functions and application factories. The helpers handle tasks such as dates, strings, passwords, tokens, files, tracing, and rate limits, while the factories create configured FastAPI or gRPC applications.

In plain words
What is it for?
Use it when you need common data or security helpers, or when starting a FastAPI HTTP service or gRPC server with ArchiPy's standard configuration and middleware.
Why use it?
It prevents duplicated utility code and avoids inconsistent setup for HTTP and gRPC services. It also keeps helpers free from database access, network calls, and business rules.

Cursor rule for Cursor

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

Good fit Use it when you need common data or security helpers, or when starting a FastAPI HTTP service or gRPC server with ArchiPy's standard configuration and middleware.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/rules/syntaxarc/archipy-plugin/using-archipy-utils"><img src="https://agentmods.dev/badge/rules/syntaxarc/archipy-plugin/using-archipy-utils.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,363 This file is loaded in full into every session.
When invoked 1,363 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.01363 $0.01363
Opus 5.5 $0.00545 $0.00545
Sonnet 5.5 $0.00273 $0.00273
Haiku 4.5 $0.00136 $0.00136

Measured 4d ago against content hash 2fa077f04e7c, 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-utils 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 4d 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-utils.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.

Using ArchiPy Utils

Helpers stay pure: no database calls, no network I/O, no constructing adapters, no domain business rules.

Prefer ArchiPy Utils

Before writing a custom util, check whether ArchiPy already provides it under archipy.helpers.utils:

  • OtelUtils, RateLimitUtils
  • DatetimeUtils, StringUtils, JWTUtils, PasswordUtils, FileUtils, ErrorUtils
  • Also: BaseUtils, TOTPUtils
  • Keycloak guards are not a util: use fastapi_auth / grpc_auth from archipy.adapters.keycloak.auth (archipy >= 5.16.0; KeycloakUtils is deprecated, removed in 6.0.0)
  • Import from concrete submodules (e.g. archipy.helpers.utils.jwt_utils) — package __init__ does not re-export
  • AppUtils — FastAPI / gRPC app factories (see below)

Hand-rolled code → ArchiPy util

Before writing this logic anywhere in the app (logics, services, repositories too, not only helpers/):

Instead of hand-rolling… Use (import from concrete submodule)
datetime.now() / utcnow(), strftime/strptime, tz fixes DatetimeUtils.get_datetime_utc_now, get_datetime_now, get_epoch_time_now, get_string_datetime_from_datetime, get_datetime_from_string_datetime, ensure_timezone_aware, daterange, convert_to_jalali (datetime_utils)
bcrypt / passlib / hashlib password hashing, password policy PasswordUtils.hash_password, verify_password, validate_password, generate_password (password_utils)
import jwt / PyJWT encode-decode (needs archipy[jwt]) JWTUtils.create_access_token, create_refresh_token, verify_access_token, verify_refresh_token, decode_token (jwt_utils)
pyotp / hand-made OTP codes TOTPUtils.generate_totp, verify_totp, generate_secret_key_for_totp (totp_utils)
regex text cleanup, snake/camel, masking, Persian/Arabic digits StringUtils.snake_to_camel_case, camel_to_snake_case, mask_emails, mask_phones, mask_urls, normalize_persian_text, convert_numbers_to_english, is_string_none_or_empty (string_utils)
upload filename checks, signed download links FileUtils.validate_file_name, create_secure_link (file_utils)
per-route exception to HTTP/gRPC mapping, validation formatting ErrorUtils.* via AppUtils (error_utils)
Iranian phone / national-code validation BaseUtils.validate_iranian_phone_number, validate_iranian_national_code_pattern (base_utils)
bare FastAPI() / grpc.server() AppUtils.create_fastapi_app, create_grpc_app, create_async_grpc_app (app_utils)

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. 4d ago Changed · +1 lines · +34 tokens per session 2fa077f04e7c
  2. 19d ago Changed · +1 lines · +54 tokens per session 1d778655ca85
  3. 1mo ago Changed · +19 lines · +525 tokens per session 38b491443c33
  4. 2mo ago Changed · +4 lines · +73 tokens per session 6885ccad5048
  5. 2mo ago First seen · 63 lines · 677 tokens per session scan A 2153cc51eb84

Subscribe to this mod's changes

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

using-archipy-utils compared with cursor rules from other repositories

using-archipy-utils next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
using-archipy-utilsSyntaxArc/archipy-pluginCursor rule35d agoMITA1,363Cursor
python-flask-json-guide-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k5mo agoCC0-1.0A185Cursor
py-fast-apiPatrickJS/awesome-cursorrulesCursor rule41k5mo agoCC0-1.0A720Cursor
python-django-best-practices-cursorrules-prompt-fiPatrickJS/awesome-cursorrulesCursor rule41k5mo agoCC0-1.0A698Cursor
pythonPatrickJS/awesome-cursorrulesCursor rule41k5mo agoCC0-1.0A734Cursor
python-fastapi-best-practices-cursorrules-prompt-fPatrickJS/awesome-cursorrulesCursor rule41k5mo agoCC0-1.0A486Cursor
fastapiPatrickJS/awesome-cursorrulesCursor rule41k5mo agoCC0-1.0A427Cursor