@handsupmin/gc-tree 0.8.19 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,16 +22,32 @@ gc-branch가 머신의 모든 저장소에 조용히 영향을 미쳐서는 안
22
22
 
23
23
  매핑되지 않은 저장소에서 `resolve`가 호출되면, 사용자가 해당 저장소에서 한 번만 계속할지, 항상 해당 gc-branch를 사용할지, 아니면 무시할지 결정할 수 있습니다.
24
24
 
25
- ## 3. `index.md`를 슬림하게 유지한다
25
+ ## 3. `index.md`를 슬림하고 키워드 풍부하게 유지한다
26
26
 
27
27
  최상위 `index.md`는 인덱스이지, 덤프가 아닙니다.
28
28
  도구와 사람이 올바른 소스 문서를 빠르게 찾을 수 있도록 돕는 것이 역할입니다.
29
- **2000자** 이하로 유지되어야 하며, 전체 지식을 인라인으로 복제하는 대신 링크 중심으로 구성되어야 합니다.
30
29
 
31
- ## 4. 소스 문서를 요약 우선으로 구성한다
30
+ 형식은 문서 경로 아래에 키워드를 그룹화하여 경로 항목이 반복되는 것을 없앱니다:
31
+
32
+ ```
33
+ - docs/workflows/db.md
34
+ - DB migration
35
+ - prisma schema
36
+ - poetry run rev
37
+ - model.py
38
+ ```
39
+
40
+ 이렇게 하면 인덱스를 간결하게 유지하면서 검색 범위를 최대화합니다. 모든 문서에는 가능한 많은 관련 키워드를 포함해야 합니다 — 별칭, 명령어 이름, 필드 이름, 약어, 관련 용어 등 — 어떤 합리적인 쿼리도 유용한 결과를 찾을 수 있도록.
41
+
42
+ ## 4. 소스 문서를 실행 가능한 내용이 담긴 요약 우선으로 구성한다
32
43
 
33
44
  모든 정보 소스 마크다운 문서는 상단 근처에 `## Summary` 섹션을 포함해야 합니다.
34
- 이는 다운스트림 도구에게 빠른 경로를 제공합니다: 먼저 짧은 버전을 읽고, 실제로 많은 상세 내용이 필요할 때만 확장합니다.
45
+ 섹션은 작업 전에 AI 컨텍스트에 주입되므로, 문서가 다루는 내용에 대한 설명이 아니라 **실제 패턴, 명령, 제약사항**을 포함해야 합니다.
46
+
47
+ 나쁜 요약: `"이 문서는 updateCollection 패턴을 설명합니다."`
48
+ 좋은 요약: `"updateCollection: { ...dto } spread 필수. return plainToInstance(Res, result satisfies Res). 새 필드 추가 = DTO → 서비스 → 컨트롤러 순서."`
49
+
50
+ 목차 항목처럼 읽히는 요약은 쓸모없습니다. AI는 이를 건너뛰고 바로 코드로 갑니다.
35
51
 
36
52
  ## 5. 온보딩을 명시적이고 안내된 방식으로 만든다
37
53
 
@@ -22,16 +22,32 @@ A gc-branch should not quietly affect every repository on the machine.
22
22
 
23
23
  If `resolve` is called from an unmapped repository, the user can decide whether to continue once, always use that gc-branch there, or ignore it there.
24
24
 
25
- ## 3. Keep `index.md` slim
25
+ ## 3. Keep `index.md` slim and keyword-rich
26
26
 
27
27
  The top-level `index.md` is an index, not a dump.
28
28
  Its job is to help tools and humans find the right source document quickly.
29
- It should stay under **2000 characters** and remain link-oriented instead of duplicating full knowledge inline.
30
29
 
31
- ## 4. Make source docs summary-first
30
+ The format groups keywords under each document path, eliminating repeated path entries:
31
+
32
+ ```
33
+ - docs/workflows/db.md
34
+ - DB migration
35
+ - prisma schema
36
+ - poetry run rev
37
+ - model.py
38
+ ```
39
+
40
+ This keeps the index compact while maximizing search surface. Every document should have as many relevant keywords as possible — aliases, command names, field names, acronyms, and related terms — so that any plausible query hits something useful.
41
+
42
+ ## 4. Make source docs summary-first with actionable content
32
43
 
33
44
  Every source-of-truth markdown document should include a `## Summary` section near the top.
