Agent skill

Okf Generator

by UmairBaig8 in UmairBaig8/okf-generator

Generate OKF (Open Knowledge Format) v0.2 knowledge bundles from codebases, and look up exact concepts for AI agent context injection.

MITAuto-check passedAgent Workflows

Install Okf Generator

skills CLI
$ npx skills add UmairBaig8/okf-generator --skill okf-generator -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install UmairBaig8/okf-generator okf-generator --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
okf-generator
GitHub stars
109
Token cost
~1.7k tokens
SKILL.md length
427 words
Files
482 (incl. scripts, references)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Generate OKF (Open Knowledge Format) v0.2 knowledge bundles from codebases, and look up exact concepts for AI agent context injection.

  • The user wants to: index a codebase
  • SKILL.md covers Pipeline Overview, CLI Reference, Dependencies and Task: Generate OKF Bundle, plus 6 more sections
  • Calls pip; needs SYNTH_API_KEY
  • Generate OKF bundles

What it does

Okf Generator is an agent skill from UmairBaig8/okf-generator. Generate OKF (Open Knowledge Format) v0.2 knowledge bundles from codebases, and look up exact concepts for AI agent context injection. Use this skill whenever the user wants to: index a codebase, generate OKF bundles, extract code knowledge into structured markdown, convert codebases into training data, look up functions/classes/modules by name, prime an AI agent with codebase context, or integrate codebase knowledge with OpenCode or other AI coding agents. Also trigger for phrases like "index my code", "generate…

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 486 other files, including scripts and reference files (for example `.devcontainer/devcontainer.json`, `.github/ISSUE_TEMPLATE/bug_report.md` and `.github/ISSUE_TEMPLATE/feature_request.md`).

It sits in Agent Workflows, covering Codebase knowledge for agents. The repository describes itself as: OKF v0.1 knowledge bundle generator — Claude skill + OpenCode integration. The licence is MIT.

When your agent uses it

  • The user wants to: index a codebase
  • Generate OKF bundles
  • Extract code knowledge into structured markdown
  • Convert codebases into training data

Example prompts

  • “index my code”
  • “generate knowledge bundle”
  • “extract codebase concepts”
  • “/okf-generator”

Requirements

  • Python 3
  • A credential in SYNTH_API_KEY

What it can do on your machine

Read from SKILL.md and the folder at commit 5fb73be. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/, which the agent can run.

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • SYNTH_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Okf Generator loads about 1.7k tokens when it runs, and up to ~7.2k if it reads all its reference files. Until then it costs about 157 tokens; SKILL.md has 427 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~157
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from UmairBaig8/okf-generator at commit 5fb73be, republished under its MIT licence (© UmairBaig8). 427 words, ~1,670 tokens.

