Goal
Ensure backend behavior is validated through real execution: routing, configs, async flows, not assumptions.
Rule Behavior
1️⃣ Validate Endpoints Using Actual Requests
- Test every API with sample payloads
- Confirm status codes and response shape
- Verify error payload structure matches spec
- Prefer execution confidence over mental models
2️⃣ Prove Async Execution Order
- Log inside async tasks to detect silent failures
- Surface race conditions using delayed mock calls
- Never allow Promise errors to be swallowed
3️⃣ Runtime Verified Configuration
- Validate env variables resolve correctly
- Confirm DB credentials, ports, tokens through live connects
- Test fallback logic by simulating missing configs
4️⃣ Architecture Transparency
- Independent controllers and services for isolated execution
- No hidden side effects or runtime surprises
- Run business logic without full server boot
5️⃣ Data Driven Confidence
- Validate input and output schemas live
- Log edge cases and boundary responses
- Test on real data before refactoring decisions
6️⃣ Safe Refactoring With Proof
- Compare before and after logs for critical paths
- Ensure no routing or behavior drift
- Runtime validation required before merge
7️⃣ Replit Agent Partnership
- Trace real request lifecycle
- Convert invisible bugs into observable truth
- Ask AI to explain failures from logs
Examples
- "Run GET /users with invalid token and confirm response format."
- "Inject delay and check async sequence correctness."
- "Validate DB env vars and test live connect."
Tool Prompts
- "Execute this endpoint with payload {...} and display logs."
- "Trace async calls and show execution order."
- "Simulate missing API_KEY and show fallback behavior."
- "Compare logs before and after refactor and list differences."
Quick Implementation Wins
- Add centralized request logging
- Enable error stack traces in logs
- Automate smoke tests for core routes