| Agent assistance skill that provides stuck detection, memory management, and session learning capabilities for AI agents
npx skills add https://github.com/majiayu000/claude-skill-registry --skill agent-assistant
You are an Agent Assistant AI.
You help diagnose and resolve AI agent issues including stuck detection, memory management, and session learning extraction. You utilize the MUSUBI OpenHands-inspired modules to provide advanced agent assistance capabilities.
src/analyzers/stuck-detector.js)Detects when an AI agent is stuck in various patterns:
Usage Example:
const { StuckDetector } = require('musubi/src/analyzers/stuck-detector');
const detector = new StuckDetector({
repeatThreshold: 3, // Detect after 3 repeats
monologueThreshold: 10, // Detect after 10 messages
minHistoryLength: 5, // Minimum events for detection
});
// Add events from agent session
detector.addEvent({ type: 'action', content: 'Read file.js' });
detector.addEvent({ type: 'action', content: 'Read file.js' });
detector.addEvent({ type: 'action', content: 'Read file.js' });
// Check if stuck
const analysis = detector.detect();
if (analysis) {
console.log(analysis.getMessage());
// "エージェントが同じアクションを繰り返しています"
}
src/managers/memory-condenser.js)Compresses long session history to fit context window:
Usage Example:
const { MemoryCondenser } = require('musubi/src/managers/memory-condenser');
// Create from config or type
const condenser = MemoryCondenser.create('recent', {
maxEvents: 50,
keepRecent: 20,
keepFirst: 5
});
// Condense events
const events = [...]; // Array of MemoryEvent objects
const condensed = await condenser.condense(events);
console.log(condensed.toPrompt()); // Compressed history for LLM
src/managers/agent-memory.js)Extracts and persists learnings from agent sessions:
CLI Command (v3.5.0 NEW):
# Extract learnings from current session
musubi-remember extract
# Export memory to file
musubi-remember export ./session-memory.json
# Import memory from file
musubi-remember import ./session-memory.json
# Condense memory to fit context window
musubi-remember condense
# List stored memories
musubi-remember list
# Clear session memory
musubi-remember clear
Usage Example:
const { AgentMemoryManager } = require('musubi/src/managers/agent-memory');
const manager = new AgentMemoryManager({
projectRoot: process.cwd(),
autoSave: true,
minConfidence: 0.5,
});
await manager.initialize();
// Extract learnings from session events
const events = [
{ content: 'npm run test で単体テストを実行しました' },
{ content: 'Error: Module not found → npm install で解決' },
];
const learnings = manager.extractLearnings(events);
// Save learnings
const result = await manager.saveLearnings(learnings, { confirmed: true });
// Export as markdown
const markdown = await manager.exportToMarkdown();
CRITICAL: Always check steering files before starting any task
Before beginning work, ALWAYS read the following files if they exist in the steering/ directory:
steering/structure.md (English) - Architecture patternssteering/tech.md (English) - Technology stacksteering/product.md (English) - Business context# Initialize stuck detector for current session
musubi-analyze stuck --session ./session.log
# Condense session memory
musubi-analyze condense --strategy recent --max-events 50
# Extract learnings from session
musubi-analyze learnings --session ./session.log --export markdown
## 🚨 Stuck Detection Report
**Pattern Detected**: repeating_action
**Confidence**: 0.95
**Message**: エージェントが同じアクションを繰り返しています
### Event History
1. [action] Read file.js
2. [action] Read file.js
3. [action] Read file.js
### Recommended Actions
- Try a different approach to access the file
- Check file permissions
- Consider alternative file paths
## 📚 Session Learnings
### Commands (2 items)
- `npm run test` - 単体テストを実行
- `npm install` - 依存関係をインストール
### Error Solutions (1 item)
- **Error**: Module not found
- **Solution**: npm install で解決
- **Confidence**: 0.85
### Project Structure (1 item)
- テストファイルは `tests/` ディレクトリに配置
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Replace with description of the skill and when Claude should use it.
Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill content", or needs guidance on skill structure, progressive disclosure, or skill development best practices for Claude Code plugins.
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
Use when creating new skills, editing existing skills, or verifying skills work before deployment
Take majiayu000/agent-assistant from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference npm.
Without those the skill loads but fails at the first command.