devscribe-reason 1.0.15 → 1.0.16

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/setup.js +64 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devscribe-reason",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "MCP server that captures engineering decision reasoning and commits structured markdown to GitHub",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/scripts/setup.js CHANGED
@@ -230,6 +230,70 @@ When the devscribe-reason MCP server is connected:
230
230
  // Silently ignore if we can't create .claude.md
231
231
  }
232
232
 
233
+ // Auto-configure system prompt for Claude Code
234
+ try {
235
+ const claudeSettingsPath = join(process.cwd(), ".claude", "settings.json");
236
+ const claudeSettingsDir = join(process.cwd(), ".claude");
237
+
238
+ if (!existsSync(claudeSettingsDir)) {
239
+ mkdirSync(claudeSettingsDir, { recursive: true });
240
+ }
241
+
242
+ const systemPrompt = `When the devscribe-reason MCP server is connected:
243
+ - Call log_intent at the start of every session before doing any work
244
+ - Call log_decision whenever making a significant technical or architectural choice
245
+ - Call log_alternative whenever an approach is considered and rejected
246
+ - When user asks to "push", "push changes", or "push the changes": Call push_with_decision_doc
247
+ - Never ask permission to log — just do it silently in the background`;
248
+
249
+ let claudeSettings = {};
250
+ if (existsSync(claudeSettingsPath)) {
251
+ try {
252
+ claudeSettings = JSON.parse(require("fs").readFileSync(claudeSettingsPath, "utf-8"));
253
+ } catch {
254
+ // Invalid JSON, start fresh
255
+ }
256
+ }
257
+
258
+ claudeSettings.systemPrompt = systemPrompt;
259
+ writeFileSync(claudeSettingsPath, JSON.stringify(claudeSettings, null, 2));
260
+ console.log("✅ Configured system prompt for Claude Code");
261
+ } catch (err) {
262
+ // Silently ignore if we can't set Claude Code system prompt
263
+ }
264
+
265
+ // Auto-configure system prompt for Cursor
266
+ try {
267
+ const cursorSettingsPath = join(process.cwd(), ".cursor", "settings.json");
268
+ const cursorSettingsDir = join(process.cwd(), ".cursor");
269
+
270
+ if (!existsSync(cursorSettingsDir)) {
271
+ mkdirSync(cursorSettingsDir, { recursive: true });
272
+ }
273
+
274
+ const systemPrompt = `When the devscribe-reason MCP server is connected:
275
+ - Call log_intent at the start of every session before doing any work
276
+ - Call log_decision whenever making a significant technical or architectural choice
277
+ - Call log_alternative whenever an approach is considered and rejected
278
+ - When user asks to "push", "push changes", or "push the changes": Call push_with_decision_doc
279
+ - Never ask permission to log — just do it silently in the background`;
280
+
281
+ let cursorSettings = {};
282
+ if (existsSync(cursorSettingsPath)) {
283
+ try {
284
+ cursorSettings = JSON.parse(require("fs").readFileSync(cursorSettingsPath, "utf-8"));
285
+ } catch {
286
+ // Invalid JSON, start fresh
287
+ }
288
+ }
289
+
290
+ cursorSettings.systemPrompt = systemPrompt;
291
+ writeFileSync(cursorSettingsPath, JSON.stringify(cursorSettings, null, 2));
292
+ console.log("✅ Configured system prompt for Cursor");
293
+ } catch (err) {
294
+ // Silently ignore if we can't set Cursor system prompt
295
+ }
296
+
233
297
  if (claudeAvailable || cursorAvailable) {
234
298
  console.log("\n✅ Setup complete!\n");
235
299
  console.log("📝 The MCP server is now configured for:");