@assistkick/create 1.16.0 → 1.17.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assistkick/create",
3
- "version": "1.16.0",
3
+ "version": "1.17.0",
4
4
  "description": "Scaffold assistkick-product-system into any project",
5
5
  "type": "module",
6
6
  "bin": {
@@ -259,7 +259,7 @@ const terminalHandler = new TerminalWsHandler({ wss: terminalWss, authService, p
259
259
 
260
260
  // Set up WebSocket for Chat v2 streaming with permission management
261
261
  const chatWss = new WebSocketServer({ noServer: true });
262
- const chatCliBridge = new ChatCliBridge({ workspacesDir: paths.workspacesDir, log });
262
+ const chatCliBridge = new ChatCliBridge({ projectRoot: paths.projectRoot, workspacesDir: paths.workspacesDir, log });
263
263
  const permissionService = new PermissionService({ getDb, log });
264
264
  const titleGeneratorService = new TitleGeneratorService({ log });
265
265
  const chatHandler = new ChatWsHandler({ wss: chatWss, authService, chatCliBridge, permissionService, chatMessageRepository, chatSessionService, titleGeneratorService, log });
@@ -69,6 +69,7 @@ describe('ChatCliBridge', () => {
69
69
  lastSpawnArgs = null;
70
70
 
71
71
  bridge = new ChatCliBridge({
72
+ projectRoot: '/data/project',
72
73
  workspacesDir: WORKSPACES_DIR,
73
74
  log: logMock,
74
75
  backendPort: 3000,
@@ -82,18 +83,19 @@ describe('ChatCliBridge', () => {
82
83
  createdConfigs.length = 0;
83
84
  });
84
85
 
85
- describe('getWorkspaceCwd', () => {
86
+ describe('getWorkspacePath', () => {
86
87
  it('returns the correct workspace path for a project', () => {
87
- const cwd = bridge.getWorkspaceCwd('proj_abc');
88
- assert.equal(cwd, '/data/workspaces/proj_abc');
88
+ const wsPath = bridge.getWorkspacePath('proj_abc');
89
+ assert.equal(wsPath, '/data/workspaces/proj_abc');
89
90
  });
90
91
 
91
92
  it('uses the injected workspacesDir', () => {
92
93
  const customBridge = new ChatCliBridge({
94
+ projectRoot: '/custom/root',
93
95
  workspacesDir: '/custom/path',
94
96
  log: logMock,
95
97
  });
96
- assert.equal(customBridge.getWorkspaceCwd('proj_x'), '/custom/path/proj_x');
98
+ assert.equal(customBridge.getWorkspacePath('proj_x'), '/custom/path/proj_x');
97
99
  });
98
100
  });
99
101
 
@@ -19,6 +19,7 @@ import { existsSync, mkdirSync } from 'node:fs';
19
19
  export type PermissionMode = 'skip' | 'allowed_tools';
20
20
 
21
21
  export interface ChatCliBridgeDeps {
22
+ projectRoot: string;
22
23
  workspacesDir: string;
23
24
  log: (tag: string, ...args: unknown[]) => void;
24
25
  }
@@ -53,20 +54,21 @@ export interface SpawnResult {
53
54
  }
54
55
 
55
56
  export class ChatCliBridge {
57
+ private readonly projectRoot: string;
56
58
  private readonly workspacesDir: string;
57
59
  private readonly log: ChatCliBridgeDeps['log'];
58
60
  private readonly activeProcesses = new Map<string, ChildProcess>();
59
61
 
60
- constructor({ workspacesDir, log }: ChatCliBridgeDeps) {
62
+ constructor({ projectRoot, workspacesDir, log }: ChatCliBridgeDeps) {
63
+ this.projectRoot = projectRoot;
61
64
  this.workspacesDir = workspacesDir;
62
65
  this.log = log;
63
66
  }
64
67
 
65
68
  /**
66
- * Resolve the workspace directory for a project.
67
- * The CLI runs with cwd set to this path.
69
+ * Resolve the workspace directory path for a project (used in system prompt).
68
70
  */
69
- getWorkspaceCwd = (projectId: string): string => {
71
+ getWorkspacePath = (projectId: string): string => {
70
72
  return join(this.workspacesDir, projectId);
71
73
  };
72
74
 
@@ -112,18 +114,22 @@ export class ChatCliBridge {
112
114
  systemParts.push(continuationContext);
113
115
  }
114
116
 
117
+ const wsPath = this.getWorkspacePath(projectId);
115
118
  systemParts.push(`We are working on project-id ${projectId}
116
- You are only allowed to read/write/edit/delete (any work with) files in the /workspaces/${projectId} directory.
119
+
120
+ ## Project Workspace
121
+ The project workspace is at: ${wsPath}
122
+ All file edits (write, edit, delete, create) MUST target files inside the workspace directory above.
123
+ You may read files from anywhere in the project root for context, but all changes go into the workspace.
117
124
 
118
125
  ## Git Repository Structure
119
- Each project workspace (workspaces/${projectId}/) has its OWN independent git repo
120
- When committing and pushing changes, always use the workspace git repo (your cwd), not the top-level repo.
121
- The skill files (.claude/skills/) and project code are tracked in the workspace repo.
126
+ The workspace (${wsPath}) has its OWN independent git repo.
127
+ When committing and pushing changes, always use the workspace git repo, not the top-level repo.
122
128
 
123
129
  ## Skills
124
- Project skills (e.g. assistkick-interview, assistkick-developer, etc.) are defined in .claude/skills/ within this workspace.
130
+ Project skills (e.g. assistkick-interview, assistkick-developer, etc.) are available via the Skill tool.
125
131
  To invoke a skill, always use the Skill tool (e.g. Skill with skill: "assistkick-interview"). Do NOT manually read or execute skill files — the Skill tool handles loading and execution.
126
- Only edit code and project files — never modify the skill definition files in .claude/skills/.`);
132
+ Only edit code and project files — never modify skill definition files.`);
127
133
 
128
134
  systemPrompt = systemParts.join('\n\n');
129
135
  args.push('--append-system-prompt', systemPrompt);
@@ -160,12 +166,13 @@ export class ChatCliBridge {
160
166
  */
161
167
  spawn = (options: SpawnOptions): SpawnResult => {
162
168
  const { projectId, message, claudeSessionId, isNewSession, onEvent } = options;
163
- const cwd = this.getWorkspaceCwd(projectId);
169
+ const cwd = this.projectRoot;
170
+ const wsPath = this.getWorkspacePath(projectId);
164
171
  const { args, systemPrompt } = this.buildArgs(options);
165
172
 
166
173
  // Ensure workspace directory exists (Docker volumes may not have project subdirs)
167
- if (!existsSync(cwd)) {
168
- mkdirSync(cwd, { recursive: true });
174
+ if (!existsSync(wsPath)) {
175
+ mkdirSync(wsPath, { recursive: true });
169
176
  }
170
177
 
171
178
  const mode = isNewSession ? 'new' : 'resume';