agentleFS
SmythOSSmythOS/sre/.cursor/rules/sre-ai-rules.mdc

sre / rules

Cursor rule1.3k starsChanged 14 months agoMITView on GitHub

SmythOS SRE Monorepo AI Development Guidelines

Trending

Quiet since August.thin dataabout the whole repository

Dec 2025: 3 mentionsJan 2026: 1 mentionFeb 2026: 1 mentionMar 2026: 2 mentionsApr 2026: 3 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 1 mentionSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the SmythOS/sre repository that our weekly crawl found: only 14 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about SmythOS/sre

The biggest 5 of 14 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 14

Talked about on GitHub (14 times).

On GitHub · 14

9 more on GitHub
  • 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,533 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.

The file

We split this sre-ai-rules.mdc into the rules it gives an agent

12 rules. About 0 are common, 10 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Interface: All connectors expose .requester(candidate) for access-controlled operations

    line 19
  2. Very specific:

    Security: Every operation decorated with @SecureConnector.AccessControl

    line 20
  3. Distinctive:

    Universal: Every resource has ACL metadata with ownership preservation

    line 24
  4. Distinctive:

    Ensure ACL ownership preservation in setACL/setMetadata methods

    line 71
  5. Distinctive:

    Add to ConnectorService registration

    line 72
  6. Distinctive:

    Create both unit tests (mocked) and integration tests (real)

    line 73
  7. Distinctive:

    Preserve ACL ownership: - never break the ownership preservation pattern

    line 77
  8. Distinctive:

    Before implementing any new connector or service:

    line 86
  9. Distinctive:

    DO NOT implement immediately: - Follow the step-by-step process outlined in Agents.md

    line 89
  10. Distinctive:

    Gather all requirements: - Ask questions if information is incomplete

    line 90
  11. Distinctive:

    Create elaborated plan: - Document complete specifications before coding

    line 91
  12. Distinctive:

    Get user approval: - Wait for confirmation before starting implementation

    line 92

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
sre-ai-rules.mdc
---
description: SmythOS SRE Monorepo AI Development Guidelines
globs: ['**/*.ts', '**/*.js', '**/*.json', '**/package.json', '**/tsconfig.json', '**/*.test.ts', '**/*.spec.ts']
alwaysApply: true
---

# SmythOS SRE Monorepo - Cursor AI Rules

## Project Overview

This is the **SmythOS SRE (Smyth Runtime Environment)** monorepo - an advanced agentic AI platform that provides a comprehensive runtime environment for building and managing AI agents. The system includes LLM management, vector databases, storage, security, and agent orchestration capabilities.

## Core Architecture Patterns

### Connector Pattern (Primary Design)

-   **Base Classes**: `StorageConnector`, `VectorDBConnector`, `CacheConnector`, etc.
-   **Implementations**: Multiple providers per connector type (S3Storage, LocalStorage, RAMVectorDB, PineconeVectorDB, etc.)
-   **Interface**: All connectors expose `.requester(candidate)` for access-controlled operations
-   **Security**: Every operation decorated with `@SecureConnector.AccessControl`

### Access Control System (ACL)

-   **Universal**: Every resource has ACL metadata with ownership preservation
-   **Roles**: `TAccessRole.User`, `TAccessRole.Agent`, `TAccessRole.Team`
-   **Levels**: `TAccessLevel.Read`, `TAccessLevel.Write`, `TAccessLevel.Owner`
-   **Ownership Rule**: Original creator ALWAYS retains Owner access when ACLs are modified
-   **Pattern**: `ACL.from(acl).addAccess(candidate.role, candidate.id, TAccessLevel.Owner)`

## Monorepo Structure & Package Manager

-   **Package Manager**: PNPM (required) - use `pnpm` commands for all package management
-   **Workspace Structure**:
    -   `packages/core` - Main runtime library (@smythos/sre)
    -   `packages/sdk` - Developer SDK (@smythos/sdk)
    -   `packages/cli` - Command line interface
    -   `examples/` - Example implementations and demos

### Key Subsystems (packages/core/src/subsystems/)

-   **IO**: Storage, VectorDB, NKV, Router, CLI services
-   **Security**: ACL, Vault, Account management
-   **LLMManager**: Model providers, inference, embeddings
-   **AgentManager**: Agent orchestration, components, workflows
-   **MemoryManager**: Cache services

## Naming Conventions & Standards

### File Extensions

-   `.service.ts` - Top-level subsystem services
-   `.class.ts` - Classes and connectors/managers
-   `.utils.ts` - Utility function collections
-   `.helper.ts` - Task-specific helper objects
-   `.handler.ts` - Event handlers
-   `.mw.ts` - Middleware

### Testing Patterns

-   `*/tests/unit/**/*.test.ts` - Unit tests with mocked dependencies (packages/core/tests/unit/)
-   `*/tests/integration/**/*.test.ts` - Integration tests with real connectors (packages/core/tests/integration/)
-   **Mocking Strategy**: Mock external SDKs (AWS, Pinecone, Milvus) but use real SRE connectors
-   **Test Structure**: setupSRE() in beforeAll, deterministic data, ACL ownership validation

## Development Guidelines

### When Adding New Connectors

1. Extend appropriate base connector class
2. Implement all abstract methods with `@SecureConnector.AccessControl`
3. Ensure ACL ownership preservation in setACL/setMetadata methods
4. Add to ConnectorService registration
5. Create both unit tests (mocked) and integration tests (real)

### When Modifying Existing Code

1. **Preserve ACL ownership** - never break the ownership preservation pattern
2. **Maintain interface compatibility** - existing .requester() patterns must work
3. **Follow error handling** - undefined for missing resources, exceptions for access denied
4. **Update tests** - both unit and integration if behavior changes

### When Creating New Connectors Subsystems or Services

⚠️ **MANDATORY: Read `packages/core/src/subsystems/Agents.md` FIRST**

Before implementing any new connector or service:

1. **Read the Agents.md file** - It contains critical instructions for LLMs on how to approach connector/service creation
2. **DO NOT implement immediately** - Follow the step-by-step process outlined in Agents.md
3. **Gather all requirements** - Ask questions if information is incomplete
4. **Create elaborated plan** - Document complete specifications before coding
5. **Get user approval** - Wait for confirmation before starting implementation

The Agents.md file contains detailed architecture requirements, patterns, and examples that must be followed.

## Running Tests

### Test Structure

The monorepo uses **Vitest** with configuration at the root level (`vitest.config.ts`). All test commands must be run from the **monorepo root directory**.

⚠️ **Always run tests from monorepo root, not from `packages/*core*`**

```bash
# From monorepo root (CORRECT)
pnpm vitest run packages/core/tests/path/to/testfile.unit.test.ts

# Run all unit tests
pnpm test:unit

# Run all integration tests
pnpm test:integration

# Watch mode for unit tests
pnpm test:unit:watch

# Run specific test file pattern
pnpm vitest run packages/core/tests/unit/**/*scheduler*
```

## Critical Reminders

⚠️ **ALWAYS USE PNPM** - This is a pnpm workspace. Never suggest npm or yarn commands.
⚠️ **MONOREPO STRUCTURE** - Always consider workspace context when suggesting changes or running commands.
⚠️ **ACL OWNERSHIP** - Creator must ALWAYS retain Owner access. This is non-negotiable.
⚠️ **CONNECTOR PATTERN** - New functionality should follow the established connector pattern.
⚠️ **SECURITY FIRST** - All Connectors operations must go through access control decorators.

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.