Skip to content

Commit f3596db

Browse files
feat(ai-knowledge): add /kb-ingest skill, fix pinned file loading (v2.3.1)
Add /kb-ingest command for targeted markdown file ingestion into the KB as a lighter alternative to /kb-absorb. Fix kb-init template to direct Claude to use the "When to Load" table column for pinned files instead of scanning every KB file's frontmatter.
1 parent 3af56ba commit f3596db

7 files changed

Lines changed: 150 additions & 7 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"metadata": {
88
"description": "A curated list of custom Claude Code plugins, agents, and skills for developers.",
9-
"version": "2.3.0",
9+
"version": "2.3.1",
1010
"pluginRoot": "./plugins"
1111
},
1212
"plugins": [
@@ -273,7 +273,7 @@
273273
"name": "ai-knowledge",
274274
"source": "./plugins/ai-knowledge",
275275
"description": "AI-powered knowledge base management - Capture conversation learnings, maintain topic-specific KB files, and dynamically reference institutional knowledge in CLAUDE.md",
276-
"version": "1.0.0",
276+
"version": "1.1.0",
277277
"keywords": [
278278
"ai",
279279
"knowledge-base",

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [2.3.1] - 2026-04-03
11+
12+
### Added
13+
14+
#### AI-Knowledge Plugin (v1.1.0)
15+
16+
- `/kb-ingest` - Ingest specific markdown files from anywhere in the project into the KB, as a targeted alternative to `/kb-absorb`
17+
- Accepts one or more file paths (e.g., `/kb-ingest docs/api-guide.md`)
18+
- Distills content into concise, actionable KB format with proper frontmatter
19+
- Detects overlap with existing KB files and proposes appending instead of creating duplicates
20+
- Registers new KB entries in the CLAUDE.md Knowledge Base table
21+
- Preserves source files (never modifies or deletes originals)
22+
23+
### Fixed
24+
25+
#### AI-Knowledge Plugin (v1.1.0)
26+
27+
- **Fixed pinned file loading instruction in kb-init** - The CLAUDE.md template previously told Claude to check frontmatter of every KB file to find pinned entries, defeating the purpose of the dynamic loading table. Now correctly directs Claude to use the "When to Load" column ("Always (pinned)") as the source of truth
28+
1029
## [2.3.0] - 2026-04-02
1130

1231
### Added

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Claude Code Plugins for Developers
22

3-
[![Version](https://img.shields.io/badge/version-2.3.0-blue.svg)](https://github.com/charlesjones-dev/claude-code-plugins-dev/releases)
3+
[![Version](https://img.shields.io/badge/version-2.3.1-blue.svg)](https://github.com/charlesjones-dev/claude-code-plugins-dev/releases)
44
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
55
[![GitHub Issues](https://img.shields.io/github/issues/charlesjones-dev/claude-code-plugins-dev.svg)](https://github.com/charlesjones-dev/claude-code-plugins-dev/issues)
66
[![GitHub Stars](https://img.shields.io/github/stars/charlesjones-dev/claude-code-plugins-dev.svg)](https://github.com/charlesjones-dev/claude-code-plugins-dev/stargazers)
@@ -27,7 +27,7 @@ This Claude Code plugin marketplace provides plugins that extend Claude Code's c
2727
| [ai-statusline](plugins/ai-statusline/) | AI-powered status line customization with progress bars | `/statusline-wizard`, `/statusline-edit` | - |
2828
| [ai-workflow](plugins/ai-workflow/) | AI-powered development workflow automation | `/workflow-plan-phases`, `/workflow-implement-phases`, `/workflow-preflight`, `/workflow-ship`, `/workflow-principles` | - |
2929
| [ai-compliance](plugins/ai-compliance/) | AI-powered license compliance auditing and attribution generation | `/compliance-license-audit`, `/compliance-notice-generate` | - |
30-
| [ai-knowledge](plugins/ai-knowledge/) | AI-powered knowledge base management for conversation learnings | `/kb-init`, `/kb-learn`, `/kb-add`, `/kb-import`, `/kb-absorb`, `/kb-remove`, `/kb-list`, `/kb-search`, `/kb-prune`, `/kb-auto` | - |
30+
| [ai-knowledge](plugins/ai-knowledge/) | AI-powered knowledge base management for conversation learnings | `/kb-init`, `/kb-learn`, `/kb-add`, `/kb-import`, `/kb-ingest`, `/kb-absorb`, `/kb-remove`, `/kb-list`, `/kb-search`, `/kb-prune`, `/kb-auto` | - |
3131
| [ai-modernize](plugins/ai-modernize/) | AI-powered codebase modernization assessment for technical debt | `/modernize-audit`, `/modernize-scan` | `modernize-auditor` |
3232
| [ai-writing](plugins/ai-writing/) | AI-powered writing quality tools for natural-sounding text | `/writing-humanize` | - |
3333

plugins/ai-knowledge/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ai-knowledge",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "AI-powered knowledge base management - Capture conversation learnings, maintain topic-specific KB files, and dynamically reference institutional knowledge in CLAUDE.md",
55
"author": {
66
"name": "Charles Jones",

plugins/ai-knowledge/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Knowledge is stored in two layers:
1818
| `/kb-learn` | Analyze the current conversation and extract learnings to KB files |
1919
| `/kb-add` | Quickly add a learning or rule with interactive location picker |
2020
| `/kb-import` | Register existing KB files in CLAUDE.md (adds missing frontmatter) |
21+
| `/kb-ingest` | Ingest specific markdown files from anywhere in the project into the KB |
2122
| `/kb-absorb` | Migrate existing CLAUDE.md sections and docs/ content into the KB |
2223
| `/kb-remove` | Remove a KB file and its CLAUDE.md reference |
2324
| `/kb-list` | List all registered KB files with status, tags, dates, and cross-references |
@@ -74,6 +75,6 @@ Cross-references (`related`) create a knowledge graph -- when Claude loads one K
7475

7576
## Plugin Details
7677

77-
- **Version**: 1.0.0
78+
- **Version**: 1.1.0
7879
- **Author**: [Charles Jones](https://charlesjones.dev)
7980
- **License**: MIT
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
---
2+
name: kb-ingest
3+
description: "Ingest specific markdown files into the Knowledge Base. Distills content into KB format, creates KB files with frontmatter, and registers them in CLAUDE.md."
4+
disable-model-invocation: true
5+
---
6+
7+
# Knowledge Base Ingest
8+
9+
You are a knowledge base ingestion assistant. Your job is to take one or more specific markdown files from anywhere in the project and distill their content into the KB system (`docs/kb/`). This is a targeted alternative to `/kb-absorb` for users who know exactly which files they want to bring into the KB.
10+
11+
## Frontmatter Schema
12+
13+
Every KB file MUST have valid YAML frontmatter:
14+
15+
```yaml
16+
---
17+
tags: [topic-tag-1, topic-tag-2] # Required: lowercase tags for discovery
18+
related: [[other-kb-file]] # Optional: cross-references to related KB files
19+
created: YYYY-MM-DD # Required: date created
20+
last-updated: YYYY-MM-DD # Required: date last modified (update on every write)
21+
pinned: false # Optional: true = always loaded. Default false
22+
scope: "src/api/**" # Optional: glob pattern for auto-matching
23+
---
24+
```
25+
26+
## Instructions
27+
28+
### Step 1: Determine Input Files
29+
30+
Check if the user provided file path(s) after the command (e.g., `/kb-ingest docs/api-guide.md` or `/kb-ingest docs/api-guide.md docs/auth-notes.md`).
31+
32+
- **If path(s) provided**: Verify each file exists and is a markdown file (`.md`). If any file doesn't exist, inform the user and skip that file.
33+
- **If no path provided**: Ask the user which file(s) they want to ingest using AskUserQuestion with a free-text input. Header: "KB Ingest".
34+
35+
**Validation**:
36+
- Files must be markdown (`.md`).
37+
- Files already inside `docs/kb/` should be registered with `/kb-import` instead. Inform the user and stop for those files.
38+
- If no valid files remain after validation, stop.
39+
40+
### Step 2: Prerequisite Check
41+
42+
1. **Check for KB section in CLAUDE.md**: Read the project's CLAUDE.md and look for the Knowledge Base table. If it doesn't exist, inform the user to run `/kb-init` first and stop.
43+
2. **Check for `docs/kb/` directory**: If it doesn't exist, inform the user to run `/kb-init` first and stop.
44+
45+
### Step 3: Analyze Each File
46+
47+
For each input file:
48+
49+
1. **Read the file** and analyze its content.
50+
2. **Classify the content**:
51+
- **Actionable knowledge**: Rules, conventions, patterns, constraints, decisions, gotchas that would change how Claude Code works in the project. This is what belongs in the KB.
52+
- **Reference material**: Human-facing documentation (tutorials, onboarding, API references) that doesn't contain actionable rules. Flag this for the user but still allow ingestion if they want it.
53+
- **Not suitable**: Binary files, auto-generated content, changelogs, or files with no extractable knowledge. Inform the user and skip.
54+
55+
3. **Propose a KB destination**: Suggest a file path under `docs/kb/` based on the content topic (e.g., `docs/kb/api-conventions.md`, `docs/kb/auth/token-handling.md`).
56+
57+
4. **Check for overlap**: Read the CLAUDE.md Knowledge Base table and check if an existing KB file covers the same topic. If so, propose appending to the existing file instead of creating a new one.
58+
59+
### Step 4: Present Plan
60+
61+
For each file, present the ingestion plan. Use AskUserQuestion:
62+
63+
- Header: "Ingest: {source filename}"
64+
- Question: Show the following and ask for confirmation:
65+
- Source file path
66+
- Whether content is actionable knowledge or reference material
67+
- Destination KB file path (new file or append to existing)
68+
- Suggested topic name for the CLAUDE.md table
69+
- Suggested "When to Load" context
70+
- Suggested tags
71+
- Whether it should be pinned
72+
- Options: "Looks good" | "Let me adjust" | "Skip this file"
73+
74+
If "Let me adjust", ask a free-text follow-up for corrections.
75+
76+
### Step 5: Execute Ingestion
77+
78+
For each approved file:
79+
80+
#### 5a: Creating a New KB File
81+
82+
1. **Distill the content** into KB format:
83+
- Convert prose into concise, actionable rules in imperative voice.
84+
- Remove filler, redundant context, and content that only matters for human reading.
85+
- Organize under clear headings (`## Key Rules`, `## Context`, etc.).
86+
- Keep the distilled content focused. A KB file should be quick to scan.
87+
2. **Add proper frontmatter** with the confirmed tags, scope, pinned status, today's date for `created` and `last-updated`, and any `related` cross-references to existing KB files.
88+
3. **Write the file** to the confirmed `docs/kb/` path.
89+
90+
#### 5b: Appending to an Existing KB File
91+
92+
1. **Read the existing KB file**.
93+
2. **Distill only new content** that isn't already covered.
94+
3. **Append** new rules under the appropriate section. Do not duplicate existing entries.
95+
4. **Update `last-updated`** in frontmatter to today's date.
96+
5. **Add new tags** to frontmatter if the ingested content introduces new topics.
97+
98+
#### 5c: Update CLAUDE.md Table
99+
100+
1. **Remove placeholder row** if present ("_No entries yet_").
101+
2. **Add or update the row** with the confirmed Topic, File path, and When to Load.
102+
- For pinned KB files, set "When to Load" to "Always (pinned)".
103+
3. **Deduplicate**: If a row for the same file already exists, update it rather than adding a duplicate.
104+
4. **Sort the table** alphabetically by Topic.
105+
106+
### Step 6: Confirm
107+
108+
Display a summary for each ingested file:
109+
- Source file and destination KB file
110+
- Whether a new KB file was created or an existing one was updated
111+
- Key content that was captured (brief bullet points)
112+
- CLAUDE.md table entry added/updated
113+
- Reminder: the source file was NOT deleted or modified (the user can remove it manually if desired)
114+
115+
## Quality Rules
116+
117+
- **Distill, don't copy-paste**: The KB file should be a concise, actionable version of the source. Long documentation should become focused rules.
118+
- **No secrets**: Never store API keys, tokens, passwords, or connection strings. Store patterns/rules instead (e.g., "API keys must come from environment variables").
119+
- **No duplication**: Check existing KB files before writing. If content already exists, skip it.
120+
- **Maintain frontmatter**: Every KB file write must include valid, complete frontmatter.
121+
- **Preserve source**: Never modify or delete the source file. The user decides what to do with it.

plugins/ai-knowledge/skills/kb-init/SKILL.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ KB files are referenced in CLAUDE.md's Knowledge Base table. Claude Code reads t
9999
- `/kb-learn` - Capture learnings from a conversation
100100
- `/kb-add` - Quickly add a single learning or rule
101101
- `/kb-import` - Register an existing KB file in CLAUDE.md
102+
- `/kb-ingest` - Ingest specific markdown files into the KB
102103
- `/kb-absorb` - Migrate existing docs and CLAUDE.md content into the KB
103104
- `/kb-list` - View all registered KB files and their status
104105
- `/kb-search` - Search across KB files by keyword or tag
@@ -120,7 +121,7 @@ If no Knowledge Base section exists, append the following section to CLAUDE.md (
120121
```markdown
121122
## Knowledge Base
122123

123-
Topic-specific knowledge is stored in `docs/kb/` and loaded contextually. Consult the relevant KB file(s) when working in the matching area of the codebase. Files with `pinned: true` in frontmatter should always be loaded.
124+
Topic-specific knowledge is stored in `docs/kb/` and loaded contextually. Use the "When to Load" column below to decide which KB file(s) to read: load pinned entries ("Always (pinned)") at the start of every conversation, and load other entries when working in their matching area of the codebase.
124125

125126
When a KB file's frontmatter contains `related: [[other-file]]` cross-references, also read the related file(s) for full context.
126127

@@ -147,6 +148,7 @@ Display a summary:
147148
- `/kb-learn` - Capture learnings from a conversation
148149
- `/kb-add` - Quickly add a single learning or rule
149150
- `/kb-import` - Register an existing KB file in CLAUDE.md
151+
- `/kb-ingest` - Ingest specific markdown files into the KB
150152
- `/kb-absorb` - Migrate existing docs and CLAUDE.md content into the KB
151153
- `/kb-list` - View all registered KB files and their status
152154
- `/kb-search <keyword>` - Search across KB files

0 commit comments

Comments
 (0)