@slycode/slycode 0.1.14 → 0.1.15

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 (81) hide show
  1. package/dist/bridge/session-manager.js +1 -8
  2. package/dist/bridge/session-manager.js.map +1 -1
  3. package/dist/store/skills/context-priming/references/area-index.md +121 -68
  4. package/{templates/store/skills/context-priming/references → dist/store/skills/context-priming}/references/areas/feature-guide.md +44 -18
  5. package/dist/store/skills/context-priming/references/areas/messaging.md +108 -34
  6. package/dist/store/skills/context-priming/references/areas/scripts-deployment.md +61 -16
  7. package/dist/store/skills/context-priming/references/areas/skills.md +99 -38
  8. package/{templates/updates/skills/context-priming/references → dist/store/skills/context-priming}/references/areas/terminal-actions.md +1 -1
  9. package/dist/store/skills/context-priming/references/areas/terminal-bridge.md +74 -42
  10. package/dist/store/skills/context-priming/references/areas/web-frontend.md +259 -74
  11. package/dist/web/.next/BUILD_ID +1 -1
  12. package/dist/web/.next/build-manifest.json +2 -2
  13. package/dist/web/.next/server/app/_global-error.html +2 -2
  14. package/dist/web/.next/server/app/_global-error.rsc +1 -1
  15. package/dist/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  16. package/dist/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  17. package/dist/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  18. package/dist/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  19. package/dist/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  20. package/dist/web/.next/server/app/_not-found.html +1 -1
  21. package/dist/web/.next/server/app/_not-found.rsc +1 -1
  22. package/dist/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  23. package/dist/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  24. package/dist/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  25. package/dist/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  26. package/dist/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  27. package/dist/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  28. package/dist/web/.next/server/pages/404.html +1 -1
  29. package/dist/web/.next/server/pages/500.html +2 -2
  30. package/lib/cli/sync.d.ts +7 -0
  31. package/lib/cli/sync.d.ts.map +1 -1
  32. package/lib/cli/sync.js +32 -0
  33. package/lib/cli/sync.js.map +1 -1
  34. package/lib/cli/update.d.ts.map +1 -1
  35. package/lib/cli/update.js +9 -0
  36. package/lib/cli/update.js.map +1 -1
  37. package/package.json +1 -1
  38. package/templates/kanban-seed.json +1 -1
  39. package/templates/store/skills/context-priming/references/area-index.md +121 -68
  40. package/templates/{updates/skills/context-priming/references → store/skills/context-priming}/references/areas/feature-guide.md +44 -18
  41. package/templates/store/skills/context-priming/references/areas/messaging.md +108 -34
  42. package/templates/store/skills/context-priming/references/areas/scripts-deployment.md +61 -16
  43. package/templates/store/skills/context-priming/references/areas/skills.md +99 -38
  44. package/{dist/store/skills/context-priming/references → templates/store/skills/context-priming}/references/areas/terminal-actions.md +1 -1
  45. package/templates/store/skills/context-priming/references/areas/terminal-bridge.md +74 -42
  46. package/templates/store/skills/context-priming/references/areas/web-frontend.md +259 -74
  47. package/templates/updates/skills/context-priming/references/area-index.md +121 -68
  48. package/{dist/store/skills/context-priming/references → templates/updates/skills/context-priming}/references/areas/feature-guide.md +44 -18
  49. package/templates/updates/skills/context-priming/references/areas/messaging.md +108 -34
  50. package/templates/updates/skills/context-priming/references/areas/scripts-deployment.md +61 -16
  51. package/templates/updates/skills/context-priming/references/areas/skills.md +99 -38
  52. package/templates/{store/skills/context-priming/references → updates/skills/context-priming}/references/areas/terminal-actions.md +1 -1
  53. package/templates/updates/skills/context-priming/references/areas/terminal-bridge.md +74 -42
  54. package/templates/updates/skills/context-priming/references/areas/web-frontend.md +259 -74
  55. package/dist/store/skills/context-priming/references/areas/claude-actions.md +0 -120
  56. package/dist/store/skills/context-priming/references/references/area-index.md +0 -152
  57. package/dist/store/skills/context-priming/references/references/areas/messaging.md +0 -251
  58. package/dist/store/skills/context-priming/references/references/areas/scripts-deployment.md +0 -183
  59. package/dist/store/skills/context-priming/references/references/areas/skills.md +0 -196
  60. package/dist/store/skills/context-priming/references/references/areas/terminal-bridge.md +0 -263
  61. package/dist/store/skills/context-priming/references/references/areas/web-frontend.md +0 -437
  62. package/dist/store/skills/context-priming/references/references/maintenance.md +0 -128
  63. package/templates/store/skills/context-priming/references/areas/claude-actions.md +0 -120
  64. package/templates/store/skills/context-priming/references/references/area-index.md +0 -152
  65. package/templates/store/skills/context-priming/references/references/areas/messaging.md +0 -251
  66. package/templates/store/skills/context-priming/references/references/areas/scripts-deployment.md +0 -183
  67. package/templates/store/skills/context-priming/references/references/areas/skills.md +0 -196
  68. package/templates/store/skills/context-priming/references/references/areas/terminal-bridge.md +0 -263
  69. package/templates/store/skills/context-priming/references/references/areas/web-frontend.md +0 -437
  70. package/templates/store/skills/context-priming/references/references/maintenance.md +0 -128
  71. package/templates/updates/skills/context-priming/references/areas/claude-actions.md +0 -120
  72. package/templates/updates/skills/context-priming/references/references/area-index.md +0 -152
  73. package/templates/updates/skills/context-priming/references/references/areas/messaging.md +0 -251
  74. package/templates/updates/skills/context-priming/references/references/areas/scripts-deployment.md +0 -183
  75. package/templates/updates/skills/context-priming/references/references/areas/skills.md +0 -196
  76. package/templates/updates/skills/context-priming/references/references/areas/terminal-bridge.md +0 -263
  77. package/templates/updates/skills/context-priming/references/references/areas/web-frontend.md +0 -437
  78. package/templates/updates/skills/context-priming/references/references/maintenance.md +0 -128
  79. /package/dist/web/.next/static/{wMUaNt62q8VYjpVs4m1_t → sAL_sqPSOaOIrKiwdPzL2}/_buildManifest.js +0 -0
  80. /package/dist/web/.next/static/{wMUaNt62q8VYjpVs4m1_t → sAL_sqPSOaOIrKiwdPzL2}/_clientMiddlewareManifest.json +0 -0
  81. /package/dist/web/.next/static/{wMUaNt62q8VYjpVs4m1_t → sAL_sqPSOaOIrKiwdPzL2}/_ssgManifest.js +0 -0
@@ -1,33 +1,33 @@
1
1
  # Messaging Service
2
2
 
3
- Updated: 2026-02-14
3
+ Updated: 2026-03-13
4
4
 
5
5
  ## Overview
6
6
 
