prjct-cli 0.19.0 → 0.20.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.
- package/CHANGELOG.md +66 -6
- package/CLAUDE.md +56 -15
- package/README.md +5 -6
- package/bin/prjct +59 -42
- package/bin/prjct.ts +60 -0
- package/core/__tests__/agentic/memory-system.test.ts +18 -3
- package/core/__tests__/agentic/plan-mode.test.ts +55 -26
- package/core/__tests__/agentic/prompt-builder.test.ts +6 -6
- package/core/__tests__/utils/project-commands.test.ts +72 -0
- package/core/agentic/agent-router.ts +3 -12
- package/core/agentic/command-executor.ts +372 -3
- package/core/agentic/context-builder.ts +7 -27
- package/core/agentic/ground-truth.ts +604 -5
- package/core/agentic/index.ts +180 -0
- package/core/agentic/loop-detector.ts +418 -4
- package/core/agentic/memory-system.ts +857 -3
- package/core/agentic/plan-mode.ts +491 -4
- package/core/agentic/prompt-builder.ts +44 -65
- package/core/agentic/services.ts +13 -5
- package/core/agentic/skill-loader.ts +112 -0
- package/core/agentic/smart-context.ts +37 -122
- package/core/agentic/template-loader.ts +79 -122
- package/core/agentic/tool-registry.ts +5 -11
- package/core/agents/index.ts +1 -1
- package/core/agents/performance.ts +4 -2
- package/core/bus/bus.ts +262 -0
- package/core/bus/index.ts +3 -313
- package/core/commands/analysis.ts +5 -5
- package/core/commands/analytics.ts +11 -11
- package/core/commands/base.ts +33 -209
- package/core/commands/cleanup.ts +148 -0
- package/core/commands/command-data.ts +346 -0
- package/core/commands/commands.ts +216 -0
- package/core/commands/design.ts +83 -0
- package/core/commands/index.ts +13 -207
- package/core/commands/maintenance.ts +52 -473
- package/core/commands/planning.ts +3 -3
- package/core/commands/register.ts +104 -0
- package/core/commands/registry.ts +441 -0
- package/core/commands/setup.ts +25 -9
- package/core/commands/shipping.ts +48 -11
- package/core/commands/snapshots.ts +299 -0
- package/core/commands/workflow.ts +2 -2
- package/core/constants/index.ts +254 -4
- package/core/domain/agent-loader.ts +5 -6
- package/core/domain/task-stack.ts +555 -4
- package/core/errors.ts +127 -1
- package/core/events/events.ts +87 -0
- package/core/events/index.ts +4 -138
- package/core/index.ts +15 -23
- package/core/infrastructure/agent-detector.ts +126 -201
- package/core/infrastructure/author-detector.ts +99 -171
- package/core/infrastructure/command-installer.ts +476 -4
- package/core/infrastructure/config-manager.ts +41 -37
- package/core/infrastructure/path-manager.ts +59 -9
- package/core/infrastructure/permission-manager.ts +286 -0
- package/core/outcomes/analyzer.ts +7 -41
- package/core/outcomes/index.ts +1 -1
- package/core/outcomes/recorder.ts +1 -1
- package/core/{plugins → plugin/builtin}/webhook.ts +6 -22
- package/core/plugin/loader.ts +5 -5
- package/core/plugin/registry.ts +2 -2
- package/core/schemas/ideas.ts +85 -54
- package/core/schemas/index.ts +14 -33
- package/core/schemas/permissions.ts +177 -0
- package/core/schemas/project.ts +39 -12
- package/core/schemas/roadmap.ts +94 -59
- package/core/schemas/schemas.ts +39 -0
- package/core/schemas/shipped.ts +87 -60
- package/core/schemas/state.ts +110 -70
- package/core/server/index.ts +21 -0
- package/core/server/routes.ts +165 -0
- package/core/server/server.ts +136 -0
- package/core/server/sse.ts +135 -0
- package/core/services/agent-service.ts +170 -0
- package/core/services/breakdown-service.ts +126 -0
- package/core/services/index.ts +21 -0
- package/core/services/memory-service.ts +108 -0
- package/core/services/project-service.ts +146 -0
- package/core/services/skill-service.ts +253 -0
- package/core/session/compaction.ts +257 -0
- package/core/session/index.ts +20 -8
- package/core/{infrastructure/session-manager/migration.ts → session/log-migration.ts} +9 -9
- package/core/{infrastructure/session-manager/session-manager.ts → session/session-log-manager.ts} +27 -26
- package/core/session/{session-manager.ts → task-session-manager.ts} +7 -4
- package/core/session/utils.ts +1 -1
- package/core/storage/ideas-storage.ts +10 -26
- package/core/storage/index.ts +14 -162
- package/core/storage/queue-storage.ts +13 -11
- package/core/storage/shipped-storage.ts +4 -17
- package/core/storage/state-storage.ts +35 -43
- package/core/storage/storage-manager.ts +42 -52
- package/core/storage/storage.ts +160 -0
- package/core/sync/auth-config.ts +1 -8
- package/core/sync/index.ts +17 -10
- package/core/sync/oauth-handler.ts +1 -6
- package/core/sync/sync-client.ts +6 -34
- package/core/sync/sync-manager.ts +11 -40
- package/core/types/agentic.ts +577 -0
- package/core/types/agents.ts +145 -0
- package/core/types/bus.ts +82 -0
- package/core/types/commands.ts +366 -0
- package/core/types/config.ts +66 -0
- package/core/types/core.ts +96 -0
- package/core/types/domain.ts +71 -0
- package/core/types/events.ts +42 -0
- package/core/types/fs.ts +56 -0
- package/core/types/index.ts +387 -500
- package/core/types/infrastructure.ts +196 -0
- package/core/{agentic/memory-system/types.ts → types/memory.ts} +33 -8
- package/core/{outcomes/types.ts → types/outcomes.ts} +53 -8
- package/core/types/plugin.ts +25 -0
- package/core/types/server.ts +54 -0
- package/core/types/services.ts +65 -0
- package/core/types/session.ts +135 -0
- package/core/types/storage.ts +148 -0
- package/core/types/sync.ts +121 -0
- package/core/types/task.ts +72 -0
- package/core/types/template.ts +24 -0
- package/core/types/utils.ts +90 -0
- package/core/utils/cache.ts +195 -0
- package/core/utils/collection-filters.ts +245 -0
- package/core/utils/date-helper.ts +1 -5
- package/core/utils/file-helper.ts +20 -10
- package/core/utils/jsonl-helper.ts +5 -8
- package/core/utils/markdown-builder.ts +277 -0
- package/core/utils/project-commands.ts +132 -0
- package/core/utils/runtime.ts +119 -0
- package/dist/bin/prjct.mjs +12568 -0
- package/package.json +13 -8
- package/scripts/build.js +106 -0
- package/scripts/postinstall.js +50 -8
- package/templates/agentic/agents/uxui.md +210 -0
- package/templates/agentic/subagent-generation.md +1 -1
- package/templates/commands/bug.md +219 -41
- package/templates/commands/feature.md +368 -80
- package/templates/commands/serve.md +118 -0
- package/templates/commands/ship.md +152 -14
- package/templates/commands/skill.md +110 -0
- package/templates/commands/sync.md +63 -4
- package/templates/commands/test.md +40 -188
- package/templates/mcp-config.json +0 -36
- package/templates/permissions/default.jsonc +60 -0
- package/templates/permissions/permissive.jsonc +49 -0
- package/templates/permissions/strict.jsonc +62 -0
- package/templates/skills/code-review.md +47 -0
- package/templates/skills/debug.md +61 -0
- package/templates/skills/refactor.md +47 -0
- package/templates/subagents/domain/devops.md +1 -1
- package/templates/subagents/domain/testing.md +6 -10
- package/templates/subagents/workflow/prjct-shipper.md +16 -7
- package/templates/tools/bash.txt +22 -0
- package/templates/tools/edit.txt +18 -0
- package/templates/tools/glob.txt +19 -0
- package/templates/tools/grep.txt +21 -0
- package/templates/tools/read.txt +14 -0
- package/templates/tools/task.txt +20 -0
- package/templates/tools/webfetch.txt +16 -0
- package/templates/tools/websearch.txt +18 -0
- package/templates/tools/write.txt +17 -0
- package/core/agentic/command-executor/command-executor.ts +0 -312
- package/core/agentic/command-executor/index.ts +0 -16
- package/core/agentic/command-executor/status-signal.ts +0 -38
- package/core/agentic/command-executor/types.ts +0 -79
- package/core/agentic/ground-truth/index.ts +0 -76
- package/core/agentic/ground-truth/types.ts +0 -33
- package/core/agentic/ground-truth/utils.ts +0 -48
- package/core/agentic/ground-truth/verifiers/analyze.ts +0 -54
- package/core/agentic/ground-truth/verifiers/done.ts +0 -75
- package/core/agentic/ground-truth/verifiers/feature.ts +0 -70
- package/core/agentic/ground-truth/verifiers/index.ts +0 -37
- package/core/agentic/ground-truth/verifiers/init.ts +0 -52
- package/core/agentic/ground-truth/verifiers/now.ts +0 -57
- package/core/agentic/ground-truth/verifiers/ship.ts +0 -85
- package/core/agentic/ground-truth/verifiers/spec.ts +0 -45
- package/core/agentic/ground-truth/verifiers/sync.ts +0 -47
- package/core/agentic/ground-truth/verifiers.ts +0 -6
- package/core/agentic/loop-detector/error-analysis.ts +0 -97
- package/core/agentic/loop-detector/hallucination.ts +0 -71
- package/core/agentic/loop-detector/index.ts +0 -41
- package/core/agentic/loop-detector/loop-detector.ts +0 -222
- package/core/agentic/loop-detector/types.ts +0 -66
- package/core/agentic/memory-system/history.ts +0 -53
- package/core/agentic/memory-system/index.ts +0 -192
- package/core/agentic/memory-system/patterns.ts +0 -156
- package/core/agentic/memory-system/semantic-memories.ts +0 -278
- package/core/agentic/memory-system/session.ts +0 -21
- package/core/agentic/plan-mode/approval.ts +0 -57
- package/core/agentic/plan-mode/constants.ts +0 -44
- package/core/agentic/plan-mode/index.ts +0 -28
- package/core/agentic/plan-mode/plan-mode.ts +0 -407
- package/core/agentic/plan-mode/types.ts +0 -193
- package/core/agents/types.ts +0 -126
- package/core/command-registry/categories.ts +0 -23
- package/core/command-registry/commands.ts +0 -15
- package/core/command-registry/core-commands.ts +0 -344
- package/core/command-registry/index.ts +0 -158
- package/core/command-registry/optional-commands.ts +0 -163
- package/core/command-registry/setup-commands.ts +0 -83
- package/core/command-registry/types.ts +0 -59
- package/core/command-registry.ts +0 -9
- package/core/commands/types.ts +0 -185
- package/core/commands.ts +0 -11
- package/core/constants/formats.ts +0 -187
- package/core/context-sync.ts +0 -18
- package/core/data/index.ts +0 -27
- package/core/data/md-base-manager.ts +0 -203
- package/core/data/md-ideas-manager.ts +0 -155
- package/core/data/md-queue-manager.ts +0 -180
- package/core/data/md-shipped-manager.ts +0 -90
- package/core/data/md-state-manager.ts +0 -137
- package/core/domain/task-stack/index.ts +0 -19
- package/core/domain/task-stack/parser.ts +0 -86
- package/core/domain/task-stack/storage.ts +0 -123
- package/core/domain/task-stack/task-stack.ts +0 -340
- package/core/domain/task-stack/types.ts +0 -51
- package/core/infrastructure/command-installer/command-installer.ts +0 -327
- package/core/infrastructure/command-installer/global-config.ts +0 -136
- package/core/infrastructure/command-installer/index.ts +0 -25
- package/core/infrastructure/command-installer/types.ts +0 -41
- package/core/infrastructure/session-manager/index.ts +0 -23
- package/core/infrastructure/session-manager/types.ts +0 -45
- package/core/infrastructure/session-manager.ts +0 -8
- package/core/serializers/ideas-serializer.ts +0 -187
- package/core/serializers/index.ts +0 -36
- package/core/serializers/queue-serializer.ts +0 -210
- package/core/serializers/shipped-serializer.ts +0 -108
- package/core/serializers/state-serializer.ts +0 -136
- package/core/session/types.ts +0 -29
- /package/core/infrastructure/{agents/claude-agent.ts → claude-agent.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
allowed-tools: [Bash, Read, Write, Edit]
|
|
3
|
-
description: 'Run tests with auto-fix
|
|
3
|
+
description: 'Run tests with auto-fix'
|
|
4
4
|
timestamp-rule: 'GetTimestamp() for ALL timestamps'
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -9,10 +9,8 @@ timestamp-rule: 'GetTimestamp() for ALL timestamps'
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
11
11
|
```
|
|
12
|
-
/p:test [all|unit|e2e|failed|fix
|
|
12
|
+
/p:test [all|unit|e2e|failed|fix]
|
|
13
13
|
[--blocking] # Exit with error if tests fail
|
|
14
|
-
[--testsprite] # Force TestSprite even if native runner exists
|
|
15
|
-
[--scope=codebase|diff] # TestSprite: test all or only changed files
|
|
16
14
|
```
|
|
17
15
|
|
|
18
16
|
## Context Variables
|
|
@@ -35,118 +33,59 @@ IF file not found:
|
|
|
35
33
|
SET defaults:
|
|
36
34
|
- {testMode} = "all"
|
|
37
35
|
- {blocking} = false
|
|
38
|
-
- {useTestSprite} = false
|
|
39
|
-
- {testScope} = "diff"
|
|
40
36
|
|
|
41
37
|
PARSE args:
|
|
42
|
-
- IF arg is "ai": {useTestSprite} = true
|
|
43
38
|
- IF arg is "all|unit|e2e|failed|fix": {testMode} = arg
|
|
44
39
|
- IF arg contains "--blocking": {blocking} = true
|
|
45
|
-
- IF arg contains "--testsprite": {useTestSprite} = true
|
|
46
|
-
- IF arg contains "--scope=codebase": {testScope} = "codebase"
|
|
47
40
|
|
|
48
|
-
## Step 3:
|
|
49
|
-
|
|
50
|
-
IF {useTestSprite}:
|
|
51
|
-
READ: `{configPath}`
|
|
52
|
-
|
|
53
|
-
### Check if user dismissed TestSprite
|
|
54
|
-
IF config.testspriteSkip == "never":
|
|
55
|
-
OUTPUT: "ℹ️ TestSprite disabled. Using native tests."
|
|
56
|
-
{useTestSprite} = false
|
|
57
|
-
→ Go to Step 4
|
|
58
|
-
|
|
59
|
-
IF config.testspriteSkip == "later" AND config.testspriteSkipUntil > now:
|
|
60
|
-
OUTPUT: "ℹ️ TestSprite reminder snoozed. Using native tests."
|
|
61
|
-
{useTestSprite} = false
|
|
62
|
-
→ Go to Step 4
|
|
63
|
-
|
|
64
|
-
### Check for existing API key
|
|
65
|
-
IF config.testspriteApiKey exists AND is not empty:
|
|
66
|
-
SET: {apiKey} = config.testspriteApiKey
|
|
67
|
-
→ Continue to Step 4
|
|
68
|
-
|
|
69
|
-
### No API key - show options (NON-BLOCKING)
|
|
70
|
-
OUTPUT: "🤖 TestSprite AI Testing (Optional)"
|
|
71
|
-
OUTPUT: ""
|
|
72
|
-
OUTPUT: "TestSprite can generate and run AI-powered tests."
|
|
73
|
-
OUTPUT: "Free API key at: https://testsprite.com/dashboard/api-keys"
|
|
74
|
-
OUTPUT: ""
|
|
75
|
-
|
|
76
|
-
ASK with options:
|
|
77
|
-
1. "Enter API key" → Prompt for key
|
|
78
|
-
2. "Skip for now" → Use native tests this time
|
|
79
|
-
3. "Remind me in a week" → Snooze reminder
|
|
80
|
-
4. "Never ask again" → Disable permanently
|
|
81
|
-
|
|
82
|
-
HANDLE response:
|
|
83
|
-
|
|
84
|
-
IF option 1 (Enter API key):
|
|
85
|
-
ASK: "Paste your TestSprite API key:"
|
|
86
|
-
SET: {apiKey} = user input
|
|
87
|
-
|
|
88
|
-
UPDATE config.json:
|
|
89
|
-
- testspriteApiKey: {apiKey}
|
|
90
|
-
|
|
91
|
-
OUTPUT: "✅ API key saved"
|
|
92
|
-
→ Continue to Step 4
|
|
93
|
-
|
|
94
|
-
IF option 2 (Skip for now):
|
|
95
|
-
OUTPUT: "⏭️ Skipping TestSprite. Using native tests."
|
|
96
|
-
{useTestSprite} = false
|
|
97
|
-
→ Go to Step 4
|
|
98
|
-
|
|
99
|
-
IF option 3 (Remind me in a week):
|
|
100
|
-
SET: {skipUntil} = now + 7 days
|
|
101
|
-
|
|
102
|
-
UPDATE config.json:
|
|
103
|
-
- testspriteSkip: "later"
|
|
104
|
-
- testspriteSkipUntil: {skipUntil}
|
|
105
|
-
|
|
106
|
-
OUTPUT: "⏰ Will ask again in a week. Using native tests."
|
|
107
|
-
{useTestSprite} = false
|
|
108
|
-
→ Go to Step 4
|
|
109
|
-
|
|
110
|
-
IF option 4 (Never ask again):
|
|
111
|
-
UPDATE config.json:
|
|
112
|
-
- testspriteSkip: "never"
|
|
113
|
-
|
|
114
|
-
OUTPUT: "🔕 Won't ask again. Use --testsprite flag to enable manually."
|
|
115
|
-
{useTestSprite} = false
|
|
116
|
-
→ Go to Step 4
|
|
117
|
-
|
|
118
|
-
## Step 4: Detect Testing Strategy
|
|
119
|
-
|
|
120
|
-
IF {useTestSprite}:
|
|
121
|
-
→ Go to Step 6 (TestSprite AI Testing)
|
|
41
|
+
## Step 3: Detect Testing Strategy
|
|
122
42
|
|
|
123
43
|
### Check for Native Test Runner
|
|
124
44
|
|
|
125
45
|
READ: `package.json`
|
|
126
46
|
IF has "scripts.test":
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
47
|
+
Detect package manager (package.json "packageManager" or lockfiles):
|
|
48
|
+
- pnpm-lock.yaml → pnpm
|
|
49
|
+
- yarn.lock → yarn
|
|
50
|
+
- bun.lock/bun.lockb → bun
|
|
51
|
+
- else → npm
|
|
52
|
+
|
|
53
|
+
{runner} = "{packageManager}"
|
|
54
|
+
{runnerCmd} = "{packageManager} test"
|
|
55
|
+
→ Go to Step 4 (Native Testing)
|
|
130
56
|
|
|
131
57
|
IF file exists: `pytest.ini` OR `pyproject.toml` with pytest:
|
|
132
58
|
{runner} = "pytest"
|
|
133
59
|
{runnerCmd} = "pytest"
|
|
134
|
-
→ Go to Step
|
|
60
|
+
→ Go to Step 4
|
|
135
61
|
|
|
136
62
|
IF file exists: `Cargo.toml`:
|
|
137
63
|
{runner} = "cargo"
|
|
138
64
|
{runnerCmd} = "cargo test"
|
|
139
|
-
→ Go to Step
|
|
65
|
+
→ Go to Step 4
|
|
66
|
+
|
|
67
|
+
IF file exists: `go.mod`:
|
|
68
|
+
{runner} = "go"
|
|
69
|
+
{runnerCmd} = "go test ./..."
|
|
70
|
+
→ Go to Step 4
|
|
71
|
+
|
|
72
|
+
IF file exists: `*.sln` OR `*.csproj`:
|
|
73
|
+
{runner} = "dotnet"
|
|
74
|
+
{runnerCmd} = "dotnet test"
|
|
75
|
+
→ Go to Step 4
|
|
140
76
|
|
|
141
77
|
IF no runner found:
|
|
142
78
|
OUTPUT: "No test runner detected."
|
|
143
79
|
OUTPUT: ""
|
|
144
80
|
OUTPUT: "Options:"
|
|
145
|
-
OUTPUT: "• /p:test ai - Generate tests with AI (TestSprite)"
|
|
146
81
|
OUTPUT: "• Add 'test' script to package.json"
|
|
82
|
+
OUTPUT: "• Add pytest.ini for Python projects"
|
|
83
|
+
OUTPUT: "• Add Cargo.toml for Rust projects"
|
|
84
|
+
OUTPUT: "• Add go.mod for Go projects"
|
|
85
|
+
OUTPUT: "• Add a .sln/.csproj for .NET projects"
|
|
147
86
|
STOP
|
|
148
87
|
|
|
149
|
-
## Step
|
|
88
|
+
## Step 4: Native Test Runner
|
|
150
89
|
|
|
151
90
|
OUTPUT: "🧪 Running tests with {runner}..."
|
|
152
91
|
|
|
@@ -170,69 +109,17 @@ ELSE:
|
|
|
170
109
|
IF {testMode} == "fix" AND {testStatus} == "failed":
|
|
171
110
|
OUTPUT: "🔧 Attempting auto-fix..."
|
|
172
111
|
|
|
173
|
-
IF {runner} == "npm":
|
|
174
|
-
|
|
112
|
+
IF {runner} == "npm" OR {runner} == "pnpm" OR {runner} == "yarn" OR {runner} == "bun":
|
|
113
|
+
# Reason: only JS test runners commonly support snapshot update flags.
|
|
114
|
+
BASH: `{runnerCmd} -- -u 2>&1` # Update snapshots (best effort)
|
|
175
115
|
|
|
176
116
|
OUTPUT: "Snapshots updated. Re-running tests..."
|
|
177
117
|
BASH: `{runnerCmd} 2>&1`
|
|
178
118
|
CAPTURE and re-parse results
|
|
179
119
|
|
|
180
|
-
→ Go to Step
|
|
181
|
-
|
|
182
|
-
## Step 6: TestSprite AI Testing
|
|
183
|
-
|
|
184
|
-
OUTPUT: "🤖 Running AI-powered tests with TestSprite..."
|
|
185
|
-
|
|
186
|
-
### 6.1 Bootstrap Tests
|
|
187
|
-
|
|
188
|
-
CALL MCP TOOL: `testsprite_bootstrap_tests`
|
|
189
|
-
PARAMETERS:
|
|
190
|
-
- projectPath: current working directory (absolute path)
|
|
191
|
-
- type: auto-detect based on project (frontend/backend)
|
|
192
|
-
- testScope: {testScope}
|
|
193
|
-
|
|
194
|
-
CAPTURE: bootstrap result
|
|
195
|
-
|
|
196
|
-
### 6.2 Generate and Execute Tests
|
|
197
|
-
|
|
198
|
-
CALL MCP TOOL: `testsprite_generate_code_and_execute`
|
|
199
|
-
PARAMETERS:
|
|
200
|
-
- projectName: from package.json "name" or directory name
|
|
201
|
-
- projectPath: current working directory (absolute path)
|
|
202
|
-
- testIds: [] (run all)
|
|
120
|
+
→ Go to Step 5 (Results)
|
|
203
121
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
### 6.3 Parse TestSprite Results
|
|
207
|
-
|
|
208
|
-
READ: `testsprite_tests/test_results.json`
|
|
209
|
-
|
|
210
|
-
EXTRACT:
|
|
211
|
-
- {passed}: count of passed tests
|
|
212
|
-
- {failed}: count of failed tests
|
|
213
|
-
- {coverage}: coverage percentage if available
|
|
214
|
-
|
|
215
|
-
IF {failed} == 0:
|
|
216
|
-
{testStatus} = "passed"
|
|
217
|
-
ELSE:
|
|
218
|
-
{testStatus} = "failed"
|
|
219
|
-
|
|
220
|
-
### Handle Fix Mode with TestSprite
|
|
221
|
-
IF {testMode} == "fix" AND {testStatus} == "failed":
|
|
222
|
-
OUTPUT: "🔧 Running auto-healing..."
|
|
223
|
-
|
|
224
|
-
CALL MCP TOOL: `testsprite_rerun_tests`
|
|
225
|
-
PARAMETERS:
|
|
226
|
-
- projectPath: current working directory
|
|
227
|
-
|
|
228
|
-
READ: `testsprite_tests/test_results.json` (updated)
|
|
229
|
-
Re-parse results
|
|
230
|
-
|
|
231
|
-
→ Go to Step 8 (Results)
|
|
232
|
-
|
|
233
|
-
## Step 7: (Reserved for future expansion)
|
|
234
|
-
|
|
235
|
-
## Step 8: Results & Response
|
|
122
|
+
## Step 5: Results & Response
|
|
236
123
|
|
|
237
124
|
### Log to Memory
|
|
238
125
|
|
|
@@ -240,7 +127,7 @@ SET: {now} = GetTimestamp()
|
|
|
240
127
|
|
|
241
128
|
APPEND to `{memoryPath}`:
|
|
242
129
|
```json
|
|
243
|
-
{"ts":"{now}","type":"test_run","tool":"{runner
|
|
130
|
+
{"ts":"{now}","type":"test_run","tool":"{runner}","passed":{passed},"failed":{failed},"mode":"{testMode}"}
|
|
244
131
|
```
|
|
245
132
|
|
|
246
133
|
### Check Blocking Mode
|
|
@@ -268,10 +155,7 @@ IF {testStatus} == "passed":
|
|
|
268
155
|
IF {testStatus} == "failed":
|
|
269
156
|
OUTPUT: "❌ {failed} tests failing"
|
|
270
157
|
OUTPUT: ""
|
|
271
|
-
|
|
272
|
-
OUTPUT: "📋 Report: testsprite_tests/TestSprite_MCP_Test_Report.html"
|
|
273
|
-
ELSE:
|
|
274
|
-
OUTPUT: "{testOutput}" # Show relevant failure output
|
|
158
|
+
OUTPUT: "{testOutput}" # Show relevant failure output
|
|
275
159
|
OUTPUT: ""
|
|
276
160
|
OUTPUT: "💡 Auto-fix: /p:test fix"
|
|
277
161
|
OUTPUT: ""
|
|
@@ -282,11 +166,8 @@ IF {testStatus} == "failed":
|
|
|
282
166
|
| Error | Response | Action |
|
|
283
167
|
|-------|----------|--------|
|
|
284
168
|
| No project | "No prjct project" | STOP |
|
|
285
|
-
| No test runner | "No test runner detected" |
|
|
286
|
-
| TestSprite API key missing | Show options | Fallback to native (non-blocking) |
|
|
287
|
-
| TestSprite dismissed | Skip silently | Use native tests |
|
|
169
|
+
| No test runner | "No test runner detected" | Show setup options |
|
|
288
170
|
| Tests timeout | "Tests timed out" | Suggest increasing timeout |
|
|
289
|
-
| MCP tool not available | "TestSprite not configured" | Fallback to native tests |
|
|
290
171
|
|
|
291
172
|
## Examples
|
|
292
173
|
|
|
@@ -303,13 +184,13 @@ IF {testStatus} == "failed":
|
|
|
303
184
|
🎯 Next: /p:ship
|
|
304
185
|
```
|
|
305
186
|
|
|
306
|
-
### Example 2:
|
|
187
|
+
### Example 2: Tests with Failures
|
|
307
188
|
```
|
|
308
|
-
|
|
189
|
+
🧪 Running tests with npm...
|
|
309
190
|
|
|
310
191
|
❌ 3 tests failing
|
|
311
192
|
|
|
312
|
-
|
|
193
|
+
[test output here]
|
|
313
194
|
|
|
314
195
|
💡 Auto-fix: /p:test fix
|
|
315
196
|
|
|
@@ -324,32 +205,3 @@ IF {testStatus} == "failed":
|
|
|
324
205
|
|
|
325
206
|
Fix failing tests or run without --blocking flag.
|
|
326
207
|
```
|
|
327
|
-
|
|
328
|
-
### Example 4: First Time TestSprite (No API Key)
|
|
329
|
-
```
|
|
330
|
-
🤖 TestSprite AI Testing (Optional)
|
|
331
|
-
|
|
332
|
-
TestSprite can generate and run AI-powered tests.
|
|
333
|
-
Free API key at: https://testsprite.com/dashboard/api-keys
|
|
334
|
-
|
|
335
|
-
Options:
|
|
336
|
-
1. Enter API key
|
|
337
|
-
2. Skip for now
|
|
338
|
-
3. Remind me in a week
|
|
339
|
-
4. Never ask again
|
|
340
|
-
|
|
341
|
-
> 2
|
|
342
|
-
|
|
343
|
-
⏭️ Skipping TestSprite. Using native tests.
|
|
344
|
-
|
|
345
|
-
🧪 Running tests with npm...
|
|
346
|
-
...
|
|
347
|
-
```
|
|
348
|
-
|
|
349
|
-
### Example 5: TestSprite Snoozed
|
|
350
|
-
```
|
|
351
|
-
ℹ️ TestSprite reminder snoozed. Using native tests.
|
|
352
|
-
|
|
353
|
-
🧪 Running tests with npm...
|
|
354
|
-
...
|
|
355
|
-
```
|
|
@@ -4,14 +4,6 @@
|
|
|
4
4
|
"command": "npx",
|
|
5
5
|
"args": ["-y", "@upstash/context7-mcp@latest"],
|
|
6
6
|
"description": "Library documentation lookup - use for framework/library docs"
|
|
7
|
-
},
|
|
8
|
-
"testsprite": {
|
|
9
|
-
"command": "npx",
|
|
10
|
-
"args": ["-y", "@testsprite/testsprite-mcp@latest"],
|
|
11
|
-
"env": {
|
|
12
|
-
"API_KEY": "${TESTSPRITE_API_KEY}"
|
|
13
|
-
},
|
|
14
|
-
"description": "AI-powered test generation and execution"
|
|
15
7
|
}
|
|
16
8
|
},
|
|
17
9
|
"usage": {
|
|
@@ -30,34 +22,6 @@
|
|
|
30
22
|
"resolve-library-id('nextjs') → get-library-docs('/vercel/next.js', 'app router')",
|
|
31
23
|
"resolve-library-id('tailwindcss') → get-library-docs('/tailwindlabs/tailwindcss', 'configuration')"
|
|
32
24
|
]
|
|
33
|
-
},
|
|
34
|
-
"testsprite": {
|
|
35
|
-
"when": [
|
|
36
|
-
"User runs /p:test ai or /p:test --testsprite",
|
|
37
|
-
"Project needs AI-generated tests for frontend or backend",
|
|
38
|
-
"Auto-fixing flaky or broken tests",
|
|
39
|
-
"Generating comprehensive test coverage"
|
|
40
|
-
],
|
|
41
|
-
"tools": [
|
|
42
|
-
"testsprite_bootstrap_tests: Initialize testing environment",
|
|
43
|
-
"testsprite_generate_code_summary: Analyze project architecture",
|
|
44
|
-
"testsprite_generate_standardized_prd: Generate structured requirements",
|
|
45
|
-
"testsprite_generate_frontend_test_plan: Create frontend test plan",
|
|
46
|
-
"testsprite_generate_backend_test_plan: Create backend test plan",
|
|
47
|
-
"testsprite_generate_code_and_execute: Generate and run tests",
|
|
48
|
-
"testsprite_rerun_tests: Re-run tests with auto-healing"
|
|
49
|
-
],
|
|
50
|
-
"examples": [
|
|
51
|
-
"testsprite_bootstrap_tests(projectPath, 'frontend', 'diff')",
|
|
52
|
-
"testsprite_generate_code_and_execute(projectName, projectPath)"
|
|
53
|
-
],
|
|
54
|
-
"apiKeySetup": "Get free API key at https://testsprite.com/dashboard/api-keys",
|
|
55
|
-
"configFields": {
|
|
56
|
-
"testspriteApiKey": "API key (optional)",
|
|
57
|
-
"testspriteSkip": "'never' | 'later' | null",
|
|
58
|
-
"testspriteSkipUntil": "ISO timestamp for snooze"
|
|
59
|
-
},
|
|
60
|
-
"nonBlocking": true
|
|
61
25
|
}
|
|
62
26
|
}
|
|
63
27
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Default permissions preset for prjct-cli
|
|
3
|
+
// Safe defaults with protection against destructive operations
|
|
4
|
+
|
|
5
|
+
"bash": {
|
|
6
|
+
// Safe read-only commands - always allowed
|
|
7
|
+
"git status*": "allow",
|
|
8
|
+
"git log*": "allow",
|
|
9
|
+
"git diff*": "allow",
|
|
10
|
+
"git branch*": "allow",
|
|
11
|
+
"ls*": "allow",
|
|
12
|
+
"pwd": "allow",
|
|
13
|
+
"cat*": "allow",
|
|
14
|
+
"head*": "allow",
|
|
15
|
+
"tail*": "allow",
|
|
16
|
+
"grep*": "allow",
|
|
17
|
+
"find*": "allow",
|
|
18
|
+
"which*": "allow",
|
|
19
|
+
"node -e*": "allow",
|
|
20
|
+
"bun -e*": "allow",
|
|
21
|
+
"npm list*": "allow",
|
|
22
|
+
"npx tsc --noEmit*": "allow",
|
|
23
|
+
|
|
24
|
+
// Potentially destructive - ask first
|
|
25
|
+
"rm -rf*": "ask",
|
|
26
|
+
"rm -r*": "ask",
|
|
27
|
+
"git push*": "ask",
|
|
28
|
+
"git reset --hard*": "ask",
|
|
29
|
+
"npm publish*": "ask",
|
|
30
|
+
"chmod*": "ask",
|
|
31
|
+
|
|
32
|
+
// Always denied - too dangerous
|
|
33
|
+
"rm -rf /*": "deny",
|
|
34
|
+
"rm -rf ~/*": "deny",
|
|
35
|
+
"sudo*": "deny"
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
"files": {
|
|
39
|
+
"read": {
|
|
40
|
+
"**/*": "allow"
|
|
41
|
+
},
|
|
42
|
+
"write": {
|
|
43
|
+
"**/*": "allow"
|
|
44
|
+
},
|
|
45
|
+
"delete": {
|
|
46
|
+
"**/*": "ask"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
"web": {
|
|
51
|
+
"enabled": true
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
"doomLoop": {
|
|
55
|
+
"enabled": true,
|
|
56
|
+
"maxRetries": 3
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
"externalDirectories": "ask"
|
|
60
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Permissive preset for prjct-cli
|
|
3
|
+
// For trusted environments - minimal restrictions
|
|
4
|
+
|
|
5
|
+
"bash": {
|
|
6
|
+
// Most commands allowed
|
|
7
|
+
"git*": "allow",
|
|
8
|
+
"npm*": "allow",
|
|
9
|
+
"bun*": "allow",
|
|
10
|
+
"node*": "allow",
|
|
11
|
+
"ls*": "allow",
|
|
12
|
+
"cat*": "allow",
|
|
13
|
+
"mkdir*": "allow",
|
|
14
|
+
"cp*": "allow",
|
|
15
|
+
"mv*": "allow",
|
|
16
|
+
"rm*": "allow",
|
|
17
|
+
"chmod*": "allow",
|
|
18
|
+
|
|
19
|
+
// Still protect against catastrophic mistakes
|
|
20
|
+
"rm -rf /*": "deny",
|
|
21
|
+
"rm -rf ~/*": "deny",
|
|
22
|
+
"sudo rm -rf*": "deny",
|
|
23
|
+
":(){ :|:& };:*": "deny"
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
"files": {
|
|
27
|
+
"read": {
|
|
28
|
+
"**/*": "allow"
|
|
29
|
+
},
|
|
30
|
+
"write": {
|
|
31
|
+
"**/*": "allow"
|
|
32
|
+
},
|
|
33
|
+
"delete": {
|
|
34
|
+
"**/*": "allow",
|
|
35
|
+
"**/node_modules/**": "deny" // Protect dependencies
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
"web": {
|
|
40
|
+
"enabled": true
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
"doomLoop": {
|
|
44
|
+
"enabled": true,
|
|
45
|
+
"maxRetries": 5
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
"externalDirectories": "allow"
|
|
49
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Strict permissions preset for prjct-cli
|
|
3
|
+
// Maximum safety - requires approval for most operations
|
|
4
|
+
|
|
5
|
+
"bash": {
|
|
6
|
+
// Only read-only commands allowed
|
|
7
|
+
"git status": "allow",
|
|
8
|
+
"git log*": "allow",
|
|
9
|
+
"git diff*": "allow",
|
|
10
|
+
"ls*": "allow",
|
|
11
|
+
"pwd": "allow",
|
|
12
|
+
"cat*": "allow",
|
|
13
|
+
"head*": "allow",
|
|
14
|
+
"tail*": "allow",
|
|
15
|
+
"which*": "allow",
|
|
16
|
+
|
|
17
|
+
// Everything else requires approval
|
|
18
|
+
"git*": "ask",
|
|
19
|
+
"npm*": "ask",
|
|
20
|
+
"bun*": "ask",
|
|
21
|
+
"node*": "ask",
|
|
22
|
+
"rm*": "ask",
|
|
23
|
+
"mv*": "ask",
|
|
24
|
+
"cp*": "ask",
|
|
25
|
+
"mkdir*": "ask",
|
|
26
|
+
|
|
27
|
+
// Always denied
|
|
28
|
+
"rm -rf*": "deny",
|
|
29
|
+
"sudo*": "deny",
|
|
30
|
+
"chmod 777*": "deny"
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
"files": {
|
|
34
|
+
"read": {
|
|
35
|
+
"**/*": "allow",
|
|
36
|
+
"**/.*": "ask", // Hidden files need approval
|
|
37
|
+
"**/.env*": "deny" // Never read env files
|
|
38
|
+
},
|
|
39
|
+
"write": {
|
|
40
|
+
"**/*": "ask" // All writes need approval
|
|
41
|
+
},
|
|
42
|
+
"delete": {
|
|
43
|
+
"**/*": "deny" // No deletions without explicit override
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
"web": {
|
|
48
|
+
"enabled": true,
|
|
49
|
+
"blockedDomains": [
|
|
50
|
+
"localhost",
|
|
51
|
+
"127.0.0.1",
|
|
52
|
+
"internal"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
"doomLoop": {
|
|
57
|
+
"enabled": true,
|
|
58
|
+
"maxRetries": 2
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
"externalDirectories": "deny"
|
|
62
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Code Review
|
|
3
|
+
description: Review code changes for quality, security, and best practices
|
|
4
|
+
agent: general
|
|
5
|
+
tags: [review, quality, security]
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Code Review Skill
|
|
10
|
+
|
|
11
|
+
Review the provided code changes with focus on:
|
|
12
|
+
|
|
13
|
+
## Quality Checks
|
|
14
|
+
- Code readability and clarity
|
|
15
|
+
- Naming conventions
|
|
16
|
+
- Function/method length
|
|
17
|
+
- Code duplication
|
|
18
|
+
- Error handling
|
|
19
|
+
|
|
20
|
+
## Security Checks
|
|
21
|
+
- Input validation
|
|
22
|
+
- SQL injection risks
|
|
23
|
+
- XSS vulnerabilities
|
|
24
|
+
- Sensitive data exposure
|
|
25
|
+
- Authentication/authorization issues
|
|
26
|
+
|
|
27
|
+
## Best Practices
|
|
28
|
+
- SOLID principles
|
|
29
|
+
- DRY (Don't Repeat Yourself)
|
|
30
|
+
- Single responsibility
|
|
31
|
+
- Proper typing (TypeScript)
|
|
32
|
+
- Documentation where needed
|
|
33
|
+
|
|
34
|
+
## Output Format
|
|
35
|
+
|
|
36
|
+
Provide feedback in this structure:
|
|
37
|
+
|
|
38
|
+
### Summary
|
|
39
|
+
Brief overview of the changes
|
|
40
|
+
|
|
41
|
+
### Issues Found
|
|
42
|
+
- 🔴 **Critical**: Must fix before merge
|
|
43
|
+
- 🟡 **Warning**: Should fix, but not blocking
|
|
44
|
+
- 🔵 **Suggestion**: Nice to have improvements
|
|
45
|
+
|
|
46
|
+
### Recommendations
|
|
47
|
+
Specific actionable items to improve the code
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Debug
|
|
3
|
+
description: Systematic debugging to find and fix issues
|
|
4
|
+
agent: general
|
|
5
|
+
tags: [debug, fix, troubleshoot]
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Debug Skill
|
|
10
|
+
|
|
11
|
+
Systematically debug the reported issue.
|
|
12
|
+
|
|
13
|
+
## Process
|
|
14
|
+
|
|
15
|
+
### Step 1: Understand the Problem
|
|
16
|
+
- What is the expected behavior?
|
|
17
|
+
- What is the actual behavior?
|
|
18
|
+
- When did it start happening?
|
|
19
|
+
- Can it be reproduced consistently?
|
|
20
|
+
|
|
21
|
+
### Step 2: Gather Information
|
|
22
|
+
- Read relevant error messages
|
|
23
|
+
- Check logs
|
|
24
|
+
- Review recent changes
|
|
25
|
+
- Identify affected code paths
|
|
26
|
+
|
|
27
|
+
### Step 3: Form Hypothesis
|
|
28
|
+
- What could cause this behavior?
|
|
29
|
+
- List possible causes in order of likelihood
|
|
30
|
+
- Identify the most likely root cause
|
|
31
|
+
|
|
32
|
+
### Step 4: Test Hypothesis
|
|
33
|
+
- Add logging if needed
|
|
34
|
+
- Isolate the problematic code
|
|
35
|
+
- Verify the root cause
|
|
36
|
+
|
|
37
|
+
### Step 5: Fix
|
|
38
|
+
- Implement the minimal fix
|
|
39
|
+
- Ensure no side effects
|
|
40
|
+
- Add tests if applicable
|
|
41
|
+
|
|
42
|
+
### Step 6: Verify
|
|
43
|
+
- Confirm the issue is resolved
|
|
44
|
+
- Check for regressions
|
|
45
|
+
- Document the fix
|
|
46
|
+
|
|
47
|
+
## Output Format
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
## Issue
|
|
51
|
+
[Description of the problem]
|
|
52
|
+
|
|
53
|
+
## Root Cause
|
|
54
|
+
[What was causing the issue]
|
|
55
|
+
|
|
56
|
+
## Fix
|
|
57
|
+
[What was changed to fix it]
|
|
58
|
+
|
|
59
|
+
## Prevention
|
|
60
|
+
[How to prevent similar issues]
|
|
61
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Refactor
|
|
3
|
+
description: Refactor code for better structure, readability, and maintainability
|
|
4
|
+
agent: general
|
|
5
|
+
tags: [refactor, cleanup, improvement]
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Refactor Skill
|
|
10
|
+
|
|
11
|
+
Refactor the specified code with these goals:
|
|
12
|
+
|
|
13
|
+
## Objectives
|
|
14
|
+
1. **Improve Readability** - Clear naming, logical structure
|
|
15
|
+
2. **Reduce Complexity** - Simplify nested logic, extract functions
|
|
16
|
+
3. **Enhance Maintainability** - Make future changes easier
|
|
17
|
+
4. **Preserve Behavior** - No functional changes unless requested
|
|
18
|
+
|
|
19
|
+
## Approach
|
|
20
|
+
|
|
21
|
+
### Step 1: Analyze Current Code
|
|
22
|
+
- Identify pain points
|
|
23
|
+
- Note code smells
|
|
24
|
+
- Understand dependencies
|
|
25
|
+
|
|
26
|
+
### Step 2: Plan Changes
|
|
27
|
+
- List specific refactoring operations
|
|
28
|
+
- Prioritize by impact
|
|
29
|
+
- Consider breaking changes
|
|
30
|
+
|
|
31
|
+
### Step 3: Execute
|
|
32
|
+
- Make incremental changes
|
|
33
|
+
- Test after each change
|
|
34
|
+
- Document decisions
|
|
35
|
+
|
|
36
|
+
## Common Refactorings
|
|
37
|
+
- Extract function/method
|
|
38
|
+
- Rename for clarity
|
|
39
|
+
- Remove duplication
|
|
40
|
+
- Simplify conditionals
|
|
41
|
+
- Replace magic numbers with constants
|
|
42
|
+
- Add type annotations
|
|
43
|
+
|
|
44
|
+
## Output
|
|
45
|
+
- Modified code
|
|
46
|
+
- Brief explanation of changes
|
|
47
|
+
- Any trade-offs made
|