files

files is a cursor rule for Cursor from Pranav-Karra-3301/tuck. It costs 0 tokens per session (668 once invoked), scanned A, original, MIT.

A set of rules for keeping a code project's files and folders organized. It defines where command code, reusable library code, terminal interface parts, validation schemas, and shared types belong.

In plain words
What is it for?
Use it when creating or changing a TypeScript command-line project. It helps place new commands, library modules, terminal interface components, schemas, and shared definitions in the expected locations.
Why use it?
It prevents related code from being scattered across the project and makes files easier to find. Consistent naming and registration rules also reduce confusion when adding commands or modules.

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/pranav-karra-3301/tuck/files
Clone the repo
git clone --depth 1 https://github.com/Pranav-Karra-3301/tuck

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 files

README.md
[![agentmods](https://agentmods.dev/badge/rules/pranav-karra-3301/tuck/files.svg)](https://agentmods.dev/rules/pranav-karra-3301/tuck/files)
Your own site
<a href="https://agentmods.dev/rules/pranav-karra-3301/tuck/files"><img src="https://agentmods.dev/badge/rules/pranav-karra-3301/tuck/files.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 668 The whole file, excluding the scripts and references it only reads on demand.
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.00000 $0.00668
Opus 5 $0.00000 $0.00334
Sonnet 5 $0.00000 $0.00134
Haiku 4.5 $0.00000 $0.00067

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

Security

Grade A, and why

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

.cursor/rules/files.mdc · 104 lines

How it starts

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

File Organization Rules

Directory Structure

src/
├── commands/     # CLI command implementations (14 commands)
│   ├── init, add, remove, sync, push, pull
│   ├── restore, status, list, diff, config
│   └── apply, undo, scan
├── lib/          # Core library modules (11 modules)
│   ├── paths, config, manifest, git, files
│   ├── backup, hooks, github, timemachine
│   └── merge, detect
├── ui/           # Terminal UI components
│   └── banner, logger, prompts, spinner, table
├── schemas/      # Zod validation schemas
│   └── config.schema, manifest.schema
├── constants.ts  # App constants
├── types.ts      # TypeScript types
├── errors.ts     # Custom error classes
└── index.ts      # Entry point

File Placement

Commands (src/commands/)

  • One file per command
  • Named after the command: add.ts, sync.ts
  • Export named command: export const addCommand
  • Register in src/commands/index.ts

Library Modules (src/lib/)

  • Core functionality, reusable across commands
  • Named by domain: paths.ts, git.ts, config.ts
  • Export all public functions
  • Register in src/lib/index.ts

UI Components (src/ui/)

  • Terminal UI utilities
  • Named by function: logger.ts, prompts.ts
  • Wrapper around @clack/prompts, chalk, etc.
  • Register in src/ui/index.ts

Schemas (src/schemas/)

  • Zod validation schemas
  • Named with .schema.ts suffix
  • Export input and output types

Creating New Files

New Command

  1. Create src/commands/mycommand.ts
  2. Export from src/commands/index.ts
  3. Register in src/index.ts
  4. Add tests in tests/commands/mycommand.test.ts

New Library Module

  1. Create src/lib/mymodule.ts
  2. Export from src/lib/index.ts
  3. Add tests in tests/lib/mymodule.test.ts

New Schema

  1. Create src/schemas/myschema.schema.ts
  2. Export input type, output type, and schema

Index Files

Always use barrel exports:

// src/lib/index.ts
export * from './paths.js';
export * from './config.js';
export * from './git.js';

Read the full file on GitHub · 104 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 First seen · 104 lines · 0 tokens per session scan A 041920e056cd

Subscribe to this mod's changes

files is a cursor rule published in the GitHub repository Pranav-Karra-3301/tuck (15 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 668 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-30.