@kentwynn/kgraph 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.
- package/README.md +6 -6
- package/dist/integrations/adapters/claude-code.js +3 -15
- package/dist/integrations/adapters/codex.js +2 -23
- package/dist/integrations/adapters/copilot.js +2 -23
- package/dist/integrations/adapters/cursor.js +1 -18
- package/dist/integrations/integration-registry.d.ts +1 -0
- package/dist/integrations/integration-store.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,10 +86,10 @@ KGraph writes local instruction files and command/prompt packs so AI tools can u
|
|
|
86
86
|
|
|
87
87
|
| Integration | Always-on guidance | KGraph command assets |
|
|
88
88
|
| --- | --- | --- |
|
|
89
|
-
| Codex | `AGENTS.md` | `.agents/skills/kgraph
|
|
90
|
-
| GitHub Copilot | `.github/copilot-instructions.md` | `.github/prompts/kgraph
|
|
91
|
-
| Cursor | `.cursor/rules/kgraph.mdc` |
|
|
92
|
-
| Claude Code | `CLAUDE.md` | `.claude/commands/kgraph
|
|
89
|
+
| Codex | `AGENTS.md` | `.agents/skills/kgraph/SKILL.md` |
|
|
90
|
+
| GitHub Copilot | `.github/copilot-instructions.md` | `.github/prompts/kgraph.prompt.md` |
|
|
91
|
+
| Cursor | `.cursor/rules/kgraph.mdc` | Built into the KGraph Cursor rule |
|
|
92
|
+
| Claude Code | `CLAUDE.md` | `.claude/commands/kgraph.md` |
|
|
93
93
|
|
|
94
94
|
Example:
|
|
95
95
|
|
|
@@ -98,13 +98,13 @@ kgraph integrate add codex copilot cursor claude-code
|
|
|
98
98
|
kgraph integrate list
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
This gives supported
|
|
101
|
+
This gives each supported tool one reusable KGraph entry point similar to a Spec Kit-style command:
|
|
102
102
|
|
|
103
103
|
- KGraph context: query `kgraph context "<topic>"` before broad repo exploration
|
|
104
104
|
- KGraph update: save durable chat/debugging/workflow discoveries to `.kgraph/inbox/`, then run `kgraph update`
|
|
105
105
|
- KGraph scan: run `kgraph scan` after refactors, file moves, renamed functions, or dependency changes
|
|
106
106
|
|
|
107
|
-
The exact invocation depends on the host tool. Copilot uses prompt
|
|
107
|
+
The exact invocation depends on the host tool. Copilot uses one prompt file, Codex uses one skill, Cursor uses one rule, and Claude Code uses one command file. Scan and update are workflows inside that single KGraph entry point, not separate duplicated commands.
|
|
108
108
|
|
|
109
109
|
KGraph-managed instruction blocks preserve existing user-authored content.
|
|
110
110
|
|
|
@@ -19,21 +19,9 @@ export const claudeCodeAdapter = {
|
|
|
19
19
|
2. Run \`kgraph context "<topic>"\`.
|
|
20
20
|
3. Use the returned files, symbols, relationships, and cognition before broad exploration.
|
|
21
21
|
4. Save durable discoveries to \`.kgraph/inbox/\` and run \`kgraph update\` when appropriate.
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
path: ".claude/commands/kgraph-update.md",
|
|
26
|
-
content: `Preserve useful chat knowledge in KGraph.
|
|
27
|
-
|
|
28
|
-
Create a concise Markdown note in \`.kgraph/inbox/\` from durable discoveries in this conversation, then run \`kgraph update\`.
|
|
29
|
-
`
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
path: ".claude/commands/kgraph-scan.md",
|
|
33
|
-
content: `Refresh KGraph structural maps.
|
|
34
|
-
|
|
35
|
-
Run \`kgraph scan\` after code structure changes and report the scan summary.
|
|
22
|
+
5. Run \`kgraph scan\` after structural changes and report the scan summary.
|
|
36
23
|
`
|
|
37
24
|
}
|
|
38
|
-
]
|
|
25
|
+
],
|
|
26
|
+
obsoleteCommandFiles: [".claude/commands/kgraph-update.md", ".claude/commands/kgraph-scan.md"]
|
|
39
27
|
};
|
|
@@ -28,29 +28,8 @@ Workflow:
|
|
|
28
28
|
4. After durable discoveries, write a concise Markdown note to \`.kgraph/inbox/\`.
|
|
29
29
|
5. Run \`kgraph update\` if you created an inbox note.
|
|
30
30
|
6. Run \`kgraph scan\` after structural changes.
|
|
31
|
-
`
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
path: ".agents/skills/kgraph-update/SKILL.md",
|
|
35
|
-
content: `---
|
|
36
|
-
name: "kgraph-update"
|
|
37
|
-
description: "Preserve useful chat discoveries into KGraph cognition."
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
Use this skill when the user asks to update KGraph memory or preserve what was learned.
|
|
41
|
-
|
|
42
|
-
Write a concise Markdown note under \`.kgraph/inbox/\` with durable architecture, debugging, workflow, file, symbol, or gotcha knowledge. Then run \`kgraph update\`.
|
|
43
|
-
`
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
path: ".agents/skills/kgraph-scan/SKILL.md",
|
|
47
|
-
content: `---
|
|
48
|
-
name: "kgraph-scan"
|
|
49
|
-
description: "Refresh KGraph structural maps after code changes."
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
Run \`kgraph scan\` after files move, functions are renamed, folders are refactored, or dependencies change. Report the scan summary and any obvious exclude/config problems.
|
|
53
31
|
`
|
|
54
32
|
}
|
|
55
|
-
]
|
|
33
|
+
],
|
|
34
|
+
obsoleteCommandFiles: [".agents/skills/kgraph-update", ".agents/skills/kgraph-scan"]
|
|
56
35
|
};
|
|
@@ -25,29 +25,8 @@ Use KGraph for the current task.
|
|
|
25
25
|
3. If you discover durable architecture, debugging, workflow, or gotcha knowledge, create a Markdown note in \`.kgraph/inbox/\`.
|
|
26
26
|
4. If you add an inbox note, run \`kgraph update\`.
|
|
27
27
|
5. If code structure changed, run \`kgraph scan\`.
|
|
28
|
-
`
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
path: ".github/prompts/kgraph-update.prompt.md",
|
|
32
|
-
content: `---
|
|
33
|
-
mode: agent
|
|
34
|
-
description: Preserve recent useful chat knowledge in KGraph
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
Create a concise Markdown cognition note in \`.kgraph/inbox/\` from the useful stable knowledge in this conversation, then run \`kgraph update\`.
|
|
38
|
-
|
|
39
|
-
Capture only durable information: architecture discoveries, debugging conclusions, workflow conventions, important files, important functions, and gotchas. Do not store temporary chatter.
|
|
40
|
-
`
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
path: ".github/prompts/kgraph-scan.prompt.md",
|
|
44
|
-
content: `---
|
|
45
|
-
mode: agent
|
|
46
|
-
description: Refresh KGraph structural maps after repository changes
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
Run \`kgraph scan\` and report the number of files and symbols scanned. If scan output suggests generated/cache files were included, mention that the exclude configuration may need adjustment.
|
|
50
28
|
`
|
|
51
29
|
}
|
|
52
|
-
]
|
|
30
|
+
],
|
|
31
|
+
obsoleteCommandFiles: [".github/prompts/kgraph-update.prompt.md", ".github/prompts/kgraph-scan.prompt.md"]
|
|
53
32
|
};
|
|
@@ -15,22 +15,5 @@ alwaysApply: true
|
|
|
15
15
|
- Run \`kgraph scan\` after refactors, moved folders, renamed functions, or other structure changes.
|
|
16
16
|
- Run \`kgraph visualize\` when visualization support is available and the developer asks to inspect the KGraph map.
|
|
17
17
|
`,
|
|
18
|
-
|
|
19
|
-
{
|
|
20
|
-
path: ".cursor/rules/kgraph-commands.mdc",
|
|
21
|
-
content: `---
|
|
22
|
-
description: KGraph command workflows for repo context, update, and scan
|
|
23
|
-
alwaysApply: false
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
# KGraph Commands
|
|
27
|
-
|
|
28
|
-
Use these workflows when the user asks for KGraph:
|
|
29
|
-
|
|
30
|
-
- KGraph context: run \`kgraph context "<topic>"\` before broad exploration.
|
|
31
|
-
- KGraph update: write durable findings to \`.kgraph/inbox/\`, then run \`kgraph update\`.
|
|
32
|
-
- KGraph scan: run \`kgraph scan\` after refactors, file moves, renamed functions, or dependency changes.
|
|
33
|
-
`
|
|
34
|
-
}
|
|
35
|
-
]
|
|
18
|
+
obsoleteCommandFiles: [".cursor/rules/kgraph-commands.mdc"]
|
|
36
19
|
};
|
|
@@ -27,6 +27,7 @@ export async function addIntegrations(workspace, names) {
|
|
|
27
27
|
};
|
|
28
28
|
byName.set(adapter.name, next);
|
|
29
29
|
await writeIntegrationInstructions(workspace.rootPath, adapter.targetPath, adapter.name, adapter.instructions);
|
|
30
|
+
await removeIntegrationCommandFiles(workspace.rootPath, adapter.obsoleteCommandFiles ?? []);
|
|
30
31
|
await writeIntegrationCommandFiles(workspace.rootPath, adapter.commandFiles ?? []);
|
|
31
32
|
changed.push(next);
|
|
32
33
|
}
|
|
@@ -42,6 +43,7 @@ export async function removeIntegrations(workspace, names) {
|
|
|
42
43
|
const adapter = getIntegrationAdapter(name);
|
|
43
44
|
await removeIntegrationInstructions(workspace.rootPath, adapter.targetPath, adapter.name);
|
|
44
45
|
await removeIntegrationCommandFiles(workspace.rootPath, adapter.commandFiles ?? []);
|
|
46
|
+
await removeIntegrationCommandFiles(workspace.rootPath, adapter.obsoleteCommandFiles ?? []);
|
|
45
47
|
removed.push(adapter.name);
|
|
46
48
|
}
|
|
47
49
|
config.integrations = config.integrations.filter((integration) => !removeNames.has(integration.name));
|
|
@@ -77,6 +79,7 @@ async function writeIntegrationCommandFiles(rootPath, files) {
|
|
|
77
79
|
}
|
|
78
80
|
async function removeIntegrationCommandFiles(rootPath, files) {
|
|
79
81
|
for (const file of files) {
|
|
80
|
-
|
|
82
|
+
const filePath = typeof file === "string" ? file : file.path;
|
|
83
|
+
await rm(path.join(rootPath, filePath), { force: true, recursive: true });
|
|
81
84
|
}
|
|
82
85
|
}
|