core

A set of project rules for building software with tests first and keeping the architecture documentation as the single source of truth. TDD means writing a failing test, making it pass with the smallest change, then improving the code.

In plain words
What is it for?
It is for guiding feature work, service or API changes, authentication and data-flow changes, and updates to the project’s architecture diagrams and documentation.
Why use it?
It prevents code and architecture documents from drifting apart and requires new behaviour to be tested before it is shipped.

Cursor rule for Cursor

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/parzival1l/altru/core
Clone the repo
git clone --depth 1 https://github.com/parzival1l/Altru

Made for: Cursor.

Per session 779 This file is loaded in full into every session.
When invoked 779 The same file — it is already loaded in full.
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 $0.00779 $0.00779
Opus 5 $0.00390 $0.00390
Sonnet 5 $0.00156 $0.00156
Haiku 4.5 $0.00078 $0.00078

Measured 2d ago against content hash 874dd3b90fda, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

core 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.

.cursor/rules/core.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.

Altru — Core Rules

Stack Conventions

Align all implementation with docs/architecture.md. Update that file as the stack is decided.

  • Frontend: TBD — update docs/architecture.md when confirmed.
  • Backend: TBD — update docs/architecture.md when confirmed.
  • Infra: TBD — update docs/architecture.md when confirmed.

Architecture Update Rule (non-negotiable)

Whenever any service, data flow, API contract, or component changes:

  1. Update docs/architecture.md before or in the same commit as the code change.
  2. If docs/architecture.md and the implementation disagree, the code is wrong — fix one or the other; never leave them out of sync.
  3. If you are adding a new service, changing an API shape, or altering auth/data flows, update the Mermaid diagram in docs/architecture.md.

Test-Driven Development (Mandatory for New Features)

Non-negotiable: Do not merge or ship new feature behaviour without Red → Green → Refactor TDD.

Cycle

  1. Red — Write a failing automated test that defines the required behaviour. Run it and confirm it fails.
  2. Green — Write the minimum code that makes the test pass. No extras.
  3. Refactor — Improve structure and remove duplication. All tests must stay green.

Defaults by Layer

  • Backend: Use the project's test runner (e.g. pytest for Python, jest/vitest for Node). Mock external services. Tests live in backend/tests/.
  • Frontend: Use Vitest + @testing-library/react (or the framework equivalent) for component behaviour. Tests co-located or in frontend/src/__tests__/.

Exceptions (must be noted inline)

  • Pure documentation, README, .gitignore, trivial config with no new testable behaviour may skip tests. Note the exception.
  • Do not skip tests for: API handlers, meaningful business logic, auth flows, or non-trivial UI logic.

Feature Tracking

  • Update feature-process.md only when a feature's phase status changes meaningfully (shipped, blocked, new phase added).
  • Keep it short. Use docs/ACTIVITY.md for session-level detail.

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. 2d ago First seen · 88 lines · 779 tokens per session scan A 874dd3b90fda

Subscribe to this mod's changes

core is a cursor rule published in the GitHub repository parzival1l/Altru (2 stars, last pushed 4mo ago), licensed MIT. It adds 779 tokens to every session, about $0.0039 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-31.