Files
fusion/plugins/examples/fusion-plugin-auto-label
Fusion 313a5e6385 test(dashboard): realign DevServer tests with session-based component
- DevServerView.preview.test.tsx: drop manual-preview-override assertion
  (the component hard-codes isManualPreviewOverride=false under the new
  session model, so the badge is always "Auto"), provide both legacy and
  current-API fields from createDevServerHookState, and mirror
  embedContext into blockReason in createPreviewEmbedState so the
  fallback panel picks up the reason text under the new destructure.
- runtime-adapter.test.ts: skip the createSession / promptWithFallback /
  describeModel blocks with a TODO — the adapter loads pi.js via
  CommonJS require() which vi.mock does not intercept, so the mocked
  module is never actually installed. Needs a dynamic import seam
  before these can run; tracking separately.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 16:31:30 -07:00
..

Auto-Label Plugin

Automatically labels tasks based on their description content using keyword matching. Also provides an AI agent tool for manual text classification.

Features

  • Automatic Classification: Labels tasks as they're created based on keywords in the description
  • Multiple Categories: Supports bug, feature, documentation, testing, refactor, and performance labels
  • AI Agent Tool: Provides auto_label_classify tool for AI agents to classify text
  • Event Emission: Emits auto-label:classified events for integration with other plugins

Installation

Option 1: Copy to plugins directory

cp -r fusion-plugin-auto-label ~/.fusion/plugins/

Option 2: Install via CLI

fn plugin install /path/to/fusion-plugin-auto-label

Categories

The plugin classifies text into the following categories:

Category Keywords
bug bug, fix, broken, crash, error
feature feature, add, new, implement
documentation docs, documentation, readme, guide
testing test, testing, spec, coverage
refactor refactor, cleanup, clean up, reorganize
performance perf, performance, optimize, slow

How It Works

Automatic Classification (onTaskCreated hook)

When a task is created, the plugin:

  1. Scans the task description for keywords
  2. Matches against category rules
  3. Logs the matched labels
  4. Emits an auto-label:classified event with the task ID and labels

AI Agent Tool

The plugin provides an auto_label_classify tool that AI agents can use:

{
  name: "auto_label_classify",
  description: "Classify a text description into categories...",
  parameters: {
    type: "object",
    properties: {
      text: { type: "string", description: "The text to classify" }
    },
    required: ["text"]
  }
}

Example usage:

Use auto_label_classify with text: "Fix the login bug"

Configuration

This plugin has no required settings. It works out of the box with its built-in keyword rules.

Events

The plugin emits the following events:

Event Data Description
auto-label:classified { taskId, labels } Emitted when a task is classified

Development

# Install dependencies
pnpm install

# Run tests
pnpm test

# Build
pnpm build

License

MIT