update-knowledge-base
Scannednpx machina-cli add skill lbb00/ai-rules-sync/update-knowledge-base --openclawUpdate Knowledge Base
Purpose
Automatically analyze recent code changes and update the project's knowledge base documentation to reflect current architecture, features, and conventions.
Instructions
-
Analyze Recent Changes
- Review git diff or recent commits
- Identify new adapters, commands, or features
- Note architectural changes or new patterns
-
Read Current Knowledge Base
- Check if KNOWLEDGE_BASE.md exists
- If not, create it with proper structure
- If exists, identify sections needing updates
-
Update Sections
- Architecture: Update if new adapters or core components added
- Features: Document new CLI commands or options
- Conventions: Note any new coding patterns established
- API Changes: Document breaking changes or deprecations
-
Verify Accuracy
- Cross-reference with actual source code
- Ensure examples are runnable
- Check that all documented features exist
-
Format Consistently
- Use consistent markdown formatting
- Include code examples where helpful
- Maintain table format for command references
Knowledge Base Structure
# AI Rules Sync - Knowledge Base
## Architecture Overview
- Adapter system description
- CLI layer structure
- Config management
## Supported Tools
| Tool | Types | Source Dir | Target Dir |
## Commands Reference
| Command | Description | Example |
## Adapter Implementation
- How to add new adapters
- Required interfaces
## Configuration
- ai-rules-sync.json structure
- Local/private rules
## Changelog
- Recent significant changes
Output
After running this skill:
- KNOWLEDGE_BASE.md is created or updated
- Changes reflect current codebase state
- Documentation is accurate and complete
Source
git clone https://github.com/lbb00/ai-rules-sync/blob/main/.claude/skills/update-knowledge-base/SKILL.mdView on GitHub Overview
Update Knowledge Base automates extracting architectural and feature changes from recent commits and diffs, then documents them in KNOWLEDGE_BASE.md. It ensures the KB stays in sync with new adapters, CLI commands, conventions, and API changes. The routine emphasizes accuracy, runnable examples, and consistent markdown structure.
How This Skill Works
The skill scans git diffs or commits to detect new adapters, commands, or patterns, then updates KNOWLEDGE_BASE.md sections such as Architecture, Features, Conventions, and API Changes. It cross-references the source to verify features exist and formats content with consistent markdown, including tables for commands when appropriate.
When to Use It
- After adding a new adapter or core component
- When new CLI commands or options are introduced
- After architecture refactors or pattern changes
- When deprecations or breaking API changes occur
- If KNOWLEDGE_BASE.md is missing or outdated
Quick Start
- Step 1: Analyze recent changes with git diff or commits
- Step 2: Update Architecture, Features, Conventions, and API Changes in KNOWLEDGE_BASE.md
- Step 3: Review for accuracy, run examples, then commit and push
Best Practices
- Ensure KNOWLEDGE_BASE.md exists or is created with the proper structure
- Cross-reference code to verify accuracy and runnable examples
- Update Architecture, Features, Conventions, and API Changes sections as needed
- Include runnable code examples where helpful
- Maintain table format for Commands Reference and other references
Example Use Cases
- Adding a new adapter prompts updates to Architecture Overview and Adapter Implementation
- A new CLI option triggers an update to Commands Reference with an example
- Core refactor updates Architecture Overview and Config sections
- API deprecation adds an API Changes entry and updates Changelog
- KB is created for a repo without an existing KNOWLEDGE_BASE.md