
Indexion Kgf
- 4.9k installs
- 1 repo stars
- Updated July 20, 2026
- trkbt10/indexion-skills
indexion-kgf is an agent skill for debugging KGF language specs via indexion CLI inspect, tokens, events, and edges subcommands.
About
indexion kgf inspects and debugs KGF language specifications that power indexion dependency analysis across source files. Subcommands list installed specs, update from GitHub, add a single spec, and run inspect, tokens, events, or edges on any file with optional --spec and --kgf-dir overrides. Invoke when developing or fixing KGF specs, when indexion analysis output looks wrong, or when grep patterns miss because aliases such as pub map to KW_pub from lex sections and actual token kinds must be read from kgf tokens output first. The workflow starts with inspect for the full pipeline, then drills into tokens, events, or edges compared against kgfs lang.kgf spec files. Documented pitfalls cover PEG first-match ordering when DocComment consumes declaration docs, silent failures from missing NL between doc comments and keywords, bottom-up event order requiring bind and $scope from child to parent rules, and token priority where generic Operator patterns swallow EQ. Verify doc strings on declares edges after every spec edit.
- inspect, tokens, events, and edges subcommands expose the full KGF processing pipeline per file.
- list, update, and add manage installed KGF specs from GitHub or local kgfs directories.
- grep debugging workflow maps pattern aliases to real token kinds like KW_pub and Ident.
- PEG pitfall docs cover DocComment ordering, NL gaps, bind scope, and token priority conflicts.
- Verify doc extraction with kgf edges and grep declares after modifying any KGF spec.
Indexion Kgf by the numbers
- 4,897 all-time installs (skills.sh)
- Ranked #18 of 596 Debugging skills by installs in the Skillselion catalog
- Security screen: MEDIUM risk (skills.sh audit)
- Data as of Aug 5, 2026 (Skillselion catalog sync)
indexion-kgf capabilities & compatibility
- Capabilities
- full pipeline inspect for tokens events and edge · spec lifecycle via list update and add · grep alias to token kind debugging workflow · peg and event order pitfall reference · doc extraction verification on declares edges
- Use cases
- debugging · testing
What indexion-kgf says it does
Inspect and debug KGF language specs by viewing tokens, parse events, and extracted edges.
KGF uses PEG parsing. In `Item -> A / B / C`, if A matches, B and C are never tried.
npx skills add https://github.com/trkbt10/indexion-skills --skill indexion-kgfAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 4.9k |
|---|---|
| repo stars | ★ 1 |
| Security audit | 2 / 3 scanners passed |
| Last updated | July 20, 2026 |
| Repository | trkbt10/indexion-skills ↗ |
How do I see why indexion tokenization, parsing, or grep patterns fail for a language spec?
Debug indexion KGF language specs by inspecting tokenization, parse events, and dependency edges when analysis or grep patterns fail.
Who is it for?
Developers authoring or fixing KGF specs and debugging indexion grep or dependency analysis output.
Skip if: Skip when the task is running indexion analysis without spec authoring, token inspection, or parse debugging needs.
When should I use this skill?
User debugs how indexion parses a file, develops KGF specs, or grep patterns fail to match expected tokens.
What you get
Visible tokens, parse events, and dependency edges aligned with KGF spec rules and verified doc extraction on declares edges.
- Token inspection output
- Parse tree visualization
- Edge extraction debug report
Files
indexion kgf
Inspect and debug KGF language specs by viewing tokens, parse events, and extracted edges.
When to Use
- User wants to debug how indexion processes a specific file
- User is developing or modifying a KGF spec
- User asks "how does indexion parse this file?"
- Verifying that tokenization/parsing works correctly for a language
- Debugging grep patterns: when a grep pattern doesn't match, use
kgf tokens to see the actual token kinds
Subcommands
indexion kgf list — List Installed Specs
indexion kgf listindexion kgf update — Update All Specs
Download the latest specs from GitHub.
indexion kgf updateindexion kgf add — Install a Single Spec
indexion kgf add <spec-name>indexion kgf inspect — Full Inspection
Show tokens, events, and edges all at once.
indexion kgf inspect <file>
indexion kgf inspect --spec=typescript src/app.tsindexion kgf tokens — Tokenization Only
Show how a file is tokenized.
indexion kgf tokens <file>
indexion kgf tokens --spec=go-mod go.modindexion kgf events — Parse Events Only
Show parse events generated from tokens.
indexion kgf events <file>indexion kgf edges — Extracted Edges Only
Show the dependency edges extracted from a file.
indexion kgf edges <file>
indexion kgf edges fixtures/project/npm/package.jsonOptions
| Option | Default | Description |
|---|---|---|
--spec=NAME | auto-detect | KGF spec name to use |
--kgf-dir=PATH | kgfs | KGF specs directory |
Relationship to grep
indexion grep uses KGF tokenization under the hood. Pattern aliases (pub → KW_pub) are derived from the === lex section of KGF specs.
When a grep pattern doesn't match as expected:
# 1. See the actual tokens for a file
indexion kgf tokens src/config/paths.mbt
# 2. Check which token kinds exist
indexion kgf tokens src/config/paths.mbt | head -20
# 3. Then adjust your grep pattern to match the actual token kinds
indexion grep "KW_pub KW_fn Ident" src/config/paths.mbtCommon token kinds (MoonBit):
KW_pub,KW_fn,KW_struct,KW_enum,KW_type,KW_trait,KW_let,KW_forIdent(lowercase identifiers),TypeIdent(PascalCase type names)LPAREN,RPAREN,LBRACE,RBRACE,LBRACKET,RBRACKETNL(newline),SKIP(whitespace — filtered from grep patterns)DocComment,DocLine,DocSection,LineComment,BlockCommentString,Number,Char
Workflow
1. Run indexion kgf inspect <file> to see the full processing pipeline 2. If something looks wrong, drill down with tokens, events, or edges 3. Compare with the KGF spec file (kgfs/<lang>.kgf) to diagnose issues
KGF Development Pitfalls
Common bugs found when writing or modifying KGF specs:
PEG Item Ordering (first-match-wins)
KGF uses PEG parsing. In Item -> A / B / C, if A matches, B and C are never tried. DocComment as a standalone alternative before declaration rules will consume doc comments that should be attached to declarations.
# BAD: DocComment before FuncDecl — doc is consumed as standalone item
Item -> NL / DocComment / FuncDecl / Other
# GOOD: DocComment after declarations — FuncDecl's doc:DocComment? gets it
Item -> NL / FuncDecl / DocComment / OtherNL Between Doc and Keyword
Source code has newlines between doc comments and declarations. Without NL? or NL*, the optional doc capture fails silently:
# BAD: DocComment immediately followed by keyword — NL breaks the match
FuncDecl -> doc:DocComment? KW_fn id:Ident ...
# GOOD: NL? allows the typical newline between doc and keyword
FuncDecl -> doc:DocComment? NL? KW_fn id:Ident ...Bottom-Up Event Order (bind/scope)
Events fire bottom-up: child rules before parent rules. If ExportDecl wraps FunctionDecl, FunctionDecl fires first. Use bind/$scope to pass data from child to parent:
on FunctionDecl {
bind ns "value" name "child_decl_id" to $id
edge declares from $file to sym_id attrs obj(...)
}
on ExportDecl when $doc {
let id = $scope("value", "child_decl_id")
edge declares from $file to sym_id attrs obj("doc", $doc, ...)
}Token Priority Conflicts
Tokens defined earlier take priority. A generic Operator /[=+\-*]+/ before EQ /=/ will consume = as Operator. Define specific tokens first:
# BAD: Operator matches = before EQ can
TOKEN Operator /[!$%&*+\-.\/:<=>?@^|~]+/
TOKEN EQ /=/
# GOOD: EQ defined first, takes priority
TOKEN EQ /=/
TOKEN Operator /[!$%&*+\-.\/:<=>?@^|~]+/Verifying Doc Extraction
After modifying a KGF, always verify doc appears in declares edges:
# Must show doc="..." in the declares edge
indexion kgf edges test_file.ts --spec=typescript | grep declares
# If doc is missing, check events to see where the DocComment went
indexion kgf events test_file.ts --spec=typescript | grep DocCommentRelated skills
FAQ
Which subcommand shows the full pipeline?
indexion kgf inspect prints tokens, parse events, and extracted edges together for a file.
Why do grep patterns fail to match?
Pattern aliases derive from KGF lex sections; run kgf tokens to see actual kinds like KW_pub before adjusting grep.
How do I verify doc comments attach to declarations?
Run kgf edges with grep declares and confirm doc attributes appear; use events to trace stray DocComment tokens.
Is Indexion Kgf safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.