Skip to content

Commit f1adbb8

Browse files
tae2089claude
andcommitted
chore: remove the ccg index command (subset of ccg docs)
`ccg index` only regenerated index.md — exactly what `ccg docs` already writes as part of full generation. The dedicated command duplicated a slice of docs generation with no unique capability. - delete internal/cli/index.go (+ index_test.go) and its root.go registration - remove the now-unused docs.Generator.RunIndex (writeIndex/validateDocGroups stay — still used by Generator.Run) - migrate the two integration-test steps that ran `index` to `docs` (which also writes index.md, so the index.md assertions still hold) - sweep CLI-reference / namespace-migration / skills docs Verified with the real binary: `ccg index` is gone (unknown command) and `ccg docs` writes index.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e80f34e commit f1adbb8

11 files changed

Lines changed: 4 additions & 219 deletions

File tree

.claude/skills/ccg-docs/SKILL.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Generate Markdown documentation from code graphs, build RAG indexes for AI consu
1212
| Command | Description | Example |
1313
|---------|-------------|---------|
1414
| `docs [--out dir]` | Generate Markdown documentation | `ccg docs --out docs` |
15-
| `index [--out dir]` | Regenerate index.md only | `ccg index` |
1615
| `lint [--out dir]` | 8-category docs lint | `ccg lint` |
1716
| `lint --strict` | Exit 1 on issues (for CI/pre-commit) | `ccg lint --strict` |
1817
| `hooks install` | Install pre-commit git hook | `ccg hooks install` |

guide/cli-reference.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ ccg update ./backend --namespace backend
5050
| `ccg docs --rag-index-dir <dir>` | Override the `doc-index.json` and `wiki-index.json` output directory (default `.ccg` or `rag.index_dir`) |
5151
| `ccg docs --prune=false` | Regenerate docs without deleting older generator-managed files |
5252
| `ccg docs --exclude <pat>` | Exclude files/paths from generated docs (repeatable) |
53-
| `ccg index [--out dir]` | Regenerate `index.md` only |
5453
| `ccg rag-index [--out dir]` | Rebuild RAG index from generated docs and already-computed community structure |
5554
| `ccg languages` | List supported languages and extensions |
5655
| `ccg example [language]` | Show annotation writing example |

guide/ko/cli-reference.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ ccg update ./backend --namespace backend
5252
| `ccg docs --rag-index-dir <dir>` | `doc-index.json``wiki-index.json` 출력 디렉터리 지정 (기본 `.ccg` 또는 `rag.index_dir`) |
5353
| `ccg docs --prune=false` | 기존 generator-managed 문서를 삭제하지 않고 문서만 다시 생성 |
5454
| `ccg docs --exclude <pat>` | 문서 생성 대상에서 파일/경로 제외 (반복 가능) |
55-
| `ccg index [--out dir]` | `index.md`만 재생성 |
5655
| `ccg rag-index [--out dir]` | 생성된 문서와 이미 계산된 커뮤니티 구조 기반 RAG 인덱스 재생성 |
5756
| `ccg languages` | 지원되는 언어 및 확장자 목록 출력 |
5857
| `ccg example [language]` | 어노테이션 작성 예시 출력 |

guide/ko/namespace-migration.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ CLI와 MCP 도구 간의 일관성을 높이기 위해 기본 네임스페이스
1515
네임스페이스를 지정하지 않았을 때 모든 네임스페이스를 스캔하던 암시적인 동작이 다음 경로에서 제거되었습니다:
1616
- `status`
1717
- `docs`
18-
- `index`
1918
- `lint`
2019
- `eval`
2120
- 모든 MCP 관련 도구 경로

guide/namespace-migration.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ The default namespace is now literally `"default"`. Previously, an unset namespa
1313
Implicit whole-database reads (scanning all namespaces when none is specified) have been removed from the following paths:
1414
- `status`
1515
- `docs`
16-
- `index`
1716
- `lint`
1817
- `eval`
1918
- All MCP-related tool paths

internal/cli/index.go

Lines changed: 0 additions & 55 deletions
This file was deleted.

internal/cli/index_test.go

Lines changed: 0 additions & 127 deletions
This file was deleted.

internal/cli/integration_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ func Lib() {}
105105
// Index with exclusion
106106
outDir := t.TempDir()
107107
stdout.Reset()
108-
if err := executeCmd(deps, stdout, stderr, "index", "--out", outDir, "--exclude", "vendor"); err != nil {
109-
t.Fatalf("index: %v", err)
108+
if err := executeCmd(deps, stdout, stderr, "docs", "--out", outDir, "--exclude", "vendor"); err != nil {
109+
t.Fatalf("docs: %v", err)
110110
}
111111

112112
content, err := os.ReadFile(filepath.Join(outDir, "index.md"))
@@ -145,8 +145,8 @@ func Inner() {}
145145

146146
outDir := t.TempDir()
147147
stdout.Reset()
148-
if err := executeCmd(deps, stdout, stderr, "index", "--out", outDir); err != nil {
149-
t.Fatalf("index: %v", err)
148+
if err := executeCmd(deps, stdout, stderr, "docs", "--out", outDir); err != nil {
149+
t.Fatalf("docs: %v", err)
150150
}
151151

152152
content, err := os.ReadFile(filepath.Join(outDir, "index.md"))

internal/cli/root.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ func NewRootCmd(deps *Deps) *cobra.Command {
158158
newExampleCmd(deps),
159159
newTagsCmd(deps),
160160
newHooksCmd(deps),
161-
newIndexCmd(deps),
162161
newLintCmd(deps),
163162
newVersionCmd(deps),
164163
)

internal/docs/generator.go

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -83,32 +83,6 @@ func (g *Generator) Run() error {
8383
return errors.Join(errs...)
8484
}
8585

86-
// RunIndex regenerates only index.md without rewriting per-file docs.
87-
// @intent 개별 문서를 유지한 채 파일 인덱스만 빠르게 갱신한다.
88-
// @sideEffect 출력 디렉터리의 index.md를 다시 기록한다.
89-
func (g *Generator) RunIndex() error {
90-
nodes, annByID, err := g.loadNodes()
91-
if err != nil {
92-
return fmt.Errorf("load nodes: %w", err)
93-
}
94-
95-
if len(g.Exclude) > 0 {
96-
filtered := nodes[:0]
97-
for _, n := range nodes {
98-
if !pathutil.MatchExcludes(g.Exclude, n.FilePath) {
99-
filtered = append(filtered, n)
100-
}
101-
}
102-
nodes = filtered
103-
}
104-
105-
groups := groupByFile(nodes, annByID, nil)
106-
if err := g.validateDocGroups(groups); err != nil {
107-
return err
108-
}
109-
return g.writeIndex(groups)
110-
}
111-
11286
// validateDocGroups checks that every group's output path is safe before writing begins.
11387
// @intent prevent path-traversal writes before any file I/O is attempted
11488
func (g *Generator) validateDocGroups(groups []nodeGroup) error {

0 commit comments

Comments
 (0)