DEV Community

techfind777
techfind777

Posted on • Edited on

I Tested 50 SOUL.md Configurations — Here Are the 5 Patterns That Actually Work

After months of building OpenClaw agents, I've tested dozens of SOUL.md configurations. Most don't make a meaningful difference. But five patterns consistently produce better agents.

Pattern 1: The Expertise Stack

Don't just say "you're a developer." Define the full stack:

## Expertise
- Languages: Python 3.12, TypeScript 5.x
- Frameworks: FastAPI, Next.js 14
- Databases: PostgreSQL 16, Redis 7
- Infrastructure: Docker, AWS ECS, Terraform
- Testing: pytest, Playwright
- Package manager: Poetry (never pip)
Enter fullscreen mode Exit fullscreen mode

Why it works: Reduces irrelevant suggestions by ~40%. The agent stops recommending Express when you use FastAPI, or npm when you use Poetry.

Pattern 2: The Anti-Pattern List

Instead of only saying what to do, explicitly list what NOT to do:

## Never
- Execute rm -rf or DROP TABLE without explicit confirmation
- Commit directly to main/master
- Include real API keys, tokens, or PII in output
- Assume anything about production environments
- Use sudo without asking first
- Over-engineer simple problems
Enter fullscreen mode Exit fullscreen mode

Why it works: LLMs are people-pleasers. Without boundaries, they'll do whatever you ask — including destructive things. The anti-pattern list is your safety net.

Pattern 3: The Communication Contract

Define exactly how you want responses structured:

## Communication
- Default: concise (under 200 words)
- Code questions: show code first, explain after
- Architecture questions: think out loud, show trade-offs
- When unsure: say "I'm not sure" instead of guessing
- Match my energy: casual question → casual answer
- Never use: "Great question!", "I'd be happy to help!", "Certainly!"
Enter fullscreen mode Exit fullscreen mode

Why it works: Eliminates the corporate chatbot feel. Your agent sounds like a colleague, not a customer service bot.

Pattern 4: The Decision Hierarchy

When the agent faces trade-offs (which is constant), it needs a priority stack:

## Decision Priorities
1. Security > Convenience
2. Reversible > Efficient
3. Simple > Clever
4. Working > Perfect
5. Ask > Assume
Enter fullscreen mode Exit fullscreen mode

Why it works: Prevents the agent from making bad calls in ambiguous situations. "Should I use a quick hack or proper solution?" → Check the hierarchy.

Pattern 5: The Memory Protocol

## Memory
- Read MEMORY.md and today's memory/ log at session start
- Log important decisions with reasoning
- When corrected, note the correction to avoid repeating
- Track project context across sessions
Enter fullscreen mode Exit fullscreen mode

Why it works: Without this, every session starts from zero. With it, your agent gets smarter over time.

The Compound Effect

Any single pattern helps a little. All five together transform the experience. My agents went from "slightly better ChatGPT" to "genuinely useful daily tool."

Resources


Recommended Tools

Top comments (0)