Skip to content

Commit 7807ce0

Browse files
committed
Update SKILL.md with local crate exploration workflows for agents
Add "Exploring Your Own Crate" section with key patterns (-rps, -rpb, -rp -k mod) and guidance on semantic scoping vs file reads. Steer agents toward -s over -d since source includes doc comments. Add note on parallel subagent module exploration for large codebases.
1 parent 883e6f4 commit 7807ce0

1 file changed

Lines changed: 34 additions & 9 deletions

File tree

skills/groxide/SKILL.md

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
name: groxide
33
description: >
44
Query Rust crate documentation from the terminal using groxide (grox).
5-
Use when you need to look up Rust API docs, check type signatures, explore
6-
module contents, find methods on a type, or search crate documentation —
7-
without leaving the terminal or browsing docs.rs. Ideal for LLM coding agents
8-
working on Rust projects. Do NOT use for general Rust language questions,
9-
reading local source files, or managing Cargo dependencies.
5+
Use when you need to explore your own crate's structure and source, look up
6+
dependency APIs, check type signatures, find methods on a type, or search
7+
crate documentation — without leaving the terminal or browsing docs.rs.
8+
Ideal for LLM coding agents working on Rust projects. Do NOT use for general
9+
Rust language questions, reading arbitrary files, or managing Cargo dependencies.
1010
license: MIT OR Apache-2.0
1111
compatibility: Requires Rust nightly toolchain and cargo
1212
allowed-tools: Bash(grox:*)
@@ -28,7 +28,29 @@ Agents should capture stdout only. Exit codes: 0 = success, 1 = not found, 2 = e
2828

2929
**Outside a Rust project**: query the standard library (`grox std::collections::HashMap`) or auto-fetch any crate from crates.io (`grox axum::Router`). No Cargo.toml needed for these.
3030

31-
## Common Patterns
31+
## Exploring Your Own Crate
32+
33+
groxide gives you **semantically-scoped views** of code — query by item path, not
34+
file path. You get exactly the struct, function, or module you ask for, with doc
35+
comments included in the source. No need to know which file something lives in.
36+
37+
```sh
38+
grox # crate overview (run with no args)
39+
grox -rp -k mod # discover all modules (public + private)
40+
grox -rp # full API surface with signatures
41+
grox -rpb # structural skeleton (names only)
42+
grox -s mycrate::some::Type # source for one item (includes doc comments)
43+
grox -rps mycrate::render # full source of a module tree
44+
```
45+
46+
Use `-s` instead of `-d` — source code already contains `///` doc comments, so
47+
`-s` gives you docs and implementation in one view without duplication.
48+
49+
**Scaling to large codebases:** Use `grox -rp -k mod` to discover modules, then
50+
query individual modules with `grox -rps <module>`. Subagents can each take a
51+
module in parallel to quickly map out the codebase.
52+
53+
## Looking Up Dependencies
3254

3355
The examples below assume you are inside a Rust project that depends on the queried crates (e.g., `serde`, `tokio`). For stdlib and auto-fetch, see the dedicated sections below — those work anywhere.
3456

@@ -169,8 +191,8 @@ dependency resolution.
169191
| Flag | Short | Purpose |
170192
|------|-------|---------|
171193
| `--brief` | `-b` | Show only item names (compact output) |
172-
| `--docs` | `-d` | Show full rendered documentation per item |
173-
| `--source` | `-s` | Show source code (composable with `-d` for source + docs) |
194+
| `--docs` | `-d` | Show rendered documentation (without source). Agents: prefer `-s` instead |
195+
| `--source` | `-s` | Show source code with doc comments, file path, and line numbers |
174196
| `--search <Q>` | `-S` | Full-text search (`\|` for OR, space for AND) |
175197
| `--json` | `-j` | JSON Lines output |
176198
| `--kind <K>` | `-k` | Filter by kind: `fn`, `struct`, `enum`, `trait`, `type`, `const`, `mod`, `macro` |
@@ -208,10 +230,13 @@ User asks: "How do I read a file asynchronously with tokio?"
208230

209231
## Tips for Effective Use
210232

233+
- **Prefer `-s` over `-d` for agents.** Source code includes `///` doc comments,
234+
so `-s` gives you docs + implementation in one view. `-d` renders docs separately
235+
without source — useful for humans but redundant for agents.
211236
- **Start broad, then drill down.** Query the crate first (`grox tokio`), then
212237
a module (`grox tokio::sync`), then a type (`grox tokio::sync::Mutex`).
213238
- **Use `-r` to orient.** When you don't know what's in a module, `-r` gives
214-
a quick overview. Add `-b` for names only, `-d` for full docs.
239+
a quick overview. Add `-b` for names only, `-s` for full source.
215240
- **Use `--json` for structured data.** When you need to extract specific fields
216241
(signatures, method lists), JSON is more reliable to parse than plain text.
217242
- **Search before guessing paths.** If you're not sure of the exact path,

0 commit comments

Comments
 (0)