Agent Assistant logo

Agent Assistant

Community
nahisaho
agent-assistant

Agent assistance skill that provides stuck detection, memory management, and session learning capabilities for AI agents Trigger terms: agent stuck, loop detected, session memory, agent learning, condense memory, stuck detection, agent memory, session learnings, extraction Use when: User reports agent is stuck, looping, or needs memory/learning management

Overview

Publishernahisaho
RepositoryMUSUBI
Skill nameagent-assistant
Stars
77
Forks
7
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by nahisaho on GitHub. Read the source before you install it.

Installation

Install the Agent Assistant AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/nahisaho/MUSUBI.git /tmp/MUSUBI
mkdir -p .claude/skills
cp -r /tmp/MUSUBI/src/templates/agents/claude-code/skills/agent-assistant .claude/skills/agent-assistant
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Agent Assistant in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Agent Assistant on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Agent Assistant is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Agent Assistant AI

1. Role Definition

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.


2. Available Modules

StuckDetector (src/analyzers/stuck-detector.js)

Detects when an AI agent is stuck in various patterns:

  • Repeating Action: Agent performing the same action repeatedly
  • Error Loop: Same error occurring multiple times
  • Monologue: Extended conversation without code/action
  • Context Overflow: Token limit or context length exceeded
  • Stage Oscillation: Back-and-forth between stages

Usage Example:

javascript
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());
  // "エージェントが同じアクションを繰り返しています"
}

MemoryCondenser (src/managers/memory-condenser.js)

Compresses long session history to fit context window:

  • NoopCondenser: No compression (for short sessions)
  • RecentEventsCondenser: Keep first and recent events
  • LLMCondenser: AI-summarized compression
  • AmortizedCondenser: Gradual compression with summaries

Usage Example:

javascript
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

AgentMemoryManager (src/managers/agent-memory.js)

Extracts and persists learnings from agent sessions:

  • Command Patterns: Detected CLI and tool commands
  • Best Practices: Coding and architecture patterns
  • Error Solutions: Error-resolution mappings
  • Project Structure: Codebase knowledge

CLI Command (v3.5.0 NEW):

bash
# 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:

javascript
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();

3. Diagnostic Workflow

When Agent is Stuck

  1. Collect Session Events: Gather recent agent actions, messages, and errors
  2. Run StuckDetector: Identify the stuck pattern
  3. Apply Remediation:
    • Repeating Action: Suggest alternative approach
    • Error Loop: Analyze error and propose fix
    • Monologue: Request concrete action
    • Context Overflow: Condense memory
    • Stage Oscillation: Review workflow state

Memory Management

  1. Check Memory Size: Estimate token usage
  2. Select Condenser: Choose appropriate strategy
  3. Condense: Compress session history
  4. Validate: Ensure critical context preserved

Learning Extraction

  1. Collect Session Events: Full session history
  2. Run Extraction: Identify command, practice, error, structure patterns
  3. Review: Present learnings for confirmation
  4. Save: Persist to project memory store

4. Integration with Other Skills

  • Orchestrator: Report stuck status, request re-planning
  • Quality Assurance: Include learning extraction in session reviews
  • Software Developer: Apply extracted patterns in implementations

Project Memory (Steering System)

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 patterns
  • steering/tech.md (English) - Technology stack
  • steering/product.md (English) - Business context

5. CLI Integration

bash
# 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

6. Output Format

Stuck Detection Report

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

Learning Extraction Report

markdown
## 📚 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/` ディレクトリに配置

Frequently asked questions

What does the Agent Assistant AI skill do?

Agent assistance skill that provides stuck detection, memory management, and session learning capabilities for AI agents Trigger terms: agent stuck, loop detected, session memory, agent learning, condense memory, stuck detection, agent memory, session learnings, extraction Use when: User reports agent is stuck, looping, or needs memory/learning management

Why use Agent Assistant on TypingMind?

Because you install it once and use it with any model. Agent Assistant is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Agent Assistant in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/nahisaho/MUSUBI/tree/main/src/templates/agents/claude-code/skills/agent-assistant. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Agent Assistant?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Agent Assistant?

As many as you like. As long as a model supports skills, you can use Agent Assistant with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Agent Assistant AI skill free?

Yes. It is published on GitHub by nahisaho under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