prjct-cli 0.35.3 → 0.36.1

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 (68) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +63 -618
  3. package/bin/prjct.ts +116 -17
  4. package/core/cli/start.ts +387 -0
  5. package/core/commands/analysis.ts +58 -32
  6. package/core/commands/command-data.ts +11 -50
  7. package/core/commands/commands.ts +18 -21
  8. package/core/commands/context.ts +238 -0
  9. package/core/commands/register.ts +7 -5
  10. package/core/commands/setup.ts +1 -17
  11. package/core/index.ts +103 -39
  12. package/core/infrastructure/ai-provider.ts +312 -0
  13. package/core/infrastructure/command-installer.ts +49 -5
  14. package/core/infrastructure/editors-config.ts +20 -6
  15. package/core/infrastructure/setup.ts +227 -62
  16. package/core/services/index.ts +2 -0
  17. package/core/services/skill-service.ts +52 -16
  18. package/core/services/sync-service.ts +1080 -0
  19. package/core/types/commands.ts +0 -12
  20. package/core/types/index.ts +12 -1
  21. package/core/types/provider.ts +110 -0
  22. package/core/utils/branding.ts +20 -3
  23. package/dist/bin/prjct.mjs +1053 -1426
  24. package/dist/core/infrastructure/command-installer.js +33 -2
  25. package/dist/core/infrastructure/editors-config.js +13 -3
  26. package/dist/core/infrastructure/setup.js +293 -73
  27. package/package.json +10 -16
  28. package/scripts/postinstall.js +17 -119
  29. package/templates/agentic/agent-routing.md +22 -88
  30. package/templates/agentic/agents/uxui.md +42 -197
  31. package/templates/agentic/context-filtering.md +14 -56
  32. package/templates/agentic/orchestrator.md +26 -302
  33. package/templates/agentic/skill-integration.md +37 -289
  34. package/templates/agentic/subagent-generation.md +31 -104
  35. package/templates/agentic/task-fragmentation.md +39 -273
  36. package/templates/agents/AGENTS.md +33 -181
  37. package/templates/commands/bug.md +22 -520
  38. package/templates/commands/dash.md +26 -161
  39. package/templates/commands/done.md +19 -250
  40. package/templates/commands/enrich.md +21 -732
  41. package/templates/commands/idea.md +18 -160
  42. package/templates/commands/init.md +20 -209
  43. package/templates/commands/merge.md +21 -185
  44. package/templates/commands/next.md +21 -103
  45. package/templates/commands/p.md +1 -1
  46. package/templates/commands/p.toml +37 -0
  47. package/templates/commands/pause.md +21 -272
  48. package/templates/commands/resume.md +18 -411
  49. package/templates/commands/setup.md +0 -1
  50. package/templates/commands/ship.md +30 -627
  51. package/templates/commands/sync.md +11 -1448
  52. package/templates/commands/task.md +17 -439
  53. package/templates/commands/test.md +30 -259
  54. package/templates/global/CLAUDE.md +33 -1
  55. package/templates/global/GEMINI.md +265 -0
  56. package/templates/global/STORAGE-SPEC.md +256 -0
  57. package/templates/global/docs/agents.md +88 -0
  58. package/templates/global/docs/architecture.md +103 -0
  59. package/templates/global/docs/commands.md +96 -0
  60. package/templates/global/docs/validation.md +95 -0
  61. package/CLAUDE.md +0 -211
  62. package/packages/shared/package.json +0 -29
  63. package/packages/shared/src/index.ts +0 -10
  64. package/packages/shared/src/schemas.ts +0 -124
  65. package/packages/shared/src/types.ts +0 -187
  66. package/packages/shared/src/unified.ts +0 -174
  67. package/packages/shared/src/utils.ts +0 -148
  68. package/packages/shared/tsconfig.json +0 -18
