@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/README.md
CHANGED
|
@@ -19,44 +19,33 @@ Manage multiple contexts like Git branches.
|
|
|
19
19
|
|
|
20
20
|
</div>
|
|
21
21
|
|
|
22
|
-
Built for developers whose real work spans **multiple repos, products, clients, and workflows**.
|
|
23
|
-
|
|
24
|
-
`gc-tree` gives AI coding tools a reusable context layer **above the repo level**. Keep long-lived context across sessions, scope it to the right repos, and let `gc-tree` stay out of the way when the current repo is unrelated.
|
|
25
|
-
|
|
26
22
|
---
|
|
27
23
|
|
|
28
|
-
##
|
|
24
|
+
## The problem
|
|
29
25
|
|
|
30
|
-
|
|
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.
|
|
31
27
|
|
|
32
|
-
|
|
28
|
+
So you end up doing this every session:
|
|
33
29
|
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
- switching workstreams means manually switching mental context too
|
|
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
|
|
39
34
|
|
|
40
|
-
|
|
35
|
+
That's not an AI problem. It's a **context management problem**.
|
|
41
36
|
|
|
42
37
|
---
|
|
43
38
|
|
|
44
|
-
##
|
|
45
|
-
|
|
46
|
-
- **Multiple durable contexts**
|
|
47
|
-
Keep separate context lanes for different products, clients, or workstreams.
|
|
39
|
+
## Who this is for
|
|
48
40
|
|
|
49
|
-
|
|
50
|
-
Map each context to the repos where it actually belongs.
|
|
41
|
+
You'll get the most out of `gc-tree` if you:
|
|
51
42
|
|
|
52
|
-
- **
|
|
53
|
-
|
|
43
|
+
- Work across **multiple repos** (monorepo teams, platform + client repos, backend + frontend stacks)
|
|
44
|
+
- Switch between **multiple products or clients** in the same week
|
|
45
|
+
- Find yourself **re-explaining the same context** at the start of every AI session
|
|
46
|
+
- Want AI tools to understand your **conventions, architecture, and domain knowledge** — not just the current file
|
|
54
47
|
|
|
55
|
-
|
|
56
|
-
Use Codex, Claude Code, or both to onboard and maintain context over time.
|
|
57
|
-
|
|
58
|
-
- **Summary-first markdown knowledge**
|
|
59
|
-
Store reusable context in files, not hidden memory, and let tools read the short version first.
|
|
48
|
+
If you only ever work in one repo and one product, you probably don't need this. `CLAUDE.md` or `.cursorrules` is enough.
|
|
60
49
|
|
|
61
50
|
---
|
|
62
51
|
|
|
@@ -67,160 +56,187 @@ npm install -g @handsupmin/gc-tree
|
|
|
67
56
|
gctree init
|
|
68
57
|
```
|
|
69
58
|
|
|
70
|
-
|
|
71
|
-
|
|
59
|
+
`gctree init` walks you through:
|
|
60
|
+
|
|
61
|
+
1. Choose provider: `claude-code`, `codex`, or `both`
|
|
62
|
+
2. Scaffold the integration files into your current repo
|
|
63
|
+
3. Run guided onboarding for the `main` gc-branch
|
|
72
64
|
|
|
73
|
-
|
|
74
|
-
- **Requirements:** Node.js 20+
|
|
65
|
+
After that, your AI tool will know to call `gctree resolve` before planning or implementing.
|
|
75
66
|
|
|
76
|
-
|
|
67
|
+
- **CLI:** `gctree`
|
|
68
|
+
- **Requires:** Node.js 20+
|
|
77
69
|
|
|
78
70
|
---
|
|
79
71
|
|
|
80
|
-
##
|
|
72
|
+
## What gc-tree does
|
|
81
73
|
|
|
82
|
-
|
|
74
|
+
`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.
|
|
83
75
|
|
|
84
76
|
```bash
|
|
85
|
-
gctree
|
|
86
|
-
gctree onboard
|
|
77
|
+
gctree resolve --query "auth token rotation policy"
|
|
87
78
|
```
|
|
88
79
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"gc_branch": "main",
|
|
83
|
+
"matches": [
|
|
84
|
+
{
|
|
85
|
+
"title": "Auth & Session Conventions",
|
|
86
|
+
"score": 4,
|
|
87
|
+
"summary": "JWT rotation on every request, refresh tokens stored in httpOnly cookies, 15-min access token TTL",
|
|
88
|
+
"excerpt": "## Auth Flow\nAccess token: 15-min TTL, rotated on every authenticated request..."
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
95
92
|
```
|
|
96
93
|
|
|
97
|
-
|
|
94
|
+
Your AI tool gets the right context. Not the whole knowledge base — just the relevant slice.
|
|
98
95
|
|
|
99
|
-
|
|
96
|
+
**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.
|
|
100
97
|
|
|
101
|
-
|
|
102
|
-
gctree update-gc
|
|
103
|
-
gctree ugc
|
|
104
|
-
```
|
|
98
|
+
---
|
|
105
99
|
|
|
106
|
-
|
|
100
|
+
## Why not just use CLAUDE.md or cursor rules?
|
|
107
101
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
102
|
+
`CLAUDE.md` is great — for one repo.
|
|
103
|
+
|
|
104
|
+
The moment you have multiple repos, clients, or workstreams:
|
|
111
105
|
|
|
112
|
-
|
|
106
|
+
| | `CLAUDE.md` / cursor rules | `gc-tree` |
|
|
107
|
+
| ---------------------- | -------------------------- | -------------------------------------------- |
|
|
108
|
+
| Scope | One repo | Multiple repos, one context |
|
|
109
|
+
| Persistence | Per-repo file | Stored outside repos, reused across sessions |
|
|
110
|
+
| Switching contexts | Manual file edits | `gctree checkout client-b` |
|
|
111
|
+
| Relevance filtering | Everything or nothing | Only injects matching docs (~4% of total) |
|
|
112
|
+
| Onboarding | Hand-written | Guided by your AI tool |
|
|
113
|
+
| Works with Codex | ✅ | ✅ |
|
|
114
|
+
| Works with Claude Code | ✅ | ✅ |
|
|
113
115
|
|
|
114
116
|
---
|
|
115
117
|
|
|
116
|
-
##
|
|
118
|
+
## Validated performance
|
|
117
119
|
|
|
118
|
-
|
|
120
|
+
Tested against real internal documentation (4 Notion exports, Korean + English mixed queries):
|
|
119
121
|
|
|
120
|
-
|
|
122
|
+
| Metric | Result |
|
|
123
|
+
| -------------------------------------------- | ---------------- |
|
|
124
|
+
| Recall — relevant queries find the right doc | **100%** (16/16) |
|
|
125
|
+
| Precision — irrelevant queries return empty | **80%** (4/5) |
|
|
126
|
+
| F1 score | **88.9%** |
|
|
127
|
+
| Tokens injected per query vs. total context | **~4%** |
|
|
128
|
+
| Works with mixed Korean + English queries | ✅ |
|
|
121
129
|
|
|
122
|
-
|
|
123
|
-
- a product line
|
|
124
|
-
- a platform team
|
|
125
|
-
- a shared backend + frontend stack
|
|
126
|
-
- a temporary initiative or migration
|
|
130
|
+
---
|
|
127
131
|
|
|
128
|
-
|
|
132
|
+
## Works with Claude Code and Codex — both verified
|
|
129
133
|
|
|
130
134
|
```bash
|
|
131
|
-
gctree
|
|
132
|
-
gctree
|
|
135
|
+
gctree scaffold --host claude-code # installs CLAUDE.md snippet + /gc-onboard, /gc-update-global-context
|
|
136
|
+
gctree scaffold --host codex # installs AGENTS.md snippet + $gc-onboard, $gc-update-global-context
|
|
137
|
+
gctree scaffold --host both # both at once
|
|
133
138
|
```
|
|
134
139
|
|
|
135
|
-
|
|
140
|
+
Both providers use the same underlying context store. Onboard once, use from either tool.
|
|
136
141
|
|
|
137
|
-
|
|
142
|
+
**Claude Code** — uses `/gc-resolve-context`, `/gc-onboard`, `/gc-update-global-context` slash commands.
|
|
138
143
|
|
|
139
|
-
|
|
144
|
+
**Codex** — uses `$gc-resolve-context`, `$gc-onboard`, `$gc-update-global-context` skills. Verified with `codex exec`:
|
|
140
145
|
|
|
141
|
-
|
|
146
|
+
```
|
|
147
|
+
gctree status → gc_branch: main, doc_count: 2
|
|
148
|
+
gctree resolve --query 'NestJS DTO plainToInstance'
|
|
149
|
+
→ matched "Backend Coding Conventions" (score: 3)
|
|
150
|
+
→ DTO: class-transformer plainToInstance, class-validator required
|
|
151
|
+
→ Error handling: HttpException-based custom exceptions, no raw Error throws
|
|
152
|
+
```
|
|
142
153
|
|
|
143
|
-
|
|
154
|
+
---
|
|
144
155
|
|
|
145
|
-
|
|
156
|
+
## Common moves
|
|
146
157
|
|
|
147
|
-
|
|
148
|
-
- two client repos
|
|
149
|
-
- one internal tooling repo
|
|
158
|
+
### Separate contexts for separate workstreams
|
|
150
159
|
|
|
151
|
-
|
|
160
|
+
```bash
|
|
161
|
+
gctree checkout -b client-b
|
|
162
|
+
gctree onboard
|
|
163
|
+
```
|
|
152
164
|
|
|
153
|
-
-
|
|
154
|
-
- which repos belong together
|
|
155
|
-
- which workflows matter here
|
|
156
|
-
- which context is irrelevant right now
|
|
165
|
+
Each gc-branch is a fully independent context lane. Switch between them like Git branches.
|
|
157
166
|
|
|
158
|
-
|
|
167
|
+
### Pull relevant context on demand
|
|
159
168
|
|
|
160
|
-
|
|
169
|
+
```bash
|
|
170
|
+
gctree resolve --query "billing retry policy"
|
|
171
|
+
```
|
|
161
172
|
|
|
162
|
-
|
|
163
|
-
> but **manage the right context at the right level of work**.
|
|
173
|
+
Returns only the matching docs — title, summary, and excerpt. Your tool reads the full doc only if the summary isn't enough.
|
|
164
174
|
|
|
165
|
-
|
|
175
|
+
### Keep context current
|
|
166
176
|
|
|
167
|
-
|
|
177
|
+
```bash
|
|
178
|
+
gctree update-global-context # or: gctree update-gc / gctree ugc
|
|
179
|
+
```
|
|
168
180
|
|
|
169
|
-
|
|
170
|
-
A durable context lane for one product, client, workstream, or domain.
|
|
181
|
+
Guided update flow — your AI tool asks what changed and writes the new context back to the gc-branch.
|
|
171
182
|
|
|
172
|
-
|
|
173
|
-
Rules that decide which repos a context should apply to.
|
|
183
|
+
### Scope a context to specific repos
|
|
174
184
|
|
|
175
|
-
|
|
176
|
-
|
|
185
|
+
```bash
|
|
186
|
+
gctree set-repo-scope --branch client-b --include # include current repo
|
|
187
|
+
gctree set-repo-scope --branch client-b --exclude # exclude current repo
|
|
188
|
+
```
|
|
177
189
|
|
|
178
|
-
-
|
|
179
|
-
Under the hood, `gc-tree` organizes context as branch-aware, file-backed knowledge.
|
|
180
|
-
The “tree” is the implementation model; the user-facing benefit is reusable context beyond the project.
|
|
190
|
+
`gc-tree` won't inject a context into repos where it doesn't belong.
|
|
181
191
|
|
|
182
192
|
---
|
|
183
193
|
|
|
184
|
-
##
|
|
194
|
+
## How context is stored
|
|
185
195
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
196
|
+
```
|
|
197
|
+
~/.gctree/
|
|
198
|
+
branches/
|
|
199
|
+
main/
|
|
200
|
+
index.md ← compact index, ≤2000 chars, loaded first
|
|
201
|
+
docs/
|
|
202
|
+
auth.md ← full doc, read only when needed
|
|
203
|
+
architecture.md
|
|
204
|
+
client-b/
|
|
205
|
+
index.md
|
|
206
|
+
docs/
|
|
207
|
+
...
|
|
208
|
+
branch-repo-map.json ← which repos belong to which gc-branch
|
|
209
|
+
settings.json ← preferred provider, language
|
|
210
|
+
```
|
|
190
211
|
|
|
191
|
-
|
|
212
|
+
Context lives outside your repos — no `.gitignore` rules needed, no accidental commits, reusable across every project that uses the same gc-branch.
|
|
192
213
|
|
|
193
214
|
---
|
|
194
215
|
|
|
195
|
-
## Core commands
|
|
196
|
-
|
|
197
|
-
| Goal
|
|
198
|
-
|
|
|
199
|
-
| Initialize gc-tree and choose a provider
|
|
200
|
-
| Confirm the active gc-branch
|
|
201
|
-
| Search the active context
|
|
202
|
-
|
|
|
203
|
-
|
|
|
204
|
-
|
|
|
205
|
-
| Guided
|
|
206
|
-
|
|
|
207
|
-
|
|
|
208
|
-
|
|
|
216
|
+
## Core commands
|
|
217
|
+
|
|
218
|
+
| Goal | Command |
|
|
219
|
+
| ---------------------------------------------- | --------------------------------------------------------------- |
|
|
220
|
+
| Initialize gc-tree and choose a provider | `gctree init` |
|
|
221
|
+
| Confirm the active gc-branch | `gctree status` |
|
|
222
|
+
| Search the active context | `gctree resolve --query "..."` |
|
|
223
|
+
| Create or switch gc-branches | `gctree checkout <branch>` / `gctree checkout -b <branch>` |
|
|
224
|
+
| List all gc-branches | `gctree branches` |
|
|
225
|
+
| Guided onboarding for an empty gc-branch | `gctree onboard` |
|
|
226
|
+
| Guided durable update for the active gc-branch | `gctree update-global-context` / `gctree ugc` |
|
|
227
|
+
| Show repo-scope rules | `gctree repo-map` |
|
|
228
|
+
| Include/exclude current repo for a gc-branch | `gctree set-repo-scope --branch <name> --include` / `--exclude` |
|
|
229
|
+
| Reset a gc-branch before re-onboarding | `gctree reset-gc-branch --branch <name> --yes` |
|
|
230
|
+
| Scaffold a new environment | `gctree scaffold --host codex --target /path/to/repo` |
|
|
209
231
|
|
|
210
232
|
---
|
|
211
233
|
|
|
212
234
|
## Documentation
|
|
213
235
|
|
|
214
|
-
Detailed docs live in the [`docs/`](https://github.com/handsupmin/gc-tree/tree/main/docs) directory.
|
|
215
|
-
|
|
216
236
|
- **Concept** — [`docs/concept.md`](https://github.com/handsupmin/gc-tree/blob/main/docs/concept.md)
|
|
217
|
-
Learn what `gctree` is, which problem it solves, and what belongs in the global-context layer.
|
|
218
237
|
- **Principles** — [`docs/principles.md`](https://github.com/handsupmin/gc-tree/blob/main/docs/principles.md)
|
|
219
|
-
Read the rules behind gc-branches, repo scope, slim indexes, summary-first docs, and guided updates.
|
|
220
238
|
- **Usage** — [`docs/usage.md`](https://github.com/handsupmin/gc-tree/blob/main/docs/usage.md)
|
|
221
|
-
See the standard CLI flow, provider-facing commands, repo-scope behavior, and integration patterns.
|
|
222
239
|
- **Local development** — [`docs/local-development.md`](https://github.com/handsupmin/gc-tree/blob/main/docs/local-development.md)
|
|
223
|
-
Learn how to run the CLI locally and verify changes before contributing.
|
|
224
240
|
|
|
225
241
|
---
|
|
226
242
|
|