@handsupmin/gc-tree 0.8.11 → 0.8.13

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/dist/src/hook.js CHANGED
@@ -27,9 +27,13 @@ function limitMatches(matches, max = 3) {
27
27
  function formatMatches(matches) {
28
28
  return limitMatches(matches)
29
29
  .map((match, index) => {
30
- const summary = match.summary?.trim();
31
- return summary
32
- ? `${index + 1}. ${match.title} [${match.id}]\n > ${summary}`
30
+ const summary = match.summary?.trim() ?? '';
31
+ const excerpt = match.excerpt?.trim() ?? '';
32
+ // Use summary if it looks actionable (long enough to contain patterns).
33
+ // Fall back to a trimmed excerpt when summary is a short description-only sentence.
34
+ const context = summary.length >= 60 ? summary : (excerpt.slice(0, 300) || summary);
35
+ return context
36
+ ? `${index + 1}. ${match.title} [${match.id}]\n > ${context}`
33
37
  : `${index + 1}. ${match.title} [${match.id}]`;
34
38
  })
35
39
  .join('\n');
@@ -36,7 +36,7 @@ export function onboardingProtocolLines() {
36
36
  'Treat `index.md` as concept-first: show the keywords a user or AI would search for, not just broad document titles.',
37
37
  'Generate index entries automatically from primary concept names, aliases, repository nicknames, and workflow labels when those are clear.',
38
38
  'Split glossary docs when a concept is likely to be searched directly, needs more than a short definition, or carries workflow/constraint details; keep only low-value leftover terms in a shared glossary.',
39
- 'Keep each doc summary-first so the top section gives the gist before deeper details.',
39
+ 'The `## Summary` section of every doc must be actionable, not descriptive — write the actual patterns, commands, or constraints a developer needs, not a sentence about what the doc covers. Bad: "이 문서는 updateCollection 패턴을 설명합니다." Good: "updateCollection: { ...dto } spread 필수. return plainToInstance(Res, result satisfies Res). 새 필드 추가 = DTO → 서비스 → 컨트롤러 순서." The summary is injected into the AI context before every task — if it reads like a table of contents entry, it is useless.',
40
40
  'Treat `index.md` as a human-readable dictionary-style table of contents grouped by category headings and `label -> path` entries.',
41
41
  ];
42
42
  }
@@ -52,7 +52,7 @@ export async function selfUpdate(home) {
52
52
  }
53
53
  process.stderr.write('\nUpdating gctree to latest...\n');
54
54
  try {
55
- execSync('npm install -g @handsupmin/gc-tree', { stdio: 'inherit' });
55
+ execSync('npm install -g @handsupmin/gc-tree --force', { stdio: 'inherit' });
56
56
  }
57
57
  catch {
58
58
  process.stderr.write('\nnpm registry may not have propagated the latest version yet. Wait a minute and retry: gctree update\n');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@handsupmin/gc-tree",
3
- "version": "0.8.11",
3
+ "version": "0.8.13",
4
4
  "description": "Global Context Tree, a lightweight branch-aware global context orchestrator for AI coding tools",
5
5
  "type": "module",
6
6
  "private": false,
@@ -39,7 +39,7 @@ Use this when a user wants to create global context for a product, company, or w
39
39
  - when the inspected evidence already covers a repository well enough, ask only for missing deltas instead of re-asking role, paths, and workflow from scratch
40
40
  - only ask open-ended repository questions when the needed detail cannot be recovered responsibly from local evidence
41
41
  - ask about glossary terms and default verification commands before you finish
42
- - write compact source docs with a required `## Summary` section near the top
42
+ - write compact source docs with a required `## Summary` section near the top; the `## Summary` must be actionable — write the actual patterns, commands, or constraints a developer needs, not a sentence about what the doc covers (bad: "이 문서는 X를 설명합니다"; good: "updateX: { ...dto } spread 필수. return plainToInstance(Res, result satisfies Res). 새 필드 추가 = DTO → 서비스 → 컨트롤러 순서."); the summary is injected into AI context before every task — if it reads like a table of contents entry, it is useless
43
43
  - prefer an encyclopedia-style context set with many small docs instead of a few broad docs
44
44
  - prefer category directories like `docs/role/`, `docs/repos/`, `docs/domain/`, `docs/workflows/`, `docs/conventions/`, and `docs/infra/`
45
45
  - prefer one concept, one repository, one workflow, or one convention per file when possible