codekb-extract

Extract structured knowledge from source code, git history, and OpenSpec changes.

1|Updated Jun 27, 2026
One-click install
npx skills add https://github.com/TE-QuanBZhang/skills-pool --skill codekb-extract-te-quanbzhang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codekb-extract
Source: https://github.com/TE-QuanBZhang/skills-pool/tree/main/codekb/skills/codekb-extract
Command: npx skills add https://github.com/TE-QuanBZhang/skills-pool --skill codekb-extract-te-quanbzhang

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Valuable engineering knowledge—design decisions, business rules, coding conventions, and bug patterns—stays buried in code and commit history, forcing teams to rediscover it repeatedly. ## Core Features & Use Cases - Five LLM-Powered Extractors: pattern (architecture), decision (lightweight ADRs), rule (business rules), convention (coding standards), and bug-pattern (defect patterns from fix commits). - OpenSpec Integration: Run extraction from an archived OpenSpec change with --from-change to close the knowledge feedback loop. - Quality Guardrails: Content-hash caching avoids redundant LLM calls, low-confidence entries (< 0.7) are flagged for review, and supersede links keep knowledge current. - Use Case: After archiving an OpenSpec change like add-refund-fee, run extraction to automatically capture the new business rules and design decisions into the knowledge base. ## Quick Start Ask the AI to run codekb extract on the current project to generate structured knowledge entries from the codebase and git history.

Frequently Asked Questions about codekb-extract

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract knowledge from code and git history?

Run `codekb extract` to execute all configured extractors against your project. Use `--scope` to limit directories, `--extractors` to select specific types like decision or rule, and `--from-change` to extract from an archived OpenSpec change.

What knowledge extractors does CodeKB support?

CodeKB provides five extractors: pattern for architecture patterns, decision for lightweight ADRs from commits and code comments, rule for business rules, convention for coding standards, and bug-pattern for defect patterns from fix commits.

Does codekb extract require an LLM API key?

An LLM API key is optional. CodeKB falls back to heuristic extraction when no key is configured, so basic knowledge extraction still works without LLM access.

How do I extract knowledge from an OpenSpec change?

Run `codekb extract --from-change <change-name>` after archiving the change. This sets the source_change field on generated entries for traceability back to the originating OpenSpec change.

Why are some extracted knowledge entries flagged for review?

Entries with confidence below 0.7 are flagged as pending review and excluded from automatic association in /opsx:propose. Review and confirm these entries before they participate in downstream workflows.

When should I not run codekb extract?

Do not run extraction on a hotfix branch, since the skill operates in read-only mode there. Also avoid re-running full extraction unnecessarily; use --stale to refresh only entries marked potentially stale.