34
- That gives downstream tools a fast path: read the short version first, then expand only when more detail is actually needed.
45
+ That section is injected into the AI context before every task — so it must contain **actual patterns, commands, and constraints**, not a description of what the document covers.
46
+
47
+ Bad summary: `"This document describes the updateCollection pattern."`
48
+ Good summary: `"updateCollection: spread { ...dto } into body. Return plainToInstance(Res, result satisfies Res). New field order: DTO → service → controller."`
49
+
50
+ A summary that reads like a table-of-contents entry is useless. The AI will skip it and go straight to code.
35
51
 
36
52
  ## 5. Make onboarding explicit and guided
37
53
 
@@ -22,16 +22,32 @@ gc-branch 不应该悄无声息地影响机器上的每一个代码仓库。
22
22
 
23
23
  如果从未映射的代码仓库调用 `resolve`,用户可以决定是继续一次、始终在该仓库使用此 gc-branch,还是在该仓库忽略它。
24
24
 
25
- ## 3. 保持 `index.md` 精简
25
+ ## 3. 保持 `index.md` 精简且关键词丰富
26
26
 
27
27
  顶层 `index.md` 是索引,而非内容转储。
28
28
  它的职责是帮助工具和人员快速找到正确的源文档。
29
- 它应保持在 **2000 字符**以内,以链接为主,而不是将完整知识内联复制进来。
30
29
 
31
- ## 4. 让源文档以摘要为先
30
+ 格式将关键词统一归在每个文档路径下,避免路径条目的重复:
31
+
32
+ ```
33
+ - docs/workflows/db.md
34
+ - DB migration
35
+ - prisma schema
36
+ - poetry run rev
37
+ - model.py
38
+ ```
39
+
40
+ 这样既能保持索引紧凑,又能最大化搜索覆盖面。每个文档都应尽可能包含多个相关关键词——别名、命令名、字段名、缩写及关联术语——确保任何合理的查询都能找到有用的结果。
41
+
42
+ ## 4. 让源文档以包含可执行内容的摘要为先
32
43
 
33
44
  每个作为可信来源的 Markdown 文档都应在靠近顶部的位置包含一个 `## Summary` 部分。
34
- 这为下游工具提供了一条快速路径:先读取简短版本,只有在真正需要更多细节时才展开阅读。
45
+ 该部分会在每次任务前注入 AI 上下文,因此必须包含**真实的模式、命令和约束**,而不是对文档内容的描述。
46
+
47
+ 不好的摘要:`"This document describes the updateCollection pattern."`
48
+ 好的摘要:`"updateCollection: spread { ...dto } into body. Return plainToInstance(Res, result satisfies Res). New field order: DTO → service → controller."`
49
+
50
+ 像目录条目一样的摘要毫无用处。AI 会直接跳过它去看代码。
35
51
 
36
52
  ## 5. 让 onboarding 明确且有引导
37
53
 
package/docs/usage.es.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Resumen
6
6
 
7
- Un flujo de trabajo estándar con `gctree` tiene este aspecto: inicializar gc-tree, elegir un proveedor, hacer onboarding de la gc-branch `main` predeterminada, hacer resolve del contexto que necesitas, crear nuevas gc-branches cuando el trabajo merece su propio carril, mapear los repositorios a las gc-branches correctas y usar actualizaciones guiadas para cambios duraderos más adelante.
7
+ Un flujo de trabajo estándar con `gctree` tiene este aspecto: inicializar gc-tree, elegir un proveedor, hacer onboarding de la gc-branch `main` predeterminada, hacer resolve del contexto que necesitas, crear nuevas gc-branches cuando el trabajo merece su propio carril, mapear los repositorios a las gc-branches correctas, usar actualizaciones guiadas para cambios duraderos de contexto y ejecutar `gctree update` cuando quieras refrescar la CLI y las integraciones de providers instaladas.
8
8
 
9
9
  ## Flujo de trabajo estándar
10
10
 
@@ -19,7 +19,8 @@ Un flujo de trabajo estándar con `gctree` tiene este aspecto: inicializar gc-tr
19
19
  9. crear o cambiar de gc-branch con `gctree checkout`
20
20
  10. ejecutar `gctree onboard` solo para una gc-branch vacía
21
21
  11. usar el mapeo de alcance del repositorio para que una gc-branch solo aplique donde corresponde
