

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# WINDSURF GUARDRAILS23These rules apply to ALL code generation, edits, and suggestions in this project.45## The Four Laws of Agent Safety671. **Read Before Editing** - Never modify code without reading it first. Always use the Read tool before any edit.82. **Stay in Scope** - Only touch files explicitly authorized. No "while I'm here" fixes.93. **Verify Before Committing** - Test and check all changes. Run relevant tests.104. **Halt When Uncertain** - Ask for clarification instead of guessing.1112## Pre-Operation Checklist (MANDATORY)1314Before ANY file modification:15- [ ] Read target file(s) completely16- [ ] Verify operation is within authorized scope17- [ ] Identify the rollback procedure18- [ ] Check for test/production separation requirements1920## Forbidden Actions (NEVER DO)21221. Modifying code without reading it first232. Mixing test and production environments243. Force pushing to main/master254. Committing secrets, credentials, or .env files265. Running untested code in production276. Modifying unread code287. Working outside authorized scope2930## Halt Conditions (STOP and Ask User)3132- Attempting to modify code you haven't read33- No rollback procedure exists or is unclear34- Production impact is uncertain35- User authorization is ambiguous36- Test and production environments may mix37- Uncertain about ANY aspect of the task38- Operation has failed 3 times3940## Three Strikes Rule4142- **Strike 1**: Retry with adjusted approach43- **Strike 2**: Try alternative approach44- **Strike 3**: HALT and escalate to user4546Never continue beyond 3 failures. Continuing wastes tokens, contaminates context, and rarely succeeds.4748## Production-First Rule4950Production code MUST be created before test code or infrastructure code.5152Order:531. Production implementation542. Production validation (lint, type check, compile)553. Tests for the production code564. Infrastructure/deployment config5758## Scope Rules5960Only touch files within the authorized scope:611. Explicit file list from user (highest authority)622. Files identified in the task description633. Direct dependencies of target files (with approval)644. When uncertain: HALT and ask user6566## Architecture Patterns (Go/MCP Server)6768When working on `mcp-server/`:6970### Clean Architecture Layers7172```73Domain → Application → Adapters → Interface74```7576- **Domain** (`internal/domain/`) — Interfaces, value objects. ZERO deps.77- **Application** — Command/query handlers. Depends on Domain only.78- **Adapters** (`internal/adapters/`) — DB, cache, external services.79- **Interface** (`internal/mcp/`) — MCP handlers. Depends on Domain.8081### Dependency Rule8283Outer layers can depend on inner, never reverse. Domain has no imports.8485### CQRS8687- **Commands** (write): CreateRule, UpdateRule, LogViolation88- **Queries** (read): Evaluate, List, Get — cache-friendly8990Commands publish events → cache subscribes → invalidates on rule changes.9192### Vertical Slices9394Each guardrail type is self-contained:9596```97internal/guardrails/98├── bash/ ← model + evaluator + handler99├── git/ ← all git-related code100└── fileedit/ ← all file edit code101```102103### SOLID104105- **S**: One responsibility per type106- **O**: Add new evaluator (interface), don't modify engine107- **L**: Implement interface fully or not at all108- **I**: Small interfaces (3 methods max)109- **D**: Depend on abstraction (interface), not concrete110111### Never Do (Architecture)112113- Import database packages in domain types114- Put concrete implementations in domain layer115- Create cross-layer circular dependencies116- Add infrastructure logic to handlers117118## References119120- `skills/shared-prompts/four-laws.md` - The Four Laws (canonical)121- `skills/shared-prompts/halt-conditions.md` - Full halt conditions122- `skills/shared-prompts/three-strikes.md` - Full strike tracking123- `skills/shared-prompts/production-first.md` - Full production-first rules124- `skills/shared-prompts/clean-architecture.md` - Clean Architecture patterns125- `skills/shared-prompts/cqrs.md` - CQRS command/query separation126- `docs/AGENT_GUARDRAILS.md` - Core safety protocols127
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| TheArchitectit/agent-guardrails-template.github/copilot-instructions.md · 76 | Copilot instructions | stylesecuritydo-notagent-behaviour | 73/100 | today | |
| TheArchitectit/agent-guardrails-templateCLAUDE.md · 76 | CLAUDE.md | setupstyledo-notagent-behaviour+1 | 63/100 | today |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| danielvm-git/bigpowers.windsurf/rules/guard-git.md · 139 | Windsurf rules | stylearchgitsecurity+2 | 89/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/organize-workspace.md · 139 | Windsurf rules | buildstylegitdeployment+2 | 89/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/quick-fix.md · 139 | Windsurf rules | teststylegitdeployment+1 | 85/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/develop-tdd.md · 139 | Windsurf rules | teststylearchtesting-strategy+5 | 85/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/session-state.md · 139 | Windsurf rules | lint-formatstyleagent-behaviour | 82/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/commit-message.md · 139 | Windsurf rules | lint-formatstyletypesgit+3 | 82/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/extract-design.md · 139 | Windsurf rules | lint-formatstyledependenciesui | 82/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/setup-environment.md · 139 | Windsurf rules | setupstylesecuritydo-not+1 | 81/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/thearchitectit-agent-guardrails-template-windsurfrules)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.