gkg
gkg
If .khuym/onboarding.json is missing or stale for the current repo, stop and invoke khuym:using-khuym first.
Start With The Repo Scout
Do not start with which gkg or any imagined gkg <subcommand> discovery flow.
Run:
node .codex/khuym_status.mjs --json
Use the scout output as the source of truth for this repo:
gkg_readiness.supported_repo = false: do not force gkg; use the fallback section below.gkg_readiness.server_reachable = false: gkg is not ready for query work yet.gkg_readiness.project_indexed = false: do not pretend MCP discovery is ready. Hand back tokhuym:using-khuymreadiness or follow the scout'srecommended_action.- If readiness is green, use MCP tools for discovery. Do not switch back to a CLI-shaped discovery workflow.
In this repo, readiness is exposed through the scout. Treat that as the normal operator path.
What Is Reliable Here
Use gkg as a discovery accelerator, not as a replacement for reading files.
Strong, normal-path tools in this repo:
list_projectsindex_projectrepo_mapsearch_codebase_definitionsread_definitions
Helper-only tool:
import_usage
Non-core, lower-confidence tools:
get_referencesget_definition
The practical rule is simple: use repo_map plus search_codebase_definitions plus read_definitions first, then fall back to local inspection whenever symbol-linking looks thin or suspicious.
Primary Discovery Path
Use this path by default during Khuym planning and other codebase discovery work.
1. repo_map
Use first for unfamiliar areas. It is the best starting point for a compact architecture snapshot.
Use it to answer:
- which directories and files matter for this feature
- which files expose the main definitions in a target area
- how the local repo slice is shaped before deeper reads
When discovery is being written down for planning, save the result or summary to history/<feature>/discovery.md under ## Architecture Snapshot.
2. search_codebase_definitions
Use next to find candidate symbols, classes, functions, constants, or handlers related to the feature.
Good uses:
- find auth entry points
- find route handlers
- find data access helpers
- find existing naming and pattern anchors before proposing a new approach
Keep search terms concrete and code-shaped. Prefer symbol names or narrow domain phrases over prose.
3. read_definitions
Use immediately after search_codebase_definitions to read the strongest matches in full.
This is the main evidence-gathering step. It is usually better than hopping file-to-file manually because it keeps discovery centered on actual definitions instead of filenames alone.
When planning writes formal discovery output, summarize the findings in history/<feature>/discovery.md under ## Existing Patterns.
Tool Guidance
list_projects
Use as a light sanity check when the scout says gkg should work and you want to confirm the repo is present in the index.
Do not treat this as the primary readiness check. The scout comes first.
index_project
Use to refresh an indexed project when the index is stale or after significant repo changes.
Do not use this as the first response to project_indexed = false in the scout unless the surrounding readiness workflow explicitly called for it. In this repo, first-time indexing is surfaced by the scout and typically handled by the scout's recommended action.
import_usage
Use only as a helper for importer discovery.
Good uses:
- find who imports a package or module
- check whether a dependency is used broadly or only in one slice
- identify a likely entry file after a package-level search
Do not use it as a general substitute for repo_map or search_codebase_definitions.
get_references
Treat as non-core and low-confidence in this repo.
Use it only when:
- you already know the exact definition to inspect
- you want a quick inbound-usage hint
- you are prepared to verify the answer with local file reads or
rg
If it misses callers, gives a thin set, or returns ambiguous results, fall back immediately to rg -n "<symbol>" and nearby file inspection.
get_definition
Treat as non-core and low-confidence in this repo.
Use it only as a quick jump helper from a known call site to a likely definition. Always confirm with read_definitions or a direct file read before relying on it.
If it cannot resolve the symbol cleanly, do not fight it. Fall back to search_codebase_definitions, read_definitions, and rg.
Khuym Workflow Fit
Use this skill mainly during khuym:planning discovery work.
repo_mapfeeds the architecture snapshot.search_codebase_definitionsplusread_definitionsfeed the existing-pattern evidence.import_usagecan help confirm importer spread when that matters to the approach.get_referencesandget_definitionare optional spot tools, not the backbone of the workflow.
If planning is producing history/<feature>/discovery.md, keep the saved output concise and evidence-based:
## Architecture Snapshot## Existing Patterns## Dependency Noteswhen importer or caller evidence materially affects the plan
Do not dump raw tool output when a short grounded summary will do.
Practical Fallback Without gkg
If the scout says gkg is unsupported or not ready, use local inspection with rg.
Useful fallbacks:
- file inventory:
rg --files - narrow slice inventory:
rg --files | rg 'auth|router|db|queue' - symbol search:
rg -n "MySymbol|myFunction|authMiddleware" . - importer search:
rg -n "^import .*from ['\"].*target|require\\(.*target" . - definition search:
rg -n "export (async )?function|class |const .*=" .
Then read the relevant files directly.
If planning is writing discovery output, note the fallback plainly in history/<feature>/discovery.md, for example:
gkg was unavailable or not ready for this repo/session, so discovery used
rgand direct file inspection.
Guardrails
- Do not describe the workflow as
gkg repo_map,gkg search,gkg deps, orgkg context. Those are not the discovery interface this repo relies on. - Do not skip the scout-based readiness check.
- Do not let symbol-linking tools outrank direct file evidence.
- Do not use
import_usageas a general architecture mapper. - Do not rely on
get_referencesorget_definitionwithout a fallback plan. - Do not skip reading the actual files before code changes.
More from hoangnb24/skills
prompt-leverage
Strengthen a raw user prompt into an execution-ready instruction set for Codex or another AI agent. Use when the user wants to improve an existing prompt, build a reusable prompting framework, wrap the current request with better structure, add clearer tool rules, or create a hook that upgrades prompts before execution.
14khuym:using-khuym
Bootstrap meta-skill for the khuym agentic development ecosystem. Load first on any khuym project. Lists all 9+2 skills with routing logic, session scout/bootstrap, small-change vs standard-feature vs high-risk mode selection, go mode (full-auto pipeline with 4 human gates), priority rules, and state resume. Invoke when starting a new session, choosing which skill to use, running the full pipeline end-to-end, or resuming after a handoff.
7khuym:planning
>-
7khuym:executing
>-
6khuym:swarming
Orchestrates parallel worker agents for phase execution. Use after the khuym:validating skill approves the current phase for execution. Initializes the overseer/orchestrator context, spawns bounded worker subagents, monitors Agent Mail for completions/blockers/file conflicts, coordinates rescues and course corrections, and hands off either to planning for the next phase or to reviewing after the final phase. The orchestrator TENDS — it never implements beads directly.
6khuym:validating
|
6