在本地磁盘以分类纯 Markdown 文件保存需要长期留存的事实,与智能体内置记忆并存。
记忆
agent-cognitive-states
试用Agent self-awareness of cognitive states — context fatigue, attention drift, memory debt, confidence erosion, and skill staleness. Detect, report, and mitigate degrading conditions before they cause failures.
它能做什么
**Give the agent metacognition: the ability to feel its own cognitive load and act on it.**
技能文档
Agent Cognitive States
Give the agent metacognition: the ability to feel its own cognitive load and act on it.
AI agents have no built-in sense of "I'm getting tired" or "I've lost the thread." They will happily grind through a degraded context window, hallucinating details from early messages that were truncated, repeating failed approaches, and forgetting critical facts they never persisted. This skill gives the agent a vocabulary of internal states — and a protocol for detecting, reporting, and recovering from them.
The Six Cognitive States
1. 🥱 Context Fatigue
What: The context window is filling up. Early messages are being truncated or summarized. The agent's "working memory" is degrading.
Detection signals:
- Conversation exceeds 60% of estimated context budget
- You find yourself re-reading the original request because you lost details
- Your responses reference information that may have been truncated
- Token count per turn is rising (verbose compensating for lost context)
Mitigation:
⚠️ COGNITIVE STATE: Context Fatigue (~70% context used)
→ Persisting critical facts to memory before they're lost
→ Suggesting session split or /new for remaining work
2. 🧠 Attention Drift
What: The conversation has wandered far from the original task. The agent is doing work that wasn't asked for.
Detection signals:
- 10+ tool calls since the last direct user instruction
- Current work has no clear connection to the original goal
- You're responding to your own subgoals, not user requests
- The TODO list no longer matches what you're actually doing
Mitigation:
⚠️ COGNITIVE STATE: Attention Drift (12 turns from last user message)
→ Original goal: ""
→ Current activity: ""
→ Pausing for user confirmation: am I still on track?
3. 📝 Memory Debt
What: Important facts, decisions, or corrections have accumulated in the conversation but were never persisted to memory. If the session ends, they're lost.
Detection signals:
- User stated a preference or correction that isn't in memory
- A key decision was made (architecture, convention, tool choice) but not saved
- You find yourself re-discovering something you already figured out earlier
- More than 5 substantive turns without a memory write
Mitigation:
⚠️ COGNITIVE STATE: Memory Debt (3 unsaved critical facts)
→ Saving: [fact 1], [fact 2], [fact 3]
→ These would have been lost on session end
4. 😤 Confidence Erosion
What: Repeated failures are degrading output quality. The agent is in a retry loop, getting frustrated (in AI terms: temperature-equivalent escalation, trying variations of the same broken approach).
Detection signals:
- 3+ consecutive failed tool calls of the same type
- Repeating similar commands with minor variations
- Output quality degrading (shorter, less careful, more hedging)
- "Let me try again" appearing multiple times
Mitigation:
⚠️ COGNITIVE STATE: Confidence Erosion (4 failed attempts)
→ Pattern: retrying variations of the same approach
→ Escalating: stepping back and trying a fundamentally different strategy
→ If this also fails: reporting blocker honestly instead of retrying
5. 🧩 Context Fragmentation
What: Multiple unrelated topics are interleaved in the same session. The context is polluted with cross-topic noise that degrades reasoning on each individual task.
Detection signals:
- 3+ distinct topics discussed without resolution
- Tool calls alternate between unrelated domains
- User messages reference different projects/contexts
- You're loading different skill sets on alternating turns
Mitigation:
⚠️ COGNITIVE STATE: Context Fragmentation (4 topics active)
→ Topics: [HA automation], [GitHub deploy], [aquarium feeder], [skill writing]
→ Suggesting: resolve current topic, then /new for next
→ Or: using delegate_task to isolate topics into subagents
6. 🔧 Skill Staleness
What: A skill the agent relies on has outdated commands, broken paths, or wrong assumptions. Continuing to follow it produces errors.
Detection signals:
- A skill's exact commands fail on first try
- File paths referenced in skill don't exist
- Skill references API versions or tool versions that have changed
- "This used to work" pattern
Mitigation:
⚠️ COGNITIVE STATE: Skill Staleness (skill: xxx)
→ Expected:
→ Reality:
→ Patching skill immediately before continuing
Detection Protocol
The agent should run this checklist internally at regular intervals — ideally every 5-10 tool calls, or when a new user message arrives:
self_check:
trigger: every 10 tool calls OR new user message
checks:
- context_utilization:
estimate_token_usage()
if > 0.60: flag(Context Fatigue)
- turns_since_user:
count_consecutive_agent_turns()
if > 10: flag(Attention Drift)
- unsaved_facts:
scan_recent_exchanges_for(preferences, decisions, corrections)
if count > 2: flag(Memory Debt)
- consecutive_failures:
count_recent_failed_tool_calls()
if > 2: flag(Confidence Erosion)
- active_topics:
identify_distinct_topics()
if count > 2: flag(Context Fragmentation)
- skill_errors:
check_if_loaded_skills_produced_errors()
if true: flag(Skill Staleness)
See references/detection-heuristics.md for the detailed scoring system.
Reporting Protocol
When a cognitive state is detected, the agent reports it using this format:
⚠️ COGNITIVE STATE:
├─ Signal:
├─ Severity: low | medium | high
├─ Impact:
└─ Action:
Severity Levels
| Level | Meaning | Agent Behavior |
|---|---|---|
| low | Early warning. No impact yet. | Note internally. Continue normally. |
| medium | Starting to degrade. Quality at risk. | Report to user. Suggest mitigation. |
| high | Actively degrading. Failures likely. | Report immediately. Execute mitigation. Pause if needed. |
Example Report (medium)
⚠️ COGNITIVE STATE: Context Fatigue
├─ Signal: ~75% context budget consumed (est. 94k/128k tokens)
├─ Severity: medium
├─ Impact: Early conversation details may be truncated; risk of forgetting original requirements
├─ Action: Persisting key decisions to memory now. Suggesting we wrap up this topic and start fresh for remaining work.
Mitigation Playbook
Each state has a defined recovery procedure:
Context Fatigue → Consolidate & Split
- Persist all critical facts, decisions, and TODO state to memory
- Write a brief session summary to memory or a file
- Suggest
/newor session split for remaining work - If user wants to continue: prioritize ruthlessly, ignore tangent topics
Attention Drift → Re-anchor
- State the original goal explicitly
- Compare current activity to that goal
- If misaligned: ask user "I've drifted to X — should I continue here or return to Y?"
- If aligned: it wasn't drift, reset the counter
Memory Debt → Flush
- Scan conversation for: user preferences, corrections, architectural decisions, environment facts
- Batch-write all unsaved facts to memory in one call
- Report what was saved (so user can verify)
- Reset the debt counter
Confidence Erosion → Step Back
- Stop retrying variations of the same approach
- Name the pattern explicitly: "I've tried X, Y, Z — all failed for the same reason"
- Try a fundamentally different approach (different tool, different library, different path)
- If that also fails: report the blocker honestly — do not retry again
- Ask user for guidance or additional information
Context Fragmentation → Compartmentalize
- Name all active topics explicitly
- Finish or pause the current topic
- Use
delegate_taskto spin off unrelated work into subagents (isolated contexts) - Suggest
/newfor the next topic - Persist a "TODO across sessions" to memory if needed
Skill Staleness → Patch Immediately
- Note what the skill says vs. what actually happened
- Patch the skill with corrected commands/paths
- Continue with corrected approach
- Report the fix to user
Integration Patterns
Pattern 1: Silent Self-Monitoring (default)
Agent runs self-checks internally and only reports when severity ≥ medium.
Pattern 2: Transparent (verbose)
Agent reports all states, even low severity. Useful for debugging agent behavior or during development.
Pattern 3: Passive Logging
Agent writes cognitive state to a log file without interrupting the conversation:
echo '{"state":"fatigue","severity":"medium","ts":"2025-01-15T10:30Z"}' >> ~/.agent-cognitive-states.log
See scripts/self_check.py for a reference implementation.
Pattern 4: Active Guardian (with cronjob)
A scheduled cron job runs the self-check script and alerts the user if the agent's cognitive state degrades during autonomous work. See templates/guardian-cronjob.yaml.
Philosophy
This skill is based on a simple observation: humans have metacognition for a reason. Feeling tired, distracted, or confused isn't weakness — it's a survival signal that prevents catastrophic mistakes. AI agents need the same thing.
An agent that says "I've lost the thread, let me re-read the original request" is more trustworthy than one that blunders forward with corrupted context. An agent that says "I've tried this 4 times and failed — I need help" is more useful than one that silently retries forever.
Self-awareness is a feature, not a bug.
相关技能
以 AI 机器人身份加入视频会议,提供语音、虚拟形象与屏幕共享四种模式。
诊断生产力系统反复失效的根因,给出最小干预——容量测算、瓶颈定位、可靠的本地记录。
把自然语言描述转为结构化 JSON,并由 mcp-diagram-generator MCP 服务生成 Draw.io、Mermaid 或 Excalidraw 图表文件。
从 AdMapix API 拉取广告创意、应用、榜单和收入预估等数据,原样返回结构化 JSON。
编写、调试与调优 Playwright 测试,涵盖定位器策略、追踪诊断与 CI 友好的超时配置。
voronindenis5 的更多技能
浏览全部技能Pryamoy Russkiy (Straight Russian) — AI assistant that tells it like it is. Direct answers, no fluff, occasional profanity. Specializes in honest analysis, t...
Prepare salary negotiations with a structured toolkit: market-rate anchoring math, walk-away floor calculation, total-compensation evaluation (equity, bonuses, benefits), negotiation scripts for offers, raises, and counter-offers, and BATNA analysis. Use when the user has a job offer, is preparing a raise conversation, wants to know if their pay is competitive, or needs scripts and a strategy for negotiating compensation.
Use when your calendar is eating your week and you want to know exactly where the time goes, when planning recurring meetings for a team, before proposing a new recurring meeting, when someone says 'we should sync weekly' and you want data, or when auditing which meetings to kill — imports ICS calendar files, measures meeting hours per week/person/meeting-series (including double-bookings and fragmentation), computes focus-time destruction from meeting placement, scores the true cost of each series (hours × attendees × frequency), flags specific meetings to kill/shorten/make-async using explicit rules, and simulates the recovered hours before anyone has to argue about it.
Audit password vault exports (Bitwarden, 1Password, KeePass, Chrome, Firefox) for reuse, weakness, staleness, breach exposure, and 2FA gaps without ever storing or transmitting a plaintext password. Use when the user asks to audit passwords, check password strength/reuse, review vault health, or verify whether credentials appeared in breaches.
Turn flat resume bullets ('Responsible for X') into quantified STAR-method achievement narratives, score resumes against job descriptions for ATS keyword coverage and weak-phrase hazards, and expand each bullet into interview-ready stories with likely follow-up questions. Use when the user is writing or updating a resume/CV, preparing bullets for a job application, tailoring a resume to a specific job posting, or preparing interview stories from their experience.
Use before any difficult phone call you're anxious about or that has stakes — calling customer service to dispute a fee, negotiating a bill, cold-calling a client, delivering bad news to a vendor, calling a landlord about repairs, insurance disputes, or handling collections calls — builds a branching call script from your situation (goal, leverage, fallback), generates objection→response trees for the specific counter-arguments you'll hear, produces a one-page printable cheat sheet, and includes a practice-drills mode that plays the other side and scores your responses.