Skill Sources
-- SkillKit aggregates skills from trusted sources. We credit and link back to all original creators. - Each source retains its original license. +
Skill Sources
++ Skills aggregated from open source repositories
- - Official Partner Sources -
-- - Community Contributors -
-- Want to add your skills to SkillKit? -
+', desc: 'Search learnings' }, + { cmd: 'memory compress', desc: 'Compress observations' }, + { cmd: 'memory export', desc: 'Export as skill' }, + { cmd: 'memory reinforce', desc: 'Boost memory' }, + { cmd: 'memory --global', desc: 'Global memory' }, ], }, { name: 'Team', commands: [ { cmd: 'manifest init', desc: 'Create .skills file' }, + { cmd: 'team init', desc: 'Initialize team' }, { cmd: 'team share', desc: 'Share via Git' }, { cmd: 'publish', desc: 'Submit to marketplace' }, { cmd: 'cicd init', desc: 'CI/CD templates' }, + { cmd: 'team sync', desc: 'Sync team skills' }, ], }, { name: 'Advanced', commands: [ - { cmd: 'primer', desc: 'Generate CLAUDE.md from code' }, - { cmd: 'agent translate', desc: 'Batch convert agents' }, - { cmd: 'command generate', desc: 'Create /slash commands' }, - { cmd: 'memory export', desc: 'Save session learnings' }, + { cmd: 'primer', desc: 'Generate CLAUDE.md' }, + { cmd: 'agent translate', desc: 'Batch convert' }, + { cmd: 'command generate', desc: 'Create /commands' }, + { cmd: 'context init', desc: 'Project context' }, + { cmd: 'workflow run', desc: 'Run workflow' }, + { cmd: 'test', desc: 'Test skills' }, ], }, ]; @@ -85,19 +117,19 @@ export function Commands(): React.ReactElement { })}
{c.cmd ? `skillkit ${c.cmd}` : 'npx skillkit@latest'}
-
- →
- {c.desc}
+
+ →
+ {c.desc}
diff --git a/docs/skillkit/components/SkillGenerator.tsx b/docs/skillkit/components/SkillGenerator.tsx
index c44ae989..2bc521ac 100644
--- a/docs/skillkit/components/SkillGenerator.tsx
+++ b/docs/skillkit/components/SkillGenerator.tsx
@@ -1,651 +1,123 @@
-import React, { useState, useRef, useEffect } from 'react';
-import { Button } from './Button';
-import { Card } from './Card';
-import { generateAgentSkill } from '../services/geminiService';
+import React, { useState } from 'react';
import { searchSkills, IndexedSkill } from '../data/skills-index';
-import { AgentSkill, LoadingState } from '../types';
-
-interface PriorityBadgeProps {
- priority: string;
-}
-
-type ViewMode = 'search' | 'marketplace' | 'generated' | 'content';
-
-const PRIORITY_COLORS = {
- must: 'bg-red-900/50 text-red-300 border-red-800',
- should: 'bg-yellow-900/50 text-yellow-300 border-yellow-800',
- may: 'bg-blue-900/50 text-blue-300 border-blue-800',
-} as const;
-
-function PriorityBadge({ priority }: PriorityBadgeProps): React.ReactElement {
- const colorClass = PRIORITY_COLORS[priority as keyof typeof PRIORITY_COLORS] || PRIORITY_COLORS.may;
- return (
-
- {priority}
-
- );
-}
-
-function generateSkillMd(skill: AgentSkill): string {
- const frontmatter = `---
-name: "${skill.name}"
-description: "${skill.description}"
-version: "${skill.version}"
-tags: [${skill.tags.map(t => `"${t}"`).join(', ')}]
-${skill.filePatterns?.length ? `globs: [${skill.filePatterns.map(p => `"${p}"`).join(', ')}]` : ''}
----`;
-
- const principlesSection = skill.principles.map(p =>
- `### ${p.priority.toUpperCase()}: ${p.title}\n\n${p.description}`
- ).join('\n\n');
-
- const patternsSection = skill.patterns.map(p =>
- `### ${p.name}\n\n${p.description}\n\n\`\`\`${p.language || 'typescript'}\n${p.example}\n\`\`\``
- ).join('\n\n');
-
- const antiPatternsSection = skill.antiPatterns.map(ap => {
- let content = `### ${ap.name}\n\n${ap.description}`;
- if (ap.badExample) {
- content += `\n\n**Bad:**\n\`\`\`typescript\n${ap.badExample}\n\`\`\``;
- }
- if (ap.goodExample) {
- content += `\n\n**Good:**\n\`\`\`typescript\n${ap.goodExample}\n\`\`\``;
- }
- return content;
- }).join('\n\n');
-
- const content = `# ${skill.title}
-
-${skill.description}
-
-## When to Apply
-
-${skill.applicability}
-
-${skill.filePatterns?.length ? `**File patterns:** ${skill.filePatterns.map(p => `\`${p}\``).join(', ')}` : ''}
-
-## Principles
-
-${principlesSection}
-
-## Patterns
-
-${patternsSection}
-
-## Anti-Patterns
-
-${antiPatternsSection}
-
-${skill.references?.length ? `## References\n\n${skill.references.map(r => `- ${r}`).join('\n')}` : ''}
-`;
-
- return `${frontmatter}\n\n${content}`;
-}
-
-function downloadContent(content: string, filename: string): void {
- const blob = new Blob([content], { type: 'text/markdown' });
- const url = URL.createObjectURL(blob);
- const a = document.createElement('a');
- a.href = url;
- a.download = filename;
- document.body.appendChild(a);
- a.click();
- document.body.removeChild(a);
- URL.revokeObjectURL(url);
-}
-
-// localStorage cache for AI-generated skills
-const CACHE_KEY = 'skillkit_ai_cache';
-const CACHE_VERSION = 1;
-const MAX_CACHE_ENTRIES = 50;
-const CACHE_TTL_MS = 7 * 24 * 60 * 60 * 1000; // 7 days
-
-interface CachedSkill {
- skill: AgentSkill;
- query: string;
- timestamp: number;
-}
-
-interface SkillCache {
- version: number;
- skills: Record;
-}
-
-function normalizeQuery(query: string): string {
- return query.toLowerCase().trim().replace(/\s+/g, ' ');
-}
-
-function getSkillCache(): SkillCache {
- try {
- const cached = localStorage.getItem(CACHE_KEY);
- if (cached) {
- const parsed = JSON.parse(cached) as SkillCache;
- if (parsed.version === CACHE_VERSION) {
- // Prune expired entries
- const now = Date.now();
- let mutated = false;
- for (const [key, value] of Object.entries(parsed.skills)) {
- if (!value?.timestamp || now - value.timestamp >= CACHE_TTL_MS) {
- delete parsed.skills[key];
- mutated = true;
- }
- }
- if (mutated) {
- localStorage.setItem(CACHE_KEY, JSON.stringify(parsed));
- }
- return parsed;
- }
- }
- } catch {
- // Ignore parse errors
- }
- return { version: CACHE_VERSION, skills: {} };
-}
-
-function getCachedSkill(query: string): AgentSkill | null {
- const cache = getSkillCache();
- const key = normalizeQuery(query);
- const cached = cache.skills[key];
- if (cached && Date.now() - cached.timestamp < CACHE_TTL_MS) {
- return cached.skill;
- }
- return null;
-}
-
-function setCachedSkill(query: string, skill: AgentSkill): void {
- try {
- const cache = getSkillCache();
- const key = normalizeQuery(query);
- cache.skills[key] = {
- skill,
- query: key,
- timestamp: Date.now(),
- };
- // Enforce max entries limit
- const entries = Object.entries(cache.skills);
- if (entries.length > MAX_CACHE_ENTRIES) {
- entries
- .sort((a, b) => a[1].timestamp - b[1].timestamp)
- .slice(0, entries.length - MAX_CACHE_ENTRIES)
- .forEach(([k]) => delete cache.skills[k]);
- }
- localStorage.setItem(CACHE_KEY, JSON.stringify(cache));
- } catch {
- // Ignore storage errors (quota exceeded, etc.)
- }
-}
export function SkillGenerator(): React.ReactElement {
- const [input, setInput] = useState('');
- const [status, setStatus] = useState(LoadingState.IDLE);
- const [viewMode, setViewMode] = useState('search');
-
- const [marketplaceResults, setMarketplaceResults] = useState([]);
- const [selectedSkill, setSelectedSkill] = useState(null);
- const [skillContent, setSkillContent] = useState(null);
- const [generatedSkill, setGeneratedSkill] = useState(null);
- const [isFromCache, setIsFromCache] = useState(false);
- const [activeTab, setActiveTab] = useState<'principles' | 'patterns' | 'antipatterns'>('principles');
-
- const [error, setError] = useState(null);
- const inputRef = useRef(null);
+ const [query, setQuery] = useState('');
+ const [results, setResults] = useState([]);
+ const [hasSearched, setHasSearched] = useState(false);
+ const [copied, setCopied] = useState(null);
function handleSearch(e: React.FormEvent): void {
e.preventDefault();
- if (!input.trim()) return;
-
- setError(null);
- setSelectedSkill(null);
- setSkillContent(null);
- setGeneratedSkill(null);
-
- const results = searchSkills(input);
- setMarketplaceResults(results);
- setViewMode(results.length > 0 ? 'marketplace' : 'search');
- setStatus(LoadingState.SUCCESS);
+ if (!query.trim()) return;
+ const found = searchSkills(query);
+ setResults(found);
+ setHasSearched(true);
}
- async function handleViewSkill(skill: IndexedSkill): Promise {
- setSelectedSkill(skill);
- setSkillContent(null);
- setViewMode('content');
-
- if (skill.rawUrl) {
- setStatus(LoadingState.LOADING);
- try {
- const response = await fetch(skill.rawUrl);
- if (response.ok) {
- const content = await response.text();
- setSkillContent(content);
- }
- } catch {
- // Silently handle fetch errors
- }
- setStatus(LoadingState.SUCCESS);
- }
- }
-
- async function handleGenerateWithAI(): Promise {
- setError(null);
-
- // Check cache first
- const cached = getCachedSkill(input);
- if (cached) {
- setGeneratedSkill(cached);
- setIsFromCache(true);
- setViewMode('generated');
- setStatus(LoadingState.SUCCESS);
- return;
- }
-
- setStatus(LoadingState.LOADING);
- setIsFromCache(false);
-
+ async function copyInstall(skill: IndexedSkill): Promise {
+ const cmd = `npx skillkit@latest install ${skill.id.split('/').slice(0, 2).join('/')}`;
try {
- const result = await generateAgentSkill(input);
- setGeneratedSkill(result);
- setCachedSkill(input, result); // Cache the result
- setViewMode('generated');
- setStatus(LoadingState.SUCCESS);
+ await navigator.clipboard.writeText(cmd);
+ setCopied(skill.id);
+ setTimeout(() => setCopied(null), 2000);
} catch {
- setError("Failed to generate skill. Please try again.");
- setStatus(LoadingState.ERROR);
+ // ignore
}
}
- function submitToMarketplace(): void {
- if (!generatedSkill) return;
-
- const slug = generatedSkill.name.toLowerCase().replace(/\s+/g, '-').replace(/[^a-z0-9-]/g, '');
- const skillContent = generateSkillMd(generatedSkill);
-
- const body = `## 📤 AI-Generated Skill: ${generatedSkill.title}
-
-### Skill Details
-- **Name:** ${generatedSkill.name}
-- **Description:** ${generatedSkill.description}
-- **Tags:** ${generatedSkill.tags.join(', ')}
-- **Version:** ${generatedSkill.version}
-
-### SKILL.md Content
-
-
-Click to expand
-
-\`\`\`markdown
-${skillContent.slice(0, 4000)}${skillContent.length > 4000 ? '\n...(truncated)' : ''}
-\`\`\`
-
-
-
-### Checklist for Maintainer
-- [ ] Review skill content for quality
-- [ ] Add to \`marketplace/skills.json\`
-
----
-**Generated via:** AI Skill Generator
-**Search query:** "${input}"`;
-
- const title = encodeURIComponent(`[AI Skill] ${generatedSkill.title}`);
- const encodedBody = encodeURIComponent(body);
- const url = `https://github.com/rohitg00/skillkit/issues/new?title=${title}&body=${encodedBody}&labels=ai-generated,skill-submission`;
-
- window.open(url, '_blank', 'noopener,noreferrer');
- }
-
- function handleBack(): void {
- switch (viewMode) {
- case 'content':
- setViewMode('marketplace');
- setSelectedSkill(null);
- setSkillContent(null);
- break;
- case 'generated':
- setViewMode(marketplaceResults.length > 0 ? 'marketplace' : 'search');
- setGeneratedSkill(null);
- break;
- default:
- setViewMode('search');
- setMarketplaceResults([]);
- }
- }
-
- function downloadSkillMd(): void {
- if (skillContent) {
- downloadContent(skillContent, 'SKILL.md');
- }
- }
-
- function downloadGeneratedSkillMd(): void {
- if (generatedSkill) {
- downloadContent(generateSkillMd(generatedSkill), 'SKILL.md');
- }
- }
-
- // Focus input only after user interaction, not on initial page load
- useEffect(() => {
- if (status === LoadingState.SUCCESS && inputRef.current) {
- inputRef.current.focus({ preventScroll: true });
- }
- }, [status]);
-
return (
-
-
- Skill Finder
-
- Search the marketplace or generate new skills with AI.
+
+
+ Find Skills
+
+ Search 15,000+ skills from the marketplace
-
Click to expand
- -\`\`\`markdown -${skillContent.slice(0, 4000)}${skillContent.length > 4000 ? '\n...(truncated)' : ''} -\`\`\` - -Skill Finder
-- Search the marketplace or generate new skills with AI. +
Find Skills
++ Search 15,000+ skills from the marketplace