22
- 12. usar `gctree update-global-context` para cambios duraderos más adelante
22
+ 12. usar `gctree update-global-context` para cambios duraderos de contexto más adelante
23
+ 13. usar `gctree update` para actualizar gc-tree y reinstalar los providers instalados
23
24
 
24
25
  ## Comandos principales
25
26
 
@@ -41,6 +42,7 @@ Un flujo de trabajo estándar con `gctree` tiene este aspecto: inicializar gc-tr
41
42
  | `gctree update-global-context` | Iniciar una actualización duradera guiada para la gc-branch activa. |
42
43
  | `gctree update-gc` / `gctree ugc` | Alias para `gctree update-global-context`. |
43
44
  | `gctree scaffold --host <codex\|claude-code>` | Instalar un override local orientado al proveedor en un repositorio o workspace concreto. |
45
+ | `gctree update` | Actualizar gctree a la última versión de npm y reinstalar todos los providers previamente instalados. |
44
46
  | `gctree uninstall --yes` | Eliminar `~/.gctree` y la activación global de gctree. |
45
47
 
46
48
  ## Qué devuelve resolve
@@ -51,40 +53,22 @@ Un flujo de trabajo estándar con `gctree` tiene este aspecto: inicializar gc-tr
51
53
  gctree resolve --query "auth token rotation policy"
52
54
  ```
53
55
 
54
- ```json
55
- {
56
- "gc_branch": "main",
57
- "query": "auth token rotation policy",
58
- "status": "matched",
59
- "matches": [
60
- {
61
- "id": "auth",
62
- "title": "Auth & Session Conventions",
63
- "path": "docs/auth.md",
64
- "score": 4,
65
- "summary": "JWT rotation on every request, refresh tokens in httpOnly cookies, 15-min access token TTL",
66
- "excerpt": "## Auth Flow\nAccess token: 15-min TTL, rotated on every authenticated request...",
67
- "commands": {
68
- "show_doc": "gctree show-doc --id \"auth\" --home \"~/.gctree\" --branch \"main\"",
69
- "related": "gctree related --id \"auth\" --home \"~/.gctree\" --branch \"main\""
70
- }
71
- }
72
- ]
73
- }
56
+ ```
57
+ [gc-tree] 1 matching doc gc-branch="main" repo="my-repo"
58
+ [Auth & Session Conventions] JWT rotation on every request, refresh tokens in httpOnly cookies, 15-min access token TTL
59
+ [Auth & Session Conventions] show full doc: gctree show-doc --id "auth" --branch "main"
74
60
  ```
75
61
 
76
62
  El flujo recomendado es:
77
63
 
78
64
  1. `resolve` → índice compacto
79
- 2. `related` → documentos de apoyo alrededor de una coincidencia
80
- 3. `show-doc` → markdown completo solo cuando hace falta
65
+ 2. `show-doc` → markdown completo solo cuando hace falta
81
66
 
82
67
  La degradación elegante también es explícita:
83
68
 
84
- - gc-branch vacía → `status: "empty_branch"`
85
- - repo excluido → `status: "excluded"`
86
- - sin resultados → `status: "no_match"`
87
- - ID de documento inexistente → `status: "doc_not_found"`
69
+ - gc-branch vacía → mensaje en texto plano indicando que la gc-branch está vacía
70
+ - repo excluido → mensaje en texto plano indicando que el repo está excluido
71
+ - sin resultados → mensaje en texto plano indicando que no hay coincidencias
88
72
 
89
73
  ## Ejemplo de flujo de alcance del repositorio
90
74
 
@@ -128,7 +112,7 @@ Luego:
128
112
  ## Ejemplo de flujo con múltiples branches
129
113
 
130
114
  ```bash
131
- gctree checkout -b client-b
115
+ gctree checkout -b project-b
132
116
  gctree onboard
133
117
  gctree resolve --query "billing retry policy"
134
118
  ```
@@ -151,13 +135,21 @@ Si un repositorio recién relevante también debería pasar a formar parte del c
151
135
  1. mapear ese repositorio a la gc-branch
152
136
  2. luego ejecutar `update-global-context` para agregar conocimiento duradero sobre qué hace ese repositorio y por qué es importante
153
137
 