7
- Multi-channel messaging service for remote AI interaction via Telegram (and future channels). Supports text and voice messages, project selection, voice swapping, response mode/tone preferences, multi-provider support (Claude/Gemini/Codex), stop command for session interruption, permission mismatch detection, context-aware command filtering, and two-way communication with AI sessions through the terminal bridge. Runs as a standalone Node/Express service with a CLI for outbound messages.
7
+ Multi-channel messaging service for remote AI interaction via Telegram (and future channels). Supports text, voice, and photo messages, target-based navigation (global/project/card), voice swapping, response mode/tone preferences, multi-provider support (Claude/Gemini/Codex), stop command for session interruption, cross-project card search with inline keyboards, permission mismatch detection, instruction file pre-flight checks, context-aware command filtering, and two-way communication with AI sessions through the terminal bridge. Runs as a standalone Node/Express service with a CLI for outbound messages.
8
8
 
9
9
  ## Key Files
10
10
 
11
11
  ### Service Core
12
- - `messaging/src/index.ts` - Main entry, channel wiring, HTTP server, bot commands, stop interception
13
- - `messaging/src/types.ts` - Channel interface, configs, bridge types, ResponseMode
14
- - `messaging/src/state.ts` - StateManager: project selection, voice state, response mode, voice tone, provider selection, persistence
15
- - `messaging/src/bridge-client.ts` - BridgeClient: session management, provider-aware creation, permission mismatch detection, activity watching, soft stop
12
+ - `messaging/src/index.ts` - Main entry, channel wiring, HTTP server, bot commands, callback handlers, stop interception
13
+ - `messaging/src/types.ts` - Channel interface, InlineButton, configs, bridge types, ResponseMode, TargetType, NavigationTarget, InstructionFileCheck, PendingInstructionFileConfirm, BridgeSessionInfo
14
+ - `messaging/src/state.ts` - StateManager: target navigation (global/project/card), voice state, response mode, voice tone, provider selection, persistence. Resolves paths via SLYCODE_HOME env var (messaging-state.json, registry.json).
15
+ - `messaging/src/bridge-client.ts` - BridgeClient: session management, provider-aware creation, permission mismatch detection, instruction file check, activity watching, soft stop, debug logging, background activity monitor, image upload
16
16
 
17
17
  ### Channels
18
- - `messaging/src/channels/telegram.ts` - TelegramChannel: bot polling, inline buttons, chat actions
18
+ - `messaging/src/channels/telegram.ts` - TelegramChannel: bot polling, inline buttons, persistent keyboards, callback handlers, chat actions
19
19
 
20
20
  ### Voice Pipeline
21
- - `messaging/src/stt.ts` - Whisper STT via OpenAI API
21
+ - `messaging/src/stt.ts` - Dual-backend STT: OpenAI Whisper API or local whisper.cpp CLI. SttConfig interface, validateSttConfig() validation. Local backend: ffmpeg OGA→WAV conversion + whisper-cli execution (2min timeout).
22
22
  - `messaging/src/tts.ts` - ElevenLabs v3 TTS with audio tag support, optional voice override
23
23
  - `messaging/src/voices.ts` - Voice search across personal + community library (v2 + v1 APIs)
24
24
 
25
25
  ### Command System
26
- - `messaging/src/command-filter.ts` - Context-aware command filtering by terminal class, session state, card type
26
+ - `messaging/src/sly-action-filter.ts` - SlyActionFilter: context-aware action filtering by terminal class, placement, card type (v3 classAssignments-based). Resolves sly-actions.json via SLYCODE_HOME env var.
27
27
  - `messaging/src/kanban-client.ts` - Direct access to project kanban boards for card metadata
28
28
 
29
29
  ### CLI & Skill
30
- - `messaging/src/cli.ts` - CLI tool for sending text/voice from Claude skills
30
+ - `messaging/src/cli.ts` - CLI tool for sending text/voice from agent skills
31
31
  - `.claude/skills/messaging/SKILL.md` - Skill definition (v2.2.0) with mode/tone system and audio tags
32
32
 
33
33
  ### Config
@@ -44,47 +44,86 @@ Channel {
44
44
  stop(): void;
45
45
  onText(handler): void;
46
46
  onVoice(handler): void;
47
+ onPhoto(handler): void; // Photo messages (batched for albums)
47
48
  onCommand(command, handler): void;
48
- onProjectSelect(handler): void;
49
49
  sendText(text): Promise<void>; // With Markdown
50
50
  sendTextRaw(text): Promise<void>; // Without Markdown (preserves [brackets])
51
51
  sendVoice(audio: Buffer): Promise<void>;
52
- sendProjectList(projects): Promise<void>;
52
+ sendInlineKeyboard(text, buttons: InlineButton[][]): Promise<void>; // Inline buttons with breadcrumb
53
+ setPersistentKeyboard(buttons: string[][]): Promise<void>; // Bottom keyboard
53
54
  sendTyping(): Promise<void>;
54
55
  sendChatAction(action): Promise<void>;
55
56
  sendVoiceList?(voices): Promise<void>; // Optional
56
- onVoiceSelect?(handler): void; // Optional
57
+ onVoiceSelect?(handler): void; // Optional
58
+ onCallback(prefix, handler): void; // Inline button callback routing
57
59
  isReady(): boolean;
58
60
  }
