SuperCharge Claude Code v1.0.0 - Complete Customization Package
Features: - 30+ Custom Skills (cognitive, development, UI/UX, autonomous agents) - RalphLoop autonomous agent integration - Multi-AI consultation (Qwen) - Agent management system with sync capabilities - Custom hooks for session management - MCP servers integration - Plugin marketplace setup - Comprehensive installation script Components: - Skills: always-use-superpowers, ralph, brainstorming, ui-ux-pro-max, etc. - Agents: 100+ agents across engineering, marketing, product, etc. - Hooks: session-start-superpowers, qwen-consult, ralph-auto-trigger - Commands: /brainstorm, /write-plan, /execute-plan - MCP Servers: zai-mcp-server, web-search-prime, web-reader, zread - Binaries: ralphloop wrapper Installation: ./supercharge.sh
This commit is contained in:
48
plugins/examples/knowledge-base/.claude-plugin/plugin.json
Normal file
48
plugins/examples/knowledge-base/.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "knowledge-base",
|
||||
"version": "1.0.0",
|
||||
"description": "AI-powered knowledge base with semantic search",
|
||||
"author": "Your Name",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/yourusername/claude-knowledge-base",
|
||||
"claude": {
|
||||
"permissions": [
|
||||
"read:files",
|
||||
"write:files",
|
||||
"execute:commands"
|
||||
],
|
||||
"commands": [
|
||||
{
|
||||
"name": "knowledge:add",
|
||||
"description": "Add knowledge entries to your knowledge base",
|
||||
"handler": "commands/add.ts",
|
||||
"permissions": ["write:files"]
|
||||
},
|
||||
{
|
||||
"name": "knowledge:search",
|
||||
"description": "Search your knowledge base with semantic understanding",
|
||||
"handler": "commands/search.ts",
|
||||
"permissions": ["read:files"]
|
||||
},
|
||||
{
|
||||
"name": "knowledge:list",
|
||||
"description": "List all knowledge entries",
|
||||
"handler": "commands/list.ts",
|
||||
"permissions": ["read:files"]
|
||||
},
|
||||
{
|
||||
"name": "knowledge:export",
|
||||
"description": "Export knowledge base to various formats",
|
||||
"handler": "commands/export.ts",
|
||||
"permissions": ["read:files"]
|
||||
}
|
||||
],
|
||||
"hooks": [
|
||||
{
|
||||
"event": "SessionEnd",
|
||||
"handler": "hooks/auto-save.ts",
|
||||
"priority": 10
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
77
plugins/examples/knowledge-base/commands/add.ts
Normal file
77
plugins/examples/knowledge-base/commands/add.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* Knowledge Add Command
|
||||
* Add knowledge entries to your knowledge base
|
||||
*/
|
||||
|
||||
import { writeFileSync, readFileSync, existsSync, mkdirSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import { homedir } from 'os'
|
||||
|
||||
export interface AddOptions {
|
||||
content: string
|
||||
tags?: string[]
|
||||
category?: string
|
||||
title?: string
|
||||
source?: string
|
||||
}
|
||||
|
||||
const KNOWLEDGE_DIR = join(homedir(), '.claude', 'knowledge')
|
||||
const KNOWLEDGE_FILE = join(KNOWLEDGE_DIR, 'knowledge.json')
|
||||
|
||||
interface KnowledgeEntry {
|
||||
id: string
|
||||
title?: string
|
||||
content: string
|
||||
tags: string[]
|
||||
category: string
|
||||
source?: string
|
||||
timestamp: string
|
||||
}
|
||||
|
||||
export async function handle(args: AddOptions, context: any): Promise<string> {
|
||||
const { content, tags = [], category = 'general', title, source } = args
|
||||
|
||||
try {
|
||||
// Ensure knowledge directory exists
|
||||
if (!existsSync(KNOWLEDGE_DIR)) {
|
||||
mkdirSync(KNOWLEDGE_DIR, { recursive: true })
|
||||
}
|
||||
|
||||
// Load existing knowledge
|
||||
let knowledge: KnowledgeEntry[] = []
|
||||
|
||||
if (existsSync(KNOWLEDGE_FILE)) {
|
||||
const data = readFileSync(KNOWLEDGE_FILE, 'utf-8')
|
||||
knowledge = JSON.parse(data)
|
||||
}
|
||||
|
||||
// Create new entry
|
||||
const entry: KnowledgeEntry = {
|
||||
id: generateId(),
|
||||
title,
|
||||
content,
|
||||
tags,
|
||||
category,
|
||||
source,
|
||||
timestamp: new Date().toISOString(),
|
||||
}
|
||||
|
||||
knowledge.push(entry)
|
||||
|
||||
// Save knowledge
|
||||
writeFileSync(KNOWLEDGE_FILE, JSON.stringify(knowledge, null, 2), 'utf-8')
|
||||
|
||||
return `✓ Knowledge entry added (ID: ${entry.id})\n` +
|
||||
` Category: ${category}\n` +
|
||||
` Tags: ${tags.join(', ') || 'none'}\n` +
|
||||
` Total entries: ${knowledge.length}`
|
||||
} catch (error: any) {
|
||||
throw new Error(`Failed to add knowledge: ${error.message}`)
|
||||
}
|
||||
}
|
||||
|
||||
function generateId(): string {
|
||||
return Date.now().toString(36) + Math.random().toString(36).substr(2)
|
||||
}
|
||||
|
||||
export default { handle }
|
||||
115
plugins/examples/knowledge-base/commands/export.ts
Normal file
115
plugins/examples/knowledge-base/commands/export.ts
Normal file
@@ -0,0 +1,115 @@
|
||||
/**
|
||||
* Knowledge Export Command
|
||||
* Export knowledge base to various formats
|
||||
*/
|
||||
|
||||
import { writeFileSync, readFileSync, existsSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import { homedir } from 'os'
|
||||
|
||||
export interface ExportOptions {
|
||||
format: 'json' | 'markdown' | 'csv'
|
||||
outputPath?: string
|
||||
category?: string
|
||||
}
|
||||
|
||||
const KNOWLEDGE_FILE = join(homedir(), '.claude', 'knowledge', 'knowledge.json')
|
||||
|
||||
interface KnowledgeEntry {
|
||||
id: string
|
||||
title?: string
|
||||
content: string
|
||||
tags: string[]
|
||||
category: string
|
||||
source?: string
|
||||
timestamp: string
|
||||
}
|
||||
|
||||
export async function handle(args: ExportOptions, context: any): Promise<string> {
|
||||
const { format, outputPath, category } = args
|
||||
|
||||
try {
|
||||
if (!existsSync(KNOWLEDGE_FILE)) {
|
||||
return 'Knowledge base is empty. Add some knowledge first!'
|
||||
}
|
||||
|
||||
const data = readFileSync(KNOWLEDGE_FILE, 'utf-8')
|
||||
let knowledge: KnowledgeEntry[] = JSON.parse(data)
|
||||
|
||||
if (category) {
|
||||
knowledge = knowledge.filter(entry => entry.category === category)
|
||||
}
|
||||
|
||||
let content: string
|
||||
let defaultPath: string
|
||||
|
||||
switch (format) {
|
||||
case 'json':
|
||||
content = JSON.stringify(knowledge, null, 2)
|
||||
defaultPath = join(homedir(), 'knowledge-export.json')
|
||||
break
|
||||
|
||||
case 'markdown':
|
||||
content = exportAsMarkdown(knowledge)
|
||||
defaultPath = join(homedir(), 'knowledge-export.md')
|
||||
break
|
||||
|
||||
case 'csv':
|
||||
content = exportAsCSV(knowledge)
|
||||
defaultPath = join(homedir(), 'knowledge-export.csv')
|
||||
break
|
||||
|
||||
default:
|
||||
throw new Error(`Unknown format: ${format}`)
|
||||
}
|
||||
|
||||
const output = outputPath || defaultPath
|
||||
writeFileSync(output, content, 'utf-8')
|
||||
|
||||
return `✓ Exported ${knowledge.length} entries to ${output}`
|
||||
} catch (error: any) {
|
||||
throw new Error(`Failed to export knowledge: ${error.message}`)
|
||||
}
|
||||
}
|
||||
|
||||
function exportAsMarkdown(entries: KnowledgeEntry[]): string {
|
||||
const lines: string[] = ['# Knowledge Base Export', '', `Generated: ${new Date().toISOString()}`, '']
|
||||
|
||||
for (const entry of entries) {
|
||||
lines.push(`## ${entry.title || 'Untitled'}`)
|
||||
lines.push(`**ID:** ${entry.id}`)
|
||||
lines.push(`**Category:** ${entry.category}`)
|
||||
lines.push(`**Tags:** ${entry.tags.join(', ') || 'none'}`)
|
||||
lines.push(`**Date:** ${new Date(entry.timestamp).toLocaleString()}`)
|
||||
if (entry.source) {
|
||||
lines.push(`**Source:** ${entry.source}`)
|
||||
}
|
||||
lines.push('')
|
||||
lines.push(entry.content)
|
||||
lines.push('')
|
||||
lines.push('---')
|
||||
lines.push('')
|
||||
}
|
||||
|
||||
return lines.join('\n')
|
||||
}
|
||||
|
||||
function exportAsCSV(entries: KnowledgeEntry[]): string {
|
||||
const headers = ['ID', 'Title', 'Category', 'Tags', 'Content', 'Source', 'Date']
|
||||
const rows = entries.map(entry => [
|
||||
entry.id,
|
||||
entry.title || '',
|
||||
entry.category,
|
||||
entry.tags.join('; '),
|
||||
`"${entry.content.replace(/"/g, '""')}"`,
|
||||
entry.source || '',
|
||||
entry.timestamp
|
||||
])
|
||||
|
||||
return [
|
||||
headers.join(','),
|
||||
...rows.map(row => row.join(','))
|
||||
].join('\n')
|
||||
}
|
||||
|
||||
export default { handle }
|
||||
74
plugins/examples/knowledge-base/commands/list.ts
Normal file
74
plugins/examples/knowledge-base/commands/list.ts
Normal file
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* Knowledge List Command
|
||||
* List all knowledge entries
|
||||
*/
|
||||
|
||||
import { readFileSync, existsSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import { homedir } from 'os'
|
||||
|
||||
export interface ListOptions {
|
||||
category?: string
|
||||
tags?: string[]
|
||||
}
|
||||
|
||||
const KNOWLEDGE_FILE = join(homedir(), '.claude', 'knowledge', 'knowledge.json')
|
||||
|
||||
interface KnowledgeEntry {
|
||||
id: string
|
||||
title?: string
|
||||
content: string
|
||||
tags: string[]
|
||||
category: string
|
||||
source?: string
|
||||
timestamp: string
|
||||
}
|
||||
|
||||
export async function handle(args: ListOptions, context: any): Promise<string> {
|
||||
const { category, tags } = args
|
||||
|
||||
try {
|
||||
if (!existsSync(KNOWLEDGE_FILE)) {
|
||||
return 'Knowledge base is empty. Add some knowledge first!'
|
||||
}
|
||||
|
||||
const data = readFileSync(KNOWLEDGE_FILE, 'utf-8')
|
||||
const knowledge: KnowledgeEntry[] = JSON.parse(data)
|
||||
|
||||
// Group by category
|
||||
const byCategory: Record<string, KnowledgeEntry[]> = {}
|
||||
|
||||
for (const entry of knowledge) {
|
||||
if (category && entry.category !== category) continue
|
||||
if (tags && !tags.some(t => entry.tags.includes(t))) continue
|
||||
|
||||
if (!byCategory[entry.category]) {
|
||||
byCategory[entry.category] = []
|
||||
}
|
||||
byCategory[entry.category].push(entry)
|
||||
}
|
||||
|
||||
if (Object.keys(byCategory).length === 0) {
|
||||
return 'No entries found matching criteria'
|
||||
}
|
||||
|
||||
// Format output
|
||||
const lines: string[] = []
|
||||
|
||||
for (const [cat, entries] of Object.entries(byCategory)) {
|
||||
lines.push(`\n📁 ${cat} (${entries.length} entries)`)
|
||||
|
||||
for (const entry of entries) {
|
||||
const title = entry.title || entry.content.slice(0, 50)
|
||||
const date = new Date(entry.timestamp).toLocaleDateString()
|
||||
lines.push(` • ${title} [${entry.tags.join(', ') || 'no tags'}] - ${date}`)
|
||||
}
|
||||
}
|
||||
|
||||
return `\n📚 Knowledge Base (${knowledge.length} total entries)\n${lines.join('\n')}`
|
||||
} catch (error: any) {
|
||||
throw new Error(`Failed to list knowledge: ${error.message}`)
|
||||
}
|
||||
}
|
||||
|
||||
export default { handle }
|
||||
91
plugins/examples/knowledge-base/commands/search.ts
Normal file
91
plugins/examples/knowledge-base/commands/search.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* Knowledge Search Command
|
||||
* Search your knowledge base with semantic understanding
|
||||
*/
|
||||
|
||||
import { readFileSync, existsSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import { homedir } from 'os'
|
||||
|
||||
export interface SearchOptions {
|
||||
query: string
|
||||
category?: string
|
||||
tags?: string[]
|
||||
limit?: number
|
||||
}
|
||||
|
||||
const KNOWLEDGE_FILE = join(homedir(), '.claude', 'knowledge', 'knowledge.json')
|
||||
|
||||
interface KnowledgeEntry {
|
||||
id: string
|
||||
title?: string
|
||||
content: string
|
||||
tags: string[]
|
||||
category: string
|
||||
source?: string
|
||||
timestamp: string
|
||||
}
|
||||
|
||||
export async function handle(args: SearchOptions, context: any): Promise<string> {
|
||||
const { query, category, tags, limit = 10 } = args
|
||||
|
||||
try {
|
||||
if (!existsSync(KNOWLEDGE_FILE)) {
|
||||
return 'Knowledge base is empty. Add some knowledge first!'
|
||||
}
|
||||
|
||||
const data = readFileSync(KNOWLEDGE_FILE, 'utf-8')
|
||||
const knowledge: KnowledgeEntry[] = JSON.parse(data)
|
||||
|
||||
// Filter knowledge
|
||||
let results = knowledge
|
||||
|
||||
if (category) {
|
||||
results = results.filter(entry => entry.category === category)
|
||||
}
|
||||
|
||||
if (tags && tags.length > 0) {
|
||||
results = results.filter(entry =>
|
||||
tags.some(tag => entry.tags.includes(tag))
|
||||
)
|
||||
}
|
||||
|
||||
// Text search (simple implementation)
|
||||
if (query) {
|
||||
const queryLower = query.toLowerCase()
|
||||
results = results.filter(entry =>
|
||||
entry.content.toLowerCase().includes(queryLower) ||
|
||||
(entry.title && entry.title.toLowerCase().includes(queryLower)) ||
|
||||
entry.tags.some(tag => tag.toLowerCase().includes(queryLower))
|
||||
)
|
||||
}
|
||||
|
||||
// Limit results
|
||||
results = results.slice(0, limit)
|
||||
|
||||
if (results.length === 0) {
|
||||
return `No results found for query: "${query}"`
|
||||
}
|
||||
|
||||
// Format results
|
||||
const formatted = results.map(entry => {
|
||||
const lines = [
|
||||
`ID: ${entry.id}`,
|
||||
entry.title ? `Title: ${entry.title}` : null,
|
||||
`Category: ${entry.category}`,
|
||||
`Tags: ${entry.tags.join(', ') || 'none'}`,
|
||||
`Date: ${new Date(entry.timestamp).toLocaleDateString()}`,
|
||||
'',
|
||||
entry.content.slice(0, 200) + (entry.content.length > 200 ? '...' : ''),
|
||||
''
|
||||
]
|
||||
return lines.filter(Boolean).join('\n')
|
||||
})
|
||||
|
||||
return `Found ${results.length} result(s):\n\n${formatted.join('\n---\n\n')}`
|
||||
} catch (error: any) {
|
||||
throw new Error(`Failed to search knowledge: ${error.message}`)
|
||||
}
|
||||
}
|
||||
|
||||
export default { handle }
|
||||
Reference in New Issue
Block a user