@rigour-labs/mcp 6.7.10 → 6.8.0

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
@@ -34,6 +34,7 @@ the directory the server started in.
34
34
  | `rigour_reviewer_verdict` | What the reviewer last decided for the branch (read-only) |
35
35
  | `rigour_check`, `rigour_get_fix_packet` | Run the checks, and get the violations a page at a time |
36
36
  | `rigour_index`, `rigour_context_scope`, `rigour_check_pattern` | Find the few files a task needs, and whether a helper already exists |
37
+ | `rigour_brief` | The team's briefing for a task before writing: rules, verified lessons, settled points; at most 10, each cited |
37
38
  | `rigour_recall`, `rigour_remember` | Recall and store conventions and lessons |
38
39
 
39
40
  More groups (agent teams, context, telemetry) are listed with `RIGOUR_MCP_TOOLS`. Every tool:
@@ -1,6 +1,6 @@
1
1
  export declare const TOOL_GROUPS: {
2
2
  /** Load memory, scope context, avoid reinvention, gate and review the change, learn. */
3
- readonly core: readonly ["rigour_recall", "rigour_index", "rigour_context_scope", "rigour_check_pattern", "rigour_check", "rigour_review", "rigour_review_ack", "rigour_reviewer_verdict", "rigour_get_fix_packet", "rigour_remember"];
3
+ readonly core: readonly ["rigour_brief", "rigour_recall", "rigour_index", "rigour_context_scope", "rigour_check_pattern", "rigour_check", "rigour_review", "rigour_review_ack", "rigour_reviewer_verdict", "rigour_get_fix_packet", "rigour_remember"];
4
4
  /** Multi-agent registration, checkpoints, handoffs, hooks and supervised runs. */
5
5
  readonly governance: readonly ["rigour_agent_register", "rigour_agent_deregister", "rigour_checkpoint", "rigour_handoff", "rigour_handoff_accept", "rigour_hooks_check", "rigour_hooks_init", "rigour_run", "rigour_run_supervised"];
6
6
  /** Occasional context and security tools. */
@@ -173,6 +173,37 @@ export declare function getAdvertisedToolDefinitions(spec?: string | undefined,
173
173
  idempotentHint: boolean;
174
174
  openWorldHint: boolean;
175
175
  };
176
+ } | {
177
+ name: string;
178
+ description: string;
179
+ inputSchema: {
180
+ type: string;
181
+ properties: {
182
+ goal: {
183
+ type: string;
184
+ description: string;
185
+ };
186
+ files: {
187
+ type: string;
188
+ items: {
189
+ type: string;
190
+ };
191
+ description: string;
192
+ };
193
+ cwd: {
194
+ type: "string";
195
+ description: string;
196
+ };
197
+ };
198
+ required: string[];
199
+ };
200
+ annotations: {
201
+ title: string;
202
+ readOnlyHint: boolean;
203
+ destructiveHint: boolean;
204
+ idempotentHint: boolean;
205
+ openWorldHint: boolean;
206
+ };
176
207
  } | {
177
208
  name: string;
178
209
  description: string;
@@ -16,6 +16,7 @@ import { TOOL_DEFINITIONS } from './tools/definitions.js';
16
16
  export const TOOL_GROUPS = {
17
17
  /** Load memory, scope context, avoid reinvention, gate and review the change, learn. */
18
18
  core: [
19
+ 'rigour_brief',
19
20
  'rigour_recall',
20
21
  'rigour_index',
21
22
  'rigour_context_scope',
package/dist/index.js CHANGED
@@ -28,6 +28,7 @@ import { getAdvertisedToolDefinitions } from './advertised-tools.js';
28
28
  import { handleCheck, handleExplain, handleStatus, handleGetFixPacket, handleListGates, handleGetConfig } from './tools/quality-handlers.js';
29
29
  import { handleRemember, handleForget } from './tools/memory-handlers.js';
30
30
  import { handleRecall } from './tools/memory-recall.js';
31
+ import { handleBrief } from './tools/brief-handler.js';
31
32
  import { handleCheckPattern, handleSecurityAudit } from './tools/pattern-handlers.js';
32
33
  import { handleRun, handleRunSupervised } from './tools/execution-handlers.js';
33
34
  import { handleAgentRegister, handleCheckpoint, handleHandoff, handleAgentDeregister, handleHandoffAccept } from './tools/agent-handlers.js';
@@ -157,6 +158,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
157
158
  case "rigour_recall":
158
159
  result = await handleRecall(cwd, { key: args.key, query: args.query });
159
160
  break;
161
+ case "rigour_brief":
162
+ result = handleBrief(cwd, config, args);
163
+ break;
160
164
  case "rigour_forget":
161
165
  result = await handleForget(cwd, args.key, args.scope);
162
166
  break;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * rigour_brief: the team's briefing for a task, for any agent that speaks MCP (Claude Code gets it from a prompt hook).
3
+ * Read-only apart from the task thread's record of what was briefed; nothing when the team switched briefings off.
4
+ */
5
+ import { type Config } from '@rigour-labs/core';
6
+ export declare function handleBrief(cwd: string, config: Config, args: {
7
+ goal?: string;
8
+ files?: unknown;
9
+ agent?: string;
10
+ }): {
11
+ content: Array<{
12
+ type: 'text';
13
+ text: string;
14
+ }>;
15
+ };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * rigour_brief: the team's briefing for a task, for any agent that speaks MCP (Claude Code gets it from a prompt hook).
3
+ * Read-only apart from the task thread's record of what was briefed; nothing when the team switched briefings off.
4
+ */
5
+ import { briefFile, briefingText, briefTask, fileBriefingText } from '@rigour-labs/core';
6
+ export function handleBrief(cwd, config, args) {
7
+ if (config.brief?.enabled === false || /^(0|false|off|no)$/i.test(process.env.RIGOUR_BRIEF?.trim() ?? '')) {
8
+ return { content: [{ type: 'text', text: 'Briefings are switched off in this repository (brief.enabled: false, or RIGOUR_BRIEF=0).' }] };
9
+ }
10
+ const files = Array.isArray(args.files) ? args.files.filter((f) => typeof f === 'string' && !!f.trim()) : undefined;
11
+ const lessons = config.gates.deep?.review_lessons;
12
+ const agent = args.agent ?? 'mcp';
13
+ // Files and no goal: the agent is about to edit them; the team's word on each, like the edit hook (at most three each, ten in all).
14
+ if (!args.goal?.trim() && files?.length) {
15
+ const texts = files.slice(0, 10).map(file => fileBriefingText(briefFile(cwd, file, { agent, ...(lessons ? { lessons } : {}) }))).filter(Boolean);
16
+ return { content: [{ type: 'text', text: texts.join('\n\n') || `Nothing to brief for ${files.join(', ')}: no rule or lesson of this repository names them yet.` }] };
17
+ }
18
+ const briefing = briefTask(cwd, { goal: args.goal, ...(files?.length ? { files } : {}), limit: config.brief?.max_items ?? 10, agent, ...(lessons ? { lessons } : {}) });
19
+ const text = briefingText(briefing) || `Nothing to brief: no rule or verified lesson of this repository applies to ${briefing.files.length ? briefing.files.join(', ') : 'this task'} yet.`;
20
+ return { content: [{ type: 'text', text }] };
21
+ }
@@ -176,6 +176,37 @@ export declare const TOOL_DEFINITIONS: ({
176
176
  idempotentHint: boolean;
177
177
  openWorldHint: boolean;
178
178
  };
179
+ } | {
180
+ name: string;
181
+ description: string;
182
+ inputSchema: {
183
+ type: string;
184
+ properties: {
185
+ goal: {
186
+ type: string;
187
+ description: string;
188
+ };
189
+ files: {
190
+ type: string;
191
+ items: {
192
+ type: string;
193
+ };
194
+ description: string;
195
+ };
196
+ cwd: {
197
+ type: "string";
198
+ description: string;
199
+ };
200
+ };
201
+ required: string[];
202
+ };
203
+ annotations: {
204
+ title: string;
205
+ readOnlyHint: boolean;
206
+ destructiveHint: boolean;
207
+ idempotentHint: boolean;
208
+ openWorldHint: boolean;
209
+ };
179
210
  } | {
180
211
  name: string;
181
212
  description: string;
@@ -195,6 +195,26 @@ export const TOOL_DEFINITIONS = [
195
195
  openWorldHint: false,
196
196
  },
197
197
  },
198
+ {
199
+ name: "rigour_brief",
200
+ description: "Before writing: with goal, the team's rules, lessons and settled points for the task (max 10, cited); with only files, its word on each file you will edit. A [must] you break blocks at review.",
201
+ inputSchema: {
202
+ type: "object",
203
+ properties: {
204
+ ...cwdParam(),
205
+ goal: { type: "string", description: "What the task is for: the request or the ticket summary." },
206
+ files: { type: "array", items: { type: "string" }, description: "Optional. Files the task will touch." },
207
+ },
208
+ required: ["cwd"],
209
+ },
210
+ annotations: {
211
+ title: "Brief Before Writing",
212
+ readOnlyHint: true,
213
+ destructiveHint: false,
214
+ idempotentHint: true,
215
+ openWorldHint: false,
216
+ },
217
+ },
198
218
  {
199
219
  name: "rigour_recall",
200
220
  description: "Load stored conventions. At the START of a task, call it with 'query' describing the task to get the few memories that match by meaning, plus promoted team knowledge when team mode is on. With 'key' it returns that memory; with neither, every repository and user memory.",
@@ -257,6 +257,10 @@ export declare function loadConfig(cwd: string): Promise<{
257
257
  output: {
258
258
  report_path: string;
259
259
  };
260
+ brief: {
261
+ enabled: boolean;
262
+ max_items: number;
263
+ };
260
264
  review: {
261
265
  include_heuristics: boolean;
262
266
  show_preexisting: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rigour-labs/mcp",
3
- "version": "6.7.10",
3
+ "version": "6.8.0",
4
4
  "description": "Rigour's MCP server: lets coding agents review their change, check for an existing helper before writing a new one, and recall the team's lessons. Works with Claude Code, Cursor and other MCP clients.",
5
5
  "engines": {
6
6
  "node": ">=22.13"
@@ -65,7 +65,7 @@
65
65
  "execa": "^8.0.1",
66
66
  "fs-extra": "^11.4.0",
67
67
  "yaml": "^2.8.2",
68
- "@rigour-labs/core": "6.7.10"
68
+ "@rigour-labs/core": "6.8.0"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@types/node": "^25.0.3",