prjct-cli 0.27.0 → 0.28.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/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.28.0] - 2026-01-10
4
+
5
+ ### Feature: Claude Code Native Integration
6
+
7
+ **Skills as First-Class Citizens**: prjct commands are now installed as Claude Code Skills for automatic discovery.
8
+
9
+ - **SessionStart Hook**: Injects fresh project context at session start via `~/.claude/hooks/prjct-session-start.sh`
10
+ - **Skills Auto-Install**: 4 skills installed to `~/.claude/skills/` during `npm install`:
11
+ - `prjct-task` - Start tasks with classification
12
+ - `prjct-sync` - Analyze codebase, generate agents
13
+ - `prjct-done` - Complete current subtask
14
+ - `prjct-ship` - Ship with PR + version bump
15
+ - **Setup Integration**: `core/infrastructure/setup.ts` now installs hooks and skills automatically
16
+ - **Simplified CLAUDE.md**: Reduced global template from 221 to ~50 lines - hooks handle fresh context
17
+
18
+ **Upgrade Impact**: Run `npm install -g prjct-cli` to install hooks and skills.
19
+
20
+ ---
21
+
3
22
  ## [0.27.0] - 2026-01-08
4
23
 
5
24
  ### Fix: prjct Commit Signature (CRITICAL)
package/CLAUDE.md CHANGED
@@ -145,26 +145,34 @@ Next: [suggested action]
145
145
 
146
146
  ---
147
147
 
148
- ## SKILL INTEGRATION (v0.27)
148
+ ## CLAUDE CODE INTEGRATION (v0.28)
149
149
 
150
- Agents are linked to Claude Code skills from claude-plugins.dev.
150
+ prjct-cli uses Claude Code's native features for robust integration:
151
151
 
152
- ### Agent → Skill Mapping
152
+ ### SessionStart Hook
153
153
 
154
- | Agent | Skill |
155
- |-------|-------|
156
- | `frontend.md` | `frontend-design` |
157
- | `uxui.md` | `frontend-design` |
158
- | `backend.md` | `javascript-typescript` |
159
- | `testing.md` | `developer-kit` |
160
- | `devops.md` | `developer-kit` |
161
- | `prjct-planner.md` | `feature-dev` |
162
- | `prjct-shipper.md` | `code-review` |
154
+ A hook runs at the start of every Claude Code session to inject fresh context:
155
+ - Located at: `~/.claude/hooks/prjct-session-start.sh`
156
+ - Automatically reads project state and injects into session
157
+ - Bypasses CLAUDE.md caching issues
163
158
 
164
- ### Usage
159
+ ### Skills (Auto-Discovery)
165
160
 
166
- - `p. sync` installs required skills automatically
167
- - `p. task` invokes skills based on task type
168
- - Skills config: `{globalPath}/config/skills.json`
161
+ Skills are auto-discovered by Claude Code when relevant:
169
162
 
170
- See `templates/agentic/skill-integration.md` for details.
163
+ | Skill | Trigger |
164
+ |-------|---------|
165
+ | `prjct-task` | "p. task", starting work, features/bugs |
166
+ | `prjct-sync` | "p. sync", analyze codebase |
167
+ | `prjct-done` | "p. done", completing work |
168
+ | `prjct-ship` | "p. ship", releasing features |
169
+
170
+ Skills location: `~/.claude/skills/prjct-*/SKILL.md`
171
+
172
+ ### Setup
173
+
174
+ All integration is installed automatically via `npm install -g prjct-cli`:
175
+ 1. SessionStart hook → `~/.claude/hooks/`
176
+ 2. Skills → `~/.claude/skills/`
177
+ 3. Commands → `~/.claude/commands/p/`
178
+ 4. Settings → `~/.claude/settings.json`
@@ -112,6 +112,12 @@ export async function run(): Promise<SetupResults> {
112
112
 
113
113
  // Step 4c: Install status line with version check
114
114
  await installStatusLine()
115
+
116
+ // Step 4d: Install SessionStart hook for fresh context injection
117
+ await installSessionHook()
118
+
119
+ // Step 4e: Install Skills for auto-discovery
120
+ await installSkills()
115
121
  }
