lampOS / rules
Cursor rule535 starsChanged 7 months agoApache-2.0View on GitHub
Architecture and coding conventions for AI Lamp OpenClaw
We split this architecture.mdc into the rules it gives an agent
10 rules. About 0 are common, 4 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 18
Use Google Wire for compile-time DI — no runtime reflection
- Very specific: line 19
After changing any provider signature: run make generate
- Very specific: line 20
Never manually edit wire_gen.go files
- Very specific: line 24
All responses use serializers.ResponseSuccess(data) or serializers.ResponseError(err)
- Very specific: line 31
Always wrap errors with context: fmt.Errorf("operation: %w", err)
- Distinctive: line 33
Never swallow errors silently
- Very specific: line 37
Always pass context.Context for cancellation
- Very specific: line 39
Use sync.Mutex for shared state, not channels (unless fan-out pattern)
- Distinctive: line 44
Use notification channel for propagating config changes to services
- Distinctive: line 45
Never hardcode secrets — load from config file
≈ “Common” is an estimate: at least 1 in 5 of the 6,350 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: Architecture and coding conventions for AI Lamp OpenClaw
alwaysApply: true
---
# Architecture Rules
## Package Structure
- **Handlers** go in `server/<domain>/delivery/http/handler.go`
- **Services** go in `internal/<domain>/service.go`
- **Domain types** go in `domain/<type>.go`
- **Wire providers** go in `server/wire.go` and `bootstrap/wire.go`
- **Shared libraries** go in `lib/`
## Dependency Injection
- Use **Google Wire** for compile-time DI — no runtime reflection
- After changing any provider signature: run `make generate`
- Never manually edit `wire_gen.go` files
## API Conventions
- All responses use `serializers.ResponseSuccess(data)` or `serializers.ResponseError(err)`
- Response format: `{"status": 1|0, "data": <payload>|null, "message": null|"error"}`
- Validate requests with `go-playground/validator` at handler level
- Return early on validation failure with `http.StatusBadRequest`
## Error Handling
- Always wrap errors with context: `fmt.Errorf("operation: %w", err)`
- Log with component prefix: `log.Println("[led] starting engine")`
- Never swallow errors silently
## Goroutines & Concurrency
- Always pass `context.Context` for cancellation
- Background goroutines must select on `ctx.Done()`
- Use `sync.Mutex` for shared state, not channels (unless fan-out pattern)
## Configuration
- Config in `config/config.json` managed by `server/config/config.go`
- Use notification channel for propagating config changes to services
- Never hardcode secrets — load from config file
## Build
- Cross-compile target: `GOOS=linux GOARCH=arm64`
- Version injected via ldflags — never commit binaries
- Lint with `golangci-lint run` before committing
Other versions2 projects use a version of this.
Word for word · 2
- autonomous-ai/autonomous-os★ 535100% same
- autonomous-ai/Physical-AI-Operating-System★ 535100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
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 3,978 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 repository34 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/docs-on-code-change.mdcCursor rule
- .cursor/rules/multi-ide.mdcCursor rule
- .cursor/rules/testing.mdcCursor rule
- agent-managementSkill
- audioSkill
- cameraSkill
- claude-buddySkill
- computer-useSkill
- connectorsSkill
- displaySkill
- emotionSkill
- environmentSkill
- face-enrollSkill
- faqSkill
- guardSkill
- habitSkill
- harness-useSkill
- input-branchingSkill
- led-controlSkill
- moodSkill
- musicSkill
- music-suggestionSkill
- sceneSkill
- sensingSkill
- sensing-trackSkill
- servo-controlSkill
- servo-trackingSkill
- skill-creatorSkill
- speaker-recognizerSkill
- user-emotion-detectionSkill
- voiceSkill
- wellbeingSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