138
+ ## Ejemplo de flujo de actualización de la herramienta
139
+
140
+ ```bash
141
+ gctree update
142
+ ```
143
+
144
+ Esto actualiza `@handsupmin/gc-tree` a la última versión de npm y reinstala todos los providers ya instalados mediante `gctree init` o `gctree scaffold`. Es el comando de mantenimiento para cuando se publiquen nuevos hooks, comandos, skills o snippets de integración.
145
+
154
146
  ## Patrones de integración
155
147
 
156
148
  ### Codex CLI / Claude Code CLI
157
149
 
158
150
  `gctree init` instala la superficie global de hooks orientada al proveedor. `gctree scaffold` instala un override local en un directorio de destino cuando un repositorio concreto necesita sus propios snippets markdown o una superficie de comandos local.
159
151
 
160
- El hook UserPromptSubmit solo inyecta contexto previo compacto: estado found/no-match más títulos e IDs de documentos coincidentes. No incluye resúmenes ni excerpts largos por defecto; abre documentos completos con `gctree resolve --id <id>` cuando sea necesario.
152
+ El hook UserPromptSubmit inyecta los resúmenes de los documentos coincidentes directamente en el contexto antes de cada prompt — de modo que la IA ve patrones y comandos reales, no solo títulos. Cuando un resumen es corto o genérico, el hook recurre a un fragmento del cuerpo del documento. Los documentos completos siempre están disponibles bajo demanda con `gctree resolve --id <id>`.
161
153
 
162
154
  ```bash
163
155
  gctree scaffold --host codex --target /path/to/repo
package/docs/usage.ja.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## 概要
6
6
 
7
- 標準的な `gctree` の流れはこうです。gc-tree を初期化し、プロバイダーを選び、デフォルトの `main` gc-branch をオンボードし、必要なコンテキストを resolve で引き、作業に応じて新しい gc-branch を作り、リポジトリを適切な gc-branch に結び付け、後からの永続的な変更はガイド付き更新で反映していきます。
7
+ 標準的な `gctree` の流れはこうです。gc-tree を初期化し、プロバイダーを選び、デフォルトの `main` gc-branch をオンボードし、必要なコンテキストを resolve で引き、作業に応じて新しい gc-branch を作り、リポジトリを適切な gc-branch に結び付け、後からの永続的なコンテキスト変更はガイド付き更新で反映し、CLI とインストール済みプロバイダー統合を更新したいときは `gctree update` を実行します。
8
8
 
9
9
  ## 標準ワークフロー
10
10
 
@@ -19,7 +19,8 @@
19
19
  9. `gctree checkout` で gc-branch を作成または切り替える
20
20
  10. `gctree onboard` は空の gc-branch に対してだけ使う
21
21
  11. repo scope を設定して gc-branch が本来のリポジトリにだけ作用するようにする
22
- 12. 後からの永続的な変更には `gctree update-global-context` を使う
22
+ 12. 後からの永続的なコンテキスト変更には `gctree update-global-context` を使う
23
+ 13. gc-tree 自体とインストール済みプロバイダーを更新するには `gctree update` を使う
23
24
 
24
25
  ## 主要コマンド
25
26
 
@@ -41,6 +42,7 @@
41
42
  | `gctree update-global-context` | アクティブな gc-branch に対するガイド付き永続的更新を開始します。 |
42
43
  | `gctree update-gc` / `gctree ugc` | `gctree update-global-context` の別名です。 |
43
44
  | `gctree scaffold --host <codex\|claude-code>` | 1つのリポジトリやワークスペースにローカルなプロバイダー override をインストールします。 |
45
+ | `gctree update` | gctree を最新 npm バージョンに更新し、以前インストールしたすべてのプロバイダーを再スキャフォールドします。 |
44
46
  | `gctree uninstall --yes` | `~/.gctree` とグローバルな gctree 有効化を削除します。 |
45
47
 
46
48
  ## resolve が返す内容
@@ -51,40 +53,22 @@
51
53
  gctree resolve --query "auth token rotation policy"
52
54
  ```
53
55
 
