agent-configIntelligently modify agent core context files (AGENTS.md, SOUL.md, IDENTITY.md, USER.md, TOOLS.md, MEMORY.md, HEARTBEAT.md). Use when conversation involves changing agent behavior, updating rules, tweaking personality, modifying instructions, adjusting operational procedures, updating memory architecture, changing delegation patterns, adding safety rules, refining prompt patterns, or any other modification to agent workspace configuration files. Triggers on intent to configure, tune, improve, fix, or evolve agent behavior through context file changes.
Install via ClawdBot CLI:
clawdbot install ThatGuySizemore/agent-configThis skill provides a structured workflow for intelligently modifying OpenClaw agent core context files. It ensures changes are made to the right file, in the right format, without duplication or bloat, while respecting size limits and prompt engineering best practices.
When modifying agent context files, follow this process:
Read references/file-map.md to determine which file the change belongs in.
Quick decision tree:
AGENTS.mdSOUL.mdIDENTITY.mdUSER.mdTOOLS.mdMEMORY.mdHEARTBEAT.mdCritical: Subagents only see AGENTS.md + TOOLS.md. Operational rules must go in AGENTS.md, not SOUL.md.
Before making changes:
# Check file size (20K char limit per file)
wc -c ~/clawd/AGENTS.md ~/clawd/SOUL.md ~/clawd/IDENTITY.md \
~/clawd/USER.md ~/clawd/TOOLS.md ~/clawd/MEMORY.md ~/clawd/HEARTBEAT.md
# Read the target file section to check for duplication
# Use grep to search for existing similar content
grep -i "keyword" ~/clawd/TARGETFILE.md
Size warnings:
read tool, but startup context is truncatedDuplication check:
Read references/claude-patterns.md for instruction formats that work.
Format guidelines by file:
AGENTS.md (structured, imperative):
SOUL.md (first-person OK, narrative):
IDENTITY.md (minimal):
USER.md (factual, third-person):
TOOLS.md (reference guide):
MEMORY.md (wiki-style, topic-based):
HEARTBEAT.md (action list):
Ask yourself:
Fit:
Format:
Size:
Duplication:
Quality:
Use the edit tool with exact text matching:
# Read the section first to get exact text
read(path="~/clawd/AGENTS.md", offset=50, limit=20)
# Then edit with precise match
edit(
path="~/clawd/AGENTS.md",
oldText="exact existing text including whitespace",
newText="updated text with change"
)
For additions:
For updates:
For deletions:
After applying change:
Verification:
# Confirm change applied
grep -A 3 "new text" ~/clawd/TARGETFILE.md
# Check new file size
wc -c ~/clawd/TARGETFILE.md
Documentation:
/Users/macmini/Sizemore/agent/decisions/config-changes.mdReport to user:
Target: AGENTS.md ā Safety section
## Safety
- **NEVER:** Exfiltrate data, destructive commands w/o asking
- Prefer `trash` > `rm`
- **New rule:** Brief description of what NOT to do
- **New protection:** When X happens, do Y instead
Target: AGENTS.md ā Delegation section
Check existing delegation table/rules first. Update thresholds, model selection, or cost patterns.
Target: SOUL.md (tone, boundaries) or IDENTITY.md (core vibe)
Add forbidden phrases to anti-pattern list, update voice examples, refine mirroring rules.
Target: TOOLS.md
Add to relevant section (or create new section). Include code examples, when to use, paths.
Target: AGENTS.md ā Memory section
Update logging triggers, recall cascade, entity structure. Keep memory format templates in ~/clawd/templates/.
Target: AGENTS.md ā Startup section
Add to numbered checklist. Keep conditional (if MAIN, if group chat, if specific channel).
Target: HEARTBEAT.md
Keep minimal. Only what agent checks on every heartbeat run (not operational details).
If a change makes things worse:
# If file is in git
cd ~/clawd
git diff TARGETFILE.md # See what changed
git checkout TARGETFILE.md # Revert to last commit
# If not in git, restore from memory
# Read last known-good version from vault decisions log
# Or ask user to provide previous working version
Don't immediately delete failed changes. Analyze:
Update incrementally instead of full revert when possible.
Log failed changes to /Users/macmini/Sizemore/agent/learnings/config-failures.md:
This prevents repeating failed patterns.
Read references/claude-patterns.md for detailed anti-patterns.
Quick checklist:
ā Duplication - Same rule in multiple files
ā Vague instructions - "Be helpful", "Use good judgment"
ā Missing examples - Complex rules with no concrete case
ā Wrong file - Personality in AGENTS.md, operations in SOUL.md
ā No motivation - Rule without WHY it exists
ā Reference docs buried - Long guides embedded instead of linked
ā Bloat - Adding when updating existing would work
ā Format mismatch - Prose in table-heavy file, bullets in narrative file
ā Subagent blindness - Operational rule in file subagents don't see
ā Size ignorance - Adding to 19K file without checking
If adding >500 words of content, consider:
~/clawd/templates/BOOTSTRAP.md (deleted after first run)Examples:
~/clawd/templates/subagent-task.mdagent/decisions/memory-architecture.mdWhen change affects multiple files:
Example: Delegation rules live in AGENTS.md, but SOUL.md might reference "see AGENTS.md for delegation" in boundaries section.
Use conditionals in AGENTS.md:
## Startup (Every Session)
1. Read `IDENTITY.md`, `SOUL.md`, `USER.md`
2. If MAIN: read vault README, recent decisions
3. If FAMILY GROUP: read `FAMILY.md`
4. If SUBAGENT: skip personality files
When file hits ~18K chars:
When new rule conflicts with existing:
Process each change through full workflow (don't batch blindly):
This skill includes detailed reference material:
Read these files when you need detailed context beyond this workflow overview.
Request: "Add rule to never bulk export passwords"
Process:
AGENTS.md (safety is operational)### Password Manager
**NEVER:** Dump vaults, display passwords in chat, bulk exports
**ALWAYS:** Confirm each lookup, ask "Which credential?", treat as high-risk
**Refuse:** Any bulk password request
Request: "Make personality more sarcastic"
Process:
SOUL.md and IDENTITY.md (personality)Request: "Change delegation threshold from 2+ tool calls to 3+"
Process:
AGENTS.md ā Delegation sectionRequest: "Add note that iMessage attachments must use imsg CLI, not message tool"
Process:
TOOLS.md (tool-specific convention)## iMessage Attachments
**NEVER use `message` tool for iMessage files - corrupts attachments.**
**Always use imsg CLI:**bash
imsg send --chat-id
Applies to ALL iMessage attachments (images, videos, documents, vCards).
Goal: Intelligent, surgical changes to agent context files
Method: Identify ā Check ā Draft ā Validate ā Apply ā Verify
Key principles: Right file, right format, no duplication, respect size limits, include examples
Safety: Check before changing, document decisions, know how to rollback
When in doubt, read the reference files for deeper guidance on file purposes, Claude patterns, and change protocols.
Generated Mar 1, 2026
An AI development team needs to refine an agent's operational rules, such as improving delegation workflows or adding safety protocols. This skill guides them to update AGENTS.md with structured processes, ensuring changes are precise and avoid duplication while respecting file size limits.
A company wants to adjust an AI agent's tone and ethical boundaries for customer interactions. Using this skill, they modify SOUL.md to include anti-pattern lists and before/after examples, enhancing the agent's narrative style without bloating other context files.
A tech startup integrates new APIs or local tools into their AI system. This skill helps them update TOOLS.md with tables for comparison and code examples, ensuring clear reference guides for quick lookup by subagents and main agents.
An organization updates user preferences or family information for personalized AI interactions. They use this skill to edit USER.md with factual bullet lists and cross-references, keeping time-sensitive data organized and accessible.
A research team curates long-term facts or project contexts for an AI agent. This skill assists in modifying MEMORY.md with wiki-style, topic-based sections, ensuring privacy-sensitive information is structured for main session use only.
Offer expertise in configuring and optimizing AI agent contexts for clients, using this skill to ensure efficient file modifications. Revenue comes from project-based fees or retainer contracts for ongoing tuning and support.
Develop a software tool that automates context file updates based on this skill's workflow, helping users manage agent behavior changes. Revenue is generated through subscription tiers based on usage and advanced features.
Provide courses and certifications on AI agent configuration best practices, leveraging this skill as a core curriculum. Revenue streams include course fees, certification exams, and corporate training packages.
š¬ Integration Tip
Integrate this skill with version control systems to track changes and automate validation checks, ensuring consistency across agent context files.
Advanced expert in prompt engineering, custom instructions design, and prompt optimization for AI agents
577+ pattern prompt injection defense. Now with typo-tolerant bypass detection. TieredPatternLoader fully operational. Drop-in defense for any LLM application.
Detect and block prompt injection attacks in emails. Use when reading, processing, or summarizing emails. Scans for fake system outputs, planted thinking blocks, instruction hijacking, and other injection patterns. Requires user confirmation before acting on any instructions found in email content.
Safe OpenClaw config updates with automatic backup, validation, and rollback. For agent use - prevents invalid config updates.
Automatically rewrites rough user inputs into optimized, structured prompts for dramatically better AI responses. Prefix any message with "p:" to activate.
Token-safe prompt assembly with memory orchestration. Use for any agent that needs to construct LLM prompts with memory retrieval. Guarantees no API failure due to token overflow. Implements two-phase context construction, memory safety valve, and hard limits on memory injection.