feat: add claude code skills integration#470
feat: add claude code skills integration#470Jatin Mayekar (jatinmayekar) wants to merge 1 commit into
Conversation
Adds `openwiki integration claude [path]`, which scaffolds two Claude Code skills (openwiki-init, openwiki-update) into `.claude/skills/`. The user then runs them inside Claude Code, which generates and maintains the openwiki/ wiki on its own inference — no OpenWiki provider or API key. Code mode only; the only files written are under `.claude/skills/`. The skill bodies are rendered from the same agent prompt the CLI uses, so they cannot drift: the shared methodology (documentation goals, OKF front matter, concept-graph modeling, section quality, coverage/backlog) is extracted from createSystemPrompt into exported functions consumed by both. The extraction is behavior-preserving — createSystemPrompt output is byte-identical across every surface/command combination, asserted by a new regression test. The keyless surface differs only where the CLI does work outside the agent that a host coding agent cannot invoke: writing openwiki/.last-update.json, generating directory index.md, and getting OKF front matter right with no post-run repair pass (an okfFrontMatterRules repairPass flag toggles that one bullet). It also uses real relative paths and Claude Code tool vocabulary. Closes langchain-ai#156. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
This looks like a good integration boundary for host-agent-native OpenWiki workflows. Would the maintainers be open to a narrowly scoped follow-up for OpenCode using the same approach? The proposed command would be:
The generated skills would reuse the shared methodology functions introduced here, while adapting the invocation guidance, tool vocabulary, and The scope would remain intentionally small:
Although OpenCode can discover Claude-compatible skill locations, a dedicated target would avoid Claude-specific invocation and tool guidance and would If this direction is welcome, I’d be happy to submit it as a separate follow-up PR after this one. |
What
Adds
openwiki integration claude [path], a command that scaffolds two Claude Code skills —openwiki-initandopenwiki-update— into.claude/skills/in the target repo. The user thenruns
/openwiki-initinside Claude Code, and Claude Code itself generates and maintains theopenwiki/wiki using its own inference. No OpenWiki provider or API key is involved.Scope is deliberately narrow: code mode only, one command, and the only files ever written
are under
.claude/skills/. No new provider, no repository-file modification, no marketplacemetadata, no helper tooling.
Why
A large group of users already have Claude Code and just want repo docs generated without setting up
and paying for a second inference provider. This closes #156 (and overlaps #349).
It's also, as far as I can tell, the only shape Anthropic's terms permit here. A Claude-subscription
provider inside OpenWiki would have OpenWiki route requests through the user's Pro/Max credentials,
which Anthropic does not allow for
third-party developers. Scaffolding skills that run inside Claude Code, on the user's own
credentials, avoids that entirely — OpenWiki never sees a token. (This likely explains why #160,
#181 and #293 have stalled.) This is a smaller, single-concern alternative to the plugins approach in
#76 (thanks kylin0421) — happy to close in favor of that if you'd rather consolidate.
Design: rendered from
prompt.ts, not vendoredThe skill bodies are generated from the same prompt the OpenWiki agent already uses, so they
can't drift from the CLI. The shared methodology (documentation goals, OKF front-matter rules,
concept-graph modeling, section quality, coverage/backlog) is extracted from
createSystemPromptinto exported functions that both the live prompt and the skills renderer consume.
Two things are authored specifically for the keyless surface, because the CLI does them outside
the agent and a host coding agent can't invoke them:
openwiki/.last-update.json,index.mddeterministically, andokfFrontMatterRules(..., { repairPass })flag toggles that one bullet).The Claude Code surface also uses real relative paths (
openwiki/quickstart.md) instead ofOpenWiki's virtual
/openwiki/...paths, and its own tool vocabulary.Files
src/agent/prompt.ts— extract 5 methodology blocks into exported functions (behavior-preserving;see test), add the
repairPassflag andMethodologyContexttype.src/integrations/claude-code.ts— the skills renderer (new).src/commands.ts— parseintegration claude [path]+ help.src/cli.tsx— one dispatch branch + handler.test/claude-code-integration.test.ts— command parsing + rendered-skill assertions (new).test/prompt.test.ts— regression test assertingcreateSystemPromptstill embeds each extractedblock verbatim.
Most of the
prompt.tsline count is methodology text relocated verbatim into the new functions,not new logic.
Test plan
pnpm run format:check,pnpm run lint:check,pnpm run typecheck— clean.pnpm test— 685 passing (13 new). The existing suite is unchanged.createSystemPromptoutput is identicalfor every (surface × command) combination before and after, asserted by the new regression test
and verified out-of-band by diffing all 12 combinations.
pnpm dev integration claude <dir>scaffolds bothSKILL.mdfiles; rendered bodies containreal
openwiki/...paths, zero virtual/openwiki/...paths, and no connector/CLI-onlyvocabulary.
🤖 Generated with Claude Code