61
+
62
+ InlineButton { label: string; callbackData: string; }
59
63
  ```
60
64
 
65
+ ## Navigation Model
66
+
67
+ Three-level target system replacing old project-selection model:
68
+
69
+ - **Global** - No project context, uses ClaudeMaster as CWD
70
+ - **Project** - Project-level terminal (`{projectId}:{provider}:global`)
71
+ - **Card** - Card-specific terminal (`{projectId}:{provider}:card:{cardId}`)
72
+
73
+ `StateManager.getTarget()` returns `NavigationTarget { type, projectId?, cardId?, stage? }`
74
+
61
75
  ## Bot Commands
62
76
 
63
77
  - `/start` - Help text with available commands
64
- - `/projects` - Inline keyboard for project selection
65
- - `/select N` - Select project by number
66
- - `/status` - Current project, voice, response mode, and tone
78
+ - `/switch` - Primary navigation: drill-down inline keyboards (global → projects → cards)
79
+ - `/global` - Quick switch to global terminal
80
+ - `/project` - Quick switch from card to project terminal (stays in same project)
81
+ - `/search` - Quick-access: active sessions + recent cards as inline buttons. With args: text search across cards
82
+ - `/sly` - Context-aware sly actions as inline buttons (filtered by terminal class + placement)
83
+ - `/status` - Current target, project, voice, response mode, and tone
84
+ - `/provider` - Provider selection inline keyboard (Claude/Gemini/Codex)
67
85
  - `/voice` - Search/swap TTS voices, reset to default
68
86
  - `/voice <name>` - Search voices, auto-select on exact match, inline buttons for multiple
87
+ - `/mode` - Response mode selection (text/voice/both)
88
+ - `/tone` - Voice tone customization
89
+
90
+ ## Callback Handlers
91
+
92
+ - `sw_` - Switch navigation (project/card selection from inline keyboards)
93
+ - `qc_` - Quick card actions (from /search results)
94
+ - `cfg_` - Configuration callbacks
95
+ - `ifc_` - Instruction file confirmation (yes/no for creating missing instruction file)
96
+ - `perm_` - Permission mismatch actions (restart session with correct perms)
97
+ - `mode_` - Response mode selection callbacks
98
+ - `tone_` - Voice tone selection callbacks
69
99
 
70
100
  ## Message Flow
71
101
 
72
- ### Inbound (user → Claude)
102
+ ### Inbound (user → agent session)
73
103
  1. User sends text/voice on Telegram
74
104
  2. **Stop interception**: "stop" text (case-insensitive) sends Escape to active session instead of forwarding
75
105
  3. TelegramChannel routes to handler in index.ts
76
106
  4. Voice: `record_voice` chat action → Whisper transcription → typing indicator
77
- 5. BridgeClient.ensureSession() creates/finds session (with selected provider, always skipPermissions)
78
- 6. If permission mismatch (existing session without skipPermissions), warns user and offers restart
79
- 7. BridgeClient.sendMessage() writes text + CR to PTY
80
- 8. BridgeClient.watchActivity() polls /stats, sends typing while active
81
-
82
- ### Outbound (Claude → user)
83
- 1. Claude skill calls CLI: `tsx cli.ts send "message" [--tts]`
107
+ 5. **Instruction file pre-flight**: if new session would be created, checks bridge for missing instruction file. If needed, shows inline buttons (yes/no). Pending state stored in `StateManager._pendingInstructionFileConfirm` (ephemeral, not persisted). `ifc_yes` callback creates file + delivers original message; `ifc_no` delivers without creating.
108
+ 6. BridgeClient.ensureSession() creates/finds session (with selected provider, always skipPermissions, optional createInstructionFile)
109
+ 7. If permission mismatch (existing session without skipPermissions), warns user and offers restart
110
+ 8. BridgeClient.sendMessage() writes text + CR to PTY
111
+ 9. BridgeClient.watchActivity() polls /stats, sends typing while active
112
+
113
+ ### Outbound (agent user)
114
+ 1. Agent skill calls CLI: `tsx cli.ts send "message" [--tts]`
84
115
  2. CLI POSTs to HTTP server `/send` or `/voice`
85
116
  3. `/send` → channel.sendText()
86
117
  4. `/voice` → `upload_voice` chat action → TTS generation → channel.sendVoice() + sendTextRaw()
87
118
 
119
+ ### Photo Messages (user → agent session)
120
+ 1. User sends photo(s) on Telegram (single or album)
121
+ 2. TelegramChannel downloads largest resolution, batches album photos (2s window via media_group_id)
122
+ 3. BridgeClient.sendImage() uploads each photo to bridge `POST /sessions/:name/image`
123
+ 4. Bridge saves to `screenshots/` in session CWD, returns filename
124
+ 5. Screenshot references (`[Screenshot: screenshots/<filename>]`) + optional caption built into message
125
+ 6. Message sent to PTY, activity watched as normal
126
+
88
127
  ### Stop Command
89
128
  1. User sends "stop" (exact, case-insensitive)
90
129
  2. BridgeClient.stopSession() calls `POST /sessions/:name/stop` (sends Escape key)
@@ -103,22 +142,24 @@ Channel {
103
142
 
104
143
  ## Command Filtering
105
144
 
106
- - `CommandFilter.loadCommands()` - Hot-reloads commands.json on each call
107
- - `CommandFilter.filterCommands(terminalClass, sessionState, cardType?)` - Context-aware filtering
108
- - `CommandFilter.resolveTemplate(prompt, context)` - Template variable resolution
109
- - `CommandFilter.getTerminalClass(target)` - Maps navigation target to terminal class
145
+ - `SlyActionFilter.loadActions()` - Hot-reloads sly-actions.json on each call
146
+ - `SlyActionFilter.filterActions(terminalClass, placement?, cardType?)` - Context-aware filtering via classAssignments lookup
147
+ - `SlyActionFilter.resolveTemplate(prompt, context)` - Template variable resolution
148
+ - `SlyActionFilter.getTerminalClass(target)` - Maps navigation target to terminal class
110
149
  - Supports card context from KanbanClient for prompt templates
111
150
 
112
151
  ## Kanban Client
113
152
 
114
153
  - `KanbanClient.getBoard(projectId)` - Load project's kanban board
115
154
  - `KanbanClient.getCard(projectId, cardId)` - Find card with its stage
116
- - `KanbanClient.getCardsByStage(projectId, stage)` - Cards in a stage
155
+ - `KanbanClient.getCardsByStage(projectId, stage)` - Cards in a stage sorted by `order` field (used by reorder command), automation cards excluded
156
+ - `KanbanClient.searchCards(projectIds, query, maxResults)` - Text search across cards (title +2, description +1, archived -1)
157
+ - `KanbanClient.getAllCards(projectIds)` - All non-archived, non-automation cards
117
158
  - Resolves kanban.json paths per project
118
159
 
119
160
  ## Voice System
120
161
 
121
- - **STT**: OpenAI Whisper (`whisper-1`), accepts OGG from Telegram
162
+ - **STT**: Dual-backend via `SttConfig.backend` ('openai' | 'local'). OpenAI Whisper (`whisper-1`) or local whisper.cpp CLI. Backend selected via `STT_BACKEND` env var. Local backend requires `WHISPER_CLI_PATH` and `WHISPER_MODEL_PATH`. `validateSttConfig()` checks env setup before transcription attempts.
122
163
  - **TTS**: ElevenLabs v3 (`eleven_v3`), supports `[tag]` audio tags
123
164
  - **Voice selection**: Persisted in messaging-state.json, overrides .env default
124
165
  - **Voice search**: Queries both `/v2/voices` (personal) and `/v1/shared-voices` (community), deduplicates
@@ -127,16 +168,34 @@ Channel {
127
168
  ## Provider Support
128
169
 
129
170
  - `StateManager.selectedProvider` - Persisted provider choice (default: 'claude')
130
- - Session names include provider segment: `{projectId}:{provider}:global`
171
+ - **Auto-resolution**: Provider auto-resolved on navigation. `resolveProviderFromBridge()` checks bridge for existing card sessions (picks most recently active). `resolveProjectProviderFromBridge()` does the same for project-level sessions. Resolution chain: bridge session → stage default (from providers.json) → global default.
172
+ - `getProviderDefault(stage?)` reads providers.json defaults (stage-specific → global fallback)
173
+ - `updateGlobalProviderDefault(provider)` writes to providers.json when changing provider on a target with no explicit bridge session
174
+ - `hasExplicitSession()` checks whether the current provider was derived from a bridge session vs default. Status/lifecycle messages show "(default)" suffix when no explicit session exists.
175
+ - Shared `PROVIDER_LABELS` constant and `ALL_PROVIDERS` list (no more inline duplicated maps)
176
+ - Session names include provider segment: `{projectId}:{provider}:global` or `{projectId}:{provider}:card:{cardId}`
177
+ - Global target uses `global:{provider}:global`
131
178
  - `getLegacySessionName()` provides backward-compat format for existing session lookups
132
179
  - Messaging always forces `skipPermissions: true` (remote interaction can't approve prompts)
133
180
  - `BridgeClient.ensureSession()` returns `{ session, permissionMismatch? }` — detects sessions started from web UI without skip-permissions
134
181
  - `BridgeClient.restartSession()` stops old session and creates fresh one with correct provider + skip-permissions
182
+ - `BridgeClient.startActivityMonitor()` runs persistent background polling (4s) sending typing indicators when session is active
183
+ - `BridgeClient.checkInstructionFile(provider, cwd)` checks bridge for missing instruction file, returns InstructionFileCheck
184
+ - `BridgeClient.ensureSession()` accepts optional `createInstructionFile` param, passed to bridge session creation
185
+ - `BridgeClient.sendMessage()` accepts optional `createInstructionFile` param, forwarded to ensureSession
186
+ - `BridgeClient.sendImage(name, filePath, cwd?)` uploads image to bridge screenshot endpoint, returns filename
187
+ - `BridgeClient.getActiveCardSessions(projectIds)` returns Set of card IDs with active bridge sessions (for /search quick-access)
188
+ - `BridgeClient.getCardSessionRecency(projectIds)` returns Map of card IDs to lastActive timestamps (for /search recent sorting)
189
+ - Debug logging via `debugLog()` writes to `messaging-debug.log` for session create/send troubleshooting
190
+ - Resume+prompt flow: detects resumed sessions and types prompt via sendInput after delay
135
191
 
136
192
  ## State Persistence
137
193
 
138
194
  `messaging-state.json` stores:
195
+ - `targetType` - Navigation level: global/project/card
139
196
  - `selectedProjectId` - Active project
197
+ - `selectedCardId` - Active card (only with project)
198
+ - `selectedCardStage` - Active card's stage
140
199
  - `selectedProvider` - Active AI provider (claude/gemini/codex)
141
200
  - `voiceId` / `voiceName` - Selected TTS voice (null = use .env default)
142
201
  - `responseMode` - text/voice/both preference
@@ -152,8 +211,9 @@ Projects loaded from `projects/registry.json` at startup.
152
211
 
153
212
  ## Patterns & Invariants
154
213
 
214
+ - Path resolution: `SLYCODE_HOME` env var (set by `slycode start`) → `process.cwd()` fallback. All file paths (state, registry, sly-actions) resolve via `getWorkspaceRoot()` helper — no `__dirname`-relative paths (breaks in npm package installs).
155
215
  - Chat actions for status: `record_voice` (transcribing), `typing` (processing), `upload_voice` (TTS)
156
- - Session names include provider: `{projectId}:{provider}:global` (with legacy fallback)
216
+ - Session names include provider and target type: `{projectId}:{provider}:card:{cardId}` or `global:{provider}:global`
157
217
  - Messages include channel header: `[Telegram] text (Reply using /messaging | Mode: text)`
158
218
  - Voice messages: `[Telegram/Voice] transcription (Reply using /messaging | Mode: text)`
159
219
  - sendTextRaw used for voice text companions (preserves [audio tags]) and voice IDs
@@ -161,6 +221,15 @@ Projects loaded from `projects/registry.json` at startup.
161
221
  - Telegram message limit: 4096 chars, auto-split at newline boundaries
162
222
  - "stop" text intercepted before forwarding to session (soft stop via Escape key)
163
223
  - Card titles truncated to 35 chars in breadcrumb rendering
224
+ - /search quick-access shows active sessions (up to 5) + recent cards sorted by laterDate(session.lastActive, card.updated_at)
225
+ - /search text mode uses kanban-client.searchCards() with scoring (title +2, desc +1, archived -1)
226
+ - /search supports global (multi-project) and single-project scopes with cross-project card switching
227
+ - Persistent keyboard is unified single layout for all contexts: [['/switch', '/search'], ['/provider', '/status'], ['/voice', '/tone'], ['/mode', '/sly']]
228
+ - /provider shows provider inline keyboard (excludes current provider, dynamic from ALL_PROVIDERS). cfg_ callback also updates global default in providers.json when no explicit bridge session exists.
229
+ - Photo albums batched via media_group_id (2s flush window), single photos delivered immediately
230
+ - Photos: download largest resolution, save to temp dir, upload to bridge, inject `[Screenshot: screenshots/<filename>]` into message
231
+ - Instruction file pre-flight: before creating new sessions (text, voice, photo handlers), `checkInstructionFilePreFlight()` checks if provider instruction file is missing. If needed, shows inline buttons and stores pending state (PendingInstructionFileConfirm). `ifc_` callback delivers original message with `createInstructionFile` flag.
232
+ - Callback prefixes route inline button presses: sw_ (switch), qc_ (quick card), cfg_ (config), ifc_ (instruction file confirm), perm_ (permissions), mode_ (mode), tone_ (tone)
164
233
 
165
234
  ## When to Expand
166
235
 
@@ -170,8 +239,13 @@ Projects loaded from `projects/registry.json` at startup.
170
239
  - Bridge routing → bridge-client.ts
171
240
  - State persistence → state.ts
172
241
  - Telegram-specific behavior → channels/telegram.ts
173
- - Command filtering → command-filter.ts, kanban-client.ts
242
+ - Command filtering → sly-action-filter.ts, kanban-client.ts
174
243
  - Stop command → bridge-client.ts stopSession(), index.ts stop interception
175
244
  - Response modes → state.ts, SKILL.md mode/tone guidelines
176
- - Provider selection → state.ts (selectedProvider), bridge-client.ts (ensureSession provider param)
245
+ - Provider selection → state.ts (selectedProvider), index.ts (resolveProviderFromBridge, getProviderDefault, updateGlobalProviderDefault), bridge-client.ts (ensureSession provider param)
177
246
  - Permission mismatch → bridge-client.ts ensureSession/sendMessage permissionMismatch detection
247
+ - Photo messages → channels/telegram.ts (photo listener, album batching), index.ts (onPhoto handler), bridge-client.ts (sendImage)
248
+ - Card search → index.ts /search handler, kanban-client.ts searchCards/getAllCards, bridge-client.ts getActiveCardSessions/getCardSessionRecency
249
+ - Navigation → index.ts /switch handler, state.ts target methods, callback handlers (sw_)
250
+ - Instruction file flow → index.ts checkInstructionFilePreFlight(), ifc_ callback, bridge-client.ts checkInstructionFile(), state.ts pending confirm
251
+ - Inline buttons → channels/telegram.ts, types.ts InlineButton, channel.onCallback()
@@ -1,6 +1,6 @@
1
1
  # Scripts & Deployment
2
2
 
3
- Updated: 2026-02-11
3
+ Updated: 2026-03-14
4
4
 
5
5
  ## Overview
6
6
 
@@ -17,6 +17,7 @@ SlyCode has a two-tier deployment model: **dev** (individual services via tmux)
17
17
  | `sly-dev.sh` | Tmux session "sly" with three side-by-side panes running `npm run dev` |
18
18
  | `kanban.js` | Kanban CLI (standalone Node.js, no build needed) |
19
19
  | `scaffold.js` | Project scaffolding CLI (standalone Node.js) |
20
+ | `migrate-store.sh` | Migrate store from provider-split to canonical flat layout |
20
21
 
21
22
  ## Port Architecture
22
23
 
@@ -30,7 +31,7 @@ Two separate port ranges — dev and prod never overlap:
30
31
 
31
32
  - **7591/2/3**: "sly" = 759 on a phone keypad
32
33
  - **Dev ports**: hardcoded in each service's `package.json` dev scripts
33
- - **Prod ports**: configured in `.env`, read by `sly-start.sh`, passed as `PORT` env var to `npm start`
34
+ - **Prod ports**: configured in `slycode.config.js` (loaded by `start.ts`), or `.env` fallback, passed as `PORT` env var
34
35
  - `BRIDGE_URL` must match bridge port — `sly-start.sh` derives it automatically
35
36
  - Next.js reads `PORT` env var natively (no `--port` flag in prod `npm start`)
36
37
 
@@ -38,7 +39,7 @@ Two separate port ranges — dev and prod never overlap:
38
39
 
39
40
  ### Production (`sly-start.sh` / `sly-stop.sh`)
40
41
 
41
- - **Start**: runs `npm start` in background with `nohup` (assumes services are already built via `setup.sh`)
42
+ - **Start**: `slycode start` spawns services with `cwd: workspace` (ensures services inherit correct working directory). Sets `SLYCODE_HOME` env var for prod path resolution.
42
43
  - **Stop**: finds PIDs by port (not PID files — those are unreliable with npm subshells), kills process tree with `pkill -P` + `kill`
43
44
  - Ports file at `~/.slycode/ports` records which ports were started for stop to read
44
45
  - Health check after start: verifies each port is listening
@@ -62,15 +63,16 @@ Two separate port ranges — dev and prod never overlap:
62
63
  ## Setup Flow (`setup.sh`)
63
64
 
64
65
  1. Welcome banner (platform, SlyCode root, Node version)
65
- 2. Create directories (`~/bin`, `~/.slycode/logs`)
66
- 3. `npm install` in web, bridge, messaging
67
- 4. Build bridge, messaging, web (web last — heaviest, needs most memory)
68
- 5. `chmod +x` on CLI scripts
69
- 6. Symlink CLIs to `~/bin` (sly-kanban, sly-scaffold, sly-messaging)
70
- 7. Update `registry.json` with correct SlyCode path
71
- 8. Copy `.env.example` to `.env` if missing
72
- 9. Prompt: install as system service?
73
- 10. Linux: check linger, offer to enable
66
+ 2. Check build tools (`check_build_tools()` — gcc, make, g++ for node-pty compilation)
67
+ 3. Create directories (`~/bin`, `~/.slycode/logs`)
68
+ 4. `npm install` in web, bridge, messaging
69
+ 5. Build bridge, messaging, web (web last — heaviest, needs most memory)
70
+ 6. `chmod +x` on CLI scripts
71
+ 7. Symlink CLIs to `~/bin` (sly-kanban, sly-scaffold, sly-messaging)
72
+ 8. Update `registry.json` with correct SlyCode path
73
+ 9. Copy `.env.example` to `.env` if missing
74
+ 10. Prompt: install as system service?
75
+ 11. Linux: check linger, offer to enable
74
76
 
75
77
  **Flags**: `--yes` (non-interactive), `--service` (auto-install services), `--remove-service` (cleanup)
76
78
 
@@ -97,9 +99,9 @@ This means `sly-messaging` works regardless of whether you started with `sly-dev
97
99
  ## Key Design Decisions
