agentleFS
mboss37mboss37/claude-launchpad/.cursor/rules/architecture.mdc

claude-launchpad / rules

Cursor rule8 starsChanged 5 months agoMITView on GitHub

Project architecture

The file

We split this architecture.mdc into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All optional/native deps marked external in tsup — never bundled into dist

    line 64

≈ “Common” is an estimate: at least 1 in 5 of the 7,324 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
architecture.mdc
---
description: Project architecture
alwaysApply: true
---

# Architecture

## Project Structure
```
├── src/
│   ├── cli.ts                     # Entry point (registers init, doctor, eval, memory)
│   ├── commands/
│   │   ├── init/                  # Project scaffolder (auto-detects stack)
│   │   │   ├── index.ts           # Command + interactive prompts
│   │   │   └── generators/        # CLAUDE.md, TASKS.md, settings.json, skill generators
│   │   ├── doctor/                # Config diagnostic engine
│   │   │   ├── index.ts           # Command + report renderer
│   │   │   ├── analyzers/         # budget, settings, hooks, rules, permissions, mcp, memory
│   │   │   └── fixer.ts           # Auto-fix engine with FIX_TABLE
│   │   ├── eval/                  # Config testing engine
│   │   │   ├── index.ts           # Command + result renderer
│   │   │   ├── schema.ts          # YAML scenario validator
│   │   │   ├── loader.ts          # Scenario file loader
│   │   │   └── runner.ts          # Headless Claude execution (Agent SDK with CLI fallback)
│   │   └── memory/                # Optional persistent memory system
│   │       ├── index.ts           # Command factory (dynamic imports, no native deps at load)
│   │       ├── server.ts          # MCP server entry point (second tsup entry)
│   │       ├── config.ts          # Memory config + decay params
│   │       ├── types.ts           # Memory types + Zod schemas
│   │       ├── storage/           # SQLite repos (memory, relation, search, migrator)
│   │       ├── services/          # Retrieval, decay, consolidation, session
│   │       ├── tools/             # 7 MCP tool handlers
│   │       ├── subcommands/       # install, stats, doctor, push, pull, sync + hidden hook handlers (context, serve)
│   │       ├── dashboard/         # Ink TUI (lazy-loaded via --dashboard)
│   │       └── utils/             # require-deps, git-context, content-validation, gist-transport, sync-merge, similarity, mmr
│   ├── lib/
│   │   ├── detect.ts              # Project auto-detection (language, framework, tools)
│   │   ├── parser.ts              # Parse .claude/ directory structure
│   │   ├── output.ts              # Terminal formatting (colors, tables, score bars)
│   │   └── settings.ts            # Shared readSettingsJson/writeSettingsJson
│   └── types/index.ts             # Core type definitions (doctor, eval, init)
├── scenarios/                     # Built-in eval scenarios (YAML: security/, conventions/, workflow/)
├── tests/                         # Vitest tests (322+)
└── tests/memory/                  # Memory-specific tests (storage, services, sync, utils) + benchmarks (57)
```

## Command Flow
- `init` → detect stack → prompt user → generate 8 files (incl. BACKLOG.md, lp-enhance skill) → report score
- `doctor` → analyzers scan `.claude/` → score + report → optional `--fix` → memory analyzer conditional
- `/lp-enhance` → skill runs in Claude Code session → AI rewrites CLAUDE.md → suggests hooks + MCP
- `eval` → load YAML scenarios → run Claude via Agent SDK (fallback: CLI) → score checks → report
- `memory` → smart default: install prompt (if not set up) or stats (if installed)
- `memory --dashboard` → Ink TUI with vim nav, project switching, filtering
- `memory serve` → MCP server on stdio (called by Claude Code, not users)
- `memory context` → SessionStart hook handler (injects relevant memories)
- `memory push` → serialize memories → pull-before-push → upload to private GitHub Gist via `gh` CLI
- `memory pull` → fetch gist → Zod-validate → last-write-wins merge into SQLite

## Dependency Strategy
- **Core deps** (dependencies): commander, chalk, inquirer, ora, yaml — always installed
- **Optional deps** (optionalDependencies): zod, @modelcontextprotocol/sdk, ink, react — installed with package, pure JS
- **Native dep** (devDependencies): better-sqlite3 — NOT installed for users, installed when setting up memory
- **Eval dep** (devDependencies): @anthropic-ai/claude-agent-sdk — eval falls back to Claude CLI if missing
- All optional/native deps marked `external` in tsup — never bundled into dist
- Memory commands use `cwdRequire()` for native deps (resolves from user's cwd node_modules)
- Memory command factory uses dynamic imports — `cli.ts` never loads native deps at startup

## Key Boundaries
- `src/lib/detect.ts` is the single source of truth for stack detection
- `src/types/index.ts` holds core type definitions — memory types are in `memory/types.ts`
- Analyzers in `doctor/analyzers/` are independent modules — each returns findings, none calls another
- Memory analyzer returns null when memory is not detected — no native deps in doctor
- Generators in `init/generators/` each produce one file — they share detected config but don't depend on each other
- `src/lib/settings.ts` is shared between doctor fixer and memory install (readSettingsJson/writeSettingsJson)
- `memory/utils/gist-transport.ts` is pure `gh` CLI glue — no memory repo dependencies, swappable transport
- `memory/utils/sync-merge.ts` is shared merge logic used by both push (pull-before-push) and pull

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.