Skip to content

Commit f799336

Browse files
committed
feat: add Claude Code plugin with skill and slash commands
1 parent 3c56a91 commit f799336

File tree

5 files changed

+168
-0
lines changed

5 files changed

+168
-0
lines changed

.claude-plugin/plugin.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "classifier",
3+
"description": "Text classification CLI using Bayesian, LSI, KNN, Logistic Regression, and TF-IDF algorithms",
4+
"version": "1.0.0",
5+
"author": {
6+
"name": "Lucas Carlson",
7+
"url": "https://github.com/cardmagic"
8+
},
9+
"repository": "https://github.com/cardmagic/classifier",
10+
"license": "LGPL-2.1",
11+
"keywords": ["machine-learning", "text-classification", "nlp", "bayesian", "lsi", "cli"]
12+
}

commands/classify.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# /classifier:classify
2+
3+
Classify text using a pre-trained or custom model.
4+
5+
## Usage
6+
7+
```
8+
/classifier:classify <model> <text>
9+
```
10+
11+
## Examples
12+
13+
```
14+
/classifier:classify sms-spam-filter "Congratulations! You won $1000"
15+
/classifier:classify imdb-sentiment "This movie was fantastic"
16+
/classifier:classify emotion-detection "I feel so frustrated today"
17+
```
18+
19+
## Instructions
20+
21+
Run the classifier command with the specified model and text:
22+
23+
```bash
24+
classifier -r "$model" "$text"
25+
```
26+
27+
If no model is specified, list available models with `classifier models` and ask the user which one to use.
28+
29+
Report the classification result clearly, e.g.:
30+
- "The text was classified as: **spam**"
31+
- "Sentiment: **positive**"
32+
- "Detected emotion: **anger**"

commands/models.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# /classifier:models
2+
3+
List all available pre-trained classification models.
4+
5+
## Usage
6+
7+
```
8+
/classifier:models
9+
```
10+
11+
## Instructions
12+
13+
Run:
14+
15+
```bash
16+
classifier models
17+
```
18+
19+
Present the results in a formatted table showing:
20+
- Model name
21+
- Description/use case
22+
- Categories it can classify
23+
24+
Suggest relevant models based on the user's context if known.

commands/train.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# /classifier:train
2+
3+
Train a classifier with labeled examples.
4+
5+
## Usage
6+
7+
```
8+
/classifier:train <category> <text or file pattern>
9+
```
10+
11+
## Examples
12+
13+
```
14+
/classifier:train spam "Buy cheap viagra now"
15+
/classifier:train ham "Meeting scheduled for tomorrow"
16+
/classifier:train positive reviews/good/*.txt
17+
/classifier:train negative reviews/bad/*.txt
18+
```
19+
20+
## Instructions
21+
22+
Run the classifier train command:
23+
24+
```bash
25+
classifier train "$category" "$text_or_pattern"
26+
```
27+
28+
After training, inform the user they can:
29+
1. Add more training examples with additional `/classifier:train` commands
30+
2. Classify new text with `classifier "text to classify"`
31+
3. Save the model with `classifier save model-name.json`
32+
33+
For best results, recommend balanced training data across all categories.

skills/classifier/SKILL.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Text Classification with Classifier
2+
3+
Use when: User asks to classify text, detect spam, analyze sentiment, detect emotions, or use pre-trained ML models.
4+
5+
## Pre-trained Models
6+
7+
Run `classifier models` to see all available models. Common ones:
8+
9+
| Model | Command | Use Case |
10+
|-------|---------|----------|
11+
| `sms-spam-filter` | `classifier -r sms-spam-filter "text"` | Spam detection |
12+
| `imdb-sentiment` | `classifier -r imdb-sentiment "text"` | Sentiment analysis |
13+
| `emotion-detection` | `classifier -r emotion-detection "text"` | Emotion classification |
14+
15+
## Quick Classification
16+
17+
```bash
18+
# Classify with a pre-trained model
19+
classifier -r <model-name> "text to classify"
20+
21+
# Example: detect spam
22+
classifier -r sms-spam-filter "You won a free iPhone! Click here now!"
23+
24+
# Example: sentiment analysis
25+
classifier -r imdb-sentiment "This movie was absolutely terrible"
26+
27+
# Example: emotion detection
28+
classifier -r emotion-detection "I am so happy today"
29+
```
30+
31+
## Custom Training
32+
33+
```bash
34+
# Train from text
35+
classifier train positive "Great product, love it"
36+
classifier train negative "Terrible quality, waste of money"
37+
38+
# Train from files
39+
classifier train positive reviews/good/*.txt
40+
classifier train negative reviews/bad/*.txt
41+
42+
# Classify after training
43+
classifier "This product exceeded my expectations"
44+
```
45+
46+
## Model Management
47+
48+
```bash
49+
# List all available models
50+
classifier models
51+
52+
# Show model details
53+
classifier info <model-name>
54+
55+
# Save trained model
56+
classifier save my-model.json
57+
58+
# Load saved model
59+
classifier load my-model.json
60+
```
61+
62+
## Best Practices
63+
64+
1. For quick classification tasks, use pre-trained models first
65+
2. For custom domains, train with representative examples from each category
66+
3. Use `classifier models` to discover available pre-trained models
67+
4. Balance training data across categories for best results

0 commit comments

Comments
 (0)