54
- ```json
55
- {
56
- "gc_branch": "main",
57
- "query": "auth token rotation policy",
58
- "status": "matched",
59
- "matches": [
60
- {
61
- "id": "auth",
62
- "title": "Auth & Session Conventions",
63
- "path": "docs/auth.md",
64
- "score": 4,
65
- "summary": "JWT rotation on every request, refresh tokens in httpOnly cookies, 15-min access token TTL",
66
- "excerpt": "## Auth Flow\nAccess token: 15-min TTL, rotated on every authenticated request...",
67
- "commands": {
68
- "show_doc": "gctree show-doc --id \"auth\" --home \"~/.gctree\" --branch \"main\"",
69
- "related": "gctree related --id \"auth\" --home \"~/.gctree\" --branch \"main\""
70
- }
71
- }
72
- ]
73
- }
56
+ ```
57
+ [gc-tree] 1 matching doc gc-branch="main" repo="my-repo"
58
+ [Auth & Session Conventions] JWT rotation on every request, refresh tokens in httpOnly cookies, 15-min access token TTL
59
+ [Auth & Session Conventions] show full doc: gctree show-doc --id "auth" --branch "main"
74
60
  ```
75
61
 
76
62
  推奨フローは次のとおりです。
77
63
 
78
64
  1. `resolve` → compact index
79
- 2. `related` → その match の周辺にある supporting docs
80
- 3. `show-doc` → 必要なときだけフル markdown
65
+ 2. `show-doc` → 必要なときだけフル markdown
81
66
 
82
67
  Graceful degradation も明示的です。
83
68
 
84
- - 空の gc-branch → `status: "empty_branch"`
85
- - 除外された repo → `status: "excluded"`
86
- - ヒットなし → `status: "no_match"`
87
- - 文書 ID が見つからない → `status: "doc_not_found"`
69
+ - 空の gc-branch → gc-branch が空であることを示すプレーンテキストメッセージ
70
+ - 除外された repo → そのリポジトリが除外されていることを示すプレーンテキストメッセージ
71
+ - ヒットなし → 一致がなかったことを示すプレーンテキストメッセージ
88
72
 
89
73
  ## repo scope の設定例
90
74
 
@@ -128,7 +112,7 @@ gctree init
128
112
  ## 複数ブランチを使う例
129
113
 
130
114
  ```bash
131
- gctree checkout -b client-b
115
+ gctree checkout -b project-b
132
116
  gctree onboard
133
117
  gctree resolve --query "billing retry policy"
134
118
  ```
@@ -151,13 +135,21 @@ gctree ugc
151
135
  1. まずそのリポジトリを gc-branch にマップする
152
136
  2. その後 `update-global-context` を実行して、そのリポジトリが何を担い、なぜ重要なのかという永続的な知識を追加する
153
137
 
138
+ ## ツール更新の例
139
+
140
+ ```bash
141
+ gctree update
142
+ ```
143
+
144
+ `@handsupmin/gc-tree` を最新の npm バージョンに更新し、`gctree init` または `gctree scaffold` でインストール済みのすべてのプロバイダーを再スキャフォールドします。新しいフック、コマンド、スキル、統合スニペットが配布されたときに使うメンテナンスコマンドです。
145
+
154
146
  ## 統合パターン
155
147
 
156
148
  ### Codex CLI / Claude Code CLI
157
149
 
158
150
  `gctree init` はグローバルなプロバイダーフック面をインストールします。`gctree scaffold` は特定のリポジトリに独自の markdown スニペットやローカルなコマンド面が必要なときに、ターゲットディレクトリへローカル override をインストールします。
159
151
 
160
- UserPromptSubmit フックが注入するのは compact pre-task context だけです。found/no-match 状態と、マッチしたドキュメントのタイトル/ID を示します。要約や長い excerpt はデフォルトではインラインしません。必要な場合は `gctree resolve --id <id>` で全文を開きます。
152
+ UserPromptSubmit フックは、各プロンプト前にマッチしたドキュメントの要約をコンテキストに直接注入します AI がタイトルだけでなく実際のパターンとコマンドを見られるようにするためです。要約が短すぎるか一般的すぎる場合、フックはドキュメント本文の excerpt にフォールバックします。全文はいつでも `gctree resolve --id <id>` でオンデマンドに取得できます。
161
153
 
162
154
  ```bash
163
155
  gctree scaffold --host codex --target /path/to/repo
package/docs/usage.ko.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## 요약
6
6
 
