@kentwynn/kgraph 0.2.29 → 0.2.30

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.
@@ -12,16 +12,9 @@ ${numberedWorkflow('claude-code', {
12
12
  commandFiles: [
13
13
  {
14
14
  path: '.claude/commands/kgraph.md',
15
- content: `Use KGraph persistent repo intelligence through the single normal \`kgraph "<topic>" --agent claude-code\` entry point.
15
+ content: `## KGraph Workflow
16
16
 
17
- 1. Infer a concise topic from the user's request.
18
- 2. Run exactly one command from the repository root: \`kgraph "<topic>" --agent claude-code\`.
19
- 3. Treat the returned files, symbols, relationships, atoms, and warnings as the first-pass source of truth.
20
- 4. If the user asked for an edit, inspect only the returned candidate file or the smallest necessary range, then make the edit.
21
- 5. Verify the change actually landed before claiming completion. Prefer a narrow read of the changed range or \`git diff -- <path>\`; if there is no diff or the expected text is missing, say the edit did not apply and fix it before summarizing.
22
- 6. Do not run \`kgraph\` again, \`kgraph context\`, \`kgraph pack\`, \`kgraph knowledge\`, \`kgraph stale\`, \`kgraph blame\`, \`kgraph scan\`, \`kgraph update\`, \`kgraph compact\`, or \`kgraph repair\` unless the user explicitly asks for that lower-level command.
23
- 7. Do not continue broad repository search after the target file is identified. If a path must be located, prefer \`rg --files\` and quote paths containing spaces or parentheses.
24
- 8. At the end of repository-file changes, run \`kgraph "<topic>" --final --agent claude-code\`. If KGraph reports capture-required, run \`kgraph "<topic>" --capture "<durable conclusion>" --capture-file <path> --capture-symbol <name> --agent claude-code\`, or explicitly say "No durable knowledge created" only when there is genuinely no reusable knowledge.
17
+ ${numberedWorkflow('claude-code')}
25
18
  `,
26
19
  },
27
20
  {
@@ -8,6 +8,19 @@ export const copilotAdapter = {
8
8
 
9
9
  ${numberedWorkflow('copilot')}
10
10
  `,
11
- commandFiles: agentSkillFiles('copilot'),
11
+ commandFiles: [
12
+ ...agentSkillFiles('copilot'),
13
+ {
14
+ path: '.github/agents/kgraph.agent.md',
15
+ content: `---
16
+ description: Use KGraph persistent repo intelligence — runs kgraph before answering to provide file maps, symbols, relationships, and durable knowledge atoms.
17
+ ---
18
+
19
+ ## KGraph Workflow
20
+
21
+ ${numberedWorkflow('copilot')}
22
+ `,
23
+ },
24
+ ],
12
25
  obsoleteCommandFiles: [],
13
26
  };
@@ -8,8 +8,11 @@ const REPAIR_STEP = `Run \`kgraph repair --dry-run\` before cleanup when stale/n
8
8
  const COMPACT_STEP = `Run \`kgraph compact --dry-run\` when cognition looks duplicated, noisy, or stale. Run \`kgraph compact\` only when the user asks to merge/archive cognition.`;
9
9
  const HISTORY_STEP = `Run \`kgraph history\` or \`kgraph history "<topic>"\` to review past cognition sessions with git author attribution.`;
10
10
  const KNOWLEDGE_STEP = `Run \`kgraph knowledge list --topic "<topic>"\` or \`kgraph knowledge get <atom-id>\` when the user asks what KGraph remembers or atom provenance/lifecycle matters.`;
11
+ function inboxStep(agentName) {
12
+ return `If the previous command output contains "pending inbox" or a \`pendingInbox\` field with count > 0, you MUST run \`kgraph "<topic>" --agent ${agentName}\` or \`kgraph update\` immediately before proceeding. Do not skip this step.`;
13
+ }
11
14
  function packStep(agentName) {
12
- return `For normal coding context, treat \`kgraph pack "<task>" --budget 8000 --json --agent ${agentName}\` as the machine-readable context contract: use atoms, source ranges, git changes, omitted items, and inclusion reasons from the ContextPack before reading files. If the pack reports pending inbox notes, run \`kgraph "<topic>" --agent ${agentName}\` or \`kgraph update\` before relying on history or newly captured atoms.`;
15
+ return `For normal coding context, treat \`kgraph pack "<task>" --budget 8000 --json --agent ${agentName}\` as the machine-readable context contract: use atoms, source ranges, git changes, omitted items, and inclusion reasons from the ContextPack before reading files.`;
13
16
  }
14
17
  function smartRootStep(agentName) {
15
18
  return `Use the root workflow when refresh or memory processing matters: run \`kgraph "<topic>" --agent ${agentName}\` to refresh maps, process inbox notes, and return a briefing; run \`kgraph "<topic>" --final --agent ${agentName}\` before the final answer when repository files changed; run \`kgraph "<topic>" --capture "<durable conclusion>" --capture-file <path> --capture-symbol <name> --agent ${agentName}\` when the final check requires durable knowledge.`;
@@ -29,24 +32,25 @@ function sessionStep(agentName, qualifier) {
29
32
  export function numberedWorkflow(agentName, options = {}) {
30
33
  return `1. Infer the topic from the user's request.
31
34
  2. {{KGRAPH_CONTEXT_POLICY}}
32
- 3. ${ROUTING_STEP}
33
- 4. Use the returned files, symbols, relationships, and cognition before broad exploration.
34
- 5. ${EXPLORATION_BOUNDARY_STEP}
35
- 6. ${VERIFY_EDIT_STEP}
36
- 7. ${smartRootStep(agentName)}
37
- 8. ${packStep(agentName)}
38
- 9. ${KNOWLEDGE_STEP}
39
- 10. ${DOCTOR_STEP}
40
- 11. ${STALE_STEP}
41
- 12. ${sessionStep(agentName, options.sessionQualifier)}
42
- 13. ${IMPACT_STEP}
35
+ 3. ${inboxStep(agentName)}
36
+ 4. ${ROUTING_STEP}
37
+ 5. Use the returned files, symbols, relationships, and cognition before broad exploration.
38
+ 6. ${EXPLORATION_BOUNDARY_STEP}
39
+ 7. ${VERIFY_EDIT_STEP}
40
+ 8. ${smartRootStep(agentName)}
41
+ 9. ${packStep(agentName)}
42
+ 10. ${KNOWLEDGE_STEP}
43
+ 11. ${DOCTOR_STEP}
44
+ 12. ${STALE_STEP}
45
+ 13. ${sessionStep(agentName, options.sessionQualifier)}
46
+ 14. ${IMPACT_STEP}
43
47
 
44
48
  {{KGRAPH_CAPTURE_POLICY}}
45
49
 
46
- 14. ${REPAIR_STEP}
47
- 15. ${COMPACT_STEP}
48
- 16. Run \`kgraph visualize\` when the user wants to inspect the dependency graph — opens an interactive graph at http://localhost:4242 with PNG export.
49
- 17. ${HISTORY_STEP}`;
50
+ 15. ${REPAIR_STEP}
51
+ 16. ${COMPACT_STEP}
52
+ 17. Run \`kgraph visualize\` when the user wants to inspect the dependency graph — opens an interactive graph at http://localhost:4242 with PNG export.
53
+ 18. ${HISTORY_STEP}`;
50
54
  }
51
55
  /**
52
56
  * Returns the bullet-list workflow for rules files.
@@ -54,6 +58,7 @@ export function numberedWorkflow(agentName, options = {}) {
54
58
  */
55
59
  export function bulletWorkflow(agentName, options = {}) {
56
60
  return `- {{KGRAPH_CONTEXT_POLICY}}
61
+ - ${inboxStep(agentName)}
57
62
  - ${ROUTING_STEP}
58
63
  - ${EXPLORATION_BOUNDARY_STEP}
59
64
  - ${VERIFY_EDIT_STEP}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kentwynn/kgraph",
3
- "version": "0.2.29",
3
+ "version": "0.2.30",
4
4
  "description": "Persistent repo intelligence for AI coding assistants.",
5
5
  "type": "module",
6
6
  "bin": {