You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: skills/ccc/SKILL.md
+6-24Lines changed: 6 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,13 @@ description: "This skill should be used when code search is needed (whether expl
7
7
8
8
`ccc` is the CLI for CocoIndex Code, providing semantic search over the current codebase and index management.
9
9
10
-
## Prerequisites
10
+
## Ownership
11
11
12
-
The current project must be initialized before `ccc search` or `ccc index` can be used. If either command fails with an error about missing initialization or the tool not being found, refer to [management.md](references/management.md) for installation and initialization instructions.
12
+
The agent owns the `ccc` lifecycle for the current project — initialization, indexing, and searching. Do not ask the user to perform these steps; handle them automatically.
13
+
14
+
-**Initialization**: If `ccc search` or `ccc index` fails with an initialization error (e.g., "Not in an initialized project directory"), run `ccc init` from the project root directory, then `ccc index` to build the index, then retry the original command.
15
+
-**Index freshness**: Keep the index up to date by running `ccc index` (or `ccc search --refresh`) when the index may be stale — e.g., at the start of a session, or after making significant code changes (new files, refactors, renamed modules). There is no need to re-index between consecutive searches if no code was changed in between.
16
+
-**Installation**: If `ccc` itself is not found (command not found), refer to [management.md](references/management.md) for installation instructions and inform the user.
If all returned results look relevant, use `--offset` to fetch the next page — there are likely more useful matches beyond the first page.
53
57
54
-
### Refreshing the Index Before Search
55
-
56
-
To ensure the index reflects the latest code changes before searching:
57
-
58
-
```bash
59
-
ccc search --refresh <query terms>
60
-
```
61
-
62
-
This is equivalent to running `ccc index` followed by `ccc search`.
63
-
64
58
### Working with Search Results
65
59
66
60
Search results include file paths and line ranges. To explore a result in more detail:
67
61
68
62
- Use the editor's built-in file reading capabilities (e.g., the `Read` tool) to load the matched file and read lines around the returned range for full context.
69
63
- When working in a terminal without a file-reading tool, use `sed -n '<start>,<end>p' <file>` to extract a specific line range.
70
64
71
-
## Updating the Index
72
-
73
-
After making code changes, update the index to keep search results current:
74
-
75
-
```bash
76
-
ccc index
77
-
```
78
-
79
-
This blocks until indexing completes, showing progress. If indexing is already in progress, it waits for completion.
80
-
81
-
Run `ccc index` proactively after significant code changes (new files, refactors, renamed modules) to ensure subsequent searches return accurate results.
82
-
83
65
## Management & Troubleshooting
84
66
85
67
For installation, initialization, daemon management, troubleshooting, and cleanup commands, see [management.md](references/management.md).
0 commit comments