Files
fusion/plugins/examples/fusion-plugin-auto-label
gsxdsm 97afba2f7e fix(ci): fix test failures from recent feature additions
- Add ChatStore mock to all dashboard route tests that mock @fusion/core,
  since server.ts now instantiates ChatStore(store.getFusionDir(), ...)
- Add getFusionDir to createMockStore in server.test.ts
- Gate AI session cleanup scheduling behind shouldScheduleAiSessionCleanup()
  (returns false in test env) to prevent open handle warnings
- Fix desktop tests: DASHBOARD_URL is now exported as a function alias,
  update assertions to call DASHBOARD_URL() instead of using as string
- Add node:os mocks to system-metrics.test.ts for deterministic results
- Replace hardcoded maxWorkers=16 with availableParallelism()-based
  calculation in all vitest configs to prevent OOM on 2-core CI runners
- Add --workspace-concurrency=2 to pnpm test commands
- Fix TaskCard tests: update mission badge title assertions to full titles
- Remove unused /api/mesh/state route
- Fix plugin-auto-label: add isError field, async onTaskCreated, "tests" keyword
- Fix plugin-ci-status: add module-level logger, tighten test assertions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 08:01:03 -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