sp-rag 0.6.4 → 0.6.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 CHANGED
@@ -17,7 +17,7 @@ CLI để setup nhanh SP-RAG theo hướng dev-friendly:
17
17
  ## Trạng thái package
18
18
 
19
19
  - package npm public: `sp-rag`
20
- - version đang publish: `0.6.4`
20
+ - version đang publish: `0.6.5`
21
21
  - binary public: `sp-rag`
22
22
 
23
23
  ## Cài từ source trong monorepo
@@ -70,6 +70,7 @@ Ghi chú:
70
70
 
71
71
  - với `cursor` và `vscode` ở `scope project`, nếu Sếpp đang đứng sẵn trong repo thì có thể bỏ `--cwd`
72
72
  - CLI sẽ tự dùng thư mục hiện tại cho cả MCP lẫn skill
73
+ - rule/agent mới đã được tăng độ ưu tiên MCP-first, giảm khả năng model nhảy thẳng sang grep/read file local
73
74
 
74
75
  Ví dụ:
75
76
 
package/dist/cli.js CHANGED
@@ -4,7 +4,7 @@ import { runEvaluationSuite } from './lib/eval.js';
4
4
  import { defaultBaseUrl, defaultMcpServerAlias, defaultMcpUrl, installMcpConfig, resolveMcpConfigPath, } from './lib/mcp-config.js';
5
5
  import { fetchJson, fetchText, runDoctor } from './lib/http.js';
6
6
  import { installSkill, resolveSkillInstallTarget, } from './lib/skill.js';
7
- const cliVersion = '0.6.4';
7
+ const cliVersion = '0.6.5';
8
8
  function parseArgv(argv) {
9
9
  const positionals = [];
10
10
  const options = {};
package/dist/lib/skill.js CHANGED
@@ -62,7 +62,7 @@ export function defaultSkillDir(client = 'codex', cwd, scope) {
62
62
  function renderSkillMarkdown(context) {
63
63
  return `---
64
64
  name: sp-rag
65
- description: Use SP-RAG whenever the user asks about this codebase, internal business domain, rendered docs, import inventory, or codegraph sync status. Prefer MCP-backed evidence before answering from memory.
65
+ description: Use SP-RAG whenever the user asks about this codebase, internal business domain, rendered docs, import inventory, or codegraph sync status. You must call SP-RAG MCP tools first before answering from memory or reading local files.
66
66
  ---
67
67
 
68
68
  # SP-RAG
@@ -88,27 +88,30 @@ Docs URL: \`${context.docsUrl}\`
88
88
 
89
89
  ## Guardrails
90
90
 
91
+ - You must call SP-RAG MCP tools first for codebase or domain questions before using local workspace search, grep, or file reads.
91
92
  - Prefer MCP-grounded answers before relying on memory.
92
93
  - If the evidence may be stale, say so clearly and mention that the graph or docs may need a refresh.
93
94
  - Do not trigger sync or import actions unless the user asked for it or the workflow truly requires it.
94
95
  - When rendered docs already answer the question, cite or summarize those docs instead of rewriting everything from scratch.
96
+ - Only fall back to local workspace search or file reads after MCP is unavailable or clearly lacks the needed evidence, and say that you are falling back.
95
97
  `;
96
98
  }
97
99
  function renderCursorRule(context) {
98
100
  return `---
99
101
  description: Use SP-RAG when the request is about this codebase, internal business workflows, rendered docs, import inventory, or codegraph sync status.
100
102
  globs:
101
- alwaysApply: false
103
+ alwaysApply: true
102
104
  ---
103
105
 
104
106
  # SP-RAG
105
107
 
106
- - Prefer the \`${context.serverAlias}\` MCP server at \`${context.mcpUrl}\` before answering from memory.
108
+ - You must call the \`${context.serverAlias}\` MCP server first before using local workspace search, grep, or file reads for codebase and domain questions.
107
109
  - Use rendered docs from \`${context.docsUrl}\` when documentation already answers the question.
108
110
  - For architecture, domain, entities, relations, and business workflow questions, query MCP first and only then synthesize the answer.
109
111
  - For freshness or operational questions, check sync status, recent runs, and metrics before assuming the graph is current.
110
112
  - Only trigger codegraph sync when the user explicitly asks for it or stale evidence is the confirmed blocker.
111
113
  - If the evidence may be stale, say so clearly.
114
+ - Only fall back to local workspace search after MCP is unavailable or clearly lacks the needed evidence, and say that you are falling back.
112
115
  `;
113
116
  }
114
117
  function renderVsCodeAgent(context) {
@@ -122,6 +125,8 @@ You are the SP-RAG custom agent for this workspace.
122
125
 
123
126
  Use the \`${context.serverAlias}\` MCP server at \`${context.mcpUrl}\` and the rendered docs URL \`${context.docsUrl}\` as your grounded source of truth.
124
127
 
128
+ You must call an SP-RAG MCP tool before using local workspace search, grep, or file reads for codebase and domain questions.
129
+
125
130
  ## Recommended Workflow
126
131
 
127
132
  1. Start with \`healthz\` if connectivity or freshness is uncertain.
@@ -133,9 +138,11 @@ Use the \`${context.serverAlias}\` MCP server at \`${context.mcpUrl}\` and the r
133
138
  ## Guardrails
134
139
 
135
140
  - Prefer MCP-grounded evidence before answering from memory.
141
+ - Do not use local workspace search, grep, or file reads until SP-RAG MCP has been tried first for the current question.
136
142
  - When evidence may be stale, say so clearly and mention that a refresh might be needed.
137
143
  - Do not trigger sync or import actions unless the workflow truly requires it.
138
144
  - When rendered docs already answer the question, summarize those docs instead of rewriting everything from scratch.
145
+ - Only fall back to local workspace search or file reads after MCP is unavailable or clearly lacks the needed evidence, and say that you are falling back.
139
146
  `;
140
147
  }
141
148
  function renderSkillArtifact(context) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sp-rag",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "CLI cho setup MCP, codegraph GitNexus và skill của SP-RAG",
5
5
  "type": "module",
6
6
  "files": [