98
100
 
99
101
  ### No hardcoded paths anywhere
100
- - Web: `web/src/lib/paths.ts` derives SlyCode root from `process.cwd()` (detects `/web` suffix)
102
+ - Web: `web/src/lib/paths.ts` centralized `getSlycodeRoot()` (via `SLYCODE_HOME` → cwd fallback) and `getPackageDir()` (detects `node_modules/slycode/dist/` for prod). All 10+ API routes import from paths.ts — no local `getRepoRoot()` helpers. `legacy root env var` env var removed.
101
103
  - Bridge: reads `BRIDGE_PORT` from env
102
- - Messaging: CLI auto-detects service port (dev 3005 / prod 7593) with caching; service reads port from env
104
+ - Messaging: uses `SLYCODE_HOME` env var for workspace resolution (replaces `__dirname`-relative paths that broke in prod npm packages). CLI auto-detects service port (dev 3005 / prod 7593) with caching.
103
105
  - Skills: reference `sly-kanban` and `sly-messaging` by global command name, not paths
104
106
  - Documentation: uses `<slycode-root>` placeholder instead of absolute paths
105
107
  - `registry.json`: `setup.sh` updates the SlyCode path entry at install time
@@ -120,14 +122,57 @@ Code-server terminals don't set `XDG_RUNTIME_DIR`, breaking `systemctl --user`.
120
122
  - Saves are atomic (write `.tmp` then `rename`)
