mirror of
https://github.com/rohitg00/skillkit.git
synced 2026-11-20 20:34:46 +00:00
* feat: add persistent memory, mesh network, and agent messaging (v2.0.0)
Add three major features to SkillKit:
@skillkit/memory - CozoDB-backed semantic memory with embeddings
- 384-dim embeddings via @xenova/transformers (all-MiniLM-L6-v2)
- Memory tiers (warm/long) with promotion logic based on access patterns
- HNSW semantic search for context retrieval
- Storage: ~/.skillkit/agents/{agentId}/memory.db
@skillkit/mesh - Peer mesh network for multi-machine agent distribution
- Local LAN discovery via UDP multicast (239.255.255.250)
- Tailscale VPN support for secure remote connections
- Bidirectional peer registration with health checks
- HTTP and WebSocket transports
- Storage: ~/.skillkit/hosts.json
@skillkit/messaging - Inter-agent messaging system
- Inbox/sent/archived storage with JSON persistence
- Message router for local and cross-host delivery
- Priority levels (low/normal/high/urgent)
- Message types (request/response/notification/update)
- Storage: ~/.skillkit/messages/{inbox|sent|archived}/{agentId}/
CLI Commands:
- skillkit mesh: init, add, remove, list, health, discover, status
- skillkit message: send, inbox, read, reply, archive, forward, sent, status
All packages bumped to version 2.0.0
* feat: add advanced learning, automation, and workflow features
Implements comprehensive enhancement plan with 9 phases:
Phase 1: @skillkit/resources Package
- Bundled agents (9): architect, build-error-resolver, code-reviewer,
doc-updater, e2e-runner, planner, refactor-cleaner, security-reviewer, tdd-guide
- Command templates (10): /tdd, /plan, /e2e, /learn, /build-fix, etc.
- Operational profiles (4): dev, review, research, security
- Guidelines (5): security, code-style, testing, git, performance
- Hook templates (12): typescript-check, eslint-check, security-scan, etc.
Phase 2-3: Pattern Learning & Confidence Scoring
- skillkit learn: Extract patterns from git history
- skillkit pattern status|feedback|approve|reject|export|import|cluster
- Confidence evolution: success +0.05, failure -0.10
Phase 4: Session State Persistence
- skillkit session status|start|load|list|note|complete|in-progress
- Cross-session context preservation in ~/.skillkit/sessions/
Phase 5: Workflow Pipelines
- skillkit workflow pipeline list|<name>
- Built-in: feature, bugfix, refactor, security-audit, documentation
Phase 6: Operational Profiles
- skillkit profile list|<name>|create|remove
- Mode switching for different work contexts
Phase 7: Guidelines System
- skillkit guideline list|show|enable|disable|create|remove
- Always-on coding standards
Phase 8: Hook Templates
- skillkit hook template list|apply|show
- Pre-built automation patterns
Phase 9: Slash Command Templates
- skillkit command available|install <id>
- Install bundled command templates
* feat: add MCP memory server for Claude/Cursor integration
Adds @skillkit/mcp-memory package - an MCP (Model Context Protocol) server
that exposes SkillKit's persistent memory system to Claude, Cursor, and
other MCP-compatible AI tools.
Tools:
- memory_store: Store memories with semantic embeddings
- memory_search: Semantic search through memories
- memory_recall: Recall by category/tier/tags
- memory_get: Get memory by ID
- memory_forget: Delete a memory
- memory_link: Create relationships between memories
- memory_reinforce: Strengthen/weaken memories
- memory_stats: Get memory statistics
Resources:
- memory://stats: Current statistics (JSON)
- memory://recent: Recent memories (JSON)
Usage with Claude Desktop:
```json
{
"mcpServers": {
"skillkit-memory": {
"command": "npx",
"args": ["@skillkit/mcp-memory"],
"env": { "SKILLKIT_AGENT_ID": "claude-desktop" }
}
}
}
```
* feat(mesh): add comprehensive security hardening
- Add cryptographic identity layer (Ed25519 keypairs, fingerprints)
- Add message encryption (XChaCha20-Poly1305) and signing
- Add secure keystore with AES-256-GCM at-rest encryption
- Add JWT authentication and challenge-response handshake
- Add secure WebSocket (WSS) and HTTPS transports
- Add signed discovery messages with trust modes (open/signed/trusted-only)
- Add TLS certificate management (self-signed)
- Add CLI commands: mesh security init/status, mesh peer trust/revoke/list
- Add security presets: development, signed, secure, strict
- Align all package versions to 1.7.11
Security stack: @noble/ed25519, @noble/curves, @noble/ciphers, @noble/hashes, jose
* docs(website): add mesh network and security features
- Add Mesh Network feature card with P2P description
- Add Security feature card with Ed25519/TLS details
- Add Mesh command group with security commands
* fix: address CodeRabbit review suggestions
- cli/mesh: validate port input (1-65535 range check)
- memory/cozo-adapter: call db.close() before nullifying reference
- memory/schema: fix primary key definitions (id => columns)
- resources/hooks: guard pre-commit hooks against empty file lists
- mcp-memory: prevent double-initialization with memoized promise
- mcp-memory: don't mask reinforce failures as "not found"
- mcp-memory: guard main() to prevent auto-start on import
- mcp-memory: add js language identifiers to README code blocks
- mesh/test: update MESH_VERSION test expectation to 1.7.11
* fix: address additional CodeRabbit and Devin review suggestions
Memory package:
- encoder: reset initPromise on failure to allow retry
- encoder: call pipeline.dispose() in disposeEncoder to free GPU resources
- schema: fix probe query to use named-column matching for correct arity
Mesh package:
- hosts-config: add file locking to prevent race conditions
- local discovery: reduce multicast TTL to 1 for LAN-only traffic
- local discovery: handle announce errors in setInterval
- local discovery: close socket on membership setup failure
- local discovery: validate inbound packets (type, hostId, port range)
- local discovery: use rinfo.address to prevent spoofing
- health: guard against overlapping health checks with checking flag
- websocket: prevent auto-reconnect on explicit disconnect()
* fix(memory): increase semantic search fetch multiplier for better filter coverage
Increase from 2x to 5x results to reduce likelihood of incomplete
results when agentId/category/tier filters exclude many candidates.
Filters are applied in application code after HNSW vector search.
* feat(cli): add 'add' as alias for 'install' command
* fix(mesh/auth): use asymmetric EdDSA signing for JWT tokens
Tokens are now signed with the sender's Ed25519 private key and
verified using the sender's public key embedded in the token.
This fixes the issue where tokens couldn't be verified across
different AuthManager instances/hosts because each had a random
symmetric secret.
Changes:
- Switch from HS256 (symmetric) to EdDSA (asymmetric) algorithm
- Include sender's publicKey in JWT payload
- Add privateKey/privateKeyHex getters to PeerIdentity
- Verify fingerprint matches publicKey before accepting token
322 lines
8.7 KiB
TypeScript
322 lines
8.7 KiB
TypeScript
import { Command, Option } from 'clipanion';
|
|
import chalk from 'chalk';
|
|
import {
|
|
loadSessionFile,
|
|
saveSessionFile,
|
|
createSessionFile,
|
|
updateSessionFile,
|
|
listSessions,
|
|
getMostRecentSession,
|
|
type SessionFile,
|
|
} from '@skillkit/core';
|
|
|
|
export class SessionCommand extends Command {
|
|
static override paths = [['session']];
|
|
|
|
static override usage = Command.Usage({
|
|
description: 'Manage session state for context preservation',
|
|
details: `
|
|
Sessions track context across coding sessions, allowing you to
|
|
preserve state across compactions and session restarts.
|
|
`,
|
|
examples: [
|
|
['Show current session', '$0 session'],
|
|
['Start new session', '$0 session start'],
|
|
['Load specific date', '$0 session load 2026-01-30'],
|
|
],
|
|
});
|
|
|
|
async execute(): Promise<number> {
|
|
console.log(chalk.cyan('Session commands:\n'));
|
|
console.log(' session status Show current session state');
|
|
console.log(' session start Start a new session');
|
|
console.log(' session load Load session from specific date');
|
|
console.log(' session list List recent sessions');
|
|
console.log(' session note Add note to current session');
|
|
console.log(' session complete Mark task as completed');
|
|
console.log();
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
export class SessionStatusCommand extends Command {
|
|
static override paths = [['session', 'status']];
|
|
|
|
static override usage = Command.Usage({
|
|
description: 'Show current session state',
|
|
examples: [['Show status', '$0 session status']],
|
|
});
|
|
|
|
json = Option.Boolean('--json,-j', false, {
|
|
description: 'Output as JSON',
|
|
});
|
|
|
|
async execute(): Promise<number> {
|
|
const session = getMostRecentSession();
|
|
|
|
if (!session) {
|
|
console.log(chalk.yellow('No active session found'));
|
|
console.log(chalk.dim('Start one with: skillkit session start'));
|
|
return 0;
|
|
}
|
|
|
|
if (this.json) {
|
|
console.log(JSON.stringify(session, null, 2));
|
|
return 0;
|
|
}
|
|
|
|
this.printSession(session);
|
|
return 0;
|
|
}
|
|
|
|
private printSession(session: SessionFile): void {
|
|
console.log(chalk.cyan(`Session: ${session.date}\n`));
|
|
console.log(`Agent: ${session.agent}`);
|
|
console.log(`Project: ${session.projectPath}`);
|
|
console.log(`Started: ${session.startedAt}`);
|
|
console.log(`Last Updated: ${session.lastUpdated}`);
|
|
console.log();
|
|
|
|
if (session.completed.length > 0) {
|
|
console.log(chalk.green('Completed:'));
|
|
for (const task of session.completed) {
|
|
console.log(` ${chalk.green('✓')} ${task}`);
|
|
}
|
|
console.log();
|
|
}
|
|
|
|
if (session.inProgress.length > 0) {
|
|
console.log(chalk.yellow('In Progress:'));
|
|
for (const task of session.inProgress) {
|
|
console.log(` ${chalk.yellow('○')} ${task}`);
|
|
}
|
|
console.log();
|
|
}
|
|
|
|
if (session.notes.length > 0) {
|
|
console.log(chalk.blue('Notes for Next Session:'));
|
|
for (const note of session.notes) {
|
|
console.log(` ${chalk.dim('•')} ${note}`);
|
|
}
|
|
console.log();
|
|
}
|
|
|
|
if (session.contextToLoad.length > 0) {
|
|
console.log(chalk.dim('Context to Load:'));
|
|
for (const ctx of session.contextToLoad) {
|
|
console.log(` ${chalk.dim('•')} ${ctx}`);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
export class SessionStartCommand extends Command {
|
|
static override paths = [['session', 'start']];
|
|
|
|
static override usage = Command.Usage({
|
|
description: 'Start a new session',
|
|
examples: [
|
|
['Start session', '$0 session start'],
|
|
['Start with agent', '$0 session start --agent claude-code'],
|
|
],
|
|
});
|
|
|
|
agent = Option.String('--agent,-a', {
|
|
description: 'AI agent being used',
|
|
});
|
|
|
|
async execute(): Promise<number> {
|
|
const agent = this.agent || 'claude-code';
|
|
const projectPath = process.cwd();
|
|
|
|
const session = createSessionFile(agent, projectPath);
|
|
const filepath = saveSessionFile(session);
|
|
|
|
console.log(chalk.green(`✓ Session started: ${session.date}`));
|
|
console.log(chalk.dim(` Saved to: ${filepath}`));
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
export class SessionLoadCommand extends Command {
|
|
static override paths = [['session', 'load']];
|
|
|
|
static override usage = Command.Usage({
|
|
description: 'Load session from specific date',
|
|
examples: [['Load session', '$0 session load 2026-01-30']],
|
|
});
|
|
|
|
date = Option.String({ required: false });
|
|
|
|
async execute(): Promise<number> {
|
|
const session = this.date ? loadSessionFile(this.date) : getMostRecentSession();
|
|
|
|
if (!session) {
|
|
console.log(chalk.yellow('Session not found'));
|
|
return 1;
|
|
}
|
|
|
|
console.log(chalk.green(`✓ Loaded session: ${session.date}`));
|
|
console.log();
|
|
|
|
if (session.notes.length > 0) {
|
|
console.log(chalk.cyan('Notes from previous session:'));
|
|
for (const note of session.notes) {
|
|
console.log(` ${chalk.dim('•')} ${note}`);
|
|
}
|
|
console.log();
|
|
}
|
|
|
|
if (session.inProgress.length > 0) {
|
|
console.log(chalk.yellow('Tasks still in progress:'));
|
|
for (const task of session.inProgress) {
|
|
console.log(` ${chalk.yellow('○')} ${task}`);
|
|
}
|
|
console.log();
|
|
}
|
|
|
|
if (session.contextToLoad.length > 0) {
|
|
console.log(chalk.dim('Context to load:'));
|
|
for (const ctx of session.contextToLoad) {
|
|
console.log(` ${ctx}`);
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
export class SessionListCommand extends Command {
|
|
static override paths = [['session', 'list'], ['session', 'ls']];
|
|
|
|
static override usage = Command.Usage({
|
|
description: 'List recent sessions',
|
|
examples: [['List sessions', '$0 session list']],
|
|
});
|
|
|
|
limit = Option.String('--limit,-l', {
|
|
description: 'Number of sessions to show (default: 10)',
|
|
});
|
|
|
|
json = Option.Boolean('--json,-j', false, {
|
|
description: 'Output as JSON',
|
|
});
|
|
|
|
async execute(): Promise<number> {
|
|
const limit = this.limit ? parseInt(this.limit) : 10;
|
|
const sessions = listSessions(limit);
|
|
|
|
if (sessions.length === 0) {
|
|
console.log(chalk.yellow('No sessions found'));
|
|
return 0;
|
|
}
|
|
|
|
if (this.json) {
|
|
console.log(JSON.stringify(sessions, null, 2));
|
|
return 0;
|
|
}
|
|
|
|
console.log(chalk.cyan(`Recent Sessions (${sessions.length}):\n`));
|
|
|
|
for (const session of sessions) {
|
|
const progress = `${session.completedCount}/${session.taskCount}`;
|
|
const notesIndicator = session.hasNotes ? chalk.blue(' [notes]') : '';
|
|
console.log(` ${chalk.bold(session.date)} - ${session.agent}`);
|
|
console.log(` ${chalk.dim(session.projectPath)}`);
|
|
console.log(` Tasks: ${progress}${notesIndicator}`);
|
|
console.log();
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
export class SessionNoteCommand extends Command {
|
|
static override paths = [['session', 'note']];
|
|
|
|
static override usage = Command.Usage({
|
|
description: 'Add note to current session',
|
|
examples: [['Add note', '$0 session note "Remember to test edge cases"']],
|
|
});
|
|
|
|
note = Option.String({ required: true });
|
|
|
|
async execute(): Promise<number> {
|
|
let session = getMostRecentSession();
|
|
|
|
if (!session) {
|
|
session = createSessionFile('claude-code', process.cwd());
|
|
}
|
|
|
|
const updated = updateSessionFile(session, {
|
|
notes: [this.note],
|
|
});
|
|
|
|
saveSessionFile(updated);
|
|
|
|
console.log(chalk.green('✓ Note added'));
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
export class SessionCompleteCommand extends Command {
|
|
static override paths = [['session', 'complete']];
|
|
|
|
static override usage = Command.Usage({
|
|
description: 'Mark task as completed',
|
|
examples: [['Mark completed', '$0 session complete "Implemented user auth"']],
|
|
});
|
|
|
|
task = Option.String({ required: true });
|
|
|
|
async execute(): Promise<number> {
|
|
let session = getMostRecentSession();
|
|
|
|
if (!session) {
|
|
session = createSessionFile('claude-code', process.cwd());
|
|
}
|
|
|
|
const updated = updateSessionFile(session, {
|
|
completed: [this.task],
|
|
});
|
|
|
|
if (session.inProgress.includes(this.task)) {
|
|
updated.inProgress = session.inProgress.filter(t => t !== this.task);
|
|
}
|
|
|
|
saveSessionFile(updated);
|
|
|
|
console.log(chalk.green(`✓ Completed: ${this.task}`));
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
export class SessionInProgressCommand extends Command {
|
|
static override paths = [['session', 'wip'], ['session', 'progress']];
|
|
|
|
static override usage = Command.Usage({
|
|
description: 'Mark task as in progress',
|
|
examples: [['Mark in progress', '$0 session wip "Working on auth flow"']],
|
|
});
|
|
|
|
task = Option.String({ required: true });
|
|
|
|
async execute(): Promise<number> {
|
|
let session = getMostRecentSession();
|
|
|
|
if (!session) {
|
|
session = createSessionFile('claude-code', process.cwd());
|
|
}
|
|
|
|
const updated = updateSessionFile(session, {
|
|
inProgress: [...session.inProgress, this.task],
|
|
});
|
|
|
|
saveSessionFile(updated);
|
|
|
|
console.log(chalk.yellow(`○ In progress: ${this.task}`));
|
|
return 0;
|
|
}
|
|
}
|