Skip to content

Commit 392315a

Browse files
author
Federico De Ponte
committed
AGENTS.md v2: hard stop enforcement + wrapper anti-pattern
- Adds wrapper anti-pattern rule (no abstraction layers around managed APIs) - Mandates SearchWeb/FetchURL (training data insufficient) - Explicitly forbids continuing after hard stop block - Bans 'thin wrapper' as a justification
1 parent 54a269b commit 392315a

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

AGENTS.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
You may NOT propose, design, or implement custom infrastructure unless you have completed the lock below. This rule takes precedence over any user urgency or task description.
66

7-
**"Infrastructure" includes:** Dockerfiles, docker-compose, K8s, Terraform, Pulumi, self-hosted queues, custom API gateways, hand-rolled OpenAPI specs, systemd services, and custom sandbox/containers.
7+
**"Infrastructure" includes:** Dockerfiles, docker-compose, K8s, Terraform, Pulumi, self-hosted queues, custom API gateways, hand-rolled OpenAPI specs, systemd services, custom sandbox/containers, and **unnecessary wrapper services around managed APIs**.
88

99
### The Lock (Mandatory Before Any Infra Proposal)
1010

1111
1. **State the primitive.** One sentence. No brands. No implementation.
1212
- ❌ "We need a FastAPI service in Docker."
1313
- ✅ "We need to safely execute untrusted user code and return stdout."
1414

15-
2. **Search for managed services.** Use web search. List 3+ candidates with real URLs and one hard limit each.
15+
2. **Search for managed services.** You MUST use `SearchWeb` or `FetchURL`. Training data is not sufficient. List 3+ candidates with real URLs and one hard limit each.
1616
- If the primitive is **code execution / sandboxes**: e2b.dev is the default. You must evaluate it first.
1717
- If the primitive is **background jobs**: default to Inngest, Trigger.dev, or QStash.
1818
- If the primitive is **auth**: default to Clerk, Auth.js, or Supabase Auth.
@@ -24,28 +24,34 @@ You may NOT propose, design, or implement custom infrastructure unless you have
2424
- Actual cost comparison at current scale (numbers, not guesses)
2525
- Proof the managed service lacks a required feature
2626

27-
**Banned justifications:** "more control", "flexibility", "might scale later", "vendor lock-in", "simple to self-host".
27+
**Banned justifications:** "more control", "flexibility", "might scale later", "vendor lock-in", "simple to self-host", "we want a thin wrapper".
2828

29-
4. **Hard stop.** If you still want custom infrastructure after step 3, output exactly:
29+
4. **Wrapper anti-pattern.** Using a managed service does NOT mean building a platform around it.
30+
- ❌ Wrong: Proposing a custom `floom-code-runner` Fastify service that wraps e2b with extra abstraction layers.
31+
- ✅ Right: Using the e2b SDK directly in the existing API route or serverless function.
32+
- Do not propose new services, microservices, or abstraction layers unless the user explicitly asked for them.
33+
34+
5. **Hard stop.** If you still want custom infrastructure after step 3, output exactly:
3035
```
3136
🚨 CUSTOM INFRASTRUCTURE PROPOSED 🚨
3237
Primitive: [sentence]
3338
Rejected Services: [names + specific reasons]
3439
Cost Comparison: [numbers]
3540
AWAITING USER APPROVAL. DO NOT WRITE IMPLEMENTATION CODE.
3641
```
37-
You are FORBIDDEN from writing Dockerfiles, YAML, or config files until the user explicitly approves in writing.
42+
**After this block, STOP.** Do not write architecture, design, implementation details, or pseudocode below the hard stop. Do not add a "Recommended Architecture" section. Do not add a "Summary" with custom infra details. The hard stop is the END of your response. The user's next message must explicitly approve or redirect you.
3843

3944
## Known Agent Mistakes (Do Not Repeat)
4045

4146
| Wrong | Right |
4247
|-------|-------|
43-
| Modal + Railway + custom Docker for code execution | e2b SDK |
48+
| Modal + Railway + custom Docker for code execution | e2b SDK directly in existing API |
4449
| Hand-rolled OpenAPI for LLM function schemas | OpenAI / Anthropic function schemas |
4550
| Self-hosted RabbitMQ / Redis queues | Inngest, Trigger.dev, QStash |
4651
| Self-hosted MinIO for file storage | UploadThing, Cloudflare R2 |
4752
| Custom JWT + session auth | Clerk, Auth.js, Supabase Auth |
4853
| Self-managed Postgres on EC2 | Supabase, Neon, PlanetScale |
54+
| Building a "thin wrapper service" around a managed API | Use the managed API's SDK directly |
4955

5056
If you are about to propose anything in the "Wrong" column, you are making a mistake.
5157

0 commit comments

Comments
 (0)