Files
fusion/plugins/examples/fusion-plugin-auto-label
gsxdsm 1aa1e723f6 chore(build,test): split desktop/mobile from default build; share vitest worker budget
- pnpm build now excludes @fusion/desktop and @fusion/mobile by default
  (recursive build still available as pnpm build:all). Saves time on
  workspace-wide builds that don't need the native shells.
- Hoist the per-package max-worker computation into a shared
  packages/core/src/__test-utils__/vitest-workers.ts util. Every
  vitest.config.ts now calls computeMaxWorkers(), which honors
  VITEST_MAX_WORKERS, FUSION_TEST_TOTAL_WORKERS, and a per-config
  defaultCap, clamped to cpus-1.
- pnpm test sets VITEST_MAX_WORKERS=2 so the workspace run keeps total
  fan-out modest with --workspace-concurrency=2.
- Switch dashboard vitest pool from forks to threads so jsdom/React
  suites share a V8 heap instead of duplicating ~500MB per worker.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 15:56:15 -07:00
..
2026-05-01 23:38:03 -07:00
2026-05-01 23:38: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