feat: add LLM Wiki integration for knowledge management#998
feat: add LLM Wiki integration for knowledge management#998liqunx wants to merge 1 commit intoFission-AI:mainfrom
Conversation
This PR adds complete LLM Wiki integration examples and documentation to OpenSpec: Features: - Add openspec-wiki-query skill for querying wiki before changes - Add openspec-wiki-ingest skill for ingesting changes after archive - Add PreToolUse hook example to auto-query wiki on explore/propose - Add PostToolUse hook example to auto-ingest on archive - Add comprehensive documentation and setup guide - Update README with integration section Benefits: - Complete knowledge loop: Query → Develop → Archive → Ingest - Avoid duplicate work by querying existing knowledge - Automatic knowledge accumulation over time - Works with any project using OpenSpec + LLM Wiki The implementation is provided as examples and documentation, making it easy for users to adopt without modifying OpenSpec core. Skills use openspec/docs/ directory structure and read from actual files rather than hardcoding project-specific content. Example configurations include Claude Code hooks (settings.json). Users can adapt the pattern for other AI tools as needed.
📝 WalkthroughWalkthroughA comprehensive LLM Wiki integration system is introduced for OpenSpec projects. The changes add documentation guides, example setup instructions, Claude Code hook configurations, and two reusable skills (openspec-wiki-query and openspec-wiki-ingest) that automate knowledge querying and documentation ingestion workflows. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
examples/wiki-integration/claude-settings.json (1)
10-10: Make PreToolUse deterministic by explicitly invoking the query skill.
Right now this depends on prompt interpretation; using/openspec-wiki-querydirectly would make behavior consistent with the PostToolUse hook.♻️ Suggested change
- "prompt": "Before starting, query the Wiki for relevant background information and existing features to avoid duplicate work and leverage existing design decisions: Read openspec/docs/wiki/index.md and openspec/docs/wiki/log.md, then search for relevant pages based on user intent." + "prompt": "/openspec-wiki-query"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@examples/wiki-integration/claude-settings.json` at line 10, The PreToolUse behavior in claude-settings.json is currently implemented via a freeform "prompt" which relies on the model to interpret and call the wiki query; change this to deterministically invoke the query skill by replacing the prompt-based instruction with an explicit PreToolUse action that calls the /openspec-wiki-query skill (same skill used by PostToolUse) so the system always runs the wiki search; update the PreToolUse configuration entry that contains the "prompt" string to instead reference the /openspec-wiki-query invocation and pass the original prompt text as the skill's query parameter.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/guides/llm-wiki-integration.md`:
- Line 453: Replace the placeholder external link used in the markdown line with
the real destination (i.e., replace the URL inside the link text "LLM Wiki
Pattern" currently pointing to https://llm-wiki-pattern.example.com) or remove
the link if no valid URL exists; update the markdown link target so readers are
not directed to a stale/broken resource and keep the link text "LLM Wiki
Pattern" intact if you supply the final URL.
- Line 50: The directory-structure code fence in
docs/guides/llm-wiki-integration.md is missing a language tag (MD040); change
the opening fence that contains the "openspec/" tree to use a language specifier
(e.g., ```text) so the block starts with ```text and leaves the closing ``` in
place, ensuring the code fence around the "openspec/" listing is annotated.
In `@examples/wiki-integration/skills/openspec-wiki-ingest/skill.md`:
- Line 189: The template contains an inconsistent source reference "{Extracted
from implementation.md}" which is not listed in the ingest inputs; update that
literal to reference an actual defined source (e.g. replace "{Extracted from
implementation.md}" with "{Extracted from design.md}" or "{Extracted from
tasks.md}") so the template matches the declared ingest sources. Ensure the
string exactly matches one of the sources used elsewhere (design.md or tasks.md)
so downstream parsing/ingestion finds the correct file.
In `@examples/wiki-integration/skills/openspec-wiki-query/skill.md`:
- Line 79: Add language identifiers (e.g., "text") to the fenced code blocks in
the skill markdown so they don't trigger MD040: update the block containing "##
📚 Wiki Query Results" to start with ```text and end with ``` and likewise
change the error block that contains "Error: Wiki structure not found" to
```text ... ```; locate these blocks in
examples/wiki-integration/skills/openspec-wiki-query/skill.md (around the "Wiki
Query Results" section and the error message) and ensure both fenced blocks
declare the language.
---
Nitpick comments:
In `@examples/wiki-integration/claude-settings.json`:
- Line 10: The PreToolUse behavior in claude-settings.json is currently
implemented via a freeform "prompt" which relies on the model to interpret and
call the wiki query; change this to deterministically invoke the query skill by
replacing the prompt-based instruction with an explicit PreToolUse action that
calls the /openspec-wiki-query skill (same skill used by PostToolUse) so the
system always runs the wiki search; update the PreToolUse configuration entry
that contains the "prompt" string to instead reference the /openspec-wiki-query
invocation and pass the original prompt text as the skill's query parameter.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 05a67202-9f0e-47b2-a144-1cbad6a942bf
📒 Files selected for processing (8)
README.mddocs/guides/llm-wiki-integration.mdexamples/wiki-integration/README.mdexamples/wiki-integration/claude-settings.jsonexamples/wiki-integration/skills/openspec-wiki-ingest/skill.mdexamples/wiki-integration/skills/openspec-wiki-ingest/skill.yamlexamples/wiki-integration/skills/openspec-wiki-query/skill.mdexamples/wiki-integration/skills/openspec-wiki-query/skill.yaml
| ``` | ||
|
|
||
| **Directory Structure**: | ||
| ``` |
There was a problem hiding this comment.
Specify a language for the directory-structure code fence.
This currently triggers markdownlint MD040.
🧹 Suggested fix
-```
+```text
openspec/
├── docs/
...
-```
+```📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ``` |
🧰 Tools
🪛 markdownlint-cli2 (0.22.0)
[warning] 50-50: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/guides/llm-wiki-integration.md` at line 50, The directory-structure code
fence in docs/guides/llm-wiki-integration.md is missing a language tag (MD040);
change the opening fence that contains the "openspec/" tree to use a language
specifier (e.g., ```text) so the block starts with ```text and leaves the
closing ``` in place, ensuring the code fence around the "openspec/" listing is
annotated.
|
|
||
| - [OpenSpec Documentation](https://github.com/Fission-AI/OpenSpec) | ||
| - [Agent Skills Specification](https://skills.sh/) | ||
| - [LLM Wiki Pattern](https://llm-wiki-pattern.example.com) *(replace with actual resource)* |
There was a problem hiding this comment.
Replace the placeholder external link before merge.
https://llm-wiki-pattern.example.com is a placeholder and will be a broken/stale resource for readers.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/guides/llm-wiki-integration.md` at line 453, Replace the placeholder
external link used in the markdown line with the real destination (i.e., replace
the URL inside the link text "LLM Wiki Pattern" currently pointing to
https://llm-wiki-pattern.example.com) or remove the link if no valid URL exists;
update the markdown link target so readers are not directed to a stale/broken
resource and keep the link text "LLM Wiki Pattern" intact if you supply the
final URL.
| {Extracted from proposal.md} | ||
|
|
||
| ## Implementation Details | ||
| {Extracted from implementation.md} |
There was a problem hiding this comment.
Fix inconsistent source-file reference in template.
implementation.md is not listed in the ingest inputs; this should reference one of the defined sources (likely design.md or tasks.md) to avoid confusion.
🛠️ Suggested fix
-## Implementation Details
-{Extracted from implementation.md}
+## Implementation Details
+{Extracted from design.md and tasks.md}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| {Extracted from implementation.md} | |
| ## Implementation Details | |
| {Extracted from design.md and tasks.md} |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@examples/wiki-integration/skills/openspec-wiki-ingest/skill.md` at line 189,
The template contains an inconsistent source reference "{Extracted from
implementation.md}" which is not listed in the ingest inputs; update that
literal to reference an actual defined source (e.g. replace "{Extracted from
implementation.md}" with "{Extracted from design.md}" or "{Extracted from
tasks.md}") so the template matches the declared ingest sources. Ensure the
string exactly matches one of the sources used elsewhere (design.md or tasks.md)
so downstream parsing/ingestion finds the correct file.
| - [[{page-name}]] - {brief description extracted from page} | ||
|
|
||
| ### Related Design Decisions | ||
| - {decision content extracted from page} |
There was a problem hiding this comment.
Add language identifiers to fenced code blocks.
These fences trigger MD040 and should declare a language (e.g., text).
🧹 Suggested fix
-```
+```text
## 📚 Wiki Query Results
...
-```
+```
-```
+```text
Error: Wiki structure not found
Please check if openspec/docs/wiki/index.md exists
If Wiki is not initialized, refer to project documentation
-```
+```Also applies to: 128-128
🧰 Tools
🪛 markdownlint-cli2 (0.22.0)
[warning] 79-79: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@examples/wiki-integration/skills/openspec-wiki-query/skill.md` at line 79,
Add language identifiers (e.g., "text") to the fenced code blocks in the skill
markdown so they don't trigger MD040: update the block containing "## 📚 Wiki
Query Results" to start with ```text and end with ``` and likewise change the
error block that contains "Error: Wiki structure not found" to ```text ... ```;
locate these blocks in
examples/wiki-integration/skills/openspec-wiki-query/skill.md (around the "Wiki
Query Results" section and the error message) and ensure both fenced blocks
declare the language.
This PR adds complete LLM Wiki integration examples and documentation to OpenSpec:
Features:
Benefits:
The implementation is provided as examples and documentation, making it easy for users to adopt without modifying OpenSpec core. Skills use openspec/docs/ directory structure and read from actual files rather than hardcoding project-specific content.
Example configurations include Claude Code hooks (settings.json). Users can adapt the pattern for other AI tools as needed.
Summary by CodeRabbit
Release Notes
New Features
Documentation