Download SKILL.mdSave it as .claude/skills/okf-generator/SKILL.md (or your agent's skills folder). This skill also uses 481 other files; get the full folder from GitHub.
name
okf-generator
description
Generate OKF (Open Knowledge Format) v0.2 knowledge bundles from codebases, and look up exact concepts for AI agent context injection. Use this skill whenever the user wants to: index a codebase, generate OKF bundles, extract code knowledge into structured markdown, convert codebases into training data, look up functions/classes/modules by name, prime an AI agent with codebase context, or integrate codebase knowledge with OpenCode or other AI coding agents. Also trigger for phrases like "index my code", "generate knowledge bundle", "extract codebase concepts", "what does X class do", or "look up X in OKF".

OKF Generator & Lookup Skill

Generates structured OKF v0.2 knowledge bundles from codebases (18 languages via tree-sitter AST + stdlib ast), and provides fast concept lookup for AI agents like OpenCode.

Pipeline Overview

codebase
   |
   v
okf generate  -->  okf_bundle/          (domain/resource-path layout)
                       |
                okf lookup               (zero-LLM concept search)
                       |
                okf pairs          -->  okf_pairs.jsonl  (training data)

CLI Reference

All features via single okf CLI (installed from PyPI).

CommandPurpose
okf generateScan codebase and write OKF bundle
okf lookupSearch bundle and return exact concept
okf pairsConvert bundle to JSONL training pairs
okf summarizeRegenerate SUMMARY.md from existing bundle

Dependencies

bash
pip install okf-generator
# With LLM enrichment:
pip install "okf-generator[llm]"

Task: Generate OKF Bundle

When: user says "index my codebase", "generate OKF bundle", "extract knowledge from code"

Static extraction (no LLM — always run this first)
bash
okf generate <source_dir> <output_dir>
With LLM enrichment (fills missing docstrings and descriptions)

Configure enrichment in .okfconfig (JSON), then run:

bash
okf generate <source_dir> <output_dir> --enrich
# or run enrichment standalone on an existing bundle:
okf enrich <output_dir>
jsonc
// .okfconfig
{
  "llm": { "enabled": true, "base_url": "http://localhost:8080/v1", "api_key": "llamabarn" },
  "providers": {
    "default": { "model": "ggml-org/gemma-3-4b-it-qat-GGUF:Q4_0", "max_workers": 2 }
  }
}

Enrichment is resumable — rerun safely if interrupted. Already-enriched concepts are skipped automatically (checks disk on every run).

Output layout (mirrors source tree)
okf_bundle/
├── SUMMARY.md              <- bird's-eye view for AI agents
├── index.md                <- root index
├── log.md                  <- generation history
└── <domain>/
    └── <module>/
        ├── index.md        <- lists all concepts in folder
        ├── <module>.md     <- Module concept
        └── <ClassName>.md  <- Class / Function concepts

Task: Look Up a Concept

When: user asks "what does X do", "find class X", "look up X", or needs to prime OpenCode with exact concept context before editing code.

bash
# Full detail — signature, docstring, params, returns, related
okf lookup WorldBankConnector

# All concepts from one source file
okf lookup --file StockAI/RnD/python/connectors/economic_data.py

# Filter by type
okf lookup --type Class connector

# Filter by tag
okf lookup --tag lang:python --tag type:Function fetch

# Compact list (many results)
okf lookup --compact connector

# JSON output (programmatic / agent use)
okf lookup --json WorldBankConnector

# Custom bundle path
okf lookup --bundle ./Knowlege/okf_bundle WorldBankConnector

Default bundle path: ./okf_bundle. Also auto-tries ./Knowlege/okf_bundle and ./knowledge/okf_bundle.


Task: Generate Training Pairs

When: user wants JSONL training data from the OKF bundle.

bash
# Static only (instant, no LLM)
SKIP_SYNTH=1 okf pairs <bundle_dir> output.jsonl

# With LLM (QA, doc, summarize pairs)
SYNTH_BASE_URL="http://localhost:8080/v1" \
SYNTH_API_KEY="llamabarn" \
SYNTH_MODEL="ggml-org/gemma-3-4b-it-qat-GGUF:Q4_0" \
MAX_WORKERS=2 \
QA_PER_CONCEPT=3 \
okf pairs <bundle_dir> output.jsonl

# Specific pair types only
PAIR_TYPES="codegen,qa" okf pairs <bundle_dir> output.jsonl
Pair types
TypeStaticLLMCovers
codegenyesyesFunctions, Classes
qanoyesAll (purpose/params/return/edge)
docnoyesFunctions, Classes
summarizeyesyesModules, Classes
crosslinkyesnoAll with related concepts

Task: Regenerate SUMMARY.md Only

bash
okf summarize <bundle_dir>

Use after enrichment finishes to refresh the summary without re-scanning.


OpenCode Integration

See references/opencode-integration.md for full setup.

Quick setup:

bash
# 1. Add to AGENTS.md (auto-loaded by OpenCode)
echo "OKF bundle at ./okf_bundle — use: okf lookup <Name>" >> AGENTS.md

# 2. Add lookup command
mkdir -p .opencode/commands
echo "RUN okf lookup --bundle ./okf_bundle \$NAME" \
  > .opencode/commands/lookup.md

Show full SKILL.md (180 more words)Show less

Supported Languages

LanguageParserExtracts
Pythonstdlib astfunctions, classes, params, return types, docstrings
JS / TStree-sitterfunctions, arrow fns, classes, JSDoc
Gotree-sitterfuncs, methods, structs, interfaces, GoDoc
Javatree-sitterclasses, methods, constructors, Javadoc
Rusttree-sitterfns, structs, enums, traits, impl blocks, doc comments
Rubytree-sitterdefs, classes, modules, hash comments
C / C++ / C#tree-sitterfuncs, structs, classes, headers, XML-doc
Swift / Kotlintree-sitterfuncs, classes, protocols, visibility
PHP / Darttree-sitterclasses, functions, docblocks
Scala / Juliatree-sitterdefs, classes, traits, objects
SQLtree-sittertables, views, functions
YAMLPyYAMLdocuments, keys, anchors

Troubleshooting

No concepts found: Check that source dir is not inside a SKIP_DIRS name (node_modules, .venv, dist, etc). Leading path components like /tmp are no longer skipped (fixed in v0.1.3).

Enrichment slow: Set max_workers: 1 in the provider config. Local models process ~1 request at a time. At 32 tok/sec expect ~3-5s per concept.

Enrichment interrupted: Rerun same command. Enriched files are skipped.

JS/TS concepts missing: Ensure tree-sitter-typescript is installed. TypeScript uses a separate grammar from JavaScript.

Lookup wrong result: Add --type or --file to narrow the search scope.

© UmairBaig8, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 481 other files (scripts, references) in the repository root of UmairBaig8/okf-generator.

  • SKILL.md
  • .cursorrules
  • .devcontainer/devcontainer.json
  • .dockerignore
  • .github/ISSUE_TEMPLATE/bug_report.md
  • .github/ISSUE_TEMPLATE/feature_request.md
  • .github/PULL_REQUEST_TEMPLATE.md
  • .github/copilot-instructions.md
  • .github/workflows/ci.yml
  • .github/workflows/demo-viz.yml
  • .github/workflows/deploy-docs.yml
  • .github/workflows/docker-publish.yml
  • .github/workflows/okf-bundle.yml
  • .github/workflows/publish.yml
  • .gitignore
  • .opencode/commands
  • … and 466 more

Open the folder on GitHubat commit 5fb73be

Compare with similar skills

Okf Generator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Okf Generator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Okf Generator this skillUmairBaig8/okf-generator109—~1.7kAutomated safety check: PassMIT
ccc Semantic Code Searchcocoindex-io/cocoindex-code2.8k—~938Automated safety check: PassApache-2.0
Context Engineeringabashev/vfs-s31069 repos~2.6kAutomated safety check: NotesApache-2.0
Repomix Codebase Packeryamadashy/repomix29k—~1.3kAutomated safety check: NotesMIT
Codebase Handbook BuilderRuhan-Wang/Harness_Handbook334—~2.2kAutomated safety check: PassApache-2.0
CodemapJordanCoin/codemap703—~1.8kAutomated safety check: PassMIT

Similar skills

  • ccc Semantic Code Search

    cocoindex-io/cocoindex-code

    Semantic code search and index management with the ccc CLI: the agent initializes, indexes and queries the project by concept, filtering by language or path.

    2.8k GitHub stars~938 tokensUpdated 3 days ago
    Agent WorkflowsAuto-check passed
  • Context Engineering

    abashev/vfs-s3

    Optimizes agent context setup. An agent skill from abashev/vfs-s3.

    106 GitHub starsUsed in 9 repos~2.6k tokens
    Agent WorkflowsAuto-check: notes
  • Repomix Codebase Packer

    yamadashy/repomix

    Packs a local directory or remote GitHub repository into one AI-friendly file with Repomix, then searches it to explore structure, find patterns and count tokens.

    29k GitHub stars~1.3k tokensUpdated today
    Agent WorkflowsAuto-check: notes
  • Codebase Handbook Builder

    Ruhan-Wang/Harness_Handbook

    Generates, refreshes, validates and uses a compact handbook that maps where a change touches in a repository, using the active Codex session and no external LLM API.

    334 GitHub stars~2.2k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • Codemap

    JordanCoin/codemap

    Gives an agent a quick map of a codebase's structure, dependencies, changes and handoffs, and tunes per-project config so the output stays code-first.

    703 GitHub stars~1.8k tokensUpdated 2 days ago
    Agent WorkflowsAuto-check passed
  • Repomix Context Skill

    sopaco/deepwiki-rs

    A skill your agent uses when an agent needs source code from the local repomix index under .terrain/agent/repomix.md (not committed; regenerate via Terrain scan).

    3.1k GitHub stars~671 tokensUpdated 25 days ago
    Agent WorkflowsAuto-check passed

Categories

Questions about Okf Generator

What does Okf Generator do?

Generate OKF (Open Knowledge Format) v0.2 knowledge bundles from codebases, and look up exact concepts for AI agent context injection. Okf Generator is an agent skill from UmairBaig8/okf-generator.2 knowledge bundles from codebases, and look up exact concepts for AI agent context injection.

When should I use Okf Generator?

Okf Generator fits situations like: the user wants to: index a codebase; generate OKF bundles; extract code knowledge into structured markdown; convert codebases into training data.

How do I install Okf Generator in Claude Code?

Run `npx skills add UmairBaig8/okf-generator --skill okf-generator -a claude-code`. Or copy the skill folder (the UmairBaig8/okf-generator repository) into .claude/skills/okf-generator in your project. Claude Code loads it when a task matches its description.

How do I install Okf Generator in Codex?

Run `npx skills add UmairBaig8/okf-generator --skill okf-generator -a codex`. Or copy the skill folder (the UmairBaig8/okf-generator repository) into .agents/skills/okf-generator in your project. Codex loads it when a task matches its description.

Can I use Okf Generator in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add UmairBaig8/okf-generator --skill okf-generator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/okf-generator, .gemini/skills/okf-generator, .github/skills/okf-generator and .opencode/skills/okf-generator in your project.

What does Okf Generator need to run?

Going by SKILL.md and its folder, Okf Generator needs the command-line tools its instructions call (pip) and credentials named SYNTH_API_KEY. Our summary lists: Python 3; A credential in SYNTH_API_KEY.

Does Okf Generator access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Okf Generator safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Okf Generator use?

Okf Generator is published under the MIT licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Okf Generator use?

About 1.7k tokens (SKILL.md is roughly 6.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.5k tokens, read only when the agent opens those files.

What are the alternatives to Okf Generator?

Skills that share tags, products or a category with Okf Generator: ccc Semantic Code Search (cocoindex-io/cocoindex-code, 2.8k stars), Context Engineering (abashev/vfs-s3, 106 stars), Repomix Codebase Packer (yamadashy/repomix, 29k stars) and Codebase Handbook Builder (Ruhan-Wang/Harness_Handbook, 334 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Okf Generator?

UmairBaig8 (a GitHub user) maintains it in UmairBaig8/okf-generator, which has 109 GitHub stars. The repository was last updated on August 1, 2026.

Source: UmairBaig8/okf-generator on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.