121
123
 
122
124
  ### Bridge CWD validation
123
- Bridge requires absolute path for session `cwd` — no defaults, no relative paths. This ensures Claude associates sessions with the correct project directory in `~/.claude/projects/`.
125
+ Bridge requires absolute path for session `cwd` — no defaults, no relative paths. This ensures the AI CLI associates sessions with the correct project directory.
124
126
 
125
127
  ## Env Files
126
128
 
127
- - **`.env.example`**: template with all config vars, prod port defaults, placeholder secrets
129
+ - **`.env.example`**: template with all config vars, prod port defaults, placeholder secrets, TZ timezone var, DEV_HOSTNAME (Tailscale hostname for Next.js dev origins)
128
130
  - **`.env`**: actual config, created from example by `setup.sh`, gitignored
129
131
  - `.env` lives at repo root — messaging loads it via `dotenv`, bridge reads env vars, web gets them via `sly-start.sh` exports
130
132
 
133
+ ## slycode.config.js
134
+
135
+ Workspace-level configuration file loaded by `packages/slycode/src/config/loader.ts`:
136
+
137
+ ```js
138
+ module.exports = {
139
+ ports: { web: 7591, bridge: 7592, messaging: 7593 },
140
+ services: { web: true, bridge: true, messaging: true },
141
+ host: '127.0.0.1', // Only web binds to this; bridge+messaging always localhost
142
+ };
143
+ ```
144
+
145
+ - `slycode config [key] [value]` — View/modify config via CLI
146
+ - Defaults: ports 7591/7592/7593, all services enabled, host `127.0.0.1`
147
+ - Only web binds to `config.host`; bridge and messaging are always `127.0.0.1`
148
+
149
+ ## NPM Distribution (`packages/`)
150
+
151
+ - `packages/slycode/` (`@slycode/slycode` v0.1.11) — Main npm package providing `slycode` CLI
152
+ - Subcommands: workspace, start, stop, service, doctor, skills, sync, update, config, uninstall
153
+ - `slycode skills list|check|add|reset` for skill management
154
+ - `slycode config [key] [value]` for slycode.config.js management
155
+ - `slycode uninstall` for removing services and CLI tools
156
+ - Platform-specific service management (Linux systemd, macOS launchd, Windows Task Scheduler)
157
+ - Templates in `templates/` use flat canonical store layout, includes `tutorial-project/` template
158
+ - `files` in package.json: `bin/`, `data/`, `lib/`, `dist/`, `templates/`. Dependencies include `multer` (bridge image upload).
159
+ - Default host: `127.0.0.1` (configurable via slycode.config.js)
160
+ - `packages/create-slycode/` (`@slycode/create-slycode` v0.1.11) — Scaffold tool for initializing new SlyCode workspaces
161
+ - Exports `create-slycode` CLI command
162
+ - Setup wizard prompts for timezone (auto-detects system TZ, writes `TZ=` to .env for cron scheduling)
163
+ - Seeds `providers.json` and `sly-actions.json` from package templates during workspace creation. System service prompt skipped on Windows.
164
+ - Tutorial content seeded into workspace root via `seedTutorialWorkspaceContent()` (not a separate `slycode_tutorial/` subdirectory)
165
+ - Registry seeds workspace root as default project (id: `slycode`, path: workspace dir)
166
+ - Kanban seed uses correct stage-based format (`project_id`, `stages`, `last_updated`)
167
+ - `build/build-package.ts` — Full build pipeline: builds services, syncs store→updates, copies templates, scaffold-templates/, store/, and store/actions/ to templates/store/actions/ for scaffold seeding. Preserves tutorial-project template during wipe/rebuild.
168
+ - `build/sync-updates.ts` — Sync manifest skills from store/ to updates/ (enforces manifest as authority)
169
+ - `build/store-manifest.js` — Curated list of skills included in package distribution
170
+
171
+ ### slycode CLI new subcommands
172
+ - `slycode sync` — Refresh workspace updates/ from package templates
173
+ - `slycode update` — Platform-aware restart (systemd/launchd/Windows Task Scheduler/background)
174
+ - `slycode start` — Auto-refreshes updates + npm version check (3s timeout). Passes workspace as `cwd` to spawned services and sets `SLYCODE_HOME` env var (fixes prod path resolution where Next.js server.js does `process.chdir(__dirname)`).
175
+
131
176
  ## Related Files
