agentleFS
0xranx0xranx/golembot/.cursor/rules/architecture-constraints.mdc

golembot / rules

Cursor rule326 starsChanged 9 months agoMITView on GitHub

GolemBot architecture hard constraints — must check before modifying any src/ code

The file

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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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:

    When modifying code under src/, the following constraints must not be violated.

    line 9
  2. Distinctive:

    Do not introduce global locks (Phase 1 Mutex has been replaced with KeyedMutex)

    line 40

≈ “Common” is an estimate: at least 1 in 5 of the 6,668 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-constraints.mdc
---
description: GolemBot architecture hard constraints — must check before modifying any src/ code
globs: src/**/*.ts
alwaysApply: false
---

# Architecture Hard Constraints

When modifying code under `src/`, the following constraints must not be violated. To relax them, first update docs/architecture.md.

## Things You Must Never Do

1. **Don't do what the Agent should do** — GolemBot does not manage context window, dispatch tools, reason, or set session TTL. All "intelligent" behavior is delegated to the underlying Coding Agent.
2. **Don't add new core concepts** — The framework has only two concepts: assistant directory + Skill. Do not introduce Tool, Blueprint, Registry, Pipeline, or other abstractions.
3. **Don't put CLI logic in the core library** — `cli.ts` is a thin shell; it only parses arguments and formats output. All business logic must live in `index.ts` / `workspace.ts` / `engine.ts` / `session.ts` / `server.ts`.
4. **Don't declare Skills in config** — The `skills/` directory is the single source of truth. `golem.yaml` only configures engine and name.
5. **Process invocation is engine-owned** — All engines use `child_process.spawn`. Do not assume invocation style outside the engine.

## Interface Change Rules

- Any signature change to the `Assistant` interface (`index.ts`) must be reflected in docs/architecture.md Chapter 5 (API definition)
- Any change to the `AgentEngine` interface (`engine.ts`) must be reflected in docs/architecture.md Chapter 7
- `StreamEvent` type changes must verify compatibility with `server.ts` SSE output and `cli.ts` event handling

## File Responsibility Boundaries

| File | Responsibility | Should Not Contain |
|------|-----------------|--------------------|
| `index.ts` | Public API, concurrency locks, orchestration of workspace/engine/session | Engine implementation details, HTTP logic |
| `engine.ts` | Engine interface, Cursor / Claude Code implementations, stream-json parsing, Skill injection | Session management, config loading |
| `workspace.ts` | golem.yaml read/write, skills scanning, AGENTS.md generation | Engine invocation, session management |
| `session.ts` | Session persistence (indexed by sessionKey) | Any other logic |
| `server.ts` | HTTP service, SSE, auth | Engine implementation details |
| `cli.ts` | Argument parsing → call core API → format output | Business logic |

## Concurrency Model

- `chat()` calls with the same `sessionKey` must be serialized (KeyedMutex)
- Different `sessionKey`s can run in parallel
- Do not introduce global locks (Phase 1 Mutex has been replaced with KeyedMutex)

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.