@handsupmin/gc-tree 0.1.3 → 0.2.0
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 +172 -88
- package/README.ja.md +175 -91
- package/README.ko.md +177 -93
- package/README.md +169 -85
- package/README.zh.md +173 -89
- package/dist/src/resolve.js +40 -6
- package/docs/concept.es.md +37 -37
- package/docs/concept.ja.md +43 -43
- package/docs/concept.ko.md +41 -41
- package/docs/concept.md +15 -15
- package/docs/concept.zh.md +37 -37
- package/docs/local-development.es.md +25 -25
- package/docs/local-development.ja.md +22 -22
- package/docs/local-development.ko.md +25 -25
- package/docs/local-development.md +3 -3
- package/docs/local-development.zh.md +23 -23
- package/docs/principles.es.md +27 -26
- package/docs/principles.ja.md +28 -27
- package/docs/principles.ko.md +29 -28
- package/docs/principles.md +4 -4
- package/docs/principles.zh.md +28 -27
- package/docs/usage.es.md +32 -30
- package/docs/usage.ja.md +45 -43
- package/docs/usage.ko.md +41 -39
- package/docs/usage.md +2 -2
- package/docs/usage.zh.md +46 -44
- package/package.json +9 -2
package/README.md
CHANGED
|
@@ -1,166 +1,250 @@
|
|
|
1
1
|
# gc-tree
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
<img src="./logo.png" alt="gc-tree logo" width="260" />
|
|
6
|
+
|
|
7
|
+
### Global context, beyond the project.
|
|
8
|
+
|
|
9
|
+
Attach durable, reusable context to your existing AI tools.
|
|
10
|
+
Manage multiple contexts like Git branches.
|
|
11
|
+
|
|
12
|
+
[](https://www.npmjs.com/package/@handsupmin/gc-tree)
|
|
13
|
+
[](https://www.npmjs.com/package/@handsupmin/gc-tree)
|
|
14
|
+
[](https://github.com/handsupmin/gc-tree/stargazers)
|
|
15
|
+
[](https://github.com/handsupmin/gc-tree/blob/main/LICENSE)
|
|
16
|
+
[](https://nodejs.org)
|
|
4
17
|
|
|
5
18
|
[English](https://github.com/handsupmin/gc-tree/blob/main/README.md) | [한국어](https://github.com/handsupmin/gc-tree/blob/main/README.ko.md) | [简体中文](https://github.com/handsupmin/gc-tree/blob/main/README.zh.md) | [日本語](https://github.com/handsupmin/gc-tree/blob/main/README.ja.md) | [Español](https://github.com/handsupmin/gc-tree/blob/main/README.es.md)
|
|
6
19
|
|
|
7
|
-
|
|
20
|
+
</div>
|
|
8
21
|
|
|
9
|
-
|
|
10
|
-
It gives long-lived context a reusable, file-backed home that stays explicit, branch-aware, and easy to plug into existing workflows.
|
|
22
|
+
---
|
|
11
23
|
|
|
12
|
-
|
|
24
|
+
## The problem
|
|
13
25
|
|
|
14
|
-
|
|
15
|
-
- keep source-of-truth knowledge in markdown instead of hidden memory
|
|
16
|
-
- resolve the active context quickly with a slim index and summary-first docs
|
|
17
|
-
- onboard and update durable context through your preferred LLM CLI provider
|
|
18
|
-
- limit a gc-branch to the repositories where it actually applies
|
|
26
|
+
You use Claude Code or Codex every day. But your real work spans multiple repos, products, and clients — and your AI tools only know about the current file.
|
|
19
27
|
|
|
20
|
-
|
|
28
|
+
So you end up doing this every session:
|
|
21
29
|
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
- **Interactive scope guard**
|
|
27
|
-
If `gctree resolve` runs in a repo that is not yet mapped to the current gc-branch, it can ask whether to continue once, always use this gc-branch here, or ignore it here.
|
|
28
|
-
- **Summary-first documentation**
|
|
29
|
-
Let tools read the short version first and expand only when they need more detail.
|
|
30
|
-
- **Guided durable updates**
|
|
31
|
-
Reuse the same provider-driven flow to update context without hand-authoring JSON files.
|
|
30
|
+
- Re-explain which repos belong together
|
|
31
|
+
- Paste the same architecture doc into the prompt again
|
|
32
|
+
- Remind the agent about conventions it already "knew" last week
|
|
33
|
+
- Manually strip context that's irrelevant to the current repo
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
That's not an AI problem. It's a **context management problem**.
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
---
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
npm install -g @handsupmin/gc-tree
|
|
39
|
-
```
|
|
39
|
+
## What gc-tree does
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
`gc-tree` sits **above the repo level**. It stores durable context in structured markdown files and lets your AI tools pull only what's relevant — before each session, automatically.
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
|
-
|
|
44
|
+
gctree resolve --query "auth token rotation policy"
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"gc_branch": "main",
|
|
50
|
+
"matches": [
|
|
51
|
+
{
|
|
52
|
+
"title": "Auth & Session Conventions",
|
|
53
|
+
"score": 4,
|
|
54
|
+
"summary": "JWT rotation on every request, refresh tokens stored in httpOnly cookies, 15-min access token TTL",
|
|
55
|
+
"excerpt": "## Auth Flow\nAccess token: 15-min TTL, rotated on every authenticated request..."
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
```
|
|
51
60
|
|
|
52
|
-
|
|
61
|
+
Your AI tool gets the right context. Not the whole knowledge base — just the relevant slice.
|
|
53
62
|
|
|
54
|
-
|
|
63
|
+
**In practice: only ~4% of your total context is injected per query.** The other 96% stays on disk, out of the token window, until it's actually needed.
|
|
55
64
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Who this is for
|
|
59
68
|
|
|
60
|
-
|
|
69
|
+
You'll get the most out of `gc-tree` if you:
|
|
61
70
|
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
- asks which language the workflow should use (`English`, `Korean`, or a custom language)
|
|
67
|
-
- saves provider mode, onboarding provider, and language in `~/.gctree/settings.json`
|
|
68
|
-
- scaffolds the current environment for the selected provider mode
|
|
69
|
-
- launches guided onboarding for the active gc-branch when `main` is still empty
|
|
71
|
+
- Work across **multiple repos** (monorepo teams, platform + client repos, backend + frontend stacks)
|
|
72
|
+
- Switch between **multiple products or clients** in the same week
|
|
73
|
+
- Find yourself **re-explaining the same context** at the start of every AI session
|
|
74
|
+
- Want AI tools to understand your **conventions, architecture, and domain knowledge** — not just the current file
|
|
70
75
|
|
|
71
|
-
|
|
76
|
+
If you only ever work in one repo and one product, you probably don't need this. `CLAUDE.md` or `.cursorrules` is enough.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Why not just use CLAUDE.md or cursor rules?
|
|
81
|
+
|
|
82
|
+
`CLAUDE.md` is great — for one repo.
|
|
83
|
+
|
|
84
|
+
The moment you have multiple repos, clients, or workstreams:
|
|
85
|
+
|
|
86
|
+
| | `CLAUDE.md` / cursor rules | `gc-tree` |
|
|
87
|
+
|---|---|---|
|
|
88
|
+
| Scope | One repo | Multiple repos, one context |
|
|
89
|
+
| Persistence | Per-repo file | Stored outside repos, reused across sessions |
|
|
90
|
+
| Switching contexts | Manual file edits | `gctree checkout client-b` |
|
|
91
|
+
| Relevance filtering | Everything or nothing | Only injects matching docs (~4% of total) |
|
|
92
|
+
| Onboarding | Hand-written | Guided by your AI tool |
|
|
93
|
+
| Works with Codex | ✅ | ✅ |
|
|
94
|
+
| Works with Claude Code | ✅ | ✅ |
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Validated performance
|
|
99
|
+
|
|
100
|
+
Tested against real internal documentation (4 Notion exports, Korean + English mixed queries):
|
|
101
|
+
|
|
102
|
+
| Metric | Result |
|
|
103
|
+
|---|---|
|
|
104
|
+
| Recall — relevant queries find the right doc | **100%** (16/16) |
|
|
105
|
+
| Precision — irrelevant queries return empty | **80%** (4/5) |
|
|
106
|
+
| F1 score | **88.9%** |
|
|
107
|
+
| Tokens injected per query vs. total context | **~4%** |
|
|
108
|
+
| Works with mixed Korean + English queries | ✅ |
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Works with Claude Code and Codex — both verified
|
|
72
113
|
|
|
73
114
|
```bash
|
|
74
|
-
gctree
|
|
115
|
+
gctree scaffold --host claude-code # installs CLAUDE.md snippet + /gc-onboard, /gc-update-global-context
|
|
116
|
+
gctree scaffold --host codex # installs AGENTS.md snippet + $gc-onboard, $gc-update-global-context
|
|
117
|
+
gctree scaffold --host both # both at once
|
|
75
118
|
```
|
|
76
119
|
|
|
77
|
-
|
|
120
|
+
Both providers use the same underlying context store. Onboard once, use from either tool.
|
|
121
|
+
|
|
122
|
+
**Claude Code** — uses `/gc-resolve-context`, `/gc-onboard`, `/gc-update-global-context` slash commands.
|
|
78
123
|
|
|
79
|
-
|
|
80
|
-
2. always use this gc-branch for this repo
|
|
81
|
-
3. ignore this gc-branch for this repo
|
|
124
|
+
**Codex** — uses `$gc-resolve-context`, `$gc-onboard`, `$gc-update-global-context` skills. Verified with `codex exec`:
|
|
82
125
|
|
|
83
|
-
|
|
126
|
+
```
|
|
127
|
+
gctree status → gc_branch: main, doc_count: 2
|
|
128
|
+
gctree resolve --query 'NestJS DTO plainToInstance'
|
|
129
|
+
→ matched "Backend Coding Conventions" (score: 3)
|
|
130
|
+
→ DTO: class-transformer plainToInstance, class-validator required
|
|
131
|
+
→ Error handling: HttpException-based custom exceptions, no raw Error throws
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
84
135
|
|
|
85
|
-
|
|
136
|
+
## Install & quick start
|
|
86
137
|
|
|
87
138
|
```bash
|
|
88
|
-
|
|
139
|
+
npm install -g @handsupmin/gc-tree
|
|
140
|
+
gctree init
|
|
89
141
|
```
|
|
90
142
|
|
|
91
|
-
`
|
|
143
|
+
`gctree init` walks you through:
|
|
144
|
+
1. Choose provider: `claude-code`, `codex`, or `both`
|
|
145
|
+
2. Scaffold the integration files into your current repo
|
|
146
|
+
3. Run guided onboarding for the `main` gc-branch
|
|
92
147
|
|
|
93
|
-
|
|
148
|
+
After that, your AI tool will know to call `gctree resolve` before planning or implementing.
|
|
149
|
+
|
|
150
|
+
- **CLI:** `gctree`
|
|
151
|
+
- **Requires:** Node.js 20+
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Common moves
|
|
156
|
+
|
|
157
|
+
### Separate contexts for separate workstreams
|
|
94
158
|
|
|
95
159
|
```bash
|
|
160
|
+
gctree checkout -b client-b
|
|
96
161
|
gctree onboard
|
|
97
162
|
```
|
|
98
163
|
|
|
99
|
-
|
|
164
|
+
Each gc-branch is a fully independent context lane. Switch between them like Git branches.
|
|
165
|
+
|
|
166
|
+
### Pull relevant context on demand
|
|
100
167
|
|
|
101
168
|
```bash
|
|
102
|
-
gctree
|
|
169
|
+
gctree resolve --query "billing retry policy"
|
|
103
170
|
```
|
|
104
171
|
|
|
105
|
-
|
|
172
|
+
Returns only the matching docs — title, summary, and excerpt. Your tool reads the full doc only if the summary isn't enough.
|
|
173
|
+
|
|
174
|
+
### Keep context current
|
|
106
175
|
|
|
107
176
|
```bash
|
|
108
|
-
gctree update-gc
|
|
109
|
-
gctree ugc
|
|
177
|
+
gctree update-global-context # or: gctree update-gc / gctree ugc
|
|
110
178
|
```
|
|
111
179
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
1. allow that repo in the branch repo map
|
|
115
|
-
2. then run `gctree update-global-context` to add durable context about what that repo is and why it matters
|
|
180
|
+
Guided update flow — your AI tool asks what changed and writes the new context back to the gc-branch.
|
|
116
181
|
|
|
117
|
-
|
|
182
|
+
### Scope a context to specific repos
|
|
118
183
|
|
|
119
184
|
```bash
|
|
120
|
-
gctree
|
|
185
|
+
gctree set-repo-scope --branch client-b --include # include current repo
|
|
186
|
+
gctree set-repo-scope --branch client-b --exclude # exclude current repo
|
|
121
187
|
```
|
|
122
188
|
|
|
123
|
-
|
|
189
|
+
`gc-tree` won't inject a context into repos where it doesn't belong.
|
|
190
|
+
|
|
191
|
+
---
|
|
124
192
|
|
|
125
|
-
|
|
193
|
+
## How context is stored
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
~/.gctree/
|
|
197
|
+
branches/
|
|
198
|
+
main/
|
|
199
|
+
index.md ← compact index, ≤2000 chars, loaded first
|
|
200
|
+
docs/
|
|
201
|
+
auth.md ← full doc, read only when needed
|
|
202
|
+
architecture.md
|
|
203
|
+
client-b/
|
|
204
|
+
index.md
|
|
205
|
+
docs/
|
|
206
|
+
...
|
|
207
|
+
branch-repo-map.json ← which repos belong to which gc-branch
|
|
208
|
+
settings.json ← preferred provider, language
|
|
209
|
+
```
|
|
126
210
|
|
|
127
|
-
|
|
128
|
-
- **Claude Code:** `/gc-onboard`, `/gc-update-global-context`
|
|
211
|
+
Context lives outside your repos — no `.gitignore` rules needed, no accidental commits, reusable across every project that uses the same gc-branch.
|
|
129
212
|
|
|
130
|
-
|
|
213
|
+
---
|
|
131
214
|
|
|
132
|
-
|
|
215
|
+
## Core commands
|
|
133
216
|
|
|
134
217
|
| Goal | Command |
|
|
135
|
-
|
|
218
|
+
|---|---|
|
|
136
219
|
| Initialize gc-tree and choose a provider | `gctree init` |
|
|
137
220
|
| Confirm the active gc-branch | `gctree status` |
|
|
138
221
|
| Search the active context | `gctree resolve --query "..."` |
|
|
139
|
-
| Show repo-scope rules | `gctree repo-map` |
|
|
140
|
-
| Explicitly include/exclude a repo for a gc-branch | `gctree set-repo-scope --branch <name> --include` / `--exclude` |
|
|
141
222
|
| Create or switch gc-branches | `gctree checkout <branch>` / `gctree checkout -b <branch>` |
|
|
223
|
+
| List all gc-branches | `gctree branches` |
|
|
142
224
|
| Guided onboarding for an empty gc-branch | `gctree onboard` |
|
|
143
|
-
| Guided durable update for the active gc-branch | `gctree update-global-context` / `gctree
|
|
225
|
+
| Guided durable update for the active gc-branch | `gctree update-global-context` / `gctree ugc` |
|
|
226
|
+
| Show repo-scope rules | `gctree repo-map` |
|
|
227
|
+
| Include/exclude current repo for a gc-branch | `gctree set-repo-scope --branch <name> --include` / `--exclude` |
|
|
144
228
|
| Reset a gc-branch before re-onboarding | `gctree reset-gc-branch --branch <name> --yes` |
|
|
145
|
-
| Scaffold
|
|
229
|
+
| Scaffold a new environment | `gctree scaffold --host codex --target /path/to/repo` |
|
|
146
230
|
|
|
147
|
-
|
|
231
|
+
---
|
|
148
232
|
|
|
149
|
-
|
|
233
|
+
## Documentation
|
|
150
234
|
|
|
151
235
|
- **Concept** — [`docs/concept.md`](https://github.com/handsupmin/gc-tree/blob/main/docs/concept.md)
|
|
152
|
-
Learn what `gctree` is, which problem it solves, and what belongs in the global-context layer.
|
|
153
236
|
- **Principles** — [`docs/principles.md`](https://github.com/handsupmin/gc-tree/blob/main/docs/principles.md)
|
|
154
|
-
Read the rules behind gc-branches, repo scope, slim indexes, summary-first docs, and guided updates.
|
|
155
237
|
- **Usage** — [`docs/usage.md`](https://github.com/handsupmin/gc-tree/blob/main/docs/usage.md)
|
|
156
|
-
See the standard CLI flow, provider-facing commands, repo-scope behavior, and integration patterns.
|
|
157
238
|
- **Local development** — [`docs/local-development.md`](https://github.com/handsupmin/gc-tree/blob/main/docs/local-development.md)
|
|
158
|
-
|
|
239
|
+
|
|
240
|
+
---
|
|
159
241
|
|
|
160
242
|
## Contribution
|
|
161
243
|
|
|
162
244
|
Contributions are welcome. See [CONTRIBUTING.md](https://github.com/handsupmin/gc-tree/blob/main/CONTRIBUTING.md) for the development workflow and pull request checklist.
|
|
163
245
|
|
|
246
|
+
---
|
|
247
|
+
|
|
164
248
|
## License
|
|
165
249
|
|
|
166
250
|
MIT. See [`LICENSE`](https://github.com/handsupmin/gc-tree/blob/main/LICENSE).
|