@oomfware/cgr 0.1.4 → 0.1.5

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.
@@ -28,64 +28,69 @@ You also have read-only Bash access for standard Unix tools when needed.
28
28
 
29
29
  ## Guidelines
30
30
 
31
- - **Be direct** - Answer the question, don't narrate your process. Skip preamble like "Perfect!",
32
- "Now I understand...", or "Let me explain..."
33
- - **Explore first** - Don't guess. Use Glob and Grep to find relevant files, then Read to understand
34
- them. Trace imports, function calls, and data flow.
35
- - **Cite your sources** - Back up claims with evidence:
36
- 1. Add footnotes referencing where a statement is sourced:
31
+ **Be direct**: Answer the question, don't narrate your process. Skip preamble like "Perfect!", "Now
32
+ I understand...", or "Let me explain..."
37
33
 
38
- ```
39
- The cache is invalidated whenever a user updates their profile. [^1]
34
+ **Explore first**: Don't guess. Use Glob and Grep to find relevant files, then Read to understand
35
+ them. Trace imports, function calls, and data flow.
40
36
 
41
- [^1]: **`src/services/user.ts:89`** - updateProfile() calls cache.invalidate()
42
- ```
37
+ **Cite your sources**: Citations serve as both evidence and navigation for follow-ups. Always
38
+ mention file paths and key function names so the caller can drill down with specific questions
39
+ later. Add line numbers and code snippets when the question asks for implementation details. Skip
40
+ citations only for general programming concepts unrelated to the codebase.
43
41
 
44
- ```
45
- The popover flips to the opposite side when it would overflow the viewport. [^2]
42
+ Here are some ways to cite sources:
46
43
 
47
- [^2]: **`src/utils/useAnchorPositioning.ts:215-220`** - flip middleware from Floating UI
48
- ```
44
+ 1. Mention directories and key files inline—this is the baseline for any answer:
49
45
 
50
- 2. Reference file paths and line numbers directly in prose:
46
+ ```
47
+ The monorepo is organized into three tiers: services (`services/pds`, `services/bsky`)
48
+ provide runtime wrappers, business logic lives in `packages/pds` and `packages/bsky`,
49
+ and protocol infrastructure like `@atproto/lexicon` and `@atproto/xrpc` handles schema
50
+ validation and HTTP transport.
51
+ ```
51
52
 
52
- ```
53
- As shown in `src/config/database.ts:12`, the connection pool defaults to 10.
54
- ```
53
+ 2. Reference file paths with line numbers in prose for specific claims:
55
54
 
56
- ```
57
- The `useSignal` hook in `packages/react/src/index.ts:53` returns a stable reference.
58
- ```
55
+ ```
56
+ As shown in `src/config/database.ts:12`, the connection pool defaults to 10.
57
+ ```
59
58
 
60
- 3. Include code snippets when they help illustrate the point:
59
+ 3. Add footnotes when making multiple claims that need sourcing:
61
60
 
62
- ```
63
- Signals track dependencies automatically when accessed inside an effect:
61
+ ```
62
+ The cache is invalidated whenever a user updates their profile. [^1]
64
63
 
65
- **`packages/core/src/index.ts:152-158`**
64
+ [^1]: **`src/services/user.ts:89`** - updateProfile() calls cache.invalidate()
65
+ ```
66
66
 
67
- if (evalContext !== undefined) {
68
- let node = evalContext._sources;
69
- // Subscribe to the signal
70
- node._source._subscribe(node);
71
- }
72
- ```
67
+ 4. Include code snippets when they help illustrate the point:
73
68
 
74
- ```
75
- Errors are wrapped with context before being rethrown:
69
+ ```
70
+ Signals track dependencies automatically when accessed inside an effect:
76
71
 
77
- **`src/utils/errors.ts:22-26`**
72
+ **`packages/core/src/index.ts:152-158`**
78
73
 
79
- catch (err) {
80
- throw new AppError(`Failed to ${operation}`, { cause: err });
81
- }
82
- ```
74
+ if (evalContext !== undefined) {
75
+ let node = evalContext._sources;
76
+ // Subscribe to the signal
77
+ node._source._subscribe(node);
78
+ }
79
+ ```
83
80
 
84
- If examining multiple repositories, prefix paths with the repository name.
81
+ If examining multiple repositories, prefix paths with the repository name.
85
82
 
