@handsupmin/gc-tree 0.2.0 → 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 +60 -59
- package/README.ja.md +60 -59
- package/README.ko.md +62 -61
- package/README.md +61 -60
- package/README.zh.md +62 -61
- 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 +3 -1
package/docs/principles.ja.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
[English](principles.md) | [한국어](principles.ko.md) | [简体中文](principles.zh.md) | [日本語](principles.ja.md) | [Español](principles.es.md)
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 概要
|
|
6
6
|
|
|
7
|
-
`gctree`
|
|
7
|
+
`gctree` は少数のプロダクト原則に従っています。コンテキストはブランチを意識して持つこと、ソースドキュメントは summary-first にすること、index は薄く保つこと、repo scope を明示すること、関連するものだけを注入すること、そしてシェルコマンドを実行できるあらゆるプロバイダーをサポートすることです。
|
|
8
8
|
|
|
9
9
|
## 1. コンテキストはブランチを意識して持つ
|
|
10
10
|
|
|
@@ -25,26 +25,39 @@ gc-branch がマシン上のすべてのリポジトリに黙って影響して
|
|
|
25
25
|
## 3. `index.md` は薄く保つ
|
|
26
26
|
|
|
27
27
|
トップレベルの `index.md` は知識の置き場ではなく、あくまでインデックスです。
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
役割は、人やツールが正しいソースドキュメントを素早く見つけられるようにすることです。
|
|
29
|
+
**2000 文字** 以内に収め、全文の知識をその場に複製するのではなく、コンパクトでリンク中心に保つべきです。
|
|
30
30
|
|
|
31
|
-
## 4.
|
|
31
|
+
## 4. ソースドキュメントは summary-first にする
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
信頼できる情報源となるマークダウンドキュメントには、冒頭近くに `## Summary` セクションがあるべきです。
|
|
34
|
+
そうしておけば、後段のツールはまず短い要約を読み、実際に詳細が必要になったときだけ展開できます。
|
|
35
35
|
|
|
36
36
|
## 5. オンボーディングは明示的かつガイド付きにする
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
`gctree init` と `gctree onboard`
|
|
38
|
+
使えるコンテキストツリーを作るために、ユーザーがオンボーディング用の JSON を手書きしなければならないのはよくありません。
|
|
39
|
+
`gctree init` と `gctree onboard` は、ユーザーが選んだプロバイダーに沿って流れを案内し、その結果のコンテキストを現在アクティブな gc-branch に書き込むべきです。
|
|
40
40
|
|
|
41
41
|
オンボーディングは空の gc-branch に対してだけ行うものです。
|
|
42
42
|
すでにコンテキストが入っている gc-branch の場合、正しい道筋は次のどちらかです。
|
|
43
43
|
|
|
44
44
|
- その gc-branch をリセットして再オンボードする
|
|
45
|
-
-
|
|
45
|
+
- またはガイド付きの永続的更新を実行する
|
|
46
46
|
|
|
47
|
-
## 6.
|
|
47
|
+
## 6. 永続的な更新は意図を持って行う
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
永続的なコンテキストが事故的に変わったり、隠れたメモリ経由で変わったりしてはいけません。
|
|
50
|
+
更新フローは明示的で、プロバイダー主導であり、かつ現在アクティブな gc-branch にしっかり結び付いているべきです。
|
|
51
|
+
|
|
52
|
+
## 7. 関連するものだけを注入する
|
|
53
|
+
|
|
54
|
+
ツールのセッションがナレッジベース全体を受け取るべきではありません。
|
|
55
|
+
`gctree resolve` はドキュメントをクエリに対してスコアリングし、マッチしたもののタイトル・サマリー・抜粋だけを返します。フルドキュメントはサマリーだけでは不足するときにのみ読み込まれます。
|
|
56
|
+
|
|
57
|
+
実際には 1 クエリあたり保存された総コンテキストの約 4% が注入されます。残りの 96% はディスク上に留まり、実際に必要になるまでトークンウィンドウには入りません。
|
|
58
|
+
|
|
59
|
+
## 8. プロバイダーに依存しない設計を保つ
|
|
60
|
+
|
|
61
|
+
`gctree` はコンテキストをプレーンなマークダウンファイルとして保存するため、どのツールでも読み込めます。
|
|
62
|
+
Claude Code と Codex はどちらも `gctree scaffold` を通じて同じ基盤のストアに対して scaffold します。
|
|
63
|
+
新しいプロバイダーのサポートを追加するには、新しい scaffold テンプレートを書くだけです。コアのストレージや resolve ロジックに変更は不要です。
|
package/docs/principles.ko.md
CHANGED
|
@@ -4,47 +4,60 @@
|
|
|
4
4
|
|
|
5
5
|
## 요약
|
|
6
6
|
|
|
7
|
-
`gctree`는
|
|
7
|
+
`gctree`는 소수의 제품 원칙을 따릅니다: 컨텍스트는 브랜치 인식으로, 소스 문서는 요약 우선으로, 인덱스는 슬림하게, 저장소 범위는 명시적으로, 관련된 것만 주입하고, 셸 명령을 실행할 수 있는 모든 프로바이더를 지원합니다.
|
|
8
8
|
|
|
9
|
-
## 1.
|
|
9
|
+
## 1. 컨텍스트를 브랜치 인식으로 유지한다
|
|
10
10
|
|
|
11
|
-
한 대의
|
|
12
|
-
그래서 `gctree`는 `checkout`, `checkout -b` 같은
|
|
11
|
+
한 대의 머신이 여러 전역 컨텍스트 트리를 서로 섞이지 않게 유지할 수 있어야 합니다.
|
|
12
|
+
그래서 `gctree`는 `checkout`, `checkout -b` 같은 git 스타일의 언어를 사용하면서도, 사용자 대면 문구에서는 활성 브랜치를 **gc-branch**라고 부릅니다.
|
|
13
13
|
|
|
14
|
-
## 2.
|
|
14
|
+
## 2. 저장소 범위를 명시적으로 유지한다
|
|
15
15
|
|
|
16
|
-
gc-branch가
|
|
17
|
-
`gctree`는 `branch-repo-map.json`을
|
|
16
|
+
gc-branch가 머신의 모든 저장소에 조용히 영향을 미쳐서는 안 됩니다.
|
|
17
|
+
`gctree`는 `branch-repo-map.json`을 사용해 저장소가 다음 상태 중 어느 것인지 기록합니다:
|
|
18
18
|
|
|
19
|
-
-
|
|
20
|
-
-
|
|
19
|
+
- gc-branch에 포함됨
|
|
20
|
+
- gc-branch에서 제외됨
|
|
21
21
|
- 아직 매핑되지 않음
|
|
22
22
|
|
|
23
|
-
`resolve`가
|
|
23
|
+
매핑되지 않은 저장소에서 `resolve`가 호출되면, 사용자가 해당 저장소에서 한 번만 계속할지, 항상 해당 gc-branch를 사용할지, 아니면 무시할지 결정할 수 있습니다.
|
|
24
24
|
|
|
25
|
-
## 3. `index.md
|
|
25
|
+
## 3. `index.md`를 슬림하게 유지한다
|
|
26
26
|
|
|
27
|
-
최상위 `index.md`는
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
최상위 `index.md`는 인덱스이지, 덤프가 아닙니다.
|
|
28
|
+
도구와 사람이 올바른 소스 문서를 빠르게 찾을 수 있도록 돕는 것이 역할입니다.
|
|
29
|
+
**2000자** 이하로 유지되어야 하며, 전체 지식을 인라인으로 복제하는 대신 링크 중심으로 구성되어야 합니다.
|
|
30
30
|
|
|
31
|
-
## 4.
|
|
31
|
+
## 4. 소스 문서를 요약 우선으로 구성한다
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
모든 정보 소스 마크다운 문서는 상단 근처에 `## Summary` 섹션을 포함해야 합니다.
|
|
34
|
+
이는 다운스트림 도구에게 빠른 경로를 제공합니다: 먼저 짧은 버전을 읽고, 실제로 더 많은 상세 내용이 필요할 때만 확장합니다.
|
|
35
35
|
|
|
36
|
-
## 5.
|
|
36
|
+
## 5. 온보딩을 명시적이고 안내된 방식으로 만든다
|
|
37
37
|
|
|
38
|
-
유용한 컨텍스트 트리를 만들기 위해
|
|
39
|
-
`gctree init`과 `gctree onboard`는 사용자가 선호하는
|
|
38
|
+
사용자가 유용한 컨텍스트 트리를 만들기 위해 온보딩 JSON을 직접 작성하도록 요구해서는 안 됩니다.
|
|
39
|
+
`gctree init`과 `gctree onboard`는 사용자가 선호하는 프로바이더를 안내하고, 결과 컨텍스트를 활성 gc-branch에 기록해야 합니다.
|
|
40
40
|
|
|
41
|
-
온보딩은
|
|
42
|
-
이미 컨텍스트가
|
|
41
|
+
온보딩은 빈 gc-branch에만 적용됩니다.
|
|
42
|
+
gc-branch에 이미 컨텍스트가 있다면, 올바른 경로는 다음 중 하나입니다:
|
|
43
43
|
|
|
44
|
-
-
|
|
45
|
-
-
|
|
44
|
+
- 해당 gc-branch를 초기화하고 다시 온보딩
|
|
45
|
+
- 또는 안내된 지속 업데이트 실행
|
|
46
46
|
|
|
47
|
-
## 6.
|
|
47
|
+
## 6. 지속 업데이트를 의도적으로 유지한다
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
업데이트 흐름은 명시적이어야 하고,
|
|
49
|
+
지속 컨텍스트는 우연히 또는 숨겨진 메모리를 통해 변경되어서는 안 됩니다.
|
|
50
|
+
업데이트 흐름은 명시적이어야 하고, 프로바이더 주도로 이루어지며, 현재 활성 gc-branch에 연결되어야 합니다.
|
|
51
|
+
|
|
52
|
+
## 7. 관련된 것만 주입한다
|
|
53
|
+
|
|
54
|
+
도구 세션은 전체 지식 베이스를 절대 받아서는 안 됩니다.
|
|
55
|
+
`gctree resolve`는 쿼리에 대해 문서에 점수를 매기고 매칭된 것만 반환합니다 — 제목, 요약, 발췌문 형태로. 전체 문서는 요약으로 충분하지 않을 때만 읽습니다.
|
|
56
|
+
|
|
57
|
+
실제로 이는 쿼리당 저장된 전체 컨텍스트의 약 4%만 주입됨을 의미합니다. 나머지 96%는 실제로 필요할 때까지 디스크에 남아 토큰 윈도우 밖에 있습니다.
|
|
58
|
+
|
|
59
|
+
## 8. 프로바이더에 종속되지 않는다
|
|
60
|
+
|
|
61
|
+
`gctree`는 어떤 도구든 읽을 수 있는 일반 마크다운 파일에 컨텍스트를 저장합니다.
|
|
62
|
+
Claude Code와 Codex 모두 `gctree scaffold`를 통해 동일한 기반 저장소에 대해 scaffold합니다.
|
|
63
|
+
새로운 프로바이더 지원 추가는 새 scaffold 템플릿을 작성하는 것을 의미합니다 — 핵심 저장소나 resolve 로직은 변경이 필요 없습니다.
|
package/docs/principles.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## Summary
|
|
6
6
|
|
|
7
|
-
`gctree` follows a small set of product rules: keep context branch-aware, keep source docs summary-first, keep indexes slim,
|
|
7
|
+
`gctree` follows a small set of product rules: keep context branch-aware, keep source docs summary-first, keep indexes slim, make repo scope explicit, inject only what is relevant, and support any provider that can run shell commands.
|
|
8
8
|
|
|
9
9
|
## 1. Keep context branch-aware
|
|
10
10
|
|
|
@@ -26,7 +26,7 @@ If `resolve` is called from an unmapped repository, the user can decide whether
|
|
|
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
|
|
29
|
+
It should stay under **2000 characters** and remain link-oriented instead of duplicating full knowledge inline.
|
|
30
30
|
|
|
31
31
|
## 4. Make source docs summary-first
|
|
32
32
|
|
|
@@ -48,3 +48,16 @@ If a gc-branch already contains context, the correct path is either:
|
|
|
48
48
|
|
|
49
49
|
Durable context should not change by accident or through hidden memory.
|
|
50
50
|
The update flow should be explicit, provider-driven, and tied to the currently active gc-branch.
|
|
51
|
+
|
|
52
|
+
## 7. Inject only what is relevant
|
|
53
|
+
|
|
54
|
+
A tool session should never receive the entire knowledge base.
|
|
55
|
+
`gctree resolve` scores documents against the query and returns only the matching ones — title, summary, and excerpt. The full document is read only when the summary is not enough.
|
|
56
|
+
|
|
57
|
+
In practice this means roughly 4% of total stored context is injected per query. The remaining 96% stays on disk, out of the token window, until it is actually needed.
|
|
58
|
+
|
|
59
|
+
## 8. Stay provider-agnostic
|
|
60
|
+
|
|
61
|
+
`gctree` stores context in plain markdown files that any tool can read.
|
|
62
|
+
Claude Code and Codex both scaffold against the same underlying store via `gctree scaffold`.
|
|
63
|
+
Adding support for a new provider means writing a new scaffold template — no changes to the core storage or resolve logic.
|
package/docs/principles.zh.md
CHANGED
|
@@ -1,50 +1,63 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 设计原则
|
|
2
2
|
|
|
3
3
|
[English](principles.md) | [한국어](principles.ko.md) | [简体中文](principles.zh.md) | [日本語](principles.ja.md) | [Español](principles.es.md)
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 概述
|
|
6
6
|
|
|
7
|
-
`gctree`
|
|
7
|
+
`gctree` 遵循一套简明的产品准则:保持上下文的分支感知、让源文档以摘要为先、保持索引精简、明确仓库作用范围、只注入相关内容,并支持任何能够运行 shell 命令的提供商。
|
|
8
8
|
|
|
9
|
-
## 1.
|
|
9
|
+
## 1. 保持上下文的分支感知
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
一台机器应该能够同时持有多个全局上下文树,且互不混淆。
|
|
12
|
+
这就是为什么 `gctree` 使用 `checkout` 和 `checkout -b` 这样类似 git 的语言,同时在面向用户的文案中将活跃分支称为 **gc-branch**。
|
|
13
13
|
|
|
14
|
-
## 2.
|
|
14
|
+
## 2. 明确仓库作用范围
|
|
15
15
|
|
|
16
|
-
gc-branch
|
|
17
|
-
`gctree`
|
|
16
|
+
gc-branch 不应该悄无声息地影响机器上的每一个代码仓库。
|
|
17
|
+
`gctree` 使用 `branch-repo-map.json` 来记录某个代码仓库的状态:
|
|
18
18
|
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
19
|
+
- 已包含在某个 gc-branch 中
|
|
20
|
+
- 已从某个 gc-branch 中排除
|
|
21
|
+
- 尚未映射
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
如果从未映射的代码仓库调用 `resolve`,用户可以决定是继续一次、始终在该仓库使用此 gc-branch,还是在该仓库忽略它。
|
|
24
24
|
|
|
25
|
-
## 3.
|
|
25
|
+
## 3. 保持 `index.md` 精简
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
顶层 `index.md` 是索引,而非内容转储。
|
|
28
|
+
它的职责是帮助工具和人员快速找到正确的源文档。
|
|
29
|
+
它应保持在 **2000 字符**以内,以链接为主,而不是将完整知识内联复制进来。
|
|
30
30
|
|
|
31
|
-
## 4.
|
|
31
|
+
## 4. 让源文档以摘要为先
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
每个作为可信来源的 Markdown 文档都应在靠近顶部的位置包含一个 `## Summary` 部分。
|
|
34
|
+
这为下游工具提供了一条快速路径:先读取简短版本,只有在真正需要更多细节时才展开阅读。
|
|
35
35
|
|
|
36
36
|
## 5. 让 onboarding 明确且有引导
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
`gctree init` 和 `gctree onboard`
|
|
38
|
+
用户不应该仅仅为了创建一个有用的上下文树而手动编写 onboarding JSON。
|
|
39
|
+
`gctree init` 和 `gctree onboard` 应该引导用户选择首选的提供商,并将生成的上下文写入活跃的 gc-branch。
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
Onboarding 仅适用于空的 gc-branch。
|
|
42
|
+
如果一个 gc-branch 已经包含上下文,正确的做法是:
|
|
43
43
|
|
|
44
|
-
-
|
|
45
|
-
-
|
|
44
|
+
- 重置该 gc-branch 并重新 onboard
|
|
45
|
+
- 或者执行一次有引导的持久化更新
|
|
46
46
|
|
|
47
|
-
## 6.
|
|
47
|
+
## 6. 让持久化更新保持刻意为之
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
持久化上下文不应该因意外或隐藏记忆而发生变更。
|
|
50
|
+
更新流程应该是显式的、由提供商驱动的,并与当前活跃的 gc-branch 绑定。
|
|
51
|
+
|
|
52
|
+
## 7. 只注入相关内容
|
|
53
|
+
|
|
54
|
+
工具会话不应收到整个知识库。
|
|
55
|
+
`gctree resolve` 对文档与查询进行评分,只返回匹配的文档——包含标题、摘要和摘录。只有在摘要不足时才读取完整文档。
|
|
56
|
+
|
|
57
|
+
实际上,每次查询注入的上下文约占总存储量的 4%。其余 96% 保留在磁盘上,不进入 token 窗口,直到真正需要时才读取。
|
|
58
|
+
|
|
59
|
+
## 8. 保持提供商无关性
|
|
60
|
+
|
|
61
|
+
`gctree` 将上下文存储在任何工具都能读取的纯 Markdown 文件中。
|
|
62
|
+
Claude Code 和 Codex 都通过 `gctree scaffold` 对接同一个底层存储。
|
|
63
|
+
添加对新提供商的支持,意味着编写一个新的 scaffold 模板——无需对核心存储或 resolve 逻辑做任何修改。
|
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.
|