Skip to content

Quick Start

This guide walks you through creating a simple plugin that works with multiple AI assistants.

Step 1: Create Your Project

mkdir my-plugin
cd my-plugin
go mod init github.com/yourname/my-plugin
go get github.com/agentplexus/assistantkit

Step 2: Define a Canonical Command

Create canonical/commands/greet.md:

---
name: greet
description: Greet the user with a friendly message
---

Say hello to the user in a friendly and welcoming way.
Include their name if provided.

Step 3: Create the Plugin Generator

Create main.go:

package main

import (
    "log"
    "os"

    "github.com/agentplexus/assistantkit/commands/core"
    "github.com/agentplexus/assistantkit/commands/claude"
    "github.com/agentplexus/assistantkit/commands/gemini"
    "github.com/agentplexus/assistantkit/plugins/core"
)

func main() {
    // Define canonical command
    greetCmd := commandscore.Command{
        Name:        "greet",
        Description: "Greet the user with a friendly message",
        Prompt:      "Say hello to the user in a friendly and welcoming way.",
    }

    // Generate for Claude
    claudeCmd := claude.FromCanonical(greetCmd)
    if err := os.MkdirAll("plugins/claude/commands", 0755); err != nil {
        log.Fatal(err)
    }
    if err := claudeCmd.WriteFile("plugins/claude/commands/greet.md"); err != nil {
        log.Fatal(err)
    }

    // Generate for Gemini
    geminiCmd := gemini.FromCanonical(greetCmd)
    if err := os.MkdirAll("plugins/gemini/commands", 0755); err != nil {
        log.Fatal(err)
    }
    if err := geminiCmd.WriteFile("plugins/gemini/commands/greet.yaml"); err != nil {
        log.Fatal(err)
    }

    log.Println("Plugins generated successfully!")
}

Step 4: Generate Plugins

go run main.go

This creates:

plugins/
├── claude/
│   └── commands/
│       └── greet.md
└── gemini/
    └── commands/
        └── greet.yaml

Step 5: Install the Plugin

# From local directory
claude plugin add ./plugins/claude

# Or from GitHub
claude plugin add github:yourname/my-plugin/plugins/claude
# Copy to Gemini config
cp -r plugins/gemini ~/.gemini/plugins/my-plugin

Step 6: Test Your Plugin

claude
> /greet
gemini
> /greet

Next Steps