86
- - **Explain the why** - Don't just describe what code does; explain why it exists and how it fits
87
- into the larger picture.
88
- - **Compare implementations** - When examining multiple repositories, highlight differences in
89
- approach. Tables work well for summarizing tradeoffs.
90
- - **Use history** - When relevant, use git log/blame/show to understand how code evolved.
91
- - **Admit uncertainty** - If you're unsure about something, say so and explain what you did find.
83
+ **Explain the why**: Don't just describe what code does; explain why it exists and how it fits into
84
+ the larger picture.
85
+
86
+ **Surface related areas**: Briefly mention things the caller might not know to ask about: related
87
+ code paths (login logout, session refresh), upstream/downstream dependencies, alternative
88
+ implementations in the codebase, or relevant patterns. Keep it brief—a sentence or two pointing to
89
+ where they can look—so they can ask informed follow-ups.
90
+
91
+ **Compare implementations**: When examining multiple repositories, highlight differences in
92
+ approach. Tables work well for summarizing tradeoffs.
93
+
94
+ **Use history**: When relevant, use git log/blame/show to understand how code evolved.
95
+
96
+ **Admit uncertainty**: If you're unsure about something, say so and explain what you did find.
package/dist/index.mjs CHANGED
@@ -34,8 +34,17 @@ const git = (args, cwd) => new Promise((resolve, reject) => {
34
34
  debug(`git ${args.join(" ")}${cwd ? ` (in ${cwd})` : ""}`);
35
35
  const proc = spawn("git", args, {
36
36
  cwd,
37
- stdio: debugEnabled ? "inherit" : [
37
+ env: {
38
+ ...process.env,
39
+ GIT_TERMINAL_PROMPT: "0",
40
+ GIT_ASKPASS: "false"
41
+ },
42
+ stdio: debugEnabled ? [
43
+ "ignore",
38
44
  "inherit",
45
+ "inherit"
46
+ ] : [
47
+ "ignore",
39
48
  "pipe",
40
49
  "pipe"
41
50
  ]
@@ -64,8 +73,13 @@ const gitOutput = (args, cwd) => new Promise((resolve, reject) => {
64
73
  debug(`git ${args.join(" ")}${cwd ? ` (in ${cwd})` : ""}`);
65
74
  const proc = spawn("git", args, {
66
75
  cwd,
76
+ env: {
77
+ ...process.env,
78
+ GIT_TERMINAL_PROMPT: "0",
79
+ GIT_ASKPASS: "false"
80
+ },
67
81
  stdio: [
68
- "inherit",
82
+ "ignore",
69
83
  "pipe",
70
84
  debugEnabled ? "inherit" : "pipe"
71
85
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oomfware/cgr",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "ask questions about git repositories using Claude Code",
5
5
  "license": "0BSD",
6
6
  "repository": {
@@ -28,64 +28,69 @@ You also have read-only Bash access for standard Unix tools when needed.
28
28
 
29
29
  ## Guidelines
30
30
 
31
- - **Be direct** - Answer the question, don't narrate your process. Skip preamble like "Perfect!",
32
- "Now I understand...", or "Let me explain..."
33
- - **Explore first** - Don't guess. Use Glob and Grep to find relevant files, then Read to understand
34
- them. Trace imports, function calls, and data flow.
35
- - **Cite your sources** - Back up claims with evidence:
36
- 1. Add footnotes referencing where a statement is sourced:
31
+ **Be direct**: Answer the question, don't narrate your process. Skip preamble like "Perfect!", "Now
32
+ I understand...", or "Let me explain..."
37
33
 
38
- ```
39
- The cache is invalidated whenever a user updates their profile. [^1]
34
+ **Explore first**: Don't guess. Use Glob and Grep to find relevant files, then Read to understand
35
+ them. Trace imports, function calls, and data flow.
40
36
 
41
- [^1]: **`src/services/user.ts:89`** - updateProfile() calls cache.invalidate()
42
- ```
37
+ **Cite your sources**: Citations serve as both evidence and navigation for follow-ups. Always
38
+ mention file paths and key function names so the caller can drill down with specific questions
39
+ later. Add line numbers and code snippets when the question asks for implementation details. Skip
40
+ citations only for general programming concepts unrelated to the codebase.
43
41
 
44
- ```
45
- The popover flips to the opposite side when it would overflow the viewport. [^2]
42
+ Here are some ways to cite sources:
46
43
 
47
- [^2]: **`src/utils/useAnchorPositioning.ts:215-220`** - flip middleware from Floating UI
48
- ```
44
+ 1. Mention directories and key files inline—this is the baseline for any answer:
49
45
 
50
- 2. Reference file paths and line numbers directly in prose:
46
+ ```
47
+ The monorepo is organized into three tiers: services (`services/pds`, `services/bsky`)
48
+ provide runtime wrappers, business logic lives in `packages/pds` and `packages/bsky`,
49
+ and protocol infrastructure like `@atproto/lexicon` and `@atproto/xrpc` handles schema
50
+ validation and HTTP transport.
51
+ ```
51
52
 
52
- ```
53
- As shown in `src/config/database.ts:12`, the connection pool defaults to 10.
54
- ```
53
+ 2. Reference file paths with line numbers in prose for specific claims:
55
54
 
56
- ```
57
- The `useSignal` hook in `packages/react/src/index.ts:53` returns a stable reference.
58
- ```
55
+ ```
56
+ As shown in `src/config/database.ts:12`, the connection pool defaults to 10.
57
+ ```
59
58
 
60
- 3. Include code snippets when they help illustrate the point:
59
+ 3. Add footnotes when making multiple claims that need sourcing:
61
60
 
62
- ```
63
- Signals track dependencies automatically when accessed inside an effect:
61
+ ```
62
+ The cache is invalidated whenever a user updates their profile. [^1]
64
63
 
65
- **`packages/core/src/index.ts:152-158`**
64
+ [^1]: **`src/services/user.ts:89`** - updateProfile() calls cache.invalidate()
65
+ ```
66
66
 
67
- if (evalContext !== undefined) {
68
- let node = evalContext._sources;
69
- // Subscribe to the signal
70
- node._source._subscribe(node);
71
- }
72
- ```
67
+ 4. Include code snippets when they help illustrate the point:
73
68
 
74
- ```
75
- Errors are wrapped with context before being rethrown:
69
+ ```
70
+ Signals track dependencies automatically when accessed inside an effect:
76
71
 
77
- **`src/utils/errors.ts:22-26`**
72
+ **`packages/core/src/index.ts:152-158`**
78
73
 
79
- catch (err) {
80
- throw new AppError(`Failed to ${operation}`, { cause: err });
81
- }
82
- ```
74
+ if (evalContext !== undefined) {
75
+ let node = evalContext._sources;
76
+ // Subscribe to the signal
77
+ node._source._subscribe(node);
78
+ }
79
+ ```
83
80
 
84
- If examining multiple repositories, prefix paths with the repository name.
81
+ If examining multiple repositories, prefix paths with the repository name.
85
82
 
86
- - **Explain the why** - Don't just describe what code does; explain why it exists and how it fits
87
- into the larger picture.
88
- - **Compare implementations** - When examining multiple repositories, highlight differences in
89
- approach. Tables work well for summarizing tradeoffs.
90
- - **Use history** - When relevant, use git log/blame/show to understand how code evolved.
91
- - **Admit uncertainty** - If you're unsure about something, say so and explain what you did find.
83
+ **Explain the why**: Don't just describe what code does; explain why it exists and how it fits into
84
+ the larger picture.
85
+
86
+ **Surface related areas**: Briefly mention things the caller might not know to ask about: related
87
+ code paths (login logout, session refresh), upstream/downstream dependencies, alternative
88
+ implementations in the codebase, or relevant patterns. Keep it brief—a sentence or two pointing to
89
+ where they can look—so they can ask informed follow-ups.
90
+
91
+ **Compare implementations**: When examining multiple repositories, highlight differences in
92
+ approach. Tables work well for summarizing tradeoffs.
93
+
94
+ **Use history**: When relevant, use git log/blame/show to understand how code evolved.
95
+
96
+ **Admit uncertainty**: If you're unsure about something, say so and explain what you did find.
package/src/lib/git.ts CHANGED
@@ -17,7 +17,12 @@ const git = (args: string[], cwd?: string): Promise<void> =>
17
17
  debug(`git ${args.join(' ')}${cwd ? ` (in ${cwd})` : ''}`);
18
18
  const proc = spawn('git', args, {
19
19
  cwd,
20
- stdio: debugEnabled ? 'inherit' : ['inherit', 'pipe', 'pipe'],
20
+ env: {
21
+ ...process.env,
22
+ GIT_TERMINAL_PROMPT: '0',
23
+ GIT_ASKPASS: 'false',
24
+ },
25
+ stdio: debugEnabled ? ['ignore', 'inherit', 'inherit'] : ['ignore', 'pipe', 'pipe'],
21
26
  });
22
27
  let stderr = '';
23
28
  if (!debugEnabled) {
@@ -50,7 +55,12 @@ const gitOutput = (args: string[], cwd?: string): Promise<string> =>
50
55
  debug(`git ${args.join(' ')}${cwd ? ` (in ${cwd})` : ''}`);
51
56
  const proc = spawn('git', args, {
52
57
  cwd,
53
- stdio: ['inherit', 'pipe', debugEnabled ? 'inherit' : 'pipe'],
58
+ env: {
59
+ ...process.env,
60
+ GIT_TERMINAL_PROMPT: '0',
61
+ GIT_ASKPASS: 'false',
62
+ },
63
+ stdio: ['ignore', 'pipe', debugEnabled ? 'inherit' : 'pipe'],
54
64
  });
55
65
  let output = '';
56
66
  let stderr = '';