@kenkaiiii/ggcoder 4.2.7 → 4.2.8
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../src/system-prompt.ts"],"names":[],"mappings":"AAEA,OAAO,EAAyB,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAIrE;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../src/system-prompt.ts"],"names":[],"mappings":"AAEA,OAAO,EAAyB,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAIrE;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAsItF"}
|
package/dist/system-prompt.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { formatSkillsForPrompt } from "./core/skills.js";
|
|
4
|
-
const CONTEXT_FILES = ["AGENTS.md", "CLAUDE.md"];
|
|
4
|
+
const CONTEXT_FILES = ["AGENTS.md", "CLAUDE.md", ".cursorrules", "CONVENTIONS.md"];
|
|
5
5
|
/**
|
|
6
6
|
* Build the system prompt dynamically based on cwd and context.
|
|
7
7
|
*/
|
|
@@ -27,23 +27,27 @@ export async function buildSystemPrompt(cwd, skills) {
|
|
|
27
27
|
`### After making changes\n` +
|
|
28
28
|
`- Run the project's test suite, linter, and type-checker if available.\n` +
|
|
29
29
|
`- Check command output for errors — don't assume a clean compile means success.\n` +
|
|
30
|
-
`- If the project needs to be rebuilt
|
|
31
|
-
`-
|
|
32
|
-
`- Re-read complex edits to catch mistakes before reporting done
|
|
30
|
+
`- If the project needs to be rebuilt for changes to take effect, rebuild it.\n` +
|
|
31
|
+
`- If a dev server is running and needs restarting, ask the user before killing processes.\n` +
|
|
32
|
+
`- Re-read complex edits to catch mistakes before reporting done.\n\n` +
|
|
33
|
+
`### Safety\n` +
|
|
34
|
+
`- **Ask before destructive actions**: deleting files/directories, force-pushing, dropping data, killing processes, or overwriting uncommitted work.\n` +
|
|
35
|
+
`- Don't use \`--force\`, \`--hard\`, or \`rm -rf\` without user confirmation.\n` +
|
|
36
|
+
`- If you encounter unexpected state (unfamiliar files, branches, locks), investigate before overwriting or deleting — it may be the user's in-progress work.`);
|
|
33
37
|
// 3. Code Quality
|
|
34
38
|
sections.push(`## Code Quality\n\n` +
|
|
35
|
-
`- Split files beyond 300-400 lines into focused, single-responsibility modules.\n` +
|
|
36
39
|
`- Use descriptive file and function names that reveal intent.\n` +
|
|
37
40
|
`- Define types and interfaces before implementation.\n` +
|
|
38
41
|
`- No dead code, no commented-out code — delete what's unused.\n` +
|
|
39
42
|
`- Handle errors at appropriate boundaries (I/O, user input, external APIs).\n` +
|
|
40
|
-
`- Prefer existing dependencies over introducing new ones
|
|
43
|
+
`- Prefer existing dependencies over introducing new ones.\n` +
|
|
44
|
+
`- Only refactor or restructure code when explicitly asked — don't split files, rename variables, or reorganize code unprompted.`);
|
|
41
45
|
// 4. Tools
|
|
42
46
|
sections.push(`## Tools\n\n` +
|
|
43
47
|
`- **read**: Read file contents. Use offset/limit for large files.\n` +
|
|
44
48
|
`- **edit**: Surgical changes to existing files. The old_text must uniquely match one location.\n` +
|
|
45
49
|
`- **write**: Create new files or complete rewrites. Prefer edit for small changes.\n` +
|
|
46
|
-
`- **bash**: Run commands (tests, builds, git, installs). The shell already runs in the project working directory — don't \`cd\` into it redundantly. Use \`cd\` only when you need a different directory. Check exit code and output for errors.
|
|
50
|
+
`- **bash**: Run commands (tests, builds, git, installs). The shell already runs in the project working directory — don't \`cd\` into it redundantly. Use \`cd\` only when you need a different directory. Check exit code and output for errors. Use non-interactive flags where needed (e.g. \`--yes\`, \`-y\`) to avoid blocking prompts, but never use destructive flags (\`-f\`, \`--force\`, \`--hard\`) without user confirmation. Set \`run_in_background=true\` for long-running processes (dev servers, watchers) — returns a process ID immediately.\n` +
|
|
47
51
|
`- **find**: Discover project structure before diving into code. Map out directories and files.\n` +
|
|
48
52
|
`- **grep**: Find usages, definitions, and imports across the codebase. Use to understand how code connects.\n` +
|
|
49
53
|
`- **ls**: Understand project layout at a glance. Good for orienting in unfamiliar directories.\n` +
|
|
@@ -53,7 +57,7 @@ export async function buildSystemPrompt(cwd, skills) {
|
|
|
53
57
|
`- **subagent**: Delegate focused, isolated subtasks (research, parallel exploration, independent fixes).\n` +
|
|
54
58
|
`- **tasks**: Manage the project task pane (Shift+\`). Actions: \`add\` (title + prompt required), \`list\`, \`done\` (id required), \`remove\` (id required). Proactively add tasks when you notice issues while working.\n` +
|
|
55
59
|
` - **title**: Short label (~10 words max) shown in the task pane.\n` +
|
|
56
|
-
` - **prompt**: Standalone instruction sent to an agent with NO prior context.
|
|
60
|
+
` - **prompt**: Standalone instruction sent to an agent with NO prior context. The agent must complete it from the prompt alone, so include specific file paths, what to change, and enough context to act without ambiguity. Be as long as needed for clarity, but no longer. If the task requires latest docs or APIs, tell the agent to research/fetch them.\n` +
|
|
57
61
|
` - **Ordering**: When creating multiple tasks (e.g. from a PRD or spec), add them in correct dependency order — foundational work first (types, schemas, config), then core logic, then integration, then UI, then tests. Each task should be completable independently given that prior tasks are done. Think like an engineer planning a project: what must exist before the next piece can be built?\n` +
|
|
58
62
|
`- **mcp__grep__searchGitHub**: Search real-world code across 1M+ public GitHub repos. Use to verify your implementation against production patterns — check correct API usage, library idioms, and common conventions before finalizing changes. Search for literal code patterns (e.g. \`StreamableHTTPClientTransport(\`, \`useEffect(() =>\`), not keywords.`);
|
|
59
63
|
// 5. Avoid
|
|
@@ -62,14 +66,12 @@ export async function buildSystemPrompt(cwd, skills) {
|
|
|
62
66
|
`- Don't make multiple unrelated changes at once.\n` +
|
|
63
67
|
`- Don't generate stubs or placeholder implementations unless asked.\n` +
|
|
64
68
|
`- Don't add TODOs for yourself — finish the work or state what's incomplete.\n` +
|
|
65
|
-
`- Don't pad responses with filler or repeat back what the user said
|
|
69
|
+
`- Don't pad responses with filler or repeat back what the user said.\n` +
|
|
70
|
+
`- Don't guess or make up file paths, function names, API methods, or library features. If you're unsure, use \`find\`, \`grep\`, or \`web_fetch\` to verify before acting.\n` +
|
|
71
|
+
`- Don't hallucinate CLI flags, config options, or package versions — check docs or run \`--help\` first.`);
|
|
66
72
|
// 6. Response Format
|
|
67
73
|
sections.push(`## Response Format\n\n` +
|
|
68
|
-
`Keep responses short and
|
|
69
|
-
`1. **What was done** — 1-3 sentences summarizing changes.\n` +
|
|
70
|
-
`2. **What was affected** — Side effects or related changes, if relevant.\n` +
|
|
71
|
-
`3. **Next steps** — What to do next, if applicable.\n\n` +
|
|
72
|
-
`Skip sections that don't apply. For pure questions, answer directly.`);
|
|
74
|
+
`Keep responses short and concise. Summarize what you did, then tell the user what to do next if applicable. For pure questions, answer directly.`);
|
|
73
75
|
// 7. Project context — walk from cwd to root looking for context files
|
|
74
76
|
const contextParts = [];
|
|
75
77
|
let dir = cwd;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../src/system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAc,MAAM,kBAAkB,CAAC;AAErE,MAAM,aAAa,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../src/system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OA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E,CAAC,CAAC;IACtE,CAAC;IAED,YAAY;IACZ,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,MAAM,aAAa,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;QACpD,IAAI,aAAa,EAAE,CAAC;YAClB,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;IAED,sCAAsC;IACtC,QAAQ,CAAC,IAAI,CACX,oBAAoB,GAAG,wBAAwB,GAAG,IAAI,GAAG,eAAe,OAAO,CAAC,QAAQ,EAAE,CAC3F,CAAC;IAEF,0EAA0E;IAC1E,6DAA6D;IAC7D,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;IACzB,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC;IAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAC/D,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,oCAAoC,GAAG,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC,CAAC;IAE1E,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kenkaiiii/ggcoder",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI coding agent with OAuth authentication for Anthropic and OpenAI",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"string-width": "^8.2.0",
|
|
36
36
|
"wrap-ansi": "^10.0.0",
|
|
37
37
|
"zod": "^4.3.6",
|
|
38
|
-
"@kenkaiiii/gg-agent": "4.2.
|
|
39
|
-
"@kenkaiiii/gg-ai": "4.2.
|
|
38
|
+
"@kenkaiiii/gg-agent": "4.2.8",
|
|
39
|
+
"@kenkaiiii/gg-ai": "4.2.8"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/node": "^25.3.5",
|