Commands
kural brief
Show existing code related to a concept before implementing it
Given a description of code you plan to write, returns the existing units in the snapshot that are closest in embedding space. Answers "what already exists in this area?" so you don't duplicate behavior or borrow the wrong vocabulary.
Synopsis
kural brief "<description>" [flags]Flags
| Flag | Short | Type | Description |
|---|---|---|---|
<description> | string | Description of the code you intend to write (positional, required). | |
--provider <name> | -p | string | Embedding provider — openrouter, openai, vercel (default), ollama. |
--model <id> | -m | string | Model ID override. |
--api-key <key> | -k | string | API key. Falls back to AI_GATEWAY_API_KEY. |
--json | boolean | Emit the brief as JSON — agent-friendly. |
Examples
kural brief "validate embedding provider configuration"
kural brief "persist score cards to the snapshot database" --jsonWhen to use it
- Before an AI agent writes code, pipe the brief into its context so it uses existing vocabulary and doesn't re-implement something that lives elsewhere.
- When onboarding, to discover the handful of files that already touch a concept without grep'ing for keywords.
- Before opening a PR, to sanity-check that your change isn't a near-duplicate of code that already exists.
Related
- Companion:
kural place— same input, different question (where should the new code go?). - Concept: Embedding — what "close in embedding space" means in this system.