132
177
 
133
178
  - `documentation/designs/global_cli_setup.md` — full design document
@@ -1,35 +1,37 @@
1
1
  # Skills & Infrastructure
2
2
 
3
- Updated: 2026-02-09
3
+ Updated: 2026-03-14
4
4
 
5
5
  ## Overview
6
6
 
7
- SlyCode is the central hub for reusable Claude Code assets. Skills provide specialized capabilities, commands are user-invocable shortcuts, agents handle autonomous workflows, and hooks execute on events. Includes global CLI setup, service management scripts, and project scaffolding. This repo tests new skills before deploying to other projects.
7
+ SlyCode is the central hub for reusable AI coding assets (skills, agents, configs). All commands have been converted to skills — everything is now a skill with SKILL.md. Agents handle autonomous workflows, and hooks execute on events. Includes global CLI setup, service management scripts, and project scaffolding. This repo tests new skills before deploying to other projects.
8
8
 
9
9
  ## Key Files
10
10
 
11
- ### Skills
11
+ ### Skills (17 total — all commands converted to skills)
12
12
  - `.claude/skills/context-priming/` - Dynamic codebase context loader
13
13
  - `.claude/skills/interactive-explainer/` - Creates visual HTML explainers
14
14
  - `.claude/skills/skill-creator/` - Guide for creating new skills
15
15
  - `.claude/skills/messaging/` - Send text/voice responses to messaging channels (v2.2.0)
16
16
  - `.claude/skills/claude-code-docs-maintainer/` - Maintains Claude Code documentation
17
- - `.claude/skills/kanban/` - Kanban board management skill
17
+ - `.claude/skills/kanban/` - Kanban board management (v1.4.0), notes + automation subcommands, multiline description support
18
+ - `.claude/skills/checkpoint/` - Git checkpoint creation
19
+ - `.claude/skills/feature/` - Create feature specifications
20
+ - `.claude/skills/chore/` - Create chore/maintenance plans
21
+ - `.claude/skills/implement/` - Execute plans
22
+ - `.claude/skills/design/` - Start iterative design document
23
+ - `.claude/skills/doc-discovery/` - Documentation discovery
24
+ - `.claude/skills/doc-update/` - Documentation updates
25
+ - `.claude/skills/reference-fetch/` - Fetch external docs
26
+ - `.claude/skills/create-command/` - Meta-command for new commands
27
+ - `.claude/skills/problem_summary/` - Summarize debugging issues
28
+ - `.claude/skills/convert-asset/` - Convert store asset between provider formats
18
29
 
19
30
  ### Agents
20
31
  - `.claude/agents/doc-updater.md` - Autonomous documentation maintenance agent
21
32
 
22
- ### Commands
23
- - `.claude/commands/checkpoint.md` - Git checkpoint creation
24
- - `.claude/commands/feature.md` - Create feature specifications
25
- - `.claude/commands/chore.md` - Create chore/maintenance plans
26
- - `.claude/commands/implement.md` - Execute plans
27
- - `.claude/commands/design.md` - Start iterative design document
28
- - `.claude/commands/doc-discovery.md` - Documentation discovery
29
- - `.claude/commands/doc-update.md` - Documentation updates
30
- - `.claude/commands/reference-fetch.md` - Fetch external docs
31
- - `.claude/commands/create-command.md` - Meta-command for new commands
32
- - `.claude/commands/problem_summary.md` - Summarize debugging issues
33
+ ### Commands (REMOVED)
34
+ - `.claude/commands/` directory no longer exists — all converted to `.claude/skills/*/SKILL.md`
33
35
 
34
36
  ### Scripts
35
37
  - `scripts/setup.sh` - Guided setup: environment, services, global CLI, linger
@@ -37,24 +39,69 @@ SlyCode is the central hub for reusable Claude Code assets. Skills provide speci
37
39
  - `scripts/sly-stop.sh` - Stop all services
38
40
  - `scripts/sly-restart.sh` - Restart all services
39
41
  - `scripts/sly-dev.sh` - Development mode launcher