package/CLAUDE.md DELETED
@@ -1,211 +0,0 @@
1
- # CLAUDE.md
2
-
3
- This file provides guidance to Claude Code when working with prjct-cli.
4
-
5
- ## Project Overview
6
-
7
- **prjct-cli** is a developer momentum tool. Track progress through natural language commands (`p. <command>`) without meetings or traditional PM overhead.
8
-
9
- ## HOW PRJCT WORKS
10
-
11
- When user types `p. <command>`, load the template from `templates/commands/{command}.md` and execute it **intelligently** - templates are GUIDANCE, not rigid scripts.
12
-
13
- ```
14
- p. sync → Analyze project, generate domain agents
15
- p. task X → Start task with classification + breakdown
16
- p. done → Complete current subtask
17
- p. ship X → Ship feature with PR + version bump
18
- ```
19
-
20
- ---
21
-
22
- ## CRITICAL RULES
23
-
24
- ### 1. Path Resolution (MOST IMPORTANT)
25
- **ALL writes go to global storage**: `~/.prjct-cli/projects/{projectId}/`
26
- - **NEVER** write to `.prjct/` (config only, read-only)
27
- - **NEVER** write to `./` (current directory)
28
-
29
- ### 2. Before Any Command
30
- ```
31
- 1. Read .prjct/prjct.config.json → get projectId
32
- 2. Set globalPath = ~/.prjct-cli/projects/{projectId}
33
- 3. Execute using globalPath for all writes
34
- 4. Log to {globalPath}/memory/events.jsonl
35
- ```
36
-
37
- ### 3. Timestamps & UUIDs
38
- ```bash
39
- # Timestamp (NEVER hardcode)
40
- bun -e "console.log(new Date().toISOString())" 2>/dev/null || node -e "console.log(new Date().toISOString())"
41
-
42
- # UUID
43
- bun -e "console.log(crypto.randomUUID())" 2>/dev/null || node -e "console.log(require('crypto').randomUUID())"
44
- ```
45
-
46
- ### 4. Git Commit Footer (CRITICAL - ALWAYS INCLUDE)
47
-
48
- **Every commit MUST include the prjct signature:**
49
-
50
- ```
51
- 🤖 Generated with [p/](https://www.prjct.app/)
52
- Designed for [Claude](https://www.anthropic.com/claude)
53
-
54
- ```
55
-
56
- **NON-NEGOTIABLE: The `🤖 Generated with [p/]` line identifies prjct-powered commits.**
57
-
58
- ---
59
-
60
- ## ARCHITECTURE: Write-Through Pattern
61
-
62
- ```
63
- User Action → Storage (JSON) → Context (MD) → Sync Events
64
- ```
65
-
66
- | Layer | Path | Purpose |
67
- |-------|------|---------|
68
- | **Storage** | `storage/*.json` | Source of truth |
69
- | **Context** | `context/*.md` | Claude-readable summaries |
70
- | **Memory** | `memory/events.jsonl` | Audit trail (append-only) |
71
- | **Agents** | `agents/*.md` | Domain specialists |
72
-
73
- ### File Structure
74
- ```
75
- ~/.prjct-cli/projects/{projectId}/
76
- ├── storage/
77
- │ ├── state.json # Current task (SOURCE OF TRUTH)
78
- │ ├── queue.json # Task queue
79
- │ └── shipped.json # Shipped features
80
- ├── context/
81
- │ ├── now.md # Current task (generated)
82
- │ └── next.md # Queue (generated)
83
- ├── memory/
84
- │ └── events.jsonl # Audit trail
85
- ├── agents/ # Domain specialists
86
- └── sync/
87
- └── pending.json # Backend events
88
- ```
89
-
90
- ---
91
-
92
- ## COMMANDS
93
-
94
- ### Core Workflow
95
- | Trigger | Purpose |
96
- |---------|---------|
97
- | `p. init` | Initialize project with deep analysis |
98
- | `p. sync` | Analyze repo, generate agents |
99
- | `p. task <desc>` | Start task with agentic classification |
100
- | `p. done` | Complete current subtask |
101
- | `p. ship [name]` | Ship with PR + version bump |
102
- | `p. pause` | Pause active task |
103
- | `p. resume` | Resume paused task |
104
- | `p. bug <desc>` | Report bug with auto-priority |
105
-
106
- ### Issue Tracker Integrations
107
- | Trigger | Purpose |
108
- |---------|---------|
109
- | `p. linear` | Linear issues (OAuth via MCP) |
110
- | `p. jira` | JIRA issues (OAuth/SSO via MCP) |
111
- | `p. github` | GitHub Issues (token via MCP) |
112
- | `p. monday` | Monday.com boards (OAuth via MCP) |
113
- | `p. enrich <ID>` | **AI-powered ticket enrichment** |
114
-
115
- ### Ticket Enrichment (`p. enrich`)
116
-
117
- Transform vague PM tickets into technical PRDs:
118
-
119
- ```
120
- PM creates: "Add user auth"
121
-
122
- p. enrich PRJ-59
123
-
124
- Architect analyzes codebase:
125
- - Similar implementations found
126
- - 5 files affected
127
- - OAuth2 approach recommended
128
- - 8 story points (not PM's guess of 2)
129
-
130
- Publishes PRD to tracker:
131
- - Technical approach
132
- - Acceptance criteria
133
- - LLM-ready prompt (for any AI tool)
134
- ```
135
-
136
- **Subcommands:**
137
- - `p. enrich <ID>` - Enrich specific ticket
138
- - `p. enrich setup` - Configure team preferences (estimation, output)
139
- - `p. enrich batch` - Enrich all assigned tickets (backlog grooming)
140
-
141
- ### Workflow
142
- ```
143
- p. sync → p. task "description" → [work] → p. done → p. ship
144
- ```
145
-
146
- ### With Issue Tracker
147
- ```
148
- p. linear → p. enrich PRJ-59 → p. linear start PRJ-59 → [work] → p. done → p. ship
149
- ```
150
-
151
- ---
152
-
153
- ## INTELLIGENT BEHAVIOR
154
-
155
- Templates provide guidance. Use your intelligence to:
156
-
157
- 1. **Read before write** - Always read existing files first
158
- 2. **Explore before coding** - Use Task(Explore) to understand codebase
159
- 3. **Ask when uncertain** - Use AskUserQuestion to clarify
160
- 4. **Load agents** - Read from `{globalPath}/agents/` for domain expertise
161
- 5. **Adapt templates** - They're guidance, not rigid scripts
162
- 6. **Log everything** - Append to memory/events.jsonl
163
-
164
- ---
165
-
166
- ## OUTPUT FORMAT
167
-
168
- Concise responses (< 4 lines):
169
- ```
170
- ✅ [What was done]
171
-
172
- [Key metrics]
173
- Next: [suggested action]
174
- ```
175
-
176
- ---
177
-
178
- ## KEY RULES
179
-
180
- 1. **Read files before editing** - Never assume structure
181
- 2. **Use node/bun for timestamps** - Never hardcode dates
182
- 3. **Follow template guidance** - But adapt intelligently
183
- 4. **Log to memory** - Append to `memory/events.jsonl`
184
- 5. **Suggest next actions** - Maintain user momentum
185
- 6. **Use linked skills** - Agents have skills in frontmatter
186
-
187
- ---
188
-
189
- ## SKILL INTEGRATION (v0.27)
190
-
191
- Agents are linked to Claude Code skills from claude-plugins.dev.
192
-
193
- ### Agent → Skill Mapping
194
-
195
- | Agent | Skill |
196
- |-------|-------|
197
- | `frontend.md` | `frontend-design` |
198
- | `uxui.md` | `frontend-design` |
199
- | `backend.md` | `javascript-typescript` |
200
- | `testing.md` | `developer-kit` |
201
- | `devops.md` | `developer-kit` |
202
- | `prjct-planner.md` | `feature-dev` |
203
- | `prjct-shipper.md` | `code-review` |
204
-
205
- ### Usage
206
-
207
- - `p. sync` installs required skills automatically
208
- - `p. task` invokes skills based on task type
209
- - Skills config: `{globalPath}/config/skills.json`
210
-
211
- See `templates/agentic/skill-integration.md` for details.
@@ -1,29 +0,0 @@
1
- {
2
- "name": "@prjct/shared",
3
- "version": "0.1.0",
4
- "description": "Shared types and utilities for prjct",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "module": "./dist/index.js",
8
- "types": "./dist/index.d.ts",
9
- "exports": {
10
- ".": {
11
- "import": "./dist/index.js",
12
- "types": "./dist/index.d.ts"
13
- }
14
- },
15
- "scripts": {
16
- "build": "bun build src/index.ts --outdir ./dist --target bun && bun run build:types",
17
- "build:types": "tsc --emitDeclarationOnly --declaration --outDir dist",
18
- "dev": "bun build src/index.ts --outdir ./dist --target bun --watch",
19
- "typecheck": "tsc --noEmit",
20
- "lint": "eslint src"
21
- },
22
- "dependencies": {
23
- "zod": "^3.23.8"
24
- },
25
- "devDependencies": {
26
- "@types/bun": "latest",
27
- "typescript": "^5.4.5"
28
- }
29
- }
@@ -1,10 +0,0 @@
1
- /**
2
- * @prjct/shared - Shared Types and Utilities
3
- *
4
- * Types and schemas shared between CLI, server, and web.
5
- */
6
-
7
- export * from './types'
8
- export * from './schemas'
9
- export * from './utils'
10
- export * from './unified'
@@ -1,124 +0,0 @@
1
- /**
2
- * Zod Schemas for validation
3
- */
4
-
5
- import { z } from 'zod'
6
-
7
- // Session Schemas
8
- export const SessionMetricsSchema = z.object({
9
- filesChanged: z.number().default(0),
10
- linesAdded: z.number().default(0),
11
- linesRemoved: z.number().default(0),
12
- commits: z.number().default(0),
13
- snapshots: z.array(z.string()).default([])
14
- })
15
-
16
- export const TimelineEventSchema = z.object({
17
- type: z.enum(['start', 'pause', 'resume', 'complete', 'snapshot']),
18
- at: z.string().datetime(),
19
- data: z.record(z.unknown()).optional()
20
- })
21
-
22
- export const SessionSchema = z.object({
23
- id: z.string().regex(/^sess_[a-z0-9]{8}$/),
24
- projectId: z.string(),
25
- task: z.string().min(1),
26
- status: z.enum(['active', 'paused', 'completed']),
27
- startedAt: z.string().datetime(),
28
- pausedAt: z.string().datetime().nullable(),
29
- completedAt: z.string().datetime().nullable(),
30
- duration: z.number().min(0),
31
- metrics: SessionMetricsSchema,
32
- timeline: z.array(TimelineEventSchema)
33
- })
34
-
35
- // Task Schemas
36
- export const TaskSchema = z.object({
37
- id: z.string(),
38
- title: z.string().min(1),
39
- description: z.string().optional(),
40
- status: z.enum(['pending', 'in_progress', 'completed', 'blocked']),
41
- priority: z.enum(['low', 'medium', 'high', 'critical']),
42
- createdAt: z.string().datetime(),
43
- completedAt: z.string().datetime().optional(),
44
- duration: z.number().optional(),
45
- tags: z.array(z.string()).optional()
46
- })
47
-
48
- // Idea Schemas
49
- export const IdeaSchema = z.object({
50
- id: z.string(),
51
- content: z.string().min(1),
52
- capturedAt: z.string().datetime(),
53
- source: z.string().optional(),
54
- promoted: z.boolean().optional(),
55
- promotedTo: z.string().optional()
56
- })
57
-
58
- // Feature Schemas
59
- export const FeatureSchema = z.object({
60
- id: z.string(),
61
- title: z.string().min(1),
62
- description: z.string().optional(),
63
- status: z.enum(['planned', 'in_progress', 'shipped', 'cancelled']),
64
- priority: z.number().min(1),
65
- createdAt: z.string().datetime(),
66
- shippedAt: z.string().datetime().optional(),
67
- tasks: z.array(TaskSchema).optional(),
68
- version: z.string().optional()
69
- })
70
-
71
- // Project Config Schema
72
- export const ProjectConfigSchema = z.object({
73
- projectId: z.string(),
74
- name: z.string().optional(),
75
- plugins: z.array(z.string()).optional()
76
- }).passthrough()
77
-
78
- // WebSocket Message Schemas
79
- export const WSInputMessageSchema = z.object({
80
- type: z.literal('input'),
81
- payload: z.object({
82
- data: z.string()
83
- }),
84
- timestamp: z.string().datetime()
85
- })
86
-
87
- export const WSResizeMessageSchema = z.object({
88
- type: z.literal('resize'),
89
- payload: z.object({
90
- cols: z.number().min(1),
91
- rows: z.number().min(1)
92
- }),
93
- timestamp: z.string().datetime()
94
- })
95
-
96
- export const WSMessageSchema = z.discriminatedUnion('type', [
97
- WSInputMessageSchema,
98
- WSResizeMessageSchema
99
- ])
100
-
101
- // API Request Schemas
102
- export const CreateSessionRequestSchema = z.object({
103
- task: z.string().min(1).max(200),
104
- projectId: z.string()
105
- })
106
-
107
- export const CreateTaskRequestSchema = z.object({
108
- title: z.string().min(1).max(200),
109
- description: z.string().max(1000).optional(),
110
- priority: z.enum(['low', 'medium', 'high', 'critical']).default('medium')
111
- })
112
-
113
- export const CaptureIdeaRequestSchema = z.object({
114
- content: z.string().min(1).max(500),
115
- source: z.string().optional()
116
- })
117
-
118
- // Inferred Types
119
- export type SessionInput = z.infer<typeof SessionSchema>
120
- export type TaskInput = z.infer<typeof TaskSchema>
121
- export type IdeaInput = z.infer<typeof IdeaSchema>
122
- export type FeatureInput = z.infer<typeof FeatureSchema>
123
- export type ProjectConfigInput = z.infer<typeof ProjectConfigSchema>
124
- export type WSMessageInput = z.infer<typeof WSMessageSchema>
@@ -1,187 +0,0 @@
1
- /**
2
- * Core Types for prjct
3
- */
4
-
5
- // Session Types
6
- export interface Session {
7
- id: string
8
- projectId: string
9
- task: string
10
- status: 'active' | 'paused' | 'completed'
11
- startedAt: string
12
- pausedAt: string | null
13
- completedAt: string | null
14
- duration: number
15
- metrics: SessionMetrics
16
- timeline: TimelineEvent[]
17
- }
18
-
19
- export interface SessionMetrics {
20
- filesChanged: number
21
- linesAdded: number
22
- linesRemoved: number
23
- commits: number
24
- snapshots: string[]
25
- }
26
-
27
- export interface TimelineEvent {
28
- type: 'start' | 'pause' | 'resume' | 'complete' | 'snapshot'
29
- at: string
30
- data?: Record<string, unknown>
31
- }
32
-
33
- // Snapshot Types
34
- export interface Snapshot {
35
- hash: string
36
- shortHash: string
37
- message: string
38
- timestamp: string
39
- files: string[]
40
- }
41
-
42
- // Task Types
43
- export interface Task {
44
- id: string
45
- title: string
46
- description?: string
47
- status: 'pending' | 'in_progress' | 'completed' | 'blocked'
48
- priority: 'low' | 'medium' | 'high' | 'critical'
49
- createdAt: string
50
- completedAt?: string
51
- duration?: number
52
- tags?: string[]
53
- }
54
-
55
- // Idea Types
56
- export interface Idea {
57
- id: string
58
- content: string
59
- capturedAt: string
60
- source?: string
61
- promoted?: boolean
62
- promotedTo?: string
63
- }
64
-
65
- // Feature Types
66
- export interface Feature {
67
- id: string
68
- title: string
69
- description?: string
70
- status: 'planned' | 'in_progress' | 'shipped' | 'cancelled'
71
- priority: number
72
- createdAt: string
73
- shippedAt?: string
74
- tasks?: Task[]
75
- version?: string
76
- }
77
-
78
- // Project Types
79
- export interface Project {
80
- id: string
81
- name: string
82
- path: string
83
- createdAt: string
84
- lastActiveAt: string
85
- config: ProjectConfig
86
- }
87
-
88
- export interface ProjectConfig {
89
- projectId: string
90
- name?: string
91
- plugins?: string[]
92
- [key: string]: unknown
93
- }
94
-
95
- // Metrics Types
96
- export interface DailyMetrics {
97
- date: string
98
- sessions: number
99
- duration: number
100
- commits: number
101
- filesChanged: number
102
- linesAdded: number
103
- linesRemoved: number
104
- }
105
-
106
- export interface WeeklyMetrics {
107
- weekStart: string
108
- weekEnd: string
109
- totalSessions: number
110
- totalDuration: number
111
- averageDuration: number
112
- tasksCompleted: number
113
- featuresShipped: number
114
- productivityScore: number
115
- streak: number
116
- byDay: Record<string, DailyMetrics>
117
- }
118
-
119
- // WebSocket Message Types
120
- export interface WSMessage {
121
- type: string
122
- payload?: unknown
123
- timestamp: string
124
- }
125
-
126
- export interface WSInputMessage extends WSMessage {
127
- type: 'input'
128
- payload: {
129
- data: string
130
- }
131
- }
132
-
133
- export interface WSOutputMessage extends WSMessage {
134
- type: 'output'
135
- payload: {
136
- data: string
137
- }
138
- }
139
-
140
- export interface WSResizeMessage extends WSMessage {
141
- type: 'resize'
142
- payload: {
143
- cols: number
144
- rows: number
145
- }
146
- }
147
-
148
- export interface WSStatusMessage extends WSMessage {
149
- type: 'status'
150
- payload: {
151
- status: 'connected' | 'disconnected' | 'error'
152
- message?: string
153
- }
154
- }
155
-
156
- // API Response Types
157
- export interface ApiResponse<T = unknown> {
158
- success: boolean
159
- data?: T
160
- error?: string
161
- timestamp: string
162
- }
163
-
164
- // Event Types (for event bus)
165
- export type EventType =
166
- | 'session.started'
167
- | 'session.paused'
168
- | 'session.resumed'
169
- | 'session.completed'
170
- | 'task.created'
171
- | 'task.completed'
172
- | 'feature.added'
173
- | 'feature.shipped'
174
- | 'idea.captured'
175
- | 'snapshot.created'
176
- | 'snapshot.restored'
177
- | 'git.commit'
178
- | 'git.push'
179
- | 'project.init'
180
- | 'project.sync'
181
-
182
- export interface EventPayload {
183
- type: EventType
184
- timestamp: string
185
- projectId: string
186
- data: Record<string, unknown>
187
- }