7
- 표준 `gctree` 워크플로우는 다음과 같습니다: gc-tree 초기화, 프로바이더 선택, 기본 `main` gc-branch 온보딩, 필요한 컨텍스트 resolve, 작업별로 새 gc-branch 생성, 저장소를 올바른 gc-branch에 매핑, 이후 지속 변경 시 안내된 업데이트 사용.
7
+ 표준 `gctree` 워크플로우는 다음과 같습니다: gc-tree 초기화, 프로바이더 선택, 기본 `main` gc-branch 온보딩, 필요한 컨텍스트 resolve, 작업별로 새 gc-branch 생성, 저장소를 올바른 gc-branch에 매핑, 이후 지속 컨텍스트 변경 시 안내된 업데이트 사용, CLI와 설치된 프로바이더 통합을 새로고침할 때 `gctree update` 실행.
8
8
 
9
9
  ## 표준 워크플로우
10
10
 
@@ -19,7 +19,8 @@
19
19
  9. `gctree checkout`으로 gc-branch 생성 또는 전환
20
20
  10. 빈 gc-branch에만 `gctree onboard` 실행
21
21
  11. 저장소 범위 매핑으로 gc-branch가 해당하는 곳에만 적용되도록 설정
22
- 12. 이후 지속 변경에는 `gctree update-global-context` 사용
22
+ 12. 이후 지속 컨텍스트 변경에는 `gctree update-global-context` 사용
23
+ 13. gc-tree 자체와 설치된 프로바이더를 새로고침하려면 `gctree update` 사용
23
24
 
24
25
  ## 핵심 명령어
25
26
 
@@ -41,6 +42,7 @@
41
42
  | `gctree update-global-context` | 활성 gc-branch의 안내된 지속 업데이트 실행. |
42
43
  | `gctree update-gc` / `gctree ugc` | `gctree update-global-context`의 별칭. |
43
44
  | `gctree scaffold --host <codex\|claude-code>` | 특정 저장소나 워크스페이스에 로컬 프로바이더 override 설치. |
45
+ | `gctree update` | gctree를 최신 npm 버전으로 업데이트하고 이전에 설치된 모든 프로바이더를 재스캐폴드. |
44
46
  | `gctree uninstall --yes` | `~/.gctree`와 전역 gctree 활성화를 제거. |
45
47
 
46
48
  ## resolve가 반환하는 것
@@ -51,40 +53,22 @@
51
53
  gctree resolve --query "auth token rotation policy"
52
54
  ```
53
55
 
54
- ```json
55
- {
56
- "gc_branch": "main",
57
- "query": "auth token rotation policy",
58
- "status": "matched",
59
- "matches": [
60
- {
61
- "id": "auth",
62
- "title": "Auth & Session Conventions",
63
- "path": "docs/auth.md",
64
- "score": 4,
65
- "summary": "JWT rotation on every request, refresh tokens in httpOnly cookies, 15-min access token TTL",
66
- "excerpt": "## Auth Flow\nAccess token: 15-min TTL, rotated on every authenticated request...",
67
- "commands": {
68
- "show_doc": "gctree show-doc --id \"auth\" --home \"~/.gctree\" --branch \"main\"",
69
- "related": "gctree related --id \"auth\" --home \"~/.gctree\" --branch \"main\""
70
- }
71
- }
72
- ]
73
- }
56
+ ```
57
+ [gc-tree] 1 matching doc gc-branch="main" repo="my-repo"
58
+ [Auth & Session Conventions] JWT rotation on every request, refresh tokens in httpOnly cookies, 15-min access token TTL
59
+ [Auth & Session Conventions] show full doc: gctree show-doc --id "auth" --branch "main"
74
60
  ```
75
61
 
76
62
  권장 흐름은 다음과 같습니다:
77
63
 
78
64
  1. `resolve` → compact index
79
- 2. `related` → 특정 match 주변 supporting docs
80
- 3. `show-doc` → 필요할 때만 전체 markdown
65
+ 2. `show-doc` → 필요할 때만 전체 markdown
81
66
 
82
67
  Graceful degradation도 명시적입니다:
83
68
 
84
- - 빈 gc-branch → `status: "empty_branch"`
85
- - 제외된 repo → `status: "excluded"`
86
- - 결과 없음 → `status: "no_match"`
87
- - 문서 ID 없음 → `status: "doc_not_found"`
69
+ - 빈 gc-branch → gc-branch가 비어 있다는 일반 텍스트 메시지
70
+ - 제외된 repo → 해당 repo가 제외되어 있다는 일반 텍스트 메시지
71
+ - 결과 없음 → 매칭 결과가 없다는 일반 텍스트 메시지
88
72
 
