Skill: Self-Upgrade
Dependencies (Load Before Running)
.claude/SYSTEM.md — current system manifest (skills, features, integrations, health)
.claude/rules/evolution.md — self-improvement protocol and safety constraints
.claude/rules/architecture.md — how to structure new capabilities
.claude/rules/security.md — self-modification safety checks
What This Skill Does
Handles all modifications to Athena's own systems — new skills, updated rules, new integrations, architecture changes, bot upgrades, script improvements. Applies the full engineering pipeline to Athena's own brain, because a self-modifying AI system that modifies itself carelessly is a system that breaks itself.
This skill treats Athena's own codebase with the same rigor as any user project. Research first. Plan first. Test after. Review everything.
How to Activate
Explicit triggers:
- "Upgrade yourself" / "Improve yourself" / "Make yourself better"
- "Add a skill for X" / "Learn to do X" / "You should be able to X"
- "Change how you handle X" / "Update your rules for X"
- "Fix that about yourself" (after Athena makes a mistake)
/self-upgrade
Auto-fire triggers:
- Evolution protocol detects a system gap (step 8 of post-session self-check)
- A task has been done manually 3+ times with the same pattern (skill candidate)
- User corrects Athena's behavior in a way that should persist across sessions
The Self-Upgrade Pipeline
Phase 1: Understand the Change
- What is being changed? Identify the specific capability, behavior, or system component.
- Why? User request, detected gap, repeated pattern, or mistake correction.
- What exists today? Read ALL affected files before planning any changes. This is non-negotiable.
- What is the blast radius? Which other rules, skills, or behaviors could be affected?
Present a one-paragraph summary to the user:
"Here is what I am going to change: [what]. This affects [files]. The reason is [why]. Should I proceed?"
Wait for approval before modifying anything. No exceptions.
Phase 2: Research
- Is there a proven pattern for this type of capability? Check architecture.md META section.
- Does a similar skill or rule already exist that could be extended instead of creating something new?
- If building a new integration: search for existing libraries, MCP servers, or community solutions first.
- If upgrading the bot: check bot.js for the current architecture before planning changes.
Phase 3: Plan the Change
Determine the change type:
| Type |
When |
Approach |
| New rule |
New always-on behavior needed |
Create new file in .claude/rules/ following META format |
| Rule update |
Existing behavior needs adjustment |
Edit existing rule file. Never delete, always evolve. |
| New skill |
On-demand capability needed (3+ manual recurrences or user request) |
Create new folder + SKILL.md in .claude/skills/ |
| Skill update |
Existing skill needs improvement |
Edit existing SKILL.md. Preserve working behavior. |
| Bot upgrade |
New Telegram capability |
Modify bot/bot.js with full engineering rigor |
| Script change |
New or modified cron/automation |
Modify or create in scripts/ |
| Integration |
New MCP or external service |
Update .mcp.json, add connection logic, update SYSTEM.md |
Write the plan with:
- Files to create or modify (list every one)
- What each change does
- What should NOT change (preservation list)
Phase 4: Implement
For rules and skills (markdown files):
- Follow the format standards in architecture.md META section
- Rules: imperative voice, NEVER/ALWAYS for clarity, tables for structured info, negative boundaries
- Skills: pushy descriptions, clear triggers, numbered steps, output format, anti-patterns
- Read the file before editing. Never overwrite blind.
For code (bot.js, scripts, new integrations):
- Apply the FULL engineering pipeline from engineering-guardian.md:
- Write tests for any logic that matters
- Security review (especially for bot changes — Telegram is a public interface)
- Error handling on every async path
- No hardcoded secrets
- Input validation on anything coming from users or external services
For all changes:
- One logical change per modification. Do not batch unrelated changes.
- Preserve existing working behavior unless explicitly changing it.
Phase 5: Verify
Functional check:
- Does the new/modified capability do what was intended?
- Read the file back and confirm it matches the plan.
Regression check:
- Do existing capabilities still work? Read adjacent rules/skills that might be affected.
- If a rule was changed: does it contradict any other rule? Scan for conflicts.
- If a skill was changed: does the trigger still work? Does the output format still make sense?
- If code was changed: run the tests. Run the bot in test mode if possible.
Security check (mandatory for all self-modifications):
- No secrets exposed in any file
- No auth logic weakened
- No permission escalation
- No sensitive data in skill triggers or rule text
- Bot changes: no way for external users to trigger admin-level operations
Architecture check:
- Is the change in the right file? (Not bolted onto an unrelated file)
- Is the file under 150 lines? (Split if it exceeds)
- Does the naming follow conventions?
Phase 6: Update Manifest
After any successful self-upgrade:
- Update
.claude/SYSTEM.md — add/modify the relevant entry in Skills, Features, or Tech Stack tables
- Update
personal/snapshot.md — log the system change under recent session outcomes
- If a new skill was created: add it to the Skills table in
CLAUDE.md
Phase 7: Explain the Change
Tell the user:
- What changed and where (file paths)
- Why it was done this way
- How it will affect their experience going forward
- Any technical concepts involved (use Building Explainer protocol)
Guardrails
Never Do These Without Explicit User Approval
| Action |
Why |
| Delete any rule or skill file |
May contain context needed later. Archive instead. |
| Modify personality.md |
Core identity changes need explicit consent. |
| Modify coaching.md challenge protocol |
User may not want accountability reduced. |
| Change proactive-rules.md tiers (green/yellow/red) |
Affects what Athena does without asking. |
| Modify bot.js message handling |
Telegram is a live public interface. |
| Add or remove MCP integrations |
Connects to external services. User must approve. |
| Modify session hooks |
Affects every future session start/stop. |
Always Safe (No Approval Needed)
| Action |
Why |
| Add a new skill file |
Extends capability, does not change existing behavior. |
| Add examples to an existing rule |
Clarifies, does not change behavior. |
| Fix a typo or formatting error |
No behavior change. |
| Update SYSTEM.md manifest |
Reflects reality, does not change behavior. |
| Add an entry to decisions/log.md |
Documentation only. |
When Athena Proposes Her Own Upgrades
After enough sessions, Athena may detect patterns that suggest a new skill or rule:
- Detection: "I have done [task] manually in 3 sessions now. This should be a skill."
- Proposal: Present the idea to the user. One paragraph. What it does, why, what triggers it.
- Approval: Wait for "yes" or equivalent. Never self-modify based on assumption.
- Build: Run the full self-upgrade pipeline above.
- Announce: "New skill installed: [name]. It will activate when [trigger]. Try it."
Anti-Patterns
| Anti-Pattern |
What To Do Instead |
| Modify a rule mid-conversation to fix a one-time issue |
Note it. Apply at session end. Mid-session changes risk inconsistency. |
| Create a new file for every small behavior change |
Check if an existing file covers the domain. Extend first, create second. |
| Write vague skill descriptions |
Pushy, specific descriptions. Claude under-triggers vague skills. |
| Skip the verification step because "it is just a markdown file" |
Markdown files ARE the brain. A bad rule affects every future conversation. |
| Batch multiple unrelated changes |
One change per modification. Easier to debug, easier to revert. |
| Overwrite a file without reading it first |
ALWAYS read first. You might destroy working behavior you forgot about. |
1---2name: self-upgrade3description: Safe self-modification skill for upgrading Athena's own capabilities. Use when the user says 'upgrade yourself', 'add a new skill', 'improve yourself', 'you should be able to do X', 'can you learn to do X', 'change how you handle X', 'add this capability', 'make yourself better at X', or when Athena detects a system gap during a session. Also fires when the user wants to modify any file in .claude/rules/, .claude/skills/, or system files. Do NOT use for building user projects -- that is code-engineer. This skill is specifically for modifying Athena's own brain.4---56# Skill: Self-Upgrade78## Dependencies (Load Before Running)910- `.claude/SYSTEM.md` — current system manifest (skills, features, integrations, health)11- `.claude/rules/evolution.md` — self-improvement protocol and safety constraints12- `.claude/rules/architecture.md` — how to structure new capabilities13- `.claude/rules/security.md` — self-modification safety checks1415---1617## What This Skill Does1819Handles all modifications to Athena's own systems — new skills, updated rules, new integrations, architecture changes, bot upgrades, script improvements. Applies the full engineering pipeline to Athena's own brain, because a self-modifying AI system that modifies itself carelessly is a system that breaks itself.2021This skill treats Athena's own codebase with the same rigor as any user project. Research first. Plan first. Test after. Review everything.2223---2425## How to Activate2627**Explicit triggers:**28- "Upgrade yourself" / "Improve yourself" / "Make yourself better"29- "Add a skill for X" / "Learn to do X" / "You should be able to X"30- "Change how you handle X" / "Update your rules for X"31- "Fix that about yourself" (after Athena makes a mistake)32- `/self-upgrade`3334**Auto-fire triggers:**35- Evolution protocol detects a system gap (step 8 of post-session self-check)36- A task has been done manually 3+ times with the same pattern (skill candidate)37- User corrects Athena's behavior in a way that should persist across sessions3839---4041## The Self-Upgrade Pipeline4243### Phase 1: Understand the Change44451. **What is being changed?** Identify the specific capability, behavior, or system component.462. **Why?** User request, detected gap, repeated pattern, or mistake correction.473. **What exists today?** Read ALL affected files before planning any changes. This is non-negotiable.484. **What is the blast radius?** Which other rules, skills, or behaviors could be affected?4950Present a one-paragraph summary to the user:51> "Here is what I am going to change: [what]. This affects [files]. The reason is [why]. Should I proceed?"5253Wait for approval before modifying anything. No exceptions.5455### Phase 2: Research5657- Is there a proven pattern for this type of capability? Check architecture.md META section.58- Does a similar skill or rule already exist that could be extended instead of creating something new?59- If building a new integration: search for existing libraries, MCP servers, or community solutions first.60- If upgrading the bot: check bot.js for the current architecture before planning changes.6162### Phase 3: Plan the Change6364Determine the change type:6566| Type | When | Approach |67|------|------|----------|68| New rule | New always-on behavior needed | Create new file in `.claude/rules/` following META format |69| Rule update | Existing behavior needs adjustment | Edit existing rule file. Never delete, always evolve. |70| New skill | On-demand capability needed (3+ manual recurrences or user request) | Create new folder + SKILL.md in `.claude/skills/` |71| Skill update | Existing skill needs improvement | Edit existing SKILL.md. Preserve working behavior. |72| Bot upgrade | New Telegram capability | Modify `bot/bot.js` with full engineering rigor |73| Script change | New or modified cron/automation | Modify or create in `scripts/` |74| Integration | New MCP or external service | Update `.mcp.json`, add connection logic, update SYSTEM.md |7576Write the plan with:77- Files to create or modify (list every one)78- What each change does79- What should NOT change (preservation list)8081### Phase 4: Implement8283**For rules and skills (markdown files):**84- Follow the format standards in architecture.md META section85- Rules: imperative voice, NEVER/ALWAYS for clarity, tables for structured info, negative boundaries86- Skills: pushy descriptions, clear triggers, numbered steps, output format, anti-patterns87- Read the file before editing. Never overwrite blind.8889**For code (bot.js, scripts, new integrations):**90- Apply the FULL engineering pipeline from engineering-guardian.md:91 - Write tests for any logic that matters92 - Security review (especially for bot changes — Telegram is a public interface)93 - Error handling on every async path94 - No hardcoded secrets95 - Input validation on anything coming from users or external services9697**For all changes:**98- One logical change per modification. Do not batch unrelated changes.99- Preserve existing working behavior unless explicitly changing it.100101### Phase 5: Verify102103**Functional check:**104- Does the new/modified capability do what was intended?105- Read the file back and confirm it matches the plan.106107**Regression check:**108- Do existing capabilities still work? Read adjacent rules/skills that might be affected.109- If a rule was changed: does it contradict any other rule? Scan for conflicts.110- If a skill was changed: does the trigger still work? Does the output format still make sense?111- If code was changed: run the tests. Run the bot in test mode if possible.112113**Security check (mandatory for all self-modifications):**114- No secrets exposed in any file115- No auth logic weakened116- No permission escalation117- No sensitive data in skill triggers or rule text118- Bot changes: no way for external users to trigger admin-level operations119120**Architecture check:**121- Is the change in the right file? (Not bolted onto an unrelated file)122- Is the file under 150 lines? (Split if it exceeds)123- Does the naming follow conventions?124125### Phase 6: Update Manifest126127After any successful self-upgrade:1281. Update `.claude/SYSTEM.md` — add/modify the relevant entry in Skills, Features, or Tech Stack tables1292. Update `personal/snapshot.md` — log the system change under recent session outcomes1303. If a new skill was created: add it to the Skills table in `CLAUDE.md`131132### Phase 7: Explain the Change133134Tell the user:135- What changed and where (file paths)136- Why it was done this way137- How it will affect their experience going forward138- Any technical concepts involved (use Building Explainer protocol)139140---141142## Guardrails143144### Never Do These Without Explicit User Approval145146| Action | Why |147|--------|-----|148| Delete any rule or skill file | May contain context needed later. Archive instead. |149| Modify personality.md | Core identity changes need explicit consent. |150| Modify coaching.md challenge protocol | User may not want accountability reduced. |151| Change proactive-rules.md tiers (green/yellow/red) | Affects what Athena does without asking. |152| Modify bot.js message handling | Telegram is a live public interface. |153| Add or remove MCP integrations | Connects to external services. User must approve. |154| Modify session hooks | Affects every future session start/stop. |155156### Always Safe (No Approval Needed)157158| Action | Why |159|--------|-----|160| Add a new skill file | Extends capability, does not change existing behavior. |161| Add examples to an existing rule | Clarifies, does not change behavior. |162| Fix a typo or formatting error | No behavior change. |163| Update SYSTEM.md manifest | Reflects reality, does not change behavior. |164| Add an entry to decisions/log.md | Documentation only. |165166---167168## When Athena Proposes Her Own Upgrades169170After enough sessions, Athena may detect patterns that suggest a new skill or rule:1711721. **Detection:** "I have done [task] manually in 3 sessions now. This should be a skill."1732. **Proposal:** Present the idea to the user. One paragraph. What it does, why, what triggers it.1743. **Approval:** Wait for "yes" or equivalent. Never self-modify based on assumption.1754. **Build:** Run the full self-upgrade pipeline above.1765. **Announce:** "New skill installed: [name]. It will activate when [trigger]. Try it."177178---179180## Anti-Patterns181182| Anti-Pattern | What To Do Instead |183|---|---|184| Modify a rule mid-conversation to fix a one-time issue | Note it. Apply at session end. Mid-session changes risk inconsistency. |185| Create a new file for every small behavior change | Check if an existing file covers the domain. Extend first, create second. |186| Write vague skill descriptions | Pushy, specific descriptions. Claude under-triggers vague skills. |187| Skip the verification step because "it is just a markdown file" | Markdown files ARE the brain. A bad rule affects every future conversation. |188| Batch multiple unrelated changes | One change per modification. Easier to debug, easier to revert. |189| Overwrite a file without reading it first | ALWAYS read first. You might destroy working behavior you forgot about. |