40
- - `sly-kanban` - Kanban CLI tool (installed globally as `sly-kanban`)
41
- - `scripts/scaffold.js` - Project scaffolding CLI (installed globally as `sly-scaffold`)
42
+ - `sly-kanban` - Kanban CLI tool (installed globally as `sly-kanban`), board/reorder/notes/automation subcommands, last_modified_by tracking. Sequential card numbers (auto-backfilled on first run, `nextCardNumber` on kanban root). Notes: summarize subcommand (oldest/summarize), 100 hard cap, 30 soft suggestion threshold. Archive safeguard: automation cards cannot be archived (bulk `archive done` skips them with count, individual archive rejects with error). `automation enable` no longer recalculates nextRun locally (moved server-side to web scheduler/kanban API).
43
+ - `scripts/scaffold.js` - Project scaffolding CLI (installed globally as `sly-scaffold`), multi-provider support (Claude/Codex/Gemini), provider overlay templates, purpose-grouped scaffold plan, overwrite protection, clean output (suppresses zero-count copied/created lines, reports new vs existing doc dirs)
44
+ - `scripts/migrate-store.sh` - Migrates store from provider-split to canonical flat layout
45
+ - `scripts/migrate-sly-actions.js` - One-time v2→v3 sly-actions.json migration (sessionState→placement, visibleIn.classes→classAssignments) [historical]
46
+ - `scripts/convert-actions-to-md.js` - One-time v3→v4 migration: converts sly-actions.json to individual .md files in store/actions/
47
+
48
+ ### Store (Canonical Layout)
49
+ - `store/skills/` - 17 canonical skill definitions (single source of truth, includes dummy)
50
+ - `store/actions/` - Individual action .md files (v4.0 format: YAML frontmatter + prompt body)
51
+ - `store/agents/` - Agent definitions (doc-updater.md)
52
+ - `store/mcp/` - MCP module configs (context7.json)
53
+ - `store/.backups/` - Backup copies created when accepting updates
54
+ - `store/.ignored-updates.json` - Tracks dismissed update versions
55
+ - `.agents/skills/` - Codex-format copies deployed to SlyCode (7 skills: chore, context-priming, design, feature, implement, kanban, messaging)
56
+
57
+ ### Update Delivery
58
+ - `updates/skills/` - Staged skill updates awaiting acceptance
59
+ - `updates/actions/` - Staged action updates (content-hash based comparison)
60
+ - `updates/agents/` - Staged agent updates
61
+ - `updates/claude/` - Provider-specific update overrides
62
+ - Workflow: updates/ → accept → store/ (with backup) → deploy to projects
63
+ - Actions use additive class merge on accept: keeps user's class customizations, adds new upstream classes
64
+
65
+ ### NPM Distribution
66
+ - `packages/slycode/` - Main npm package (`@slycode/slycode` v0.1.11): `slycode` CLI with workspace, start, stop, service, doctor, skills, sync, update, config, uninstall subcommands
67
+ - `packages/create-slycode/` - Scaffold tool (`@slycode/create-slycode` v0.1.11): `create-slycode` for initializing new workspaces. Setup wizard prompts for timezone (auto-detects via `Intl.DateTimeFormat`, writes `TZ=` to .env for cron scheduling). System service prompt skipped on Windows. Tutorial content seeded into workspace root (not a separate `slycode_tutorial/` subdirectory). Kanban seed uses correct stage-based format (`project_id`, `stages`, `last_updated`). Registry seeds workspace root as default project (id: `slycode`).
68
+ - Both packages under `@slycode` npm scope. Template paths resolve via `node_modules/@slycode/slycode/templates/`.
69
+ - `slycode config [key] [value]` - View/modify slycode.config.js via CLI
70
+ - `slycode uninstall` - Remove services and CLI tools (preserves workspace)
71
+ - `slycode sync` - Refresh workspace updates/ from package templates
72
+ - `slycode update` - Platform-aware restart (systemd/launchd/Windows Task Scheduler/background)
73
+ - `slycode start` auto-refreshes updates on startup + npm version check (3s timeout)
74
+
75
+ ### Build Pipeline
76
+ - `build/build-package.ts` - Full build script: builds services, syncs updates, copies templates to packages/slycode/. Copies `data/scaffold-templates/`, `store/`, `updates/actions/` to dist/ for runtime access. Also copies store/actions/ to packages/slycode/templates/store/actions/ for scaffold seeding. Removed sly-actions.json template (actions now individual .md files).
77
+ - `build/sync-updates.ts` - Sync manifest skills + actions from store/ to updates/ (enforces manifest as authority). Returns `{ skills: SyncResult, actions: SyncResult }`.
78
+ - `build/store-manifest.js` - Curated list of skills and actions included in npm package and updates
42
79
 
43
80
  ### Scaffold Templates
