sruja / rules
Cursor rule24 starsChanged 6 months agoApache-2.0View on GitHub
Wire Phase 3/4 context tools (drift injector, session prune, memory search) when using Sruja MCP
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,531 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .gemini/AGENTS.mdAGENTS.md
- skills/sruja-architecture/AGENTS.mdAGENTS.md
- skills/sruja-architecture/references/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/cli-handler.mdcCursor rule
- .cursor/rules/core-engine.mdcCursor rule
- .cursor/rules/extension-ts.mdcCursor rule
- .cursor/rules/sruja-dev.mdcCursor rule
- .cursor/rules/wasm-constraints.mdcCursor rule
- grill-meSkill
- sruja-architectureSkill
- sruja-harnessSkill
The file
We split this sruja-context-host.mdc into the rules it gives an agent
11 rules. About 0 are common, 3 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
When the sruja MCP server is enabled (see .cursor/mcp.json), follow this host contract.
- Very specific: line 25
After MCP connects, if you receive notifications/drift_state (or SRUJA_MCP_WATCH_DRIFT=1 is set), treat params as authoritative session …
- Very specific: line 28
If no notification arrived, call sruja_get_drift_state once at the start of architecture-bounded work.
- Very specific: line 29
If aidlc-docs/aidlc-state.md or a workflow inception/aidlc-docs/aidlc-state.md exists, run sruja workflow status -r .
- Very specific: line 33
Call sruja_search_memory with a short query (e.g.
- Very specific: line 34
Prefer hits with trust: reviewed_truth (decision records) over hypothesis (learnings, events).
- Very specific: line 35
Never treat memory hits as permission to edit repo.sruja without the normal proposal/review flow.
- Distinctive: line 39
When the conversation has accumulated many architecture element references (roughly 8+ tool turns on the same task, or token pressure):
- Distinctive: line 45
After compressing, avoid re-expanding dropped ids unless the user asks.
- Distinctive: line 53
Before marking a task complete:
- Very specific: line 55
Run sruja verify-task --profile <coding|bugfix|review|arch> -r .
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 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.
Files
--- description: Wire Phase 3/4 context tools (drift injector, session prune, memory search) when using Sruja MCP alwaysApply: true --- # Sruja context host (Phase 3 + 4) When the **sruja** MCP server is enabled (see `.cursor/mcp.json`), follow this host contract. Sruja suggests; you apply. ## Tool Profiles Sruja MCP server supports tool profiles to control which tools are available: - `minimal` (~10-12 tools): Core ladder + focus briefing + essential utilities - `coding` (~15-18 tools, default): Minimal + hybrid query + critique + context pruning - `arch`: Coding + read-only authoring helpers - `full`: All tools (backward compatible) The profile is controlled via: 1. Environment variable: `SRUJA_MCP_TOOL_PROFILE` 2. MCP initializationOptions (set in `.cursor/mcp.json`) 3. Defaults to `coding` profile ## Session start 1. After MCP connects, if you receive **`notifications/drift_state`** (or `SRUJA_MCP_WATCH_DRIFT=1` is set), treat `params` as authoritative session context: - `schema_version` must be `drift_state/v1` - Surface `truth_status`, `health_score`, and top `violations` before large edits 2. If no notification arrived, call **`sruja_get_drift_state`** once at the start of architecture-bounded work. 3. If `aidlc-docs/aidlc-state.md` or a workflow `inception/aidlc-docs/aidlc-state.md` exists, run **`sruja workflow status -r .`** (with `--id` when multiple workflows) to surface phase gates and `aidlc` stage before large SDLC edits. ## Before precedent / “why did we…” questions 1. Call **`sruja_search_memory`** with a short query (e.g. component name, decision topic). 2. Prefer hits with `trust: reviewed_truth` (decision records) over `hypothesis` (learnings, events). 3. Never treat memory hits as permission to edit `repo.sruja` without the normal proposal/review flow. ## Long sessions (context budget) When the conversation has accumulated many architecture element references (roughly 8+ tool turns on the same task, or token pressure): 1. Call **`sruja_suggest_context_prune`** with: - `active_element_ids`: current focus (from `sruja focus`, `sruja_get_focus_briefing`, or scan-resolved module IDs — prefer graph IDs over bare C4 names when warnings appear) - `session_element_ids`: element/module IDs mentioned in the thread 2. **Omit** transcript blocks for ids in `compress_ids`; keep full detail for `keep_ids`. 3. After compressing, avoid re-expanding dropped ids unless the user asks. ## Ladder (unchanged) `sruja_list_architecture_index` → `sruja_get_topology` → `sruja_get_elements` → `sruja_get_task_context` (`cache_friendly: true` when caching). ## End of session Before marking a task complete: 1. Run **`sruja verify-task --profile <coding|bugfix|review|arch> -r .`** (or call `sruja_verify_task` via MCP). 2. If verify failed: - Fix the issue - Re-run verify - Record a correction learning: `sruja agent record -r . -c "<context>" -H "<what was tried>" -o failed -g "<guardrail>"` 3. If verify passed: - Optionally record an affirmation learning Prompt template: MCP `prompts/get` → `sruja_mcp_guide`.
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
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.