89
73
  ## 저장소 범위 설정 예시 흐름
90
74
 
@@ -128,7 +112,7 @@ gctree init
128
112
  ## 다중 브랜치 예시 흐름
129
113
 
130
114
  ```bash
131
- gctree checkout -b client-b
115
+ gctree checkout -b project-b
132
116
  gctree onboard
133
117
  gctree resolve --query "billing retry policy"
134
118
  ```
@@ -151,13 +135,21 @@ gctree ugc
151
135
  1. 해당 저장소를 gc-branch에 매핑
152
136
  2. `update-global-context`를 실행하여 해당 저장소가 무엇을 하고 왜 중요한지에 대한 지속 지식 추가
153
137
 
138
+ ## 도구 업데이트 예시 흐름
139
+
140
+ ```bash
141
+ gctree update
142
+ ```
143
+
144
+ `@handsupmin/gc-tree`를 최신 npm 버전으로 업데이트하고, `gctree init` 또는 `gctree scaffold`로 이미 설치한 모든 프로바이더를 다시 스캐폴드합니다. 새 훅, 명령, 스킬, 통합 스니펫이 배포됐을 때 실행하는 유지보수 명령입니다.
145
+
154
146
  ## 통합 패턴
155
147
 
156
148
  ### Codex CLI / Claude Code CLI
157
149
 
158
150
  `gctree init`은 전역 프로바이더 훅 표면을 설치합니다. `gctree scaffold`는 특정 저장소에 자체 markdown 스니펫이나 로컬 명령 표면이 필요할 때 대상 디렉토리에 로컬 override를 설치합니다.
159
151
 
160
- UserPromptSubmit 훅은 compact pre-task context만 주입합니다: 찾음/no-match 상태와 매칭된 문서 제목/ID입니다. 기본적으로 요약이나 excerpt 인라인하지 않으며, 필요할 `gctree resolve --id <id>`로 전체 문서를 엽니다.
152
+ UserPromptSubmit 훅은 프롬프트 전에 매칭된 문서 요약을 컨텍스트에 직접 주입합니다 AI가 제목만이 아니라 실제 패턴과 명령을 볼 수 있도록. 요약이 짧거나 일반적인 경우, 훅은 문서 본문에서 excerpt 대체합니다. 전체 문서는 언제든 `gctree resolve --id <id>`로 필요할 확인할 수 있습니다.
161
153
 
162
154
  ```bash
163
155
  gctree scaffold --host codex --target /path/to/repo
package/docs/usage.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Summary
6
6
 
7
- A standard `gctree` workflow looks like this: initialize gc-tree, choose a provider, onboard the default `main` gc-branch, resolve the context you need, create new gc-branches when work deserves its own lane, map repositories to the right gc-branches, and use guided updates for durable changes later.
7
+ A standard `gctree` workflow looks like this: initialize gc-tree, choose a provider, onboard the default `main` gc-branch, resolve the context you need, create new gc-branches when work deserves its own lane, map repositories to the right gc-branches, use guided updates for durable context changes, and run `gctree update` when you want the CLI plus installed provider integrations refreshed.
8
8
 
9
9
  ## Standard workflow
10
10
 
@@ -19,7 +19,8 @@ A standard `gctree` workflow looks like this: initialize gc-tree, choose a provi
19
19
  9. create or switch gc-branches with `gctree checkout`
20
20
  10. run `gctree onboard` only for an empty gc-branch
21
21
  11. use repo scope mapping so a gc-branch only applies where it belongs
22
- 12. use `gctree update-global-context` for durable changes later
22
+ 12. use `gctree update-global-context` for durable context changes later
23
+ 13. use `gctree update` to update gc-tree itself and re-scaffold installed providers
23
24
 
24
25
  ## Core commands
25
26
 
@@ -41,6 +42,7 @@ A standard `gctree` workflow looks like this: initialize gc-tree, choose a provi
41
42
  | `gctree update-global-context` | Launch a guided durable update for the active gc-branch. |
42
43
  | `gctree update-gc` / `gctree ugc` | Aliases for `gctree update-global-context`. |
43
44
  | `gctree scaffold --host <codex\|claude-code>` | Install a local provider-facing override in one repository or workspace. |
45
+ | `gctree update` | Update gctree to the latest npm version and re-scaffold all previously installed providers. |
44
46
  | `gctree uninstall --yes` | Remove `~/.gctree` and the global gctree activation for the configured providers. |
45
47
 
46
48
  ## What resolve returns
@@ -51,40 +53,22 @@ A standard `gctree` workflow looks like this: initialize gc-tree, choose a provi
51
53
  gctree resolve --query "auth token rotation policy"
52
54
  ```