44
- - `data/scaffold-templates/` - Templates for project scaffolding
45
- - `claude-md.md`, `kanban.json`, `mcp.json`, `gitignore`, `archive-readme.md`, `seed-cards.json`
81
+ - `data/scaffold-templates/` - Blessed defaults for new workspaces. Sourced by build pipeline instead of `data/*.json` (working copies may have local changes).
82
+ - `base-instructions.md` (provider-neutral, replaces claude-md.md), `kanban.json`, `mcp.json`, `gitignore`, `archive-readme.md`, `seed-cards.json`, `events.json`
83
+ - `providers.json` — seeded into new workspaces by create-slycode (sly-actions.json removed — actions now in store/actions/*.md)
84
+ - `overlays/` - Provider-specific instruction overlays (`claude.md`, `codex.md`, `gemini.md`)
85
+ - To update templates: manually copy `data/*.json` → `data/scaffold-templates/*.json`
46
86
 
47
87
  ### Config
48
88
  - `.claude/settings.local.json` - Local Claude settings
49
89
  - `.mcp.json` - MCP server configuration (Context7, etc.)
50
90
  - `.env` / `.env.example` - Environment config with service ports
51
91
  - `CLAUDE.md` - Project instructions for Claude
92
+ - `AGENTS.md` - Project instructions for Codex provider (mirrors CLAUDE.md content)
93
+
94
+ ### Licensing
95
+ - `LICENSE` - Business Source License 1.1 (BUSL-1.1)
96
+ - `LICENSING.md` - Human-readable licensing guide (open-core model)
97
+ - All package.json files set `"license": "BUSL-1.1"` (web, bridge, messaging, slycode, create-slycode)
98
+ - Design doc: `documentation/designs/open_core_licensing.md`
52
99
 
53
100
  ### Documentation
54
101
  - `documentation/kanban.json` - Kanban card data
55
102
  - `documentation/events.json` - Activity event log (card moves, asset operations, sessions)
56
103
  - `documentation/terminal-classes.json` - Terminal class definitions
57
- - `documentation/features/` - Feature specs (001-020)
104
+ - `documentation/features/` - Feature specs (001-049)
58
105
  - `documentation/chores/` - Chore plans (active + completed/)
59
106
  - `documentation/designs/` - Design documents
60
107
  - `documentation/reference/` - Reference documentation
@@ -67,17 +114,7 @@ SlyCode is the central hub for reusable Claude Code assets. Skills provide speci
67
114
  └── references/ # Supporting docs, templates, examples
68
115
  ```
69
116
 
70
- ## Command Structure
71
-
72
- ```markdown
73
- ---
74
- version: X.Y.Z
75
- updated: YYYY-MM-DD
76
- allowed-tools: [Tool1, Tool2]
77
- ---
78
- # Command Name
79
- Instructions for Claude when command is invoked
80
- ```
117
+ All user-invocable operations are now skills (no separate commands directory).
81
118
 
82
119
  ## Global CLI Commands
83
120
 
@@ -95,27 +132,46 @@ After `scripts/setup.sh`, these are available globally:
95
132
 
96
133
  ## Environment Variables (.env.example)
97
134
 
135
+ - **TZ**: IANA timezone for cron schedule evaluation (e.g., Australia/Melbourne). Defaults to UTC if unset.
98
136
  - **Ports**: WEB_PORT=7591, BRIDGE_PORT=7592, MESSAGING_SERVICE_PORT=7593
99
137
  - **Bridge**: BRIDGE_URL for bridge connection
100
138
  - **Telegram**: TELEGRAM_BOT_TOKEN, TELEGRAM_AUTHORIZED_USER_ID
101
- - **STT**: OPENAI_API_KEY (Whisper)
139
+ - **STT**: STT_BACKEND (openai|local), OPENAI_API_KEY (Whisper API), WHISPER_CLI_PATH + WHISPER_MODEL_PATH (local whisper.cpp)
102
140
  - **TTS**: ELEVENLABS_API_KEY, ELEVENLABS_VOICE_ID, ELEVENLABS_VOICE_SPEED
103
141
 
104
142
  ## Hooks
105
143
 
106
144
  - `web/src/hooks/useKeyboardShortcuts.ts` - Number keys 1-9 for project navigation, Escape
107
- - `web/src/hooks/useCommandsConfig.ts` - Polling-based commands config (30s)
145
+ - `web/src/hooks/useSlyActionsConfig.ts` - Polling-based commands config (30s)
108
146
  - `web/src/hooks/useConnectionStatus.ts` - SSE connection state
109
147
  - `web/src/hooks/usePolling.ts` - Generic polling hook
110
148
 
111
149
  ## Patterns & Invariants
112
150
 
113
151
  - Skills use semantic versioning (MAJOR.MINOR.PATCH)
114
- - Always update version and date when modifying skills/commands
115
- - Commands invoked via `/command-name` shorthand
152
+ - Always update version and date when modifying skills
153
+ - Skills invoked via `/skill-name` shorthand (commands no longer exist as separate entity)
116
154
  - CLAUDE.md applies to entire project, overrides defaults
117
155
  - MCP servers configured in .mcp.json (Context7 for docs)
118
156
  - Event log in documentation/events.json tracks card moves, asset ops, sessions (500 cap)
157
+ - Store uses canonical flat layout: `store/skills/`, `store/actions/`, `store/agents/`, `store/mcp/` (no provider subdirectories)
158
+ - Skill import defaults to SKILL.md-only (via `skillMainOnly` flag on store POST) to avoid overwriting references/. Full folder import available via ImportDialog.
159
+ - Assets deployed from store to projects (including SlyCode itself)
160
+ - Codex-format skills live in `.agents/skills/`, Claude in `.claude/skills/`
161
+ - Update delivery: `updates/` → accept → `store/` (with backup) → deploy to projects
162
+ - `store/.ignored-updates.json` tracks dismissed update versions per asset
163
+ - Scaffold uses overwrite protection: copyDirRecursive defaults to skip-existing, all template files check existence. Tutorial content seeded into workspace root via `seedTutorialWorkspaceContent()` (not separate subdirectory).
164
+ - CLAUDE.release.md + templates/CLAUDE.md: AI-operated CLI policy — treat CLI tools as AI-operated, don't instruct users to run CLI commands, execute and report results plainly
165
+ - Scaffold uses multi-provider overlays: base-instructions.md + overlays/{provider}.md for provider-specific setup
166
+ - Scaffold groups items by purpose: AI Config, Project Management, Documentation, Skills, Configuration
167
+ - Build pipeline: sync-updates.ts enforces store-manifest.js as authority for both skills and actions, removes non-manifest items from updates/. build-package.ts copies scaffold-templates/, store/, and updates/actions/ to dist/ for prod runtime access. Templates (skills, actions, tutorial-project) removed from packages/slycode/templates/ — build pipeline is the sole delivery mechanism.
168
+ - Scaffold seeds `providers.json` from `data/scaffold-templates/` into new workspaces (create-slycode). Actions delivered via updates/actions/ instead of scaffold template.
169
+ - kanban.js stamps `last_modified_by: 'cli'` on all write operations and `source: 'cli'` on events. Uses dynamic `PROJECT_NAME` (from workspace basename) for event project field and session names — no hardcoded 'claude-master'.
170
+ - kanban.js has `board` (--all/--stages/--inflight/--compact), `reorder` (positional card IDs or --top/--bottom/--position), `notes` (add/list/search/edit/delete/clear/oldest/summarize), and `automation` (configure/enable/disable/run/status/list) subcommands
171
+ - Card numbers: `backfillCardNumbers()` sorts all cards by created_at and assigns sequential numbers. `ensureCardNumbers()` auto-runs on first create. Verbose format shows `(#0001)`. Search includes automation cards when query is provided (only bare search excludes them).
172
+ - Notes summarization: `notes oldest [N]` shows oldest N notes, `notes summarize "text" --count N --agent "Name"` replaces oldest N with a summary note (marked `summary: true`, tracks `summarizedCount` and `dateRange`). Hard cap 100 notes, soft suggestion at 30.
173
+ - `kanban reorder` sets order 10,20,30... on listed cards; unlisted cards keep relative order but sort after prioritized ones
174
+ - Automation uses card description as prompt (no separate --prompt option). `automation run` sends card description to bridge session.
119
175
 
120
176
  ## Environment
121
177
 
@@ -125,11 +181,16 @@ After `scripts/setup.sh`, these are available globally:
125
181
  ## When to Expand
126
182
 
127
183
  - Creating new skill → skill-creator skill, .claude/skills/
128
- - Creating new command → create-command, .claude/commands/
184
+ - Creating new command → create-command skill, creates a new skill in .claude/skills/
129
185
  - Creating new agent → .claude/agents/
130
- - Modifying Claude behavior CLAUDE.md
186
+ - Cross-provider assetsstore/, .agents/skills/, convert-asset skill
187
+ - Skill updates → updates/ directory, web UpdatesView, store/.ignored-updates.json
188
+ - NPM distribution → packages/slycode/, packages/create-slycode/
189
+ - Store migration → scripts/migrate-store.sh
190
+ - Modifying agent behavior → CLAUDE.md
131
191
  - Adding MCP servers → .mcp.json
132
192
  - Service management → scripts/sly-*.sh
133
193
  - Setup/installation → scripts/setup.sh
134
- - Project scaffolding → scripts/scaffold.js, data/scaffold-templates/
194
+ - Project scaffolding → scripts/scaffold.js, data/scaffold-templates/, data/scaffold-templates/overlays/
195
+ - Build pipeline → build/build-package.ts, build/sync-updates.ts, build/store-manifest.js
135
196
  - Activity events → documentation/events.json, web/src/lib/event-log.ts
@@ -105,7 +105,7 @@ Global context: `{ project, projectPath }`
105
105
  - **Chore** - Create maintenance/bug fix plan from card
106
106
  - **Analyse Implementation** - Detailed analysis with findings table and problem logging
107
107
  - **Test Review** - Interactive test review for testing lane (checklist assessment, implicit testing, max 3 questions per Q&A round, area context priming)
108
- - **Convert Asset** - Cross-provider asset conversion (global scope, placement: startup)
108
+ - **Convert Asset** - Cross-provider asset conversion (scoped to claude-master project only, placement: startup)
109
109
  - **Organise Backlog** - Uses `kanban board` for snapshot and `kanban reorder` for reprioritisation
110
110
 
111
111
  ## Placement