diff --git a/.gitignore b/.gitignore index cbbc787a..51b99dab 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,6 @@ target/ # Next.js build output .next/ + +# Vendored reference source (not committed) +claude-code-source/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 5999c2ce..57d7f8ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,23 @@ All notable changes to SkillNote will be documented in this file. Format follows [Keep a Changelog](https://keepachangelog.com/). +## [0.4.0] - 2026-04-27 + +### Added +- **SkillNote × OpenClaw foundation** — living skill registry for OpenClaw agents. The OpenClaw resolver subagent runs in the agent harness with full LLM reasoning over the SkillNote catalog and does the relevance ranking itself; SkillNote ships the universe with rich metadata. New endpoints under `/v1/openclaw/`: + - `POST /v1/openclaw/context-bundle` — returns up to `max_skills` skills (sorted by `usage_count_30d` desc then `rating_avg` desc) plus the full collections list and per-skill staleness/rating/recent-comment metadata. The subagent re-ranks via LLM. Optional `collection_filter` narrows the catalog when the agent has a hint. + - `POST /v1/openclaw/usage` — agents log a usage event after acting. Validates known skill IDs; rejects task summaries > 1000 chars (agents must summarize, not dump raw user messages). + - `GET /v1/openclaw/usage` — list events with `?limit`, `?since`, `?skill_id`, `?before` cursor pagination. Used by Settings → OpenClaw card to detect "connected" status. +- **`skill_usage_events` table** — agent_name, task_summary, collection_id, skill_ids (JSONB), resolver_confidence, risk_level, outcome, channel, metadata_json, created_at. Indexed on created_at + collection_id. +- **Comments extension** — `author_type` (human/agent), `comment_type` (agent_observation, agent_issue, agent_patch_suggestion, agent_success_note, agent_deprecation_warning, ...), `rating` (1-5), `linked_usage_id` FK to skill_usage_events. Backwards-compatible — legacy `{author, body}` POSTs still work. +- **OpenClaw plugin bundle** — 2 skills (`skillnote-awareness`, `skillnote-resolver`) plus `config.template.json`, served as a checksummed ZIP from `GET /v1/openclaw-bundle.zip`. Bash installer at `GET /setup/openclaw` writes everything to `~/.openclaw/` after host substitution. +- **Settings → OpenClaw card** — copy-the-curl install, "connected" indicator wired to `GET /v1/openclaw/usage`, link to the integration docs. + +### Tests +- `+11` integration tests for `/v1/openclaw/context-bundle` (usage+rating ranking, tie-breaking, collection filter, staleness rules, N+1 sentinel, recent-comment truncation). +- `+13` integration tests for `/v1/openclaw/usage` (POST validation, JSONB containment filter, cursor pagination). +- `+10` integration tests for comments extension (legacy compat, agent fields, linked_usage_id existence, PATCH ignores extra fields). + ## [0.3.4] - 2026-04-26 ### Fixed diff --git a/README.md b/README.md index ecac5e28..4f10a90b 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ Marketplace · Reviews · Live Sync · + OpenClaw · Web UI · How It Works
@@ -58,22 +59,135 @@ Your skills. Your servers. Your rules. ## Quick Start +Spin up the registry locally: + ```bash git clone https://github.com/luna-prompts/skillnote.git cd skillnote ./install.sh ``` -The install script builds and starts all containers, waits for health checks, and prints the Claude Code plugin command when ready. +The install script builds and starts all containers, waits for health checks, and prints the connect command when ready. + +Then wire up your AI agent: -Then connect Claude Code: +source ~/.zshrc or open a new terminal> },
+ { text: <>Run claude — the collection picker appears> },
+ { text: 'Start coding — skills activate automatically' },
+]
- const setupCmd = `curl -sf ${apiBase}/setup | bash`
+const OC_STEPS = [
+ { text: 'Run the install command above' },
+ { text: 'Start OpenClaw — SkillNote prompts for your server URL on first load' },
+ { text: <>Approve the AGENTS.md graft when prompted (adds the registry block)> },
+ { text: 'Start using — skills sync before every task, usage tracked automatically' },
+]
+function CodeBlock({ content, label = 'terminal', multiline = false }: { content: string; label?: string; multiline?: boolean }) {
+ const [copied, setCopied] = useState(false)
const handleCopy = async () => {
- const ok = await copyText(setupCmd)
+ const ok = await copyText(content)
if (ok) { setCopied(true); setTimeout(() => setCopied(false), 2000) }
}
+ return (
+ {content}
+ ) : (
+ {content}
+ Failed to load prompt: {promptError}
+ )} + {!promptText && !promptError && ( +Loading personalized prompt…
+ )} + {promptText &&+ Recommended · zero terminal. Paste this into a fresh OpenClaw session — your URL ({apiBase}) is already baked in. The agent handles install, config, and verification end-to-end. +
+ > + )} + + {method === 'clawhub' && ( + <> +
+ For users who already have clawhub. Versioned + auto-updates via daily check.
+
+ Note: clawhub doesn't accept a host argument — set SKILLNOTE_BASE_URL first so the skill knows where to talk to.
+
+ Unified installer · Same command works for any agent — pass --agent claude-code or --agent openclaw. Pre-fills config with your URL and runs the first sync.
+
+ Step-by-step · For air-gapped environments or when you want full control over the install +
+ > + )} +- Install the SkillNote plugin to sync skills, pick collections, and track usage. + Install the SkillNote plugin to sync skills and track usage.
Install
-{setupCmd}
-
- Installs to ~/.claude/plugins/skillnote · No sudo required · macOS + Linux
-
+ Installs to ~/.claude/plugins/skillnote · No sudo required · macOS + Linux
+
Setup
source ~/.zshrc or open a new terminal> },
- { n: '3', text: <>Run claude — the collection picker appears> },
- { n: '4', text: 'Start coding — skills activate automatically' },
- ].map(({ n, text }) => (
- {text}
Included
Why collections?
-- Collections group skills by purpose and scope them per project. Each project gets one active collection. + {/* Collections callout — Claude Code only */} + {isCC && ( +
Why collections?
++ Collections group skills by purpose and scope them per project. Each project gets one active collection. +
+{value}
+{label}
++ Too many active skills = descriptions get truncated = skills stop triggering reliably. Collections keep Claude fast and accurate.
{value}
-{label}
-How analytics work
+
+ Log-watcher runs as a background daemon and reads your OpenClaw session JSONL files. Every time a skill is read, it fires a POST /v1/hooks/skill-used event — fully automatic, no agent involvement.
+
+ Rating footer appended to every synced skill gives the agent a pre-filled curl command to rate the skill in the same turn — no cross-session memory needed.
+
- Too many active skills = descriptions get truncated = skills stop triggering reliably. Collections keep Claude fast and accurate. -
+ Give your OpenClaw agent access to this SkillNote registry. +
+ + {/* Status indicator */} ++ Install command +
+
+ {installCommand || ' '}
+
+
+