Skip to content

Commit 9bbdd4f

Browse files
Lexus2016claude
andcommitted
fix: bump version to 5.18.1 and seed default slash commands on fresh install
- package.json: version 5.17.0 → 5.18.1 (was missing, release tag was wrong) - server.js: define DEFAULT_SLASH_COMMANDS constant (8 built-in commands) - loadConfig() now seeds defaults into config.json when slashCommands key is absent (first run / fresh npx install) — existing user edits are preserved Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 96917a1 commit 9bbdd4f

2 files changed

Lines changed: 28 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "claude-code-studio",
3-
"version": "5.17.0",
3+
"version": "5.18.1",
44
"description": "Full-featured web workspace for Claude Code — chat, Kanban, multi-agent, MCP, skills, projects",
55
"bin": {
66
"claude-code-studio": "./bin/cli.js"

server.js

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -783,8 +783,33 @@ function buildUserContent(text, attachments = []) {
783783
// ============================================
784784
// CONFIG
785785
// ============================================
786-
/** Load LOCAL config only — used by write operations (add/delete MCP, upload/delete skill). */
787-
function loadConfig() { try { return JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf-8')); } catch { return { mcpServers:{}, skills:{} }; } }
786+
787+
/** Default slash commands — seeded into config.json on first run / fresh install. */
788+
const DEFAULT_SLASH_COMMANDS = [
789+
{ id: 'sc1', name: '/check', text: 'Check this step by step: syntax, logic, edge cases, and potential bugs. Be thorough.' },
790+
{ id: 'sc2', name: '/review', text: 'Do a thorough code review: readability, performance, security, and adherence to best practices. Point out issues with severity levels (critical / warning / suggestion).' },
791+
{ id: 'sc3', name: '/fix', text: 'Find and fix the bug. Explain what caused it and exactly what you changed.' },
792+
{ id: 'sc4', name: '/explain', text: 'Explain this code clearly: what it does, how it works, and why it\'s structured this way. Use examples if helpful.' },
793+
{ id: 'sc5', name: '/refactor', text: 'Refactor this code for clarity and maintainability. Keep the exact same behavior. Show what changed and why.' },
794+
{ id: 'sc6', name: '/test', text: 'Write comprehensive tests: happy path, edge cases, and error scenarios. Explain what each test covers.' },
795+
{ id: 'sc7', name: '/docs', text: 'Write clear documentation: purpose, parameters, return values, usage examples, and any gotchas.' },
796+
{ id: 'sc8', name: '/optimize', text: 'Analyze performance and optimize. Identify bottlenecks, propose improvements, quantify the expected gains.' },
797+
];
798+
799+
/** Load LOCAL config only — used by write operations (add/delete MCP, upload/delete skill).
800+
* Seeds default slash commands into config.json if the key is absent (fresh install). */
801+
function loadConfig() {
802+
let c;
803+
try { c = JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf-8')); } catch { c = {}; }
804+
if (!c.mcpServers) c.mcpServers = {};
805+
if (!c.skills) c.skills = {};
806+
// Seed defaults only when the key is absent — preserves any user edits
807+
if (!Object.prototype.hasOwnProperty.call(c, 'slashCommands')) {
808+
c.slashCommands = DEFAULT_SLASH_COMMANDS;
809+
try { fs.writeFileSync(CONFIG_PATH, JSON.stringify(c, null, 2)); } catch {}
810+
}
811+
return c;
812+
}
788813
function saveConfig(c) {
789814
fs.writeFileSync(CONFIG_PATH, JSON.stringify(c, null, 2));
790815
_mergedConfigCache = null; // invalidate on every write

0 commit comments

Comments
 (0)