53
55
 
54
- ```json
55
- {
56
- "gc_branch": "main",
57
- "query": "auth token rotation policy",
58
- "status": "matched",
59
- "matches": [
60
- {
61
- "id": "auth",
62
- "title": "Auth & Session Conventions",
63
- "path": "docs/auth.md",
64
- "score": 4,
65
- "summary": "JWT rotation on every request, refresh tokens in httpOnly cookies, 15-min access token TTL",
66
- "excerpt": "## Auth Flow\nAccess token: 15-min TTL, rotated on every authenticated request...",
67
- "commands": {
68
- "show_doc": "gctree show-doc --id \"auth\" --home \"~/.gctree\" --branch \"main\"",
69
- "related": "gctree related --id \"auth\" --home \"~/.gctree\" --branch \"main\""
70
- }
71
- }
72
- ]
73
- }
56
+ ```
57
+ [gc-tree] 1 matching doc gc-branch="main" repo="my-repo"
58
+ [Auth & Session Conventions] JWT rotation on every request, refresh tokens in httpOnly cookies, 15-min access token TTL
59
+ [Auth & Session Conventions] show full doc: gctree show-doc --id "auth" --branch "main"
74
60
  ```
75
61
 
76
62
  The intended flow is:
77
63
 
78
- 1. `resolve` → compact index
79
- 2. `related` → supporting docs around one match
80
- 3. `show-doc` → full markdown only when needed
64
+ 1. `resolve` → compact text output with summary injected
65
+ 2. `show-doc` → full markdown only when needed
81
66
 
82
- Graceful degradation is explicit:
67
+ Graceful degradation is explicit — each case returns a plain text message:
83
68
 
84
- - empty gc-branch → `status: "empty_branch"`
85
- - excluded repo → `status: "excluded"`
86
- - no hits → `status: "no_match"`
87
- - missing doc id → `status: "doc_not_found"`
69
+ - empty gc-branch → `[gc-tree] No context found — gc-branch is empty.`
70
+ - excluded repo → `[gc-tree] Repo "..." is excluded from gc-branch "...".`
71
+ - no hits → `[gc-tree] No matching documents found.`
88
72
 
89
73
  ## Example repo-scope flow
90
74
 
@@ -128,7 +112,7 @@ Then:
128
112
  ## Example multi-branch flow
129
113
 
130
114
  ```bash
131
- gctree checkout -b client-b
115
+ gctree checkout -b project-b
132
116
  gctree onboard
133
117
  gctree resolve --query "billing retry policy"
134
118
  ```
@@ -151,13 +135,21 @@ If a newly relevant repo should also become part of the durable context, the nat
151
135
  1. map that repo to the gc-branch
152
136
  2. then run `update-global-context` to add durable knowledge about what that repo does and why it matters
153
137
 
138
+ ## Example tool update flow
139
+
140
+ ```bash
141
+ gctree update
142
+ ```
143
+
144
+ This updates `@handsupmin/gc-tree` to the latest npm version and re-scaffolds every provider already installed through `gctree init` or `gctree scaffold`. It is the maintenance command to run when new provider hooks, commands, skills, or integration snippets ship.
145
+
154
146
  ## Integration patterns
155
147
 
156
148
  ### Codex CLI / Claude Code CLI
157
149
 
158
150
  `gctree init` installs the provider-facing hook surface globally. `gctree scaffold` installs a local override into one target directory when a specific repository needs its own markdown snippets or local command surface.
159
151
 
160
- The UserPromptSubmit hook injects compact pre-task context only: found/no-match state plus matched document titles and IDs. It does not inline summaries or long excerpts by default; open full documents with `gctree resolve --id <id>` when needed.
152
+ The UserPromptSubmit hook injects matched document summaries directly into context before each prompt so the AI sees actual patterns and commands, not just titles. When a summary is short or generic, the hook falls back to an excerpt from the document body. Full documents are always available on demand with `gctree resolve --id <id>`.
161
153
 
162
154
  ```bash
163
155
  gctree scaffold --host codex --target /path/to/repo