Skip to content

feat: add LLM Wiki integration for knowledge management#998

Open
liqunx wants to merge 1 commit intoFission-AI:mainfrom
liqunx:feature/llm-wiki-integration
Open

feat: add LLM Wiki integration for knowledge management#998
liqunx wants to merge 1 commit intoFission-AI:mainfrom
liqunx:feature/llm-wiki-integration

Conversation

@liqunx
Copy link
Copy Markdown

@liqunx liqunx commented Apr 22, 2026

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.

Summary by CodeRabbit

Release Notes

New Features

  • Added LLM Wiki integration for AI-driven knowledge management with automated query and ingest capabilities

Documentation

  • Added comprehensive integration guide with step-by-step setup instructions, examples, and best practices
  • Added example configuration and templates for LLM Wiki workflows
  • Updated README with new Integrations section

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.
@liqunx liqunx requested a review from TabishB as a code owner April 22, 2026 03:29
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

📝 Walkthrough

Walkthrough

A 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

Cohort / File(s) Summary
Core Documentation
README.md, docs/guides/llm-wiki-integration.md
Added Integrations section to README with link to comprehensive LLM Wiki setup guide, including operational loop overview, quick-start instructions, hook configuration details, customization options, troubleshooting, and advanced topics.
Example Setup & Configuration
examples/wiki-integration/README.md, examples/wiki-integration/claude-settings.json
Added example project documentation with quick setup instructions and Claude Code hook configuration defining PreToolUse behavior (query wiki before exploration) and PostToolUse behavior (ingest changes after archival).
Wiki Query Skill
examples/wiki-integration/skills/openspec-wiki-query/skill.md, examples/wiki-integration/skills/openspec-wiki-query/skill.yaml
Added skill documentation and metadata for querying LLM Wiki: defines search workflow, accuracy constraints, output scenarios, and integration via PreToolUse hook.
Wiki Ingest Skill
examples/wiki-integration/skills/openspec-wiki-ingest/skill.md, examples/wiki-integration/skills/openspec-wiki-ingest/skill.yaml
Added skill documentation and metadata for ingesting archived changes and raw documentation: defines invocation patterns, ingestion workflow, exclusion rules, conflict handling, and PostToolUse hook integration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A wiki grows with every hop and bound,
Where skills and guides in harmony are found,
Query, propose, apply, then ingest with care—
Knowledge loops flow through the OpenSpec air! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly summarizes the main change: adding LLM Wiki integration for knowledge management, which aligns with the PR objectives of introducing wiki query/ingest skills and comprehensive documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-query directly 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

📥 Commits

Reviewing files that changed from the base of the PR and between 3c7a05c and 49adf30.

📒 Files selected for processing (8)
  • README.md
  • docs/guides/llm-wiki-integration.md
  • examples/wiki-integration/README.md
  • examples/wiki-integration/claude-settings.json
  • examples/wiki-integration/skills/openspec-wiki-ingest/skill.md
  • examples/wiki-integration/skills/openspec-wiki-ingest/skill.yaml
  • examples/wiki-integration/skills/openspec-wiki-query/skill.md
  • examples/wiki-integration/skills/openspec-wiki-query/skill.yaml

```

**Directory Structure**:
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Suggested change
```
🧰 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)*
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Suggested change
{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}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant