@handsupmin/gc-tree 0.1.4 → 0.2.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.
- package/README.es.md +135 -119
- package/README.ja.md +136 -120
- package/README.ko.md +137 -121
- package/README.md +134 -118
- package/README.zh.md +140 -123
- package/dist/src/resolve.js +40 -6
- package/docs/concept.es.md +45 -33
- package/docs/concept.ja.md +41 -29
- package/docs/concept.ko.md +48 -36
- package/docs/concept.md +13 -1
- package/docs/concept.zh.md +48 -36
- package/docs/local-development.es.md +44 -22
- package/docs/local-development.ja.md +40 -18
- package/docs/local-development.ko.md +47 -25
- package/docs/local-development.md +27 -5
- package/docs/local-development.zh.md +27 -5
- package/docs/principles.es.md +39 -26
- package/docs/principles.ja.md +26 -13
- package/docs/principles.ko.md +40 -27
- package/docs/principles.md +15 -2
- package/docs/principles.zh.md +42 -29
- package/docs/usage.es.md +98 -50
- package/docs/usage.ja.md +71 -23
- package/docs/usage.ko.md +100 -52
- package/docs/usage.md +51 -3
- package/docs/usage.zh.md +95 -47
- package/package.json +11 -2
package/docs/usage.es.md
CHANGED
|
@@ -4,45 +4,71 @@
|
|
|
4
4
|
|
|
5
5
|
## Resumen
|
|
6
6
|
|
|
7
|
-
Un flujo estándar con `gctree`
|
|
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.
|
|
8
8
|
|
|
9
|
-
## Flujo estándar
|
|
9
|
+
## Flujo de trabajo estándar
|
|
10
10
|
|
|
11
|
-
1.
|
|
12
|
-
2.
|
|
13
|
-
3.
|
|
14
|
-
4. si elegiste `both`,
|
|
15
|
-
5.
|
|
16
|
-
6.
|
|
17
|
-
7.
|
|
18
|
-
8.
|
|
19
|
-
9.
|
|
20
|
-
10.
|
|
11
|
+
1. ejecutar `gctree init`
|
|
12
|
+
2. elegir el modo de proveedor preferido (`claude-code`, `codex` o `both`)
|
|
13
|
+
3. elegir el idioma de trabajo (`English`, `Korean` o un idioma personalizado)
|
|
14
|
+
4. si elegiste `both`, elegir qué proveedor debe iniciar el onboarding ahora
|
|
15
|
+
5. completar el onboarding guiado para la gc-branch `main` predeterminada
|
|
16
|
+
6. hacer resolve del contexto relevante con `gctree resolve --query "..."`
|
|
17
|
+
7. crear o cambiar de gc-branch con `gctree checkout`
|
|
18
|
+
8. ejecutar `gctree onboard` solo para una gc-branch vacía
|
|
19
|
+
9. usar el mapeo de alcance del repositorio para que una gc-branch solo aplique donde corresponde
|
|
20
|
+
10. usar `gctree update-global-context` para cambios duraderos más adelante
|
|
21
21
|
|
|
22
|
-
## Comandos
|
|
22
|
+
## Comandos principales
|
|
23
23
|
|
|
24
24
|
| Comando | Propósito |
|
|
25
25
|
| --- | --- |
|
|
26
|
-
| `gctree init` |
|
|
27
|
-
| `gctree checkout <branch>` |
|
|
28
|
-
| `gctree checkout -b <branch>` |
|
|
29
|
-
| `gctree branches` |
|
|
30
|
-
| `gctree status` |
|
|
31
|
-
| `gctree resolve --query TEXT` |
|
|
32
|
-
| `gctree repo-map` |
|
|
33
|
-
| `gctree set-repo-scope --branch <name> --include` |
|
|
34
|
-
| `gctree set-repo-scope --branch <name> --exclude` |
|
|
35
|
-
| `gctree onboard` |
|
|
36
|
-
| `gctree reset-gc-branch --branch <name> --yes` |
|
|
37
|
-
| `gctree update-global-context` |
|
|
38
|
-
| `gctree update-gc` / `gctree ugc` | Alias
|
|
39
|
-
| `gctree scaffold --host <codex
|
|
40
|
-
|
|
41
|
-
##
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
26
|
+
| `gctree init` | Crear `~/.gctree`, crear la gc-branch `main` predeterminada, guardar el modo de proveedor, el proveedor de onboarding y el idioma preferido, hacer scaffold del entorno actual y comenzar el onboarding guiado cuando `main` está vacía. |
|
|
27
|
+
| `gctree checkout <branch>` | Cambiar la gc-branch activa. |
|
|
28
|
+
| `gctree checkout -b <branch>` | Crear y cambiar a una nueva gc-branch vacía. |
|
|
29
|
+
| `gctree branches` | Listar las gc-branches disponibles y mostrar la activa. |
|
|
30
|
+
| `gctree status` | Mostrar la gc-branch activa, el repositorio actual, el estado del alcance del repositorio actual, advertencias y el proveedor preferido. |
|
|
31
|
+
| `gctree resolve --query TEXT` | Buscar contexto en la gc-branch relevante. Si el repositorio actual no está mapeado, `gctree` puede preguntar cómo debe tratarse ese repositorio. |
|
|
32
|
+
| `gctree repo-map` | Mostrar el contenido actual de `branch-repo-map.json`. |
|
|
33
|
+
| `gctree set-repo-scope --branch <name> --include` | Marcar el repositorio actual como incluido para esa gc-branch. |
|
|
34
|
+
| `gctree set-repo-scope --branch <name> --exclude` | Marcar el repositorio actual como ignorado para esa gc-branch. |
|
|
35
|
+
| `gctree onboard` | Iniciar el onboarding guiado para la gc-branch activa. Solo funciona cuando esa gc-branch está vacía. |
|
|
36
|
+
| `gctree reset-gc-branch --branch <name> --yes` | Limpiar una gc-branch para poder hacer onboarding de nuevo. |
|
|
37
|
+
| `gctree update-global-context` | Iniciar una actualización duradera guiada para la gc-branch activa. |
|
|
38
|
+
| `gctree update-gc` / `gctree ugc` | Alias para `gctree update-global-context`. |
|
|
39
|
+
| `gctree scaffold --host <codex\|claude-code>` | Instalar la interfaz de comandos orientada al proveedor en otro entorno. |
|
|
40
|
+
|
|
41
|
+
## Qué devuelve resolve
|
|
42
|
+
|
|
43
|
+
`gctree resolve` puntúa cada documento de la gc-branch activa contra tu consulta y devuelve solo los que coinciden. Las coincidencias en el título cuentan el doble que las coincidencias en el cuerpo.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
gctree resolve --query "auth token rotation policy"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"gc_branch": "main",
|
|
52
|
+
"query": "auth token rotation policy",
|
|
53
|
+
"matches": [
|
|
54
|
+
{
|
|
55
|
+
"title": "Auth & Session Conventions",
|
|
56
|
+
"path": "docs/auth.md",
|
|
57
|
+
"score": 4,
|
|
58
|
+
"summary": "JWT rotation on every request, refresh tokens in httpOnly cookies, 15-min access token TTL",
|
|
59
|
+
"excerpt": "## Auth Flow\nAccess token: 15-min TTL, rotated on every authenticated request..."
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
La herramienta recibe primero el resumen y el fragmento. Lee el documento completo en `path` solo cuando el resumen no es suficiente. Una consulta que no coincide con nada devuelve `"matches": []`.
|
|
66
|
+
|
|
67
|
+
## Ejemplo de flujo de alcance del repositorio
|
|
68
|
+
|
|
69
|
+
Supongamos que la gc-branch `A` es relevante para los repositorios `B`, `C` y `D`, pero no para `F`.
|
|
70
|
+
|
|
71
|
+
Puedes gestionarlo mediante:
|
|
46
72
|
|
|
47
73
|
```json
|
|
48
74
|
{
|
|
@@ -53,19 +79,19 @@ Puedes gestionarlo así:
|
|
|
53
79
|
}
|
|
54
80
|
```
|
|
55
81
|
|
|
56
|
-
|
|
82
|
+
almacenado en:
|
|
57
83
|
|
|
58
84
|
```text
|
|
59
85
|
~/.gctree/branch-repo-map.json
|
|
60
86
|
```
|
|
61
87
|
|
|
62
|
-
Cuando
|
|
88
|
+
Cuando `resolve` se ejecuta desde el repositorio `E` y la branch `A` todavía no está mapeada allí, `gctree` puede preguntar si:
|
|
63
89
|
|
|
64
|
-
1. continuar
|
|
90
|
+
1. continuar una vez
|
|
65
91
|
2. usar siempre `A` en `E`
|
|
66
92
|
3. ignorar `A` en `E`
|
|
67
93
|
|
|
68
|
-
## Ejemplo de primera ejecución
|
|
94
|
+
## Ejemplo de flujo en la primera ejecución
|
|
69
95
|
|
|
70
96
|
```bash
|
|
71
97
|
gctree init
|
|
@@ -73,11 +99,11 @@ gctree init
|
|
|
73
99
|
|
|
74
100
|
Luego:
|
|
75
101
|
|
|
76
|
-
1.
|
|
77
|
-
2.
|
|
78
|
-
3.
|
|
102
|
+
1. elegir `codex` o `claude-code`
|
|
103
|
+
2. dejar que `gctree` haga scaffold del entorno actual
|
|
104
|
+
3. completar el onboarding guiado para la gc-branch `main`
|
|
79
105
|
|
|
80
|
-
## Ejemplo con
|
|
106
|
+
## Ejemplo de flujo con múltiples branches
|
|
81
107
|
|
|
82
108
|
```bash
|
|
83
109
|
gctree checkout -b client-b
|
|
@@ -85,7 +111,7 @@ gctree onboard
|
|
|
85
111
|
gctree resolve --query "billing retry policy"
|
|
86
112
|
```
|
|
87
113
|
|
|
88
|
-
## Ejemplo de actualización
|
|
114
|
+
## Ejemplo de flujo de actualización
|
|
89
115
|
|
|
90
116
|
```bash
|
|
91
117
|
gctree update-global-context
|
|
@@ -98,24 +124,46 @@ gctree update-gc
|
|
|
98
124
|
gctree ugc
|
|
99
125
|
```
|
|
100
126
|
|
|
101
|
-
Si un
|
|
127
|
+
Si un repositorio recién relevante también debería pasar a formar parte del contexto duradero, el flujo natural es:
|
|
102
128
|
|
|
103
|
-
1.
|
|
104
|
-
2.
|
|
129
|
+
1. mapear ese repositorio a la gc-branch
|
|
130
|
+
2. luego ejecutar `update-global-context` para agregar conocimiento duradero sobre qué hace ese repositorio y por qué es importante
|
|
105
131
|
|
|
106
132
|
## Patrones de integración
|
|
107
133
|
|
|
108
134
|
### Codex CLI / Claude Code CLI
|
|
109
135
|
|
|
110
|
-
`gctree scaffold` instala
|
|
111
|
-
Esos comandos deberían mencionar de forma explícita cuál es el gc-branch activo antes de empezar a recopilar o aplicar contexto duradero, y también deberían seguir usando el idioma guardado salvo que la persona usuaria pida cambiarlo.
|
|
136
|
+
`gctree scaffold` instala archivos de comandos orientados al proveedor en el directorio de destino.
|
|
112
137
|
|
|
113
138
|
```bash
|
|
114
139
|
gctree scaffold --host codex --target /path/to/repo
|
|
115
140
|
gctree scaffold --host claude-code --target /path/to/repo
|
|
141
|
+
gctree scaffold --host both --target /path/to/repo
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Archivos escritos para `--host codex`:**
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
AGENTS.md ← fragmento de gctree añadido a las instrucciones del agente
|
|
148
|
+
.codex/prompts/gctree-bootstrap.md ← contexto de arranque para las sesiones de Codex
|
|
149
|
+
.codex/skills/gc-resolve-context/SKILL.md ← skill de resolve
|
|
150
|
+
.codex/skills/gc-onboard/SKILL.md ← skill de onboarding
|
|
151
|
+
.codex/skills/gc-update-global-context/SKILL.md ← skill de actualización
|
|
116
152
|
```
|
|
117
153
|
|
|
118
|
-
|
|
154
|
+
**Archivos escritos para `--host claude-code`:**
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
CLAUDE.md ← fragmento de gctree añadido
|
|
158
|
+
.claude/hooks/gctree-session-start.md ← hook de inicio de sesión
|
|
159
|
+
.claude/commands/gc-resolve-context.md ← comando slash de resolve
|
|
160
|
+
.claude/commands/gc-onboard.md ← comando slash de onboard
|
|
161
|
+
.claude/commands/gc-update-global-context.md ← comando slash de actualización
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Los archivos existentes no se modifican a menos que pases `--force`.
|
|
165
|
+
|
|
166
|
+
### Comportamiento en tiempo de ejecución
|
|
119
167
|
|
|
120
|
-
|
|
121
|
-
|
|
168
|
+
La gc-branch activa es la apuntada por `HEAD` dentro de `~/.gctree`, pero el mapeo del repositorio puede anular ese valor predeterminado cuando un repositorio está vinculado explícitamente a otra gc-branch.
|
|
169
|
+
Esto hace que gc-tree sea práctico para usuarios avanzados que mantienen muchas sesiones no relacionadas abiertas al mismo tiempo.
|
package/docs/usage.ja.md
CHANGED
|
@@ -2,47 +2,73 @@
|
|
|
2
2
|
|
|
3
3
|
[English](usage.md) | [한국어](usage.ko.md) | [简体中文](usage.zh.md) | [日本語](usage.ja.md) | [Español](usage.es.md)
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 概要
|
|
6
6
|
|
|
7
|
-
標準的な `gctree` の流れはこうです。gc-tree
|
|
7
|
+
標準的な `gctree` の流れはこうです。gc-tree を初期化し、プロバイダーを選び、デフォルトの `main` gc-branch をオンボードし、必要なコンテキストを resolve で引き、作業に応じて新しい gc-branch を作り、リポジトリを適切な gc-branch に結び付け、後からの永続的な変更はガイド付き更新で反映していきます。
|
|
8
8
|
|
|
9
9
|
## 標準ワークフロー
|
|
10
10
|
|
|
11
11
|
1. `gctree init` を実行する
|
|
12
|
-
2.
|
|
12
|
+
2. 好みのプロバイダーモードを選ぶ(`claude-code`、`codex`、`both`)
|
|
13
13
|
3. ワークフロー言語を選ぶ(`English`、`Korean`、またはカスタム言語)
|
|
14
|
-
4. `both`
|
|
14
|
+
4. `both` を選んだ場合は、今回のオンボーディングをどちらのプロバイダーで始めるか選ぶ
|
|
15
15
|
5. デフォルトの `main` gc-branch に対するガイド付きオンボーディングを完了する
|
|
16
16
|
6. `gctree resolve --query "..."` で必要なコンテキストを取り出す
|
|
17
|
-
7. `gctree checkout` で gc-branch
|
|
17
|
+
7. `gctree checkout` で gc-branch を作成または切り替える
|
|
18
18
|
8. `gctree onboard` は空の gc-branch に対してだけ使う
|
|
19
|
-
9. repo scope を設定して gc-branch
|
|
20
|
-
10.
|
|
19
|
+
9. repo scope を設定して gc-branch が本来のリポジトリにだけ作用するようにする
|
|
20
|
+
10. 後からの永続的な変更には `gctree update-global-context` を使う
|
|
21
21
|
|
|
22
22
|
## 主要コマンド
|
|
23
23
|
|
|
24
24
|
| コマンド | 役割 |
|
|
25
25
|
| --- | --- |
|
|
26
|
-
| `gctree init` | `~/.gctree` を作成し、デフォルトの `main` gc-branch
|
|
26
|
+
| `gctree init` | `~/.gctree` を作成し、デフォルトの `main` gc-branch を作り、プロバイダーモード・オンボーディングプロバイダー・優先言語を保存し、現在の環境を scaffold し、`main` が空ならガイド付きオンボーディングまで開始します。 |
|
|
27
27
|
| `gctree checkout <branch>` | アクティブな gc-branch を切り替えます。 |
|
|
28
28
|
| `gctree checkout -b <branch>` | 新しい空の gc-branch を作成し、そのまま切り替えます。 |
|
|
29
29
|
| `gctree branches` | 利用可能な gc-branch 一覧と、現在アクティブなものを表示します。 |
|
|
30
|
-
| `gctree status` | アクティブな gc-branch、現在のリポジトリ、現在の repo-scope
|
|
30
|
+
| `gctree status` | アクティブな gc-branch、現在のリポジトリ、現在の repo-scope 状態、警告、優先プロバイダーを表示します。 |
|
|
31
31
|
| `gctree resolve --query TEXT` | 関係する gc-branch からコンテキストを検索します。現在のリポジトリが未マップなら、そのリポジトリをどう扱うかを尋ねる場合があります。 |
|
|
32
32
|
| `gctree repo-map` | 現在の `branch-repo-map.json` の内容を表示します。 |
|
|
33
33
|
| `gctree set-repo-scope --branch <name> --include` | 現在のリポジトリを、その gc-branch に含まれるものとして記録します。 |
|
|
34
34
|
| `gctree set-repo-scope --branch <name> --exclude` | 現在のリポジトリを、その gc-branch では無視するものとして記録します。 |
|
|
35
35
|
| `gctree onboard` | アクティブな gc-branch に対するガイド付きオンボーディングを開始します。空の gc-branch でのみ動作します。 |
|
|
36
|
-
| `gctree reset-gc-branch --branch <name> --yes` | gc-branch
|
|
37
|
-
| `gctree update-global-context` | アクティブな gc-branch
|
|
36
|
+
| `gctree reset-gc-branch --branch <name> --yes` | gc-branch を空にして再オンボード可能な状態にします。 |
|
|
37
|
+
| `gctree update-global-context` | アクティブな gc-branch に対するガイド付き永続的更新を開始します。 |
|
|
38
38
|
| `gctree update-gc` / `gctree ugc` | `gctree update-global-context` の別名です。 |
|
|
39
|
-
| `gctree scaffold --host <codex
|
|
39
|
+
| `gctree scaffold --host <codex\|claude-code>` | 別の環境にプロバイダー向けコマンド面をインストールします。 |
|
|
40
40
|
|
|
41
|
-
##
|
|
41
|
+
## resolve が返す内容
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
`gctree resolve` はアクティブな gc-branch 内のすべてのドキュメントをクエリに対してスコアリングし、マッチしたものだけを返します。タイトルの一致はボディの一致の 2 倍の重みを持ちます。
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
```bash
|
|
46
|
+
gctree resolve --query "auth token rotation policy"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"gc_branch": "main",
|
|
52
|
+
"query": "auth token rotation policy",
|
|
53
|
+
"matches": [
|
|
54
|
+
{
|
|
55
|
+
"title": "Auth & Session Conventions",
|
|
56
|
+
"path": "docs/auth.md",
|
|
57
|
+
"score": 4,
|
|
58
|
+
"summary": "JWT rotation on every request, refresh tokens in httpOnly cookies, 15-min access token TTL",
|
|
59
|
+
"excerpt": "## Auth Flow\nAccess token: 15-min TTL, rotated on every authenticated request..."
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
ツールはまずサマリーと抜粋を受け取ります。サマリーだけでは不足する場合にのみ、`path` にあるフルドキュメントを読み込みます。何もマッチしないクエリの場合は `"matches": []` が返ります。
|
|
66
|
+
|
|
67
|
+
## repo scope の設定例
|
|
68
|
+
|
|
69
|
+
gc-branch `A` がリポジトリ `B`・`C`・`D` には関係し、`F` には関係しないとします。
|
|
70
|
+
|
|
71
|
+
その場合は次のように管理できます。
|
|
46
72
|
|
|
47
73
|
```json
|
|
48
74
|
{
|
|
@@ -59,7 +85,7 @@ gc-branch `A` が repo `B`、`C`、`D` には関係し、`F` には関係しな
|
|
|
59
85
|
~/.gctree/branch-repo-map.json
|
|
60
86
|
```
|
|
61
87
|
|
|
62
|
-
|
|
88
|
+
リポジトリ `E` から `resolve` を実行し、ブランチ `A` がまだそこにマップされていない場合、`gctree` は次のどれにするかを尋ねられます。
|
|
63
89
|
|
|
64
90
|
1. 今回だけ続ける
|
|
65
91
|
2. `E` では今後も常に `A` を使う
|
|
@@ -98,24 +124,46 @@ gctree update-gc
|
|
|
98
124
|
gctree ugc
|
|
99
125
|
```
|
|
100
126
|
|
|
101
|
-
|
|
127
|
+
新しく重要になったリポジトリを永続的なコンテキストにも組み込みたい場合、自然な流れは次のとおりです。
|
|
102
128
|
|
|
103
129
|
1. まずそのリポジトリを gc-branch にマップする
|
|
104
|
-
2. その後 `update-global-context`
|
|
130
|
+
2. その後 `update-global-context` を実行して、そのリポジトリが何を担い、なぜ重要なのかという永続的な知識を追加する
|
|
105
131
|
|
|
106
132
|
## 統合パターン
|
|
107
133
|
|
|
108
134
|
### Codex CLI / Claude Code CLI
|
|
109
135
|
|
|
110
|
-
`gctree scaffold`
|
|
111
|
-
これらのコマンドは、長期コンテキストを集めたり適用したりする前に、現在アクティブな gc-branch を明示的に伝えるべきです。また、ユーザーが明示的に切り替えを求めない限り、保存されたワークフロー言語を使い続けるべきです。
|
|
136
|
+
`gctree scaffold` はプロバイダー向けのコマンドファイルをターゲットディレクトリにインストールします。
|
|
112
137
|
|
|
113
138
|
```bash
|
|
114
139
|
gctree scaffold --host codex --target /path/to/repo
|
|
115
140
|
gctree scaffold --host claude-code --target /path/to/repo
|
|
141
|
+
gctree scaffold --host both --target /path/to/repo
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**`--host codex` で書き込まれるファイル:**
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
AGENTS.md ← gctree のスニペットがエージェント指示に追記される
|
|
148
|
+
.codex/prompts/gctree-bootstrap.md ← Codex セッション向けのブートストラップコンテキスト
|
|
149
|
+
.codex/skills/gc-resolve-context/SKILL.md ← resolve スキル
|
|
150
|
+
.codex/skills/gc-onboard/SKILL.md ← オンボーディングスキル
|
|
151
|
+
.codex/skills/gc-update-global-context/SKILL.md ← 更新スキル
|
|
116
152
|
```
|
|
117
153
|
|
|
118
|
-
|
|
154
|
+
**`--host claude-code` で書き込まれるファイル:**
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
CLAUDE.md ← gctree のスニペットが追記される
|
|
158
|
+
.claude/hooks/gctree-session-start.md ← セッション開始フック
|
|
159
|
+
.claude/commands/gc-resolve-context.md ← resolve スラッシュコマンド
|
|
160
|
+
.claude/commands/gc-onboard.md ← onboard スラッシュコマンド
|
|
161
|
+
.claude/commands/gc-update-global-context.md ← 更新スラッシュコマンド
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
`--force` を渡さない限り、既存のファイルは変更されません。
|
|
165
|
+
|
|
166
|
+
### ランタイムの動作
|
|
119
167
|
|
|
120
|
-
デフォルトのアクティブ gc-branch は `~/.gctree`
|
|
121
|
-
|
|
168
|
+
デフォルトのアクティブ gc-branch は `~/.gctree` 内の `HEAD` が指しているものですが、リポジトリが別の gc-branch に明示的に結び付けられている場合は、repo mapping がそのフォールバックを上書きできます。
|
|
169
|
+
これにより、互いに無関係なセッションを多数同時に開いているヘビーユーザーでも gc-tree を実用的に使えます。
|
package/docs/usage.ko.md
CHANGED
|
@@ -1,48 +1,74 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 사용법
|
|
2
2
|
|
|
3
3
|
[English](usage.md) | [한국어](usage.ko.md) | [简体中文](usage.zh.md) | [日本語](usage.ja.md) | [Español](usage.es.md)
|
|
4
4
|
|
|
5
5
|
## 요약
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
표준 `gctree` 워크플로우는 다음과 같습니다: gc-tree 초기화, 프로바이더 선택, 기본 `main` gc-branch 온보딩, 필요한 컨텍스트 resolve, 작업별로 새 gc-branch 생성, 저장소를 올바른 gc-branch에 매핑, 이후 지속 변경 시 안내된 업데이트 사용.
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## 표준 워크플로우
|
|
10
10
|
|
|
11
11
|
1. `gctree init` 실행
|
|
12
|
-
2. 선호하는
|
|
13
|
-
3.
|
|
14
|
-
4. `both`를
|
|
15
|
-
5. 기본 `main` gc-branch
|
|
16
|
-
6. `gctree resolve --query "..."`로
|
|
12
|
+
2. 선호하는 프로바이더 모드 선택 (`claude-code`, `codex`, 또는 `both`)
|
|
13
|
+
3. 워크플로우 언어 선택 (`English`, `Korean`, 또는 커스텀 언어)
|
|
14
|
+
4. `both`를 선택한 경우, 지금 온보딩을 시작할 프로바이더 선택
|
|
15
|
+
5. 기본 `main` gc-branch의 안내된 온보딩 완료
|
|
16
|
+
6. `gctree resolve --query "..."`로 관련 컨텍스트 resolve
|
|
17
17
|
7. `gctree checkout`으로 gc-branch 생성 또는 전환
|
|
18
|
-
8. `gctree onboard
|
|
19
|
-
9.
|
|
20
|
-
10.
|
|
18
|
+
8. 빈 gc-branch에만 `gctree onboard` 실행
|
|
19
|
+
9. 저장소 범위 매핑으로 gc-branch가 해당하는 곳에만 적용되도록 설정
|
|
20
|
+
10. 이후 지속 변경에는 `gctree update-global-context` 사용
|
|
21
21
|
|
|
22
|
-
## 핵심
|
|
22
|
+
## 핵심 명령어
|
|
23
23
|
|
|
24
|
-
|
|
|
24
|
+
| 명령어 | 설명 |
|
|
25
25
|
| --- | --- |
|
|
26
|
-
| `gctree init` | `~/.gctree
|
|
27
|
-
| `gctree checkout <branch>` | 활성 gc-branch
|
|
28
|
-
| `gctree checkout -b <branch>` |
|
|
29
|
-
| `gctree branches` | 사용 가능한 gc-branch
|
|
30
|
-
| `gctree status` | 활성 gc-branch, 현재
|
|
31
|
-
| `gctree resolve --query TEXT` | 관련 gc-branch에서
|
|
32
|
-
| `gctree repo-map` |
|
|
33
|
-
| `gctree set-repo-scope --branch <name> --include` | 현재
|
|
34
|
-
| `gctree set-repo-scope --branch <name> --exclude` | 현재
|
|
35
|
-
| `gctree onboard` | 활성 gc-branch
|
|
36
|
-
| `gctree reset-gc-branch --branch <name> --yes` | gc-branch를
|
|
37
|
-
| `gctree update-global-context` | 활성 gc-branch
|
|
38
|
-
| `gctree update-gc` / `gctree ugc` | `gctree update-global-context`의
|
|
39
|
-
| `gctree scaffold --host <codex
|
|
40
|
-
|
|
41
|
-
##
|
|
42
|
-
|
|
43
|
-
gc-branch
|
|
44
|
-
|
|
45
|
-
|
|
26
|
+
| `gctree init` | `~/.gctree` 생성, 기본 `main` gc-branch 생성, 프로바이더 모드·온보딩 프로바이더·선호 언어 저장, 현재 환경 scaffold, `main`이 비어 있으면 안내된 온보딩 시작. |
|
|
27
|
+
| `gctree checkout <branch>` | 활성 gc-branch 전환. |
|
|
28
|
+
| `gctree checkout -b <branch>` | 새 빈 gc-branch를 생성하고 전환. |
|
|
29
|
+
| `gctree branches` | 사용 가능한 gc-branch 목록 표시 및 현재 활성 브랜치 표시. |
|
|
30
|
+
| `gctree status` | 활성 gc-branch, 현재 저장소, 현재 저장소 범위 상태, 경고, 선호 프로바이더 표시. |
|
|
31
|
+
| `gctree resolve --query TEXT` | 관련 gc-branch에서 컨텍스트 검색. 현재 저장소가 매핑되지 않은 경우, `gctree`가 해당 저장소 처리 방법을 물어볼 수 있습니다. |
|
|
32
|
+
| `gctree repo-map` | `branch-repo-map.json`의 현재 내용 표시. |
|
|
33
|
+
| `gctree set-repo-scope --branch <name> --include` | 현재 저장소를 해당 gc-branch에 포함으로 표시. |
|
|
34
|
+
| `gctree set-repo-scope --branch <name> --exclude` | 현재 저장소를 해당 gc-branch에서 무시로 표시. |
|
|
35
|
+
| `gctree onboard` | 활성 gc-branch의 안내된 온보딩 실행. 해당 gc-branch가 비어 있을 때만 동작. |
|
|
36
|
+
| `gctree reset-gc-branch --branch <name> --yes` | gc-branch를 초기화하여 다시 온보딩할 수 있게 함. |
|
|
37
|
+
| `gctree update-global-context` | 활성 gc-branch의 안내된 지속 업데이트 실행. |
|
|
38
|
+
| `gctree update-gc` / `gctree ugc` | `gctree update-global-context`의 별칭. |
|
|
39
|
+
| `gctree scaffold --host <codex\|claude-code>` | 다른 환경에 프로바이더 대면 명령 표면 설치. |
|
|
40
|
+
|
|
41
|
+
## resolve가 반환하는 것
|
|
42
|
+
|
|
43
|
+
`gctree resolve`는 활성 gc-branch의 모든 문서를 쿼리에 대해 점수를 매기고 매칭된 것만 반환합니다. 제목 매칭은 본문 매칭보다 두 배의 가중치를 가집니다.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
gctree resolve --query "auth token rotation policy"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"gc_branch": "main",
|
|
52
|
+
"query": "auth token rotation policy",
|
|
53
|
+
"matches": [
|
|
54
|
+
{
|
|
55
|
+
"title": "Auth & Session Conventions",
|
|
56
|
+
"path": "docs/auth.md",
|
|
57
|
+
"score": 4,
|
|
58
|
+
"summary": "JWT rotation on every request, refresh tokens in httpOnly cookies, 15-min access token TTL",
|
|
59
|
+
"excerpt": "## Auth Flow\nAccess token: 15-min TTL, rotated on every authenticated request..."
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
도구는 먼저 요약과 발췌문을 받습니다. 요약만으로 충분하지 않을 때만 `path`의 전체 문서를 읽습니다. 아무것도 매칭되지 않는 쿼리는 `"matches": []`를 반환합니다.
|
|
66
|
+
|
|
67
|
+
## 저장소 범위 설정 예시 흐름
|
|
68
|
+
|
|
69
|
+
gc-branch `A`가 저장소 `B`, `C`, `D`에는 관련되지만 `F`에는 관련 없다고 가정합니다.
|
|
70
|
+
|
|
71
|
+
다음과 같이 관리할 수 있습니다:
|
|
46
72
|
|
|
47
73
|
```json
|
|
48
74
|
{
|
|
@@ -53,31 +79,31 @@ gc-branch `A`가 `B`, `C`, `D` 레포에는 관련 있고 `F`에는 관련이
|
|
|
53
79
|
}
|
|
54
80
|
```
|
|
55
81
|
|
|
56
|
-
|
|
82
|
+
저장 위치:
|
|
57
83
|
|
|
58
84
|
```text
|
|
59
85
|
~/.gctree/branch-repo-map.json
|
|
60
86
|
```
|
|
61
87
|
|
|
62
|
-
`E
|
|
88
|
+
저장소 `E`에서 `resolve`를 실행할 때 브랜치 `A`가 아직 매핑되지 않은 경우, `gctree`가 다음 중 하나를 선택하도록 물어볼 수 있습니다:
|
|
63
89
|
|
|
64
|
-
1.
|
|
65
|
-
2. `E
|
|
66
|
-
3. `E
|
|
90
|
+
1. 한 번만 계속 진행
|
|
91
|
+
2. `E`에서 항상 `A` 사용
|
|
92
|
+
3. `E`에서 `A` 무시
|
|
67
93
|
|
|
68
|
-
##
|
|
94
|
+
## 최초 실행 예시 흐름
|
|
69
95
|
|
|
70
96
|
```bash
|
|
71
97
|
gctree init
|
|
72
98
|
```
|
|
73
99
|
|
|
74
|
-
|
|
100
|
+
이후:
|
|
75
101
|
|
|
76
102
|
1. `codex` 또는 `claude-code` 선택
|
|
77
|
-
2. `gctree`가 현재 환경을
|
|
78
|
-
3. `main` gc-branch
|
|
103
|
+
2. `gctree`가 현재 환경을 scaffold하도록 허용
|
|
104
|
+
3. `main` gc-branch의 안내된 온보딩 완료
|
|
79
105
|
|
|
80
|
-
##
|
|
106
|
+
## 다중 브랜치 예시 흐름
|
|
81
107
|
|
|
82
108
|
```bash
|
|
83
109
|
gctree checkout -b client-b
|
|
@@ -85,37 +111,59 @@ gctree onboard
|
|
|
85
111
|
gctree resolve --query "billing retry policy"
|
|
86
112
|
```
|
|
87
113
|
|
|
88
|
-
## 업데이트 예시
|
|
114
|
+
## 업데이트 예시 흐름
|
|
89
115
|
|
|
90
116
|
```bash
|
|
91
117
|
gctree update-global-context
|
|
92
118
|
```
|
|
93
119
|
|
|
94
|
-
|
|
120
|
+
단축 별칭:
|
|
95
121
|
|
|
96
122
|
```bash
|
|
97
123
|
gctree update-gc
|
|
98
124
|
gctree ugc
|
|
99
125
|
```
|
|
100
126
|
|
|
101
|
-
|
|
127
|
+
새로 관련이 생긴 저장소를 지속 컨텍스트에도 포함해야 한다면, 자연스러운 흐름은 다음과 같습니다:
|
|
102
128
|
|
|
103
|
-
1.
|
|
104
|
-
2.
|
|
129
|
+
1. 해당 저장소를 gc-branch에 매핑
|
|
130
|
+
2. `update-global-context`를 실행하여 해당 저장소가 무엇을 하고 왜 중요한지에 대한 지속 지식 추가
|
|
105
131
|
|
|
106
132
|
## 통합 패턴
|
|
107
133
|
|
|
108
134
|
### Codex CLI / Claude Code CLI
|
|
109
135
|
|
|
110
|
-
`gctree scaffold`는
|
|
111
|
-
이 명령들은 장기 컨텍스트를 수집하거나 반영하기 전에 현재 활성 gc-branch가 무엇인지 명시적으로 말해야 하고, 사용자가 따로 바꾸라고 하지 않는 한 저장된 워크플로 언어를 계속 사용해야 합니다.
|
|
136
|
+
`gctree scaffold`는 대상 디렉토리에 프로바이더 대면 명령 파일을 설치합니다.
|
|
112
137
|
|
|
113
138
|
```bash
|
|
114
139
|
gctree scaffold --host codex --target /path/to/repo
|
|
115
140
|
gctree scaffold --host claude-code --target /path/to/repo
|
|
141
|
+
gctree scaffold --host both --target /path/to/repo
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**`--host codex`로 작성되는 파일:**
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
AGENTS.md ← 에이전트 지시사항에 gctree 스니펫 추가
|
|
148
|
+
.codex/prompts/gctree-bootstrap.md ← Codex 세션의 부트스트랩 컨텍스트
|
|
149
|
+
.codex/skills/gc-resolve-context/SKILL.md ← resolve 스킬
|
|
150
|
+
.codex/skills/gc-onboard/SKILL.md ← 온보딩 스킬
|
|
151
|
+
.codex/skills/gc-update-global-context/SKILL.md ← 업데이트 스킬
|
|
116
152
|
```
|
|
117
153
|
|
|
154
|
+
**`--host claude-code`로 작성되는 파일:**
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
CLAUDE.md ← gctree 스니펫 추가
|
|
158
|
+
.claude/hooks/gctree-session-start.md ← 세션 시작 훅
|
|
159
|
+
.claude/commands/gc-resolve-context.md ← resolve 슬래시 명령
|
|
160
|
+
.claude/commands/gc-onboard.md ← onboard 슬래시 명령
|
|
161
|
+
.claude/commands/gc-update-global-context.md ← 업데이트 슬래시 명령
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
`--force`를 전달하지 않으면 기존 파일은 그대로 유지됩니다.
|
|
165
|
+
|
|
118
166
|
### 런타임 동작
|
|
119
167
|
|
|
120
|
-
|
|
121
|
-
|
|
168
|
+
활성 gc-branch는 `~/.gctree` 내의 `HEAD`가 가리키는 브랜치이지만, 저장소가 다른 gc-branch에 명시적으로 바인딩된 경우 저장소 매핑이 해당 폴백을 재정의할 수 있습니다.
|
|
169
|
+
이를 통해 관련 없는 여러 세션을 동시에 열어두는 헤비 유저에게도 gc-tree가 실용적으로 동작합니다.
|