116
122
 
117
123
  // Step 5: Save version in editors-config
@@ -272,6 +278,99 @@ echo "⚡ prjct"
272
278
  }
273
279
  }
274
280
 
281
+ /**
282
+ * Install SessionStart hook for fresh context injection
283
+ * This hook runs at the start of every Claude Code session
284
+ */
285
+ async function installSessionHook(): Promise<void> {
286
+ try {
287
+ const claudeDir = path.join(os.homedir(), '.claude')
288
+ const hooksDir = path.join(claudeDir, 'hooks')
289
+ const hookPath = path.join(hooksDir, 'prjct-session-start.sh')
290
+ const settingsPath = path.join(claudeDir, 'settings.json')
291
+
292
+ // Ensure hooks directory exists
293
+ if (!fs.existsSync(hooksDir)) {
294
+ fs.mkdirSync(hooksDir, { recursive: true })
295
+ }
296
+
297
+ // Copy hook from templates
298
+ const templateHookPath = path.join(__dirname, '../../templates/hooks/prjct-session-start.sh')
299
+ if (fs.existsSync(templateHookPath)) {
300
+ const hookContent = fs.readFileSync(templateHookPath, 'utf8')
301
+ fs.writeFileSync(hookPath, hookContent, { mode: 0o755 })
302
+ }
303
+
304
+ // Update settings.json to include SessionStart hook
305
+ let settings: Record<string, unknown> = {}
306
+ if (fs.existsSync(settingsPath)) {
307
+ try {
308
+ settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'))
309
+ } catch {
310
+ // Invalid JSON, start fresh
311
+ }
312
+ }
313
+
314
+ // Add or update hooks configuration
315
+ const hooks = (settings.hooks as Record<string, unknown[]>) || {}
316
+ hooks.SessionStart = [
317
+ {
318
+ matcher: 'startup',
319
+ hooks: [
320
+ {
321
+ type: 'command',
322
+ command: hookPath
323
+ }
324
+ ]
325
+ }
326
+ ]
327
+ settings.hooks = hooks
328
+
329
+ fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2))
330
+ console.log(` ${GREEN}✓${NC} SessionStart hook installed`)
331
+ } catch {
332
+ // Silently fail - hook is optional but recommended
333
+ }
334
+ }
335
+
336
+ /**
337
+ * Install Skills for Claude Code auto-discovery
338
+ * Skills are loaded automatically when relevant to user's request
339
+ */
340
+ async function installSkills(): Promise<void> {
341
+ try {
342
+ const claudeDir = path.join(os.homedir(), '.claude')
343
+ const skillsDir = path.join(claudeDir, 'skills')
344
+ const templateSkillsDir = path.join(__dirname, '../../templates/skills')
345
+
346
+ const skillNames = ['prjct-task', 'prjct-sync', 'prjct-done', 'prjct-ship']
347
+ let installed = 0
348
+
349
+ for (const skillName of skillNames) {
350
+ const destDir = path.join(skillsDir, skillName)
351
+ const templatePath = path.join(templateSkillsDir, skillName, 'SKILL.md')
352
+
353
+ if (fs.existsSync(templatePath)) {
354
+ // Ensure skill directory exists
355
+ if (!fs.existsSync(destDir)) {
356
+ fs.mkdirSync(destDir, { recursive: true })
357
+ }
358
+
359
+ // Copy SKILL.md
360
+ const skillContent = fs.readFileSync(templatePath, 'utf8')
361
+ fs.writeFileSync(path.join(destDir, 'SKILL.md'), skillContent)
362
+ installed++
363
+ }
364
+ }
365
+
366
+ if (installed > 0) {
367
+ console.log(` ${GREEN}✓${NC} ${installed} Skills installed`)
368
+ }
369
+ } catch {
370
+ // Silently fail - skills are optional but recommended
371
+ }
372
+ }
373
+
275
374
  /**
276
375
  * Show setup results
277
376
  */