prjct-cli 0.45.0 → 0.45.3
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 +75 -0
- package/bin/prjct.ts +117 -10
- package/core/__tests__/agentic/memory-system.test.ts +39 -26
- package/core/__tests__/agentic/plan-mode.test.ts +64 -46
- package/core/__tests__/agentic/prompt-builder.test.ts +14 -14
- package/core/__tests__/services/project-index.test.ts +353 -0
- package/core/__tests__/types/fs.test.ts +3 -3
- package/core/__tests__/utils/date-helper.test.ts +10 -10
- package/core/__tests__/utils/output.test.ts +9 -6
- package/core/__tests__/utils/project-commands.test.ts +5 -6
- package/core/agentic/agent-router.ts +9 -10
- package/core/agentic/chain-of-thought.ts +16 -4
- package/core/agentic/command-executor.ts +66 -40
- package/core/agentic/context-builder.ts +8 -5
- package/core/agentic/ground-truth.ts +15 -9
- package/core/agentic/index.ts +145 -152
- package/core/agentic/loop-detector.ts +40 -11
- package/core/agentic/memory-system.ts +98 -35
- package/core/agentic/orchestrator-executor.ts +135 -71
- package/core/agentic/plan-mode.ts +46 -16
- package/core/agentic/prompt-builder.ts +108 -42
- package/core/agentic/services.ts +10 -9
- package/core/agentic/skill-loader.ts +9 -15
- package/core/agentic/smart-context.ts +129 -79
- package/core/agentic/template-executor.ts +13 -12
- package/core/agentic/template-loader.ts +7 -4
- package/core/agentic/tool-registry.ts +16 -13
- package/core/agents/index.ts +1 -1
- package/core/agents/performance.ts +10 -27
- package/core/ai-tools/formatters.ts +8 -6
- package/core/ai-tools/generator.ts +4 -4
- package/core/ai-tools/index.ts +1 -1
- package/core/ai-tools/registry.ts +21 -11
- package/core/bus/bus.ts +23 -16
- package/core/bus/index.ts +2 -2
- package/core/cli/linear.ts +3 -5
- package/core/cli/start.ts +28 -25
- package/core/commands/analysis.ts +58 -39
- package/core/commands/analytics.ts +52 -44
- package/core/commands/base.ts +15 -13
- package/core/commands/cleanup.ts +6 -13
- package/core/commands/command-data.ts +28 -4
- package/core/commands/commands.ts +57 -24
- package/core/commands/context.ts +4 -4
- package/core/commands/design.ts +3 -10
- package/core/commands/index.ts +5 -8
- package/core/commands/maintenance.ts +7 -4
- package/core/commands/planning.ts +179 -56
- package/core/commands/register.ts +13 -9
- package/core/commands/registry.ts +15 -14
- package/core/commands/setup.ts +26 -14
- package/core/commands/shipping.ts +11 -16
- package/core/commands/snapshots.ts +16 -32
- package/core/commands/uninstall.ts +541 -0
- package/core/commands/workflow.ts +24 -28
- package/core/constants/index.ts +10 -22
- package/core/context/generator.ts +82 -33
- package/core/context-tools/files-tool.ts +18 -19
- package/core/context-tools/imports-tool.ts +13 -33
- package/core/context-tools/index.ts +29 -54
- package/core/context-tools/recent-tool.ts +16 -22
- package/core/context-tools/signatures-tool.ts +17 -26
- package/core/context-tools/summary-tool.ts +20 -22
- package/core/context-tools/token-counter.ts +25 -20
- package/core/context-tools/types.ts +5 -5
- package/core/domain/agent-generator.ts +7 -5
- package/core/domain/agent-loader.ts +2 -2
- package/core/domain/analyzer.ts +19 -16
- package/core/domain/architecture-generator.ts +6 -3
- package/core/domain/context-estimator.ts +3 -4
- package/core/domain/snapshot-manager.ts +25 -22
- package/core/domain/task-stack.ts +24 -14
- package/core/errors.ts +1 -1
- package/core/events/events.ts +2 -4
- package/core/events/index.ts +1 -2
- package/core/index.ts +28 -16
- package/core/infrastructure/agent-detector.ts +3 -3
- package/core/infrastructure/ai-provider.ts +23 -20
- package/core/infrastructure/author-detector.ts +16 -10
- package/core/infrastructure/capability-installer.ts +2 -2
- package/core/infrastructure/claude-agent.ts +6 -6
- package/core/infrastructure/command-installer.ts +22 -17
- package/core/infrastructure/config-manager.ts +18 -14
- package/core/infrastructure/editors-config.ts +8 -4
- package/core/infrastructure/path-manager.ts +8 -6
- package/core/infrastructure/permission-manager.ts +20 -17
- package/core/infrastructure/setup.ts +42 -38
- package/core/infrastructure/update-checker.ts +5 -5
- package/core/integrations/issue-tracker/enricher.ts +8 -19
- package/core/integrations/issue-tracker/index.ts +2 -2
- package/core/integrations/issue-tracker/manager.ts +15 -15
- package/core/integrations/issue-tracker/types.ts +5 -22
- package/core/integrations/jira/client.ts +67 -59
- package/core/integrations/jira/index.ts +11 -14
- package/core/integrations/jira/mcp-adapter.ts +5 -10
- package/core/integrations/jira/service.ts +10 -10
- package/core/integrations/linear/client.ts +27 -18
- package/core/integrations/linear/index.ts +9 -12
- package/core/integrations/linear/service.ts +11 -11
- package/core/integrations/linear/sync.ts +8 -8
- package/core/outcomes/analyzer.ts +5 -18
- package/core/outcomes/index.ts +2 -2
- package/core/outcomes/recorder.ts +3 -3
- package/core/plugin/builtin/webhook.ts +19 -15
- package/core/plugin/hooks.ts +29 -21
- package/core/plugin/index.ts +7 -7
- package/core/plugin/loader.ts +19 -19
- package/core/plugin/registry.ts +12 -23
- package/core/schemas/agents.ts +1 -1
- package/core/schemas/analysis.ts +1 -1
- package/core/schemas/enriched-task.ts +62 -49
- package/core/schemas/ideas.ts +13 -13
- package/core/schemas/index.ts +17 -27
- package/core/schemas/issues.ts +40 -25
- package/core/schemas/metrics.ts +25 -25
- package/core/schemas/outcomes.ts +70 -62
- package/core/schemas/permissions.ts +15 -12
- package/core/schemas/prd.ts +27 -14
- package/core/schemas/project.ts +3 -3
- package/core/schemas/roadmap.ts +47 -34
- package/core/schemas/schemas.ts +3 -4
- package/core/schemas/shipped.ts +3 -3
- package/core/schemas/state.ts +43 -29
- package/core/server/index.ts +5 -6
- package/core/server/routes-extended.ts +68 -72
- package/core/server/routes.ts +3 -3
- package/core/server/server.ts +31 -26
- package/core/services/agent-generator.ts +237 -0
- package/core/services/agent-service.ts +2 -2
- package/core/services/breakdown-service.ts +2 -4
- package/core/services/context-generator.ts +299 -0
- package/core/services/context-selector.ts +420 -0
- package/core/services/doctor-service.ts +426 -0
- package/core/services/file-categorizer.ts +448 -0
- package/core/services/file-scorer.ts +270 -0
- package/core/services/git-analyzer.ts +267 -0
- package/core/services/index.ts +27 -10
- package/core/services/memory-service.ts +3 -4
- package/core/services/project-index.ts +911 -0
- package/core/services/project-service.ts +4 -4
- package/core/services/skill-installer.ts +14 -17
- package/core/services/skill-lock.ts +3 -3
- package/core/services/skill-service.ts +12 -6
- package/core/services/stack-detector.ts +245 -0
- package/core/services/sync-service.ts +87 -345
- package/core/services/watch-service.ts +294 -0
- package/core/session/compaction.ts +23 -31
- package/core/session/index.ts +11 -5
- package/core/session/log-migration.ts +3 -3
- package/core/session/metrics.ts +19 -14
- package/core/session/session-log-manager.ts +12 -17
- package/core/session/task-session-manager.ts +25 -25
- package/core/session/utils.ts +1 -1
- package/core/storage/ideas-storage.ts +41 -57
- package/core/storage/index-storage.ts +514 -0
- package/core/storage/index.ts +41 -17
- package/core/storage/metrics-storage.ts +39 -34
- package/core/storage/queue-storage.ts +35 -45
- package/core/storage/shipped-storage.ts +17 -20
- package/core/storage/state-storage.ts +50 -30
- package/core/storage/storage-manager.ts +6 -6
- package/core/storage/storage.ts +18 -15
- package/core/sync/auth-config.ts +3 -3
- package/core/sync/index.ts +13 -19
- package/core/sync/oauth-handler.ts +3 -3
- package/core/sync/sync-client.ts +4 -9
- package/core/sync/sync-manager.ts +12 -14
- package/core/types/commands.ts +42 -7
- package/core/types/index.ts +284 -305
- package/core/types/integrations.ts +3 -3
- package/core/types/storage.ts +14 -14
- package/core/types/utils.ts +3 -3
- package/core/utils/agent-stream.ts +3 -1
- package/core/utils/animations.ts +14 -11
- package/core/utils/branding.ts +7 -7
- package/core/utils/cache.ts +1 -3
- package/core/utils/collection-filters.ts +3 -15
- package/core/utils/date-helper.ts +2 -7
- package/core/utils/file-helper.ts +13 -8
- package/core/utils/jsonl-helper.ts +13 -10
- package/core/utils/keychain.ts +4 -8
- package/core/utils/logger.ts +1 -1
- package/core/utils/next-steps.ts +3 -3
- package/core/utils/output.ts +58 -11
- package/core/utils/project-commands.ts +6 -6
- package/core/utils/project-credentials.ts +5 -12
- package/core/utils/runtime.ts +2 -2
- package/core/utils/session-helper.ts +3 -4
- package/core/utils/version.ts +3 -3
- package/core/wizard/index.ts +13 -0
- package/core/wizard/onboarding.ts +633 -0
- package/core/workflow/state-machine.ts +7 -7
- package/dist/bin/prjct.mjs +18755 -15574
- package/dist/core/infrastructure/command-installer.js +86 -79
- package/dist/core/infrastructure/editors-config.js +6 -6
- package/dist/core/infrastructure/setup.js +246 -225
- package/dist/core/utils/version.js +9 -9
- package/package.json +11 -12
- package/scripts/build.js +3 -3
- package/scripts/postinstall.js +2 -2
- package/templates/mcp-config.json +6 -1
- package/templates/permissions/permissive.jsonc +1 -1
- package/templates/permissions/strict.jsonc +5 -9
- package/templates/global/docs/agents.md +0 -88
- package/templates/global/docs/architecture.md +0 -103
- package/templates/global/docs/commands.md +0 -96
- package/templates/global/docs/validation.md +0 -95
|
@@ -42,8 +42,8 @@ __export(version_exports, {
|
|
|
42
42
|
needsMigration: () => needsMigration
|
|
43
43
|
});
|
|
44
44
|
module.exports = __toCommonJS(version_exports);
|
|
45
|
-
var
|
|
46
|
-
var
|
|
45
|
+
var import_node_fs = __toESM(require("node:fs"));
|
|
46
|
+
var import_node_path = __toESM(require("node:path"));
|
|
47
47
|
var cachedVersion = null;
|
|
48
48
|
var cachedPackageJson = null;
|
|
49
49
|
var cachedPackageRoot = null;
|
|
@@ -53,10 +53,10 @@ function getPackageRoot() {
|
|
|
53
53
|
}
|
|
54
54
|
let currentDir = __dirname;
|
|
55
55
|
for (let i = 0; i < 5; i++) {
|
|
56
|
-
const packageJsonPath =
|
|
57
|
-
if (
|
|
56
|
+
const packageJsonPath = import_node_path.default.join(currentDir, "package.json");
|
|
57
|
+
if (import_node_fs.default.existsSync(packageJsonPath)) {
|
|
58
58
|
try {
|
|
59
|
-
const pkg = JSON.parse(
|
|
59
|
+
const pkg = JSON.parse(import_node_fs.default.readFileSync(packageJsonPath, "utf-8"));
|
|
60
60
|
if (pkg.name === "prjct-cli") {
|
|
61
61
|
cachedPackageRoot = currentDir;
|
|
62
62
|
return currentDir;
|
|
@@ -64,9 +64,9 @@ function getPackageRoot() {
|
|
|
64
64
|
} catch (_error) {
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
currentDir =
|
|
67
|
+
currentDir = import_node_path.default.dirname(currentDir);
|
|
68
68
|
}
|
|
69
|
-
cachedPackageRoot =
|
|
69
|
+
cachedPackageRoot = import_node_path.default.join(__dirname, "..", "..", "..");
|
|
70
70
|
return cachedPackageRoot;
|
|
71
71
|
}
|
|
72
72
|
__name(getPackageRoot, "getPackageRoot");
|
|
@@ -75,8 +75,8 @@ function getVersion() {
|
|
|
75
75
|
return cachedVersion;
|
|
76
76
|
}
|
|
77
77
|
try {
|
|
78
|
-
const packageJsonPath =
|
|
79
|
-
const packageJson = JSON.parse(
|
|
78
|
+
const packageJsonPath = import_node_path.default.join(getPackageRoot(), "package.json");
|
|
79
|
+
const packageJson = JSON.parse(import_node_fs.default.readFileSync(packageJsonPath, "utf-8"));
|
|
80
80
|
cachedVersion = packageJson.version;
|
|
81
81
|
cachedPackageJson = packageJson;
|
|
82
82
|
return cachedVersion;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prjct-cli",
|
|
3
|
-
"version": "0.45.
|
|
3
|
+
"version": "0.45.3",
|
|
4
4
|
"description": "Context layer for AI agents. Project context for Claude Code, Gemini CLI, and more.",
|
|
5
5
|
"main": "core/index.ts",
|
|
6
6
|
"bin": {
|
|
@@ -27,10 +27,12 @@
|
|
|
27
27
|
"typecheck": "tsc --noEmit -p core/tsconfig.json",
|
|
28
28
|
"typecheck:watch": "tsc --noEmit -p core/tsconfig.json --watch",
|
|
29
29
|
"validate": "bun scripts/validate-commands.js",
|
|
30
|
-
"lint": "
|
|
31
|
-
"lint:fix": "
|
|
32
|
-
"format": "
|
|
33
|
-
"format:check": "
|
|
30
|
+
"lint": "biome lint .",
|
|
31
|
+
"lint:fix": "biome lint --write .",
|
|
32
|
+
"format": "biome format --write .",
|
|
33
|
+
"format:check": "biome format .",
|
|
34
|
+
"check": "biome check .",
|
|
35
|
+
"check:fix": "biome check --write ."
|
|
34
36
|
},
|
|
35
37
|
"keywords": [
|
|
36
38
|
"claude-code",
|
|
@@ -50,6 +52,7 @@
|
|
|
50
52
|
"@hono/node-server": "^1.13.7",
|
|
51
53
|
"@linear/sdk": "^29.0.0",
|
|
52
54
|
"chalk": "^4.1.2",
|
|
55
|
+
"chokidar": "^5.0.0",
|
|
53
56
|
"esbuild": "^0.25.0",
|
|
54
57
|
"glob": "^10.3.10",
|
|
55
58
|
"hono": "^4.11.3",
|
|
@@ -59,14 +62,10 @@
|
|
|
59
62
|
"zod": "^3.24.1"
|
|
60
63
|
},
|
|
61
64
|
"devDependencies": {
|
|
65
|
+
"@biomejs/biome": "^2.3.13",
|
|
62
66
|
"@types/bun": "latest",
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"eslint-config-standard": "^17.1.0",
|
|
66
|
-
"eslint-plugin-import": "^2.32.0",
|
|
67
|
-
"eslint-plugin-n": "^16.6.2",
|
|
68
|
-
"eslint-plugin-promise": "^6.6.0",
|
|
69
|
-
"prettier": "^3.6.2",
|
|
67
|
+
"@types/chokidar": "^2.1.7",
|
|
68
|
+
"@types/prompts": "^2.4.9",
|
|
70
69
|
"typescript": "^5.9.3"
|
|
71
70
|
},
|
|
72
71
|
"repository": {
|
package/scripts/build.js
CHANGED
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* @version 2.0.0
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
const { execSync } = require('child_process')
|
|
18
|
-
const fs = require('fs')
|
|
19
|
-
const path = require('path')
|
|
17
|
+
const { execSync } = require('node:child_process')
|
|
18
|
+
const fs = require('node:fs')
|
|
19
|
+
const path = require('node:path')
|
|
20
20
|
|
|
21
21
|
const ROOT = path.resolve(__dirname, '..')
|
|
22
22
|
const DIST = path.join(ROOT, 'dist')
|
package/scripts/postinstall.js
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* This script just shows a helpful message.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
const fs = require('fs')
|
|
13
|
-
const path = require('path')
|
|
12
|
+
const fs = require('node:fs')
|
|
13
|
+
const path = require('node:path')
|
|
14
14
|
|
|
15
15
|
const ROOT = path.resolve(__dirname, '..')
|
|
16
16
|
const pkg = JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf-8'))
|
|
@@ -26,7 +26,12 @@
|
|
|
26
26
|
},
|
|
27
27
|
"monday": {
|
|
28
28
|
"when": ["Working with Monday.com boards (p. monday)"],
|
|
29
|
-
"tools": [
|
|
29
|
+
"tools": [
|
|
30
|
+
"create_item",
|
|
31
|
+
"delete_item",
|
|
32
|
+
"get_board_items_by_name",
|
|
33
|
+
"change_item_column_values"
|
|
34
|
+
],
|
|
30
35
|
"setup": ["OAuth via browser on first use"]
|
|
31
36
|
},
|
|
32
37
|
"github": {
|
|
@@ -33,24 +33,20 @@
|
|
|
33
33
|
"files": {
|
|
34
34
|
"read": {
|
|
35
35
|
"**/*": "allow",
|
|
36
|
-
"**/.*": "ask",
|
|
37
|
-
"**/.env*": "deny"
|
|
36
|
+
"**/.*": "ask", // Hidden files need approval
|
|
37
|
+
"**/.env*": "deny" // Never read env files
|
|
38
38
|
},
|
|
39
39
|
"write": {
|
|
40
|
-
"**/*": "ask"
|
|
40
|
+
"**/*": "ask" // All writes need approval
|
|
41
41
|
},
|
|
42
42
|
"delete": {
|
|
43
|
-
"**/*": "deny"
|
|
43
|
+
"**/*": "deny" // No deletions without explicit override
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
|
|
47
47
|
"web": {
|
|
48
48
|
"enabled": true,
|
|
49
|
-
"blockedDomains": [
|
|
50
|
-
"localhost",
|
|
51
|
-
"127.0.0.1",
|
|
52
|
-
"internal"
|
|
53
|
-
]
|
|
49
|
+
"blockedDomains": ["localhost", "127.0.0.1", "internal"]
|
|
54
50
|
},
|
|
55
51
|
|
|
56
52
|
"doomLoop": {
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
# Using Agents
|
|
2
|
-
|
|
3
|
-
## What Are Agents?
|
|
4
|
-
|
|
5
|
-
Agents are specialized Claude configurations for different domains:
|
|
6
|
-
|
|
7
|
-
| Agent | Domain | When to Use |
|
|
8
|
-
|-------|--------|-------------|
|
|
9
|
-
| `fe.md` | Frontend | React, CSS, UI components |
|
|
10
|
-
| `be.md` | Backend | APIs, databases, servers |
|
|
11
|
-
| `ux.md` | UX Design | Layouts, user flows |
|
|
12
|
-
| `qa.md` | Testing | Tests, QA, bug fixes |
|
|
13
|
-
| `docs.md` | Documentation | README, docs, comments |
|
|
14
|
-
|
|
15
|
-
## Agent Location
|
|
16
|
-
|
|
17
|
-
Agents live in global storage:
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
~/.prjct-cli/projects/{projectId}/agents/
|
|
21
|
-
├── fe.md # Frontend specialist
|
|
22
|
-
├── be.md # Backend specialist
|
|
23
|
-
├── ux.md # UX specialist
|
|
24
|
-
├── qa.md # Testing specialist
|
|
25
|
-
└── docs.md # Documentation specialist
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## When to Read Agent Files
|
|
29
|
-
|
|
30
|
-
Read the relevant agent file before working in that domain:
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
Task: "implement React component"
|
|
34
|
-
→ Read agents/fe.md for React patterns
|
|
35
|
-
→ Follow detected conventions
|
|
36
|
-
|
|
37
|
-
Task: "add API endpoint"
|
|
38
|
-
→ Read agents/be.md for API patterns
|
|
39
|
-
→ Follow project architecture
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Agent File Structure
|
|
43
|
-
|
|
44
|
-
Each agent file contains:
|
|
45
|
-
|
|
46
|
-
```markdown
|
|
47
|
-
---
|
|
48
|
-
name: fe
|
|
49
|
-
description: Frontend specialist for React/TypeScript
|
|
50
|
-
tools: Read, Write, Glob, Grep, Bash
|
|
51
|
-
---
|
|
52
|
-
|
|
53
|
-
## Expertise
|
|
54
|
-
- React components and hooks
|
|
55
|
-
- TypeScript patterns
|
|
56
|
-
- CSS/styling conventions
|
|
57
|
-
|
|
58
|
-
## Project Patterns
|
|
59
|
-
- Components in src/components/
|
|
60
|
-
- Use functional components
|
|
61
|
-
- CSS modules for styling
|
|
62
|
-
|
|
63
|
-
## Code Conventions
|
|
64
|
-
- Named exports
|
|
65
|
-
- Props interfaces defined inline
|
|
66
|
-
- Error boundaries for async components
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## Auto-Detection
|
|
70
|
-
|
|
71
|
-
When starting a task with `/p:now`, agents are auto-detected by keywords:
|
|
72
|
-
|
|
73
|
-
| Keywords | Agent |
|
|
74
|
-
|----------|-------|
|
|
75
|
-
| UI, frontend, React, component, CSS | `fe` |
|
|
76
|
-
| API, backend, database, server | `be` |
|
|
77
|
-
| design, UX, layout, wireframe | `ux` |
|
|
78
|
-
| test, QA, bug, coverage | `qa` |
|
|
79
|
-
| docs, README, documentation | `docs` |
|
|
80
|
-
|
|
81
|
-
## Agent Generation
|
|
82
|
-
|
|
83
|
-
Agents are generated by `/p:sync` based on:
|
|
84
|
-
- Detected tech stack (package.json, etc.)
|
|
85
|
-
- Project structure
|
|
86
|
-
- Code patterns found in codebase
|
|
87
|
-
|
|
88
|
-
Re-run `/p:sync` to regenerate agents after major changes.
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
# prjct Architecture
|
|
2
|
-
|
|
3
|
-
## Write-Through Pattern
|
|
4
|
-
|
|
5
|
-
All data flows through three layers:
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
User Action → Storage (JSON) → Context (MD) → Sync Events (JSONL)
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
### Layer Responsibilities
|
|
12
|
-
|
|
13
|
-
| Layer | Path | Purpose | Format |
|
|
14
|
-
|-------|------|---------|--------|
|
|
15
|
-
| **Storage** | `storage/*.json` | Source of truth | JSON |
|
|
16
|
-
| **Context** | `context/*.md` | Claude-readable summaries | Markdown |
|
|
17
|
-
| **Sync** | `sync/pending.json` | Backend event queue | JSON array |
|
|
18
|
-
| **Memory** | `memory/events.jsonl` | Audit trail | JSONL (append-only) |
|
|
19
|
-
|
|
20
|
-
### Data Flow Example
|
|
21
|
-
|
|
22
|
-
When user runs `/p:now "implement auth"`:
|
|
23
|
-
|
|
24
|
-
1. **Storage**: Write to `storage/state.json`
|
|
25
|
-
```json
|
|
26
|
-
{ "currentTask": { "description": "implement auth", ... } }
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
2. **Context**: Generate `context/now.md`
|
|
30
|
-
```markdown
|
|
31
|
-
# NOW
|
|
32
|
-
**implement auth**
|
|
33
|
-
Started: 2025-12-20T10:30:00.000Z
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
3. **Sync**: Append to `sync/pending.json`
|
|
37
|
-
```json
|
|
38
|
-
{ "type": "task.started", "data": {...} }
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
4. **Memory**: Append to `memory/events.jsonl`
|
|
42
|
-
```json
|
|
43
|
-
{"timestamp":"...","action":"task_started","task":"implement auth"}
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## File Structure
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
~/.prjct-cli/projects/{projectId}/
|
|
50
|
-
├── storage/ # SOURCE OF TRUTH
|
|
51
|
-
│ ├── state.json # Current task state
|
|
52
|
-
│ ├── shipped.json # Shipped features
|
|
53
|
-
│ ├── ideas.json # Ideas backlog
|
|
54
|
-
│ └── queue.json # Task queue
|
|
55
|
-
│
|
|
56
|
-
├── context/ # CLAUDE-READABLE (generated)
|
|
57
|
-
│ ├── now.md # Current task summary
|
|
58
|
-
│ ├── shipped.md # Recent ships
|
|
59
|
-
│ └── next.md # Priority queue
|
|
60
|
-
│
|
|
61
|
-
├── sync/ # BACKEND EVENTS
|
|
62
|
-
│ └── pending.json # Events waiting for sync
|
|
63
|
-
│
|
|
64
|
-
├── memory/ # AUDIT TRAIL
|
|
65
|
-
│ └── events.jsonl # Append-only log
|
|
66
|
-
│
|
|
67
|
-
├── agents/ # DOMAIN SPECIALISTS
|
|
68
|
-
│ ├── fe.md # Frontend agent
|
|
69
|
-
│ ├── be.md # Backend agent
|
|
70
|
-
│ └── ...
|
|
71
|
-
│
|
|
72
|
-
└── CLAUDE.md # Project context (read first)
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Storage vs Context
|
|
76
|
-
|
|
77
|
-
| Aspect | Storage (JSON) | Context (MD) |
|
|
78
|
-
|--------|----------------|--------------|
|
|
79
|
-
| Format | Structured JSON | Human-readable Markdown |
|
|
80
|
-
| Purpose | Source of truth | Claude summaries |
|
|
81
|
-
| Updates | Direct writes | Generated from storage |
|
|
82
|
-
| Read by | Code, Claude | Primarily Claude |
|
|
83
|
-
|
|
84
|
-
## Timestamps
|
|
85
|
-
|
|
86
|
-
All timestamps use ISO 8601 format:
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
# Prefer bun, fallback to node
|
|
90
|
-
bun -e "console.log(new Date().toISOString())" 2>/dev/null || node -e "console.log(new Date().toISOString())"
|
|
91
|
-
# Output: "2025-12-20T10:30:00.000Z"
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
**NEVER** hardcode timestamps. Always generate dynamically.
|
|
95
|
-
|
|
96
|
-
## IDs
|
|
97
|
-
|
|
98
|
-
Use UUID v4 for all IDs:
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
bun -e "console.log(crypto.randomUUID())" 2>/dev/null || node -e "console.log(require('crypto').randomUUID())"
|
|
102
|
-
# Output: "550e8400-e29b-41d4-a716-446655440000"
|
|
103
|
-
```
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
# prjct Commands Reference
|
|
2
|
-
|
|
3
|
-
## Command Table
|
|
4
|
-
|
|
5
|
-
| Trigger | Purpose | Arguments |
|
|
6
|
-
|---------|---------|-----------|
|
|
7
|
-
| `p. sync` | Analyze project, generate agents | - |
|
|
8
|
-
| `p. task [desc] [estimate]` | Start/show current task | desc: string, estimate: "2h", "30m" |
|
|
9
|
-
| `p. done` | Complete current task | - |
|
|
10
|
-
| `p. ship [feature]` | Ship with quality checks | feature: string |
|
|
11
|
-
| `p. next` | Show priority queue | - |
|
|
12
|
-
| `p. idea [text]` | Quick idea capture | text: string |
|
|
13
|
-
| `p. dash` | Project dashboard | - |
|
|
14
|
-
| `p. pause [reason]` | Pause current task | reason: string |
|
|
15
|
-
| `p. resume` | Resume paused task | - |
|
|
16
|
-
| `p. bug [desc]` | Report bug | desc: string |
|
|
17
|
-
|
|
18
|
-
## Recommended Workflow
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
1. p. sync → Analyze project, generate agents
|
|
22
|
-
2. p. idea → Capture what to build
|
|
23
|
-
3. p. task → Start working on task
|
|
24
|
-
4. [code...] → Do the actual work
|
|
25
|
-
5. p. done → Mark task complete
|
|
26
|
-
6. p. ship → Ship and celebrate
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Command Examples
|
|
30
|
-
|
|
31
|
-
### Starting Work
|
|
32
|
-
```
|
|
33
|
-
p. task implement user authentication 2h
|
|
34
|
-
```
|
|
35
|
-
- Sets current task
|
|
36
|
-
- Optional estimate for tracking accuracy
|
|
37
|
-
|
|
38
|
-
### Completing Work
|
|
39
|
-
```
|
|
40
|
-
p. done
|
|
41
|
-
```
|
|
42
|
-
- Calculates duration
|
|
43
|
-
- Logs metrics (files changed, commits)
|
|
44
|
-
- Clears current task
|
|
45
|
-
|
|
46
|
-
### Shipping
|
|
47
|
-
```
|
|
48
|
-
p. ship user authentication
|
|
49
|
-
```
|
|
50
|
-
- Runs lint/tests (optional)
|
|
51
|
-
- Bumps version
|
|
52
|
-
- Creates git commit
|
|
53
|
-
- Updates CHANGELOG
|
|
54
|
-
|
|
55
|
-
### Quick Capture
|
|
56
|
-
```
|
|
57
|
-
p. idea add dark mode support
|
|
58
|
-
```
|
|
59
|
-
- Saves to ideas backlog
|
|
60
|
-
- Doesn't interrupt current work
|
|
61
|
-
|
|
62
|
-
## How It Works
|
|
63
|
-
|
|
64
|
-
Start your message with `p.` followed by the command:
|
|
65
|
-
|
|
66
|
-
```
|
|
67
|
-
p. task login form
|
|
68
|
-
→ Starts task "login form"
|
|
69
|
-
|
|
70
|
-
p. done
|
|
71
|
-
→ Completes current task
|
|
72
|
-
|
|
73
|
-
p. ship authentication
|
|
74
|
-
→ Ships "authentication" feature
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## Command Output Format
|
|
78
|
-
|
|
79
|
-
All commands output concise responses:
|
|
80
|
-
|
|
81
|
-
```
|
|
82
|
-
✅ [What was done]
|
|
83
|
-
|
|
84
|
-
[Key metrics if applicable]
|
|
85
|
-
|
|
86
|
-
Next: [suggested action]
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Example:
|
|
90
|
-
```
|
|
91
|
-
✅ implement auth (2h 15m)
|
|
92
|
-
|
|
93
|
-
Files: 5 | +120/-30 | Commits: 3
|
|
94
|
-
|
|
95
|
-
Next: p. ship or p. task
|
|
96
|
-
```
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
# Validation Patterns
|
|
2
|
-
|
|
3
|
-
## Before Any Command
|
|
4
|
-
|
|
5
|
-
```javascript
|
|
6
|
-
// 1. Check project exists
|
|
7
|
-
const config = await Read('.prjct/prjct.config.json')
|
|
8
|
-
if (!config) {
|
|
9
|
-
return "No prjct project. Run /p:init first."
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// 2. Extract projectId
|
|
13
|
-
const { projectId } = JSON.parse(config)
|
|
14
|
-
|
|
15
|
-
// 3. Construct global path
|
|
16
|
-
const globalPath = `~/.prjct-cli/projects/${projectId}`
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Before /p:done
|
|
20
|
-
|
|
21
|
-
```javascript
|
|
22
|
-
const state = await Read(`${globalPath}/storage/state.json`)
|
|
23
|
-
|
|
24
|
-
if (!state || !state.currentTask) {
|
|
25
|
-
return "Not working on anything. Use /p:now to start a task."
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (state.currentTask.status !== 'active') {
|
|
29
|
-
return "No active task. Use /p:now to start one."
|
|
30
|
-
}
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Before /p:ship
|
|
34
|
-
|
|
35
|
-
```javascript
|
|
36
|
-
// Check git status
|
|
37
|
-
const gitStatus = await Bash('git status --porcelain')
|
|
38
|
-
|
|
39
|
-
if (!gitStatus.trim()) {
|
|
40
|
-
return "No changes to ship. Make some commits first."
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Verify git repo
|
|
44
|
-
const isGitRepo = await Bash('git rev-parse --is-inside-work-tree')
|
|
45
|
-
if (!isGitRepo) {
|
|
46
|
-
return "Not a git repository. Initialize git first."
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## Before /p:pause
|
|
51
|
-
|
|
52
|
-
```javascript
|
|
53
|
-
const state = await Read(`${globalPath}/storage/state.json`)
|
|
54
|
-
|
|
55
|
-
if (!state?.currentTask || state.currentTask.status !== 'active') {
|
|
56
|
-
return "No active task to pause."
|
|
57
|
-
}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## Before /p:resume
|
|
61
|
-
|
|
62
|
-
```javascript
|
|
63
|
-
const state = await Read(`${globalPath}/storage/state.json`)
|
|
64
|
-
|
|
65
|
-
if (!state?.pausedTask) {
|
|
66
|
-
return "No paused task to resume. Use /p:now to start a new task."
|
|
67
|
-
}
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## Error Handling
|
|
71
|
-
|
|
72
|
-
| Error | Response | Action |
|
|
73
|
-
|-------|----------|--------|
|
|
74
|
-
| Config not found | "No prjct project" | STOP |
|
|
75
|
-
| No current task | "Not working on anything" | STOP |
|
|
76
|
-
| No paused task | "No paused task" | STOP |
|
|
77
|
-
| Git fails | Use defaults for metrics | CONTINUE |
|
|
78
|
-
| Write fails | Log warning | CONTINUE |
|
|
79
|
-
| File not found | Return empty/default state | CONTINUE |
|
|
80
|
-
|
|
81
|
-
## Path Resolution
|
|
82
|
-
|
|
83
|
-
**CRITICAL**: All paths resolve to global storage.
|
|
84
|
-
|
|
85
|
-
```javascript
|
|
86
|
-
// Template says:
|
|
87
|
-
"Read: storage/state.json"
|
|
88
|
-
|
|
89
|
-
// Actually reads:
|
|
90
|
-
`~/.prjct-cli/projects/${projectId}/storage/state.json`
|
|
91
|
-
|
|
92
|
-
// NEVER:
|
|
93
|
-
".prjct/storage/state.json" // Wrong - local
|
|
94
|
-
"./storage/state.json" // Wrong - current dir
|
|
95
|
-
```
|