specweave 1.0.259 → 1.0.261
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/CLAUDE.md +40 -25
- package/bin/specweave.js +11 -0
- package/dist/dashboard/assets/index-CDl14O5G.css +1 -0
- package/dist/dashboard/assets/index-CmqBqnWd.js +11 -0
- package/dist/dashboard/index.html +14 -0
- package/dist/src/cli/commands/dashboard.d.ts +18 -0
- package/dist/src/cli/commands/dashboard.d.ts.map +1 -0
- package/dist/src/cli/commands/dashboard.js +142 -0
- package/dist/src/cli/commands/dashboard.js.map +1 -0
- package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts +9 -4
- package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts.map +1 -1
- package/dist/src/core/lazy-loading/llm-plugin-detector.js +9 -4
- package/dist/src/core/lazy-loading/llm-plugin-detector.js.map +1 -1
- package/dist/src/dashboard/server/command-runner.d.ts +21 -0
- package/dist/src/dashboard/server/command-runner.d.ts.map +1 -0
- package/dist/src/dashboard/server/command-runner.js +92 -0
- package/dist/src/dashboard/server/command-runner.js.map +1 -0
- package/dist/src/dashboard/server/dashboard-server.d.ts +33 -0
- package/dist/src/dashboard/server/dashboard-server.d.ts.map +1 -0
- package/dist/src/dashboard/server/dashboard-server.js +867 -0
- package/dist/src/dashboard/server/dashboard-server.js.map +1 -0
- package/dist/src/dashboard/server/data/activity-stream.d.ts +27 -0
- package/dist/src/dashboard/server/data/activity-stream.d.ts.map +1 -0
- package/dist/src/dashboard/server/data/activity-stream.js +142 -0
- package/dist/src/dashboard/server/data/activity-stream.js.map +1 -0
- package/dist/src/dashboard/server/data/claude-log-parser.d.ts +34 -0
- package/dist/src/dashboard/server/data/claude-log-parser.d.ts.map +1 -0
- package/dist/src/dashboard/server/data/claude-log-parser.js +218 -0
- package/dist/src/dashboard/server/data/claude-log-parser.js.map +1 -0
- package/dist/src/dashboard/server/data/cost-aggregator.d.ts +36 -0
- package/dist/src/dashboard/server/data/cost-aggregator.d.ts.map +1 -0
- package/dist/src/dashboard/server/data/cost-aggregator.js +156 -0
- package/dist/src/dashboard/server/data/cost-aggregator.js.map +1 -0
- package/dist/src/dashboard/server/data/dashboard-data-aggregator.d.ts +62 -0
- package/dist/src/dashboard/server/data/dashboard-data-aggregator.d.ts.map +1 -0
- package/dist/src/dashboard/server/data/dashboard-data-aggregator.js +361 -0
- package/dist/src/dashboard/server/data/dashboard-data-aggregator.js.map +1 -0
- package/dist/src/dashboard/server/data/plugin-scanner.d.ts +35 -0
- package/dist/src/dashboard/server/data/plugin-scanner.d.ts.map +1 -0
- package/dist/src/dashboard/server/data/plugin-scanner.js +96 -0
- package/dist/src/dashboard/server/data/plugin-scanner.js.map +1 -0
- package/dist/src/dashboard/server/data/sync-audit-reader.d.ts +38 -0
- package/dist/src/dashboard/server/data/sync-audit-reader.d.ts.map +1 -0
- package/dist/src/dashboard/server/data/sync-audit-reader.js +94 -0
- package/dist/src/dashboard/server/data/sync-audit-reader.js.map +1 -0
- package/dist/src/dashboard/server/file-watcher.d.ts +19 -0
- package/dist/src/dashboard/server/file-watcher.d.ts.map +1 -0
- package/dist/src/dashboard/server/file-watcher.js +104 -0
- package/dist/src/dashboard/server/file-watcher.js.map +1 -0
- package/dist/src/dashboard/server/router.d.ts +16 -0
- package/dist/src/dashboard/server/router.d.ts.map +1 -0
- package/dist/src/dashboard/server/router.js +110 -0
- package/dist/src/dashboard/server/router.js.map +1 -0
- package/dist/src/dashboard/server/sse-manager.d.ts +25 -0
- package/dist/src/dashboard/server/sse-manager.d.ts.map +1 -0
- package/dist/src/dashboard/server/sse-manager.js +75 -0
- package/dist/src/dashboard/server/sse-manager.js.map +1 -0
- package/dist/src/dashboard/types.d.ts +194 -0
- package/dist/src/dashboard/types.d.ts.map +1 -0
- package/dist/src/dashboard/types.js +2 -0
- package/dist/src/dashboard/types.js.map +1 -0
- package/package.json +12 -2
- package/plugins/specweave/hooks/user-prompt-submit.sh +79 -154
- package/plugins/specweave/skills/auto/SKILL.md +35 -0
- package/plugins/specweave/skills/do/SKILL.md +32 -2
- package/plugins/specweave/skills/increment/SKILL.md +1 -1
- package/plugins/specweave/skills/increment-planner/SKILL.md +26 -0
- package/plugins/specweave/skills/increment-work-router/SKILL.md +37 -9
- package/plugins/specweave/skills/plan/SKILL.md +37 -0
- package/plugins/specweave/skills/team-lead/SKILL.md +1 -1
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
export type SSEEventType = 'heartbeat' | 'increment-update' | 'analytics-event' | 'cost-update' | 'notification' | 'sync-update' | 'sync-audit' | 'error-detected' | 'config-changed' | 'activity' | 'command-output' | 'command-complete' | 'job-progress';
|
|
2
|
+
export interface SSEMessage {
|
|
3
|
+
type: SSEEventType;
|
|
4
|
+
data: unknown;
|
|
5
|
+
timestamp: string;
|
|
6
|
+
}
|
|
7
|
+
export interface OverviewPayload {
|
|
8
|
+
project: {
|
|
9
|
+
name?: string;
|
|
10
|
+
totalIncrements: number;
|
|
11
|
+
activeIncrements: number;
|
|
12
|
+
completedIncrements: number;
|
|
13
|
+
statusBreakdown: Record<string, number>;
|
|
14
|
+
typeBreakdown: Record<string, number>;
|
|
15
|
+
priorityBreakdown: Record<string, number>;
|
|
16
|
+
};
|
|
17
|
+
analytics: {
|
|
18
|
+
totalEvents: number;
|
|
19
|
+
successRate: number;
|
|
20
|
+
last24hEvents: number;
|
|
21
|
+
};
|
|
22
|
+
costs: {
|
|
23
|
+
totalCost: number;
|
|
24
|
+
totalSavings: number;
|
|
25
|
+
totalTokens: number;
|
|
26
|
+
sessionCount: number;
|
|
27
|
+
};
|
|
28
|
+
notifications: {
|
|
29
|
+
pendingCount: number;
|
|
30
|
+
criticalCount: number;
|
|
31
|
+
};
|
|
32
|
+
sync: {
|
|
33
|
+
platforms: Record<string, {
|
|
34
|
+
lastImport: string;
|
|
35
|
+
lastSyncResult: string;
|
|
36
|
+
}>;
|
|
37
|
+
};
|
|
38
|
+
generatedAt: string;
|
|
39
|
+
}
|
|
40
|
+
export interface IncrementSummary {
|
|
41
|
+
id: string;
|
|
42
|
+
title: string;
|
|
43
|
+
status: string;
|
|
44
|
+
type: string;
|
|
45
|
+
priority: string;
|
|
46
|
+
project?: string;
|
|
47
|
+
tasks: {
|
|
48
|
+
total: number;
|
|
49
|
+
completed: number;
|
|
50
|
+
};
|
|
51
|
+
acs: {
|
|
52
|
+
total: number;
|
|
53
|
+
completed: number;
|
|
54
|
+
};
|
|
55
|
+
createdAt: string;
|
|
56
|
+
lastActivity: string;
|
|
57
|
+
}
|
|
58
|
+
export interface IncrementListPayload {
|
|
59
|
+
increments: IncrementSummary[];
|
|
60
|
+
summary: Record<string, number>;
|
|
61
|
+
}
|
|
62
|
+
export interface IncrementDetailPayload {
|
|
63
|
+
id: string;
|
|
64
|
+
metadata: Record<string, unknown>;
|
|
65
|
+
tasks: Array<{
|
|
66
|
+
id: string;
|
|
67
|
+
title: string;
|
|
68
|
+
status: string;
|
|
69
|
+
userStory?: string;
|
|
70
|
+
satisfiesACs?: string[];
|
|
71
|
+
}>;
|
|
72
|
+
taskSummary: {
|
|
73
|
+
total: number;
|
|
74
|
+
completed: number;
|
|
75
|
+
pending: number;
|
|
76
|
+
inProgress: number;
|
|
77
|
+
};
|
|
78
|
+
costs?: {
|
|
79
|
+
totalCost: number;
|
|
80
|
+
totalTokens: number;
|
|
81
|
+
sessionCount: number;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export interface SyncStatusPayload {
|
|
85
|
+
platforms: Record<string, {
|
|
86
|
+
lastImport: string;
|
|
87
|
+
lastImportCount?: number;
|
|
88
|
+
lastSkippedCount?: number;
|
|
89
|
+
lastSyncResult?: string;
|
|
90
|
+
}>;
|
|
91
|
+
lastUpdated?: string;
|
|
92
|
+
}
|
|
93
|
+
export interface ActivityEvent {
|
|
94
|
+
timestamp: string;
|
|
95
|
+
category: 'command' | 'sync' | 'hook' | 'error' | 'cost' | 'notification';
|
|
96
|
+
severity: 'info' | 'warning' | 'error';
|
|
97
|
+
title: string;
|
|
98
|
+
detail?: string;
|
|
99
|
+
source: string;
|
|
100
|
+
metadata?: Record<string, unknown>;
|
|
101
|
+
}
|
|
102
|
+
export interface CommandExecution {
|
|
103
|
+
id: string;
|
|
104
|
+
command: string;
|
|
105
|
+
args: string[];
|
|
106
|
+
status: 'running' | 'completed' | 'failed';
|
|
107
|
+
startedAt: string;
|
|
108
|
+
output: string[];
|
|
109
|
+
exitCode?: number;
|
|
110
|
+
}
|
|
111
|
+
export interface SessionSummary {
|
|
112
|
+
sessionId: string;
|
|
113
|
+
startTime: string;
|
|
114
|
+
endTime?: string;
|
|
115
|
+
messageCount: number;
|
|
116
|
+
toolCallCount: number;
|
|
117
|
+
errors: SessionError[];
|
|
118
|
+
version: string;
|
|
119
|
+
gitBranch: string;
|
|
120
|
+
}
|
|
121
|
+
export interface SessionError {
|
|
122
|
+
timestamp: string;
|
|
123
|
+
sessionId: string;
|
|
124
|
+
type: 'prompt_too_long' | 'api_error' | 'tool_failure' | 'hook_error' | 'rate_limit' | 'unknown';
|
|
125
|
+
message: string;
|
|
126
|
+
context?: {
|
|
127
|
+
lastToolCall?: string;
|
|
128
|
+
messageIndex?: number;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
export interface PluginInfo {
|
|
132
|
+
name: string;
|
|
133
|
+
version: string;
|
|
134
|
+
skillCount: number;
|
|
135
|
+
commandCount: number;
|
|
136
|
+
}
|
|
137
|
+
export interface SkillUsage {
|
|
138
|
+
name: string;
|
|
139
|
+
plugin: string;
|
|
140
|
+
count: number;
|
|
141
|
+
successCount: number;
|
|
142
|
+
failureCount: number;
|
|
143
|
+
avgDuration?: number;
|
|
144
|
+
lastUsed: string;
|
|
145
|
+
}
|
|
146
|
+
export interface LspStatus {
|
|
147
|
+
checked: string;
|
|
148
|
+
status: string;
|
|
149
|
+
missing: Array<{
|
|
150
|
+
language: string;
|
|
151
|
+
type: string;
|
|
152
|
+
binaryInstall: string;
|
|
153
|
+
pluginInstall: string;
|
|
154
|
+
plugin: string;
|
|
155
|
+
message: string;
|
|
156
|
+
}>;
|
|
157
|
+
stats: {
|
|
158
|
+
totalLanguages: number;
|
|
159
|
+
checkedLanguages: number;
|
|
160
|
+
binaryMissing: number;
|
|
161
|
+
pluginMissing: number;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
export interface RepoInfo {
|
|
165
|
+
name: string;
|
|
166
|
+
org: string;
|
|
167
|
+
path: string;
|
|
168
|
+
remote?: string;
|
|
169
|
+
branch?: string;
|
|
170
|
+
hasSpecweave: boolean;
|
|
171
|
+
isCurrent?: boolean;
|
|
172
|
+
lastModified?: string;
|
|
173
|
+
}
|
|
174
|
+
export type { CostsSummaryPayload, SessionTokenSummary } from './server/data/cost-aggregator.js';
|
|
175
|
+
export type ConfigPayload = Record<string, unknown>;
|
|
176
|
+
export interface ProjectInfo {
|
|
177
|
+
id: string;
|
|
178
|
+
path: string;
|
|
179
|
+
name: string;
|
|
180
|
+
hasSpecweave: boolean;
|
|
181
|
+
}
|
|
182
|
+
export interface DashboardLockFile {
|
|
183
|
+
port: number;
|
|
184
|
+
pid: number;
|
|
185
|
+
startedAt: string;
|
|
186
|
+
projects: string[];
|
|
187
|
+
}
|
|
188
|
+
export interface ApiResponse<T> {
|
|
189
|
+
ok: boolean;
|
|
190
|
+
data?: T;
|
|
191
|
+
error?: string;
|
|
192
|
+
}
|
|
193
|
+
export type RouteHandler = (req: import('http').IncomingMessage, res: import('http').ServerResponse, params: Record<string, string>) => Promise<void>;
|
|
194
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/dashboard/types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,kBAAkB,GAClB,iBAAiB,GACjB,aAAa,GACb,cAAc,GACd,aAAa,GACb,YAAY,GACZ,gBAAgB,GAChB,gBAAgB,GAChB,UAAU,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Y,CAAC,EAAE,MAAM,CAAC;CACvB;AAGD,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAGjG,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAGpD,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,OAAO,CAAC;CACvB;AAGD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAGD,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAGD,MAAM,MAAM,YAAY,GAAG,CACzB,GAAG,EAAE,OAAO,MAAM,EAAE,eAAe,EACnC,GAAG,EAAE,OAAO,MAAM,EAAE,cAAc,EAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAC3B,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/dashboard/types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "specweave",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.261",
|
|
4
4
|
"description": "Spec-driven development framework for AI coding agents. First-class support for Claude Code — compatible with any LLM-powered coding tool. Living documentation, autonomous execution, quality gates, and multilingual support (9 languages).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"preinstall": "node scripts/check-node-version.js || exit 0",
|
|
12
12
|
"clean": "rm -rf dist/",
|
|
13
|
-
"build": "tsc && npm run copy:locales && npm run copy:plugins && npm run copy:hook-deps && npm run copy:adapters",
|
|
13
|
+
"build": "tsc && npm run build:dashboard && npm run copy:locales && npm run copy:plugins && npm run copy:hook-deps && npm run copy:adapters",
|
|
14
|
+
"build:dashboard": "npx vite build --config src/dashboard/client/vite.config.ts",
|
|
14
15
|
"copy:adapters": "node scripts/build/copy-adapters.js",
|
|
15
16
|
"rebuild": "npm run clean && npm run build",
|
|
16
17
|
"copy:locales": "node scripts/build/copy-locales.js",
|
|
@@ -109,16 +110,25 @@
|
|
|
109
110
|
},
|
|
110
111
|
"devDependencies": {
|
|
111
112
|
"@mermaid-js/mermaid-cli": "^11.12.0",
|
|
113
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
112
114
|
"@types/js-yaml": "^4.0.9",
|
|
113
115
|
"@types/node": "^25.0.3",
|
|
114
116
|
"@types/open": "^6.1.0",
|
|
117
|
+
"@types/react": "^19.2.14",
|
|
118
|
+
"@types/react-dom": "^19.2.3",
|
|
119
|
+
"@vitejs/plugin-react": "^5.1.4",
|
|
115
120
|
"@vitest/coverage-v8": "^4.0.17",
|
|
116
121
|
"@vitest/ui": "^4.0.17",
|
|
117
122
|
"ajv": "^8.17.1",
|
|
118
123
|
"ajv-formats": "^3.0.1",
|
|
119
124
|
"dotenv": "^17.2.3",
|
|
120
125
|
"memfs": "^4.51.0",
|
|
126
|
+
"react": "^19.2.4",
|
|
127
|
+
"react-dom": "^19.2.4",
|
|
128
|
+
"react-router-dom": "^7.13.0",
|
|
129
|
+
"tailwindcss": "^4.1.18",
|
|
121
130
|
"typescript": "^5.3.0",
|
|
131
|
+
"vite": "^7.3.1",
|
|
122
132
|
"vitest": "^4.0.17"
|
|
123
133
|
}
|
|
124
134
|
}
|
|
@@ -372,9 +372,8 @@ escape_json_early() {
|
|
|
372
372
|
}
|
|
373
373
|
|
|
374
374
|
# v1.0.254: Prompt safety limits to prevent "Prompt is too long" errors
|
|
375
|
-
#
|
|
375
|
+
# Must match MAX_ADDITIONAL_CONTEXT_LENGTH in src/core/lazy-loading/llm-plugin-detector.ts
|
|
376
376
|
MAX_ADDITIONAL_CONTEXT_LENGTH=3000
|
|
377
|
-
MAX_SKILL_FIRST_PROMPT_LENGTH=800
|
|
378
377
|
|
|
379
378
|
# Helper: Output approve response with context (Claude Code hook format v1.0.166)
|
|
380
379
|
# CRITICAL: systemMessage is NOT a valid field for UserPromptSubmit hooks!
|
|
@@ -386,7 +385,10 @@ MAX_SKILL_FIRST_PROMPT_LENGTH=800
|
|
|
386
385
|
output_approve_with_context() {
|
|
387
386
|
local context="$1"
|
|
388
387
|
# v1.0.254: Safety truncation to prevent prompt overflow
|
|
388
|
+
# v1.0.260: Added overflow logging for debugging context budget issues
|
|
389
389
|
if [[ ${#context} -gt $MAX_ADDITIONAL_CONTEXT_LENGTH ]]; then
|
|
390
|
+
local overflow_by=$(( ${#context} - MAX_ADDITIONAL_CONTEXT_LENGTH ))
|
|
391
|
+
echo "[$(date -Iseconds)] CONTEXT OVERFLOW | size=${#context} | max=$MAX_ADDITIONAL_CONTEXT_LENGTH | overflow_by=$overflow_by | truncating" >> "${LAZY_LOAD_LOG:-/dev/null}" 2>/dev/null
|
|
390
392
|
context="${context:0:$MAX_ADDITIONAL_CONTEXT_LENGTH}... [context truncated for safety]"
|
|
391
393
|
fi
|
|
392
394
|
local escaped
|
|
@@ -394,16 +396,9 @@ output_approve_with_context() {
|
|
|
394
396
|
printf '{"hookSpecificOutput":{"hookEventName":"UserPromptSubmit","additionalContext":"%s"}}\n' "$escaped"
|
|
395
397
|
}
|
|
396
398
|
|
|
397
|
-
#
|
|
398
|
-
#
|
|
399
|
-
#
|
|
400
|
-
# Returns: Escaped, truncated prompt on stdout
|
|
401
|
-
truncate_and_escape_prompt() {
|
|
402
|
-
local prompt="$1"
|
|
403
|
-
local truncated="${prompt:0:$MAX_SKILL_FIRST_PROMPT_LENGTH}"
|
|
404
|
-
[[ ${#prompt} -gt $MAX_SKILL_FIRST_PROMPT_LENGTH ]] && truncated="${truncated}... [truncated - see original prompt above]"
|
|
405
|
-
printf '%s' "$truncated" | sed 's/\\/\\\\/g; s/"/\\"/g; s/ /\\t/g' | tr '\n' ' '
|
|
406
|
-
}
|
|
399
|
+
# v1.0.260: truncate_and_escape_prompt() removed — prompt embedding in SKILL FIRST
|
|
400
|
+
# was eliminated to save ~800 chars of context budget per turn. The skill reads
|
|
401
|
+
# the user's prompt from conversation context (it's already there).
|
|
407
402
|
|
|
408
403
|
# Helper: Check if plugin is installed by reading installed_plugins.json (v1.0.175)
|
|
409
404
|
# This is the SOURCE OF TRUTH - more reliable than `claude plugin list` which can have timing issues.
|
|
@@ -1169,48 +1164,28 @@ if [[ "${SPECWEAVE_DISABLE_AUTO_LOAD:-0}" != "1" ]] && [[ "${SPECWEAVE_DISABLE_H
|
|
|
1169
1164
|
|
|
1170
1165
|
# Build feedback message
|
|
1171
1166
|
if [[ -n "$PLUGINS_INSTALLED" ]]; then
|
|
1172
|
-
# v1.0.
|
|
1173
|
-
#
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
AUTOLOAD_PLUGINS_MSG="\\n╔══════════════════════════════════════════════════════════════════════════════╗\\n"
|
|
1180
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}║ 🛑 FULL STOP - RESTART REQUIRED - DO NOT PROCEED ║\\n"
|
|
1181
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}╚══════════════════════════════════════════════════════════════════════════════╝\\n\\n"
|
|
1182
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}**Plugins installed**: ${PLUGINS_INSTALLED}\\n\\n"
|
|
1183
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}These plugins are NOT available in the current session. A restart is MANDATORY.\\n\\n"
|
|
1184
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}┌──────────────────────────────────────────────────────────────────────────────┐\\n"
|
|
1185
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}│ ⛔ YOU ARE BLOCKED FROM THE FOLLOWING ACTIONS: │\\n"
|
|
1186
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}├──────────────────────────────────────────────────────────────────────────────┤\\n"
|
|
1187
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}│ ❌ Write tool - BLOCKED (cannot create files) │\\n"
|
|
1188
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}│ ❌ Edit tool - BLOCKED (cannot modify files) │\\n"
|
|
1189
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}│ ❌ Bash tool - BLOCKED (except read-only commands) │\\n"
|
|
1190
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}│ ❌ Task tool - BLOCKED (agents need plugins) │\\n"
|
|
1191
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}│ ❌ Implementation - BLOCKED (no coding until restart) │\\n"
|
|
1192
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}└──────────────────────────────────────────────────────────────────────────────┘\\n\\n"
|
|
1193
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}┌──────────────────────────────────────────────────────────────────────────────┐\\n"
|
|
1194
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}│ ✅ YOUR ONLY ALLOWED ACTIONS: │\\n"
|
|
1195
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}├──────────────────────────────────────────────────────────────────────────────┤\\n"
|
|
1196
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}│ 1. Display this restart warning to user │\\n"
|
|
1197
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}│ 2. Provide the prompt below for user to copy │\\n"
|
|
1198
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}│ 3. STOP and wait for user to restart │\\n"
|
|
1199
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}└──────────────────────────────────────────────────────────────────────────────┘\\n\\n"
|
|
1200
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}**To restart:**\\n"
|
|
1201
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG} • VSCode: \\\`Cmd+Shift+P\\\` → 'Claude: New Session'\\n"
|
|
1202
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG} • CLI: Exit and run \\\`claude\\\` again\\n\\n"
|
|
1203
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}**Your prompt (copy this):**\\n"
|
|
1204
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}\\\`\\\`\\\`\\n${PROMPT_DISPLAY}\\n\\\`\\\`\\\`\\n\\n"
|
|
1205
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}════════════════════════════════════════════════════════════════════════════════\\n"
|
|
1206
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}**Claude: DO NOT ignore this. DO NOT 'help anyway'. STOP COMPLETELY.**\\n"
|
|
1207
|
-
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}════════════════════════════════════════════════════════════════════════════════\\n"
|
|
1167
|
+
# v1.0.260: Compacted RESTART message (~400 chars vs ~2000 chars)
|
|
1168
|
+
# ASCII art boxes were wasting ~1600 chars of the 3000-char context budget.
|
|
1169
|
+
AUTOLOAD_PLUGINS_MSG="RESTART REQUIRED: Plugins installed (${PLUGINS_INSTALLED}) but NOT loaded in current session.\\n"
|
|
1170
|
+
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}ALL tools BLOCKED (Write, Edit, Bash, Task). DO NOT proceed.\\n"
|
|
1171
|
+
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}Restart: VSCode \\\`Cmd+Shift+P\\\` > 'Claude: New Session' | CLI: exit + \\\`claude\\\`\\n"
|
|
1172
|
+
AUTOLOAD_PLUGINS_MSG="${AUTOLOAD_PLUGINS_MSG}STOP COMPLETELY. Do NOT help, do NOT implement, do NOT ignore this.\\n"
|
|
1208
1173
|
elif [[ -n "$PLUGINS_ALREADY" ]]; then
|
|
1209
|
-
|
|
1174
|
+
# v1.0.260: Daily caching — "Using plugins" shown once per day
|
|
1175
|
+
# Uses date-based marker (like archive-suggestion) to auto-reset daily
|
|
1176
|
+
_PLUGINS_SHOWN_FLAG="${SPECWEAVE_DIR}/state/plugins-shown.marker"
|
|
1177
|
+
_TODAY=$(date +%Y-%m-%d)
|
|
1178
|
+
_LAST_SHOWN=""
|
|
1179
|
+
[[ -f "$_PLUGINS_SHOWN_FLAG" ]] && _LAST_SHOWN=$(cat "$_PLUGINS_SHOWN_FLAG" 2>/dev/null)
|
|
1180
|
+
if [[ "$_LAST_SHOWN" != "$_TODAY" ]]; then
|
|
1181
|
+
AUTOLOAD_PLUGINS_MSG="🔌 **Using plugins**: ${PLUGINS_ALREADY}\\n"
|
|
1182
|
+
mkdir -p "$(dirname "$_PLUGINS_SHOWN_FLAG")" 2>/dev/null
|
|
1183
|
+
echo "$_TODAY" > "$_PLUGINS_SHOWN_FLAG" 2>/dev/null
|
|
1184
|
+
fi
|
|
1210
1185
|
fi
|
|
1211
1186
|
if [[ -n "$AUTOLOAD_PLUGINS_MSG" ]]; then
|
|
1212
|
-
|
|
1213
|
-
|
|
1187
|
+
# v1.0.260: Skip LLM reasoning to save context budget — it's informational only
|
|
1188
|
+
:
|
|
1214
1189
|
fi
|
|
1215
1190
|
|
|
1216
1191
|
echo "[$(date -Iseconds)] plugins | installed=${PLUGINS_INSTALLED:-none} | already=${PLUGINS_ALREADY:-none}" >> "$LAZY_LOAD_LOG"
|
|
@@ -1287,59 +1262,23 @@ if [[ "${SPECWEAVE_DISABLE_AUTO_LOAD:-0}" != "1" ]] && [[ "${SPECWEAVE_DISABLE_H
|
|
|
1287
1262
|
AGENT_DIRECTIVE=""
|
|
1288
1263
|
# v1.0.168: Skill invocation directive (takes precedence over routing)
|
|
1289
1264
|
# Skill memories now loaded via DCI in SKILL.md (no hook injection)
|
|
1265
|
+
# v1.0.260: Compacted AGENT_DIRECTIVE to save context budget
|
|
1290
1266
|
if [[ -n "$SKILL_INVOCATION" ]]; then
|
|
1291
1267
|
if [[ "$SKILL_MANDATORY" == "true" ]]; then
|
|
1292
1268
|
AGENT_DIRECTIVE="
|
|
1293
|
-
|
|
1294
|
-
---
|
|
1295
|
-
<skill_invocation_required>
|
|
1296
|
-
### 🎯 MANDATORY: Use ${SKILL_INVOCATION} Skill
|
|
1297
|
-
|
|
1298
|
-
You MUST invoke this skill for this task. Do NOT implement directly without using this skill.
|
|
1299
|
-
|
|
1300
|
-
**Invoke NOW using Skill tool:**
|
|
1301
|
-
\`\`\`typescript
|
|
1302
|
-
Skill({ skill: \"${SKILL_INVOCATION}\" })
|
|
1303
|
-
\`\`\`
|
|
1304
|
-
|
|
1305
|
-
**Why this skill is required:**
|
|
1306
|
-
${SKILL_REASON:-This skill provides specialized support for your task.}
|
|
1307
|
-
|
|
1308
|
-
⚠️ **Do NOT skip this** - the skill has domain expertise needed for quality implementation.
|
|
1309
|
-
</skill_invocation_required>"
|
|
1269
|
+
MANDATORY: Also call \`Skill({ skill: \"${SKILL_INVOCATION}\" })\` — ${SKILL_REASON:-specialized support needed}."
|
|
1310
1270
|
else
|
|
1311
1271
|
AGENT_DIRECTIVE="
|
|
1312
|
-
|
|
1313
|
-
---
|
|
1314
|
-
### 💡 Recommended: Use ${SKILL_INVOCATION} Skill
|
|
1315
|
-
|
|
1316
|
-
Consider invoking this skill for better results:
|
|
1317
|
-
\`\`\`typescript
|
|
1318
|
-
Skill({ skill: \"${SKILL_INVOCATION}\" })
|
|
1319
|
-
\`\`\`
|
|
1320
|
-
*${SKILL_REASON:-This skill provides specialized support for your task.}*"
|
|
1272
|
+
Recommended: \`Skill({ skill: \"${SKILL_INVOCATION}\" })\` — ${SKILL_REASON:-specialized support for this task}."
|
|
1321
1273
|
fi
|
|
1322
1274
|
elif [[ "$ROUTING_SKILLS_COUNT" -gt 0 ]]; then
|
|
1323
1275
|
PRIMARY_PLUGIN=$(echo "$JSON_OUTPUT" | jq -r '.routing.skills[] | select(.priority == "primary") | .plugin // empty' 2>/dev/null | head -1)
|
|
1324
1276
|
PRIMARY_SKILL_NAME=$(echo "$JSON_OUTPUT" | jq -r '.routing.skills[] | select(.priority == "primary") | .name // empty' 2>/dev/null | head -1)
|
|
1325
1277
|
PRIMARY_REASON=$(echo "$JSON_OUTPUT" | jq -r '.routing.skills[] | select(.priority == "primary") | .reason // empty' 2>/dev/null | head -1)
|
|
1326
1278
|
if [[ -n "$PRIMARY_PLUGIN" && -n "$PRIMARY_SKILL_NAME" ]]; then
|
|
1327
|
-
|
|
1279
|
+
# v1.0.260: Compacted routing directive to save context budget
|
|
1328
1280
|
AGENT_DIRECTIVE="
|
|
1329
|
-
|
|
1330
|
-
---
|
|
1331
|
-
|
|
1332
|
-
### 🚀 Then SPAWN Specialized Agent
|
|
1333
|
-
|
|
1334
|
-
**After creating increment, use Task tool:**
|
|
1335
|
-
\`\`\`typescript
|
|
1336
|
-
Task({
|
|
1337
|
-
subagent_type: \"${AGENT_TYPE}\",
|
|
1338
|
-
prompt: \"Implement the feature...\",
|
|
1339
|
-
description: \"${PRIMARY_REASON:-Implementation}\"
|
|
1340
|
-
})
|
|
1341
|
-
\`\`\`
|
|
1342
|
-
*Specialized agents produce better code than direct implementation.*"
|
|
1281
|
+
Then spawn agent: \`Task({ subagent_type: \"${PRIMARY_PLUGIN}:${PRIMARY_SKILL_NAME}\", description: \"${PRIMARY_REASON:-Implementation}\" })\`"
|
|
1343
1282
|
fi
|
|
1344
1283
|
fi
|
|
1345
1284
|
|
|
@@ -1352,37 +1291,31 @@ Task({
|
|
|
1352
1291
|
# Pass user prompt so skill can extract context
|
|
1353
1292
|
# INC_MANDATORY comes from detect-intent LLM response
|
|
1354
1293
|
if [[ "$INC_MANDATORY" == "true" ]]; then
|
|
1355
|
-
# v1.0.
|
|
1356
|
-
|
|
1294
|
+
# v1.0.260: Removed prompt embedding from SKILL FIRST args to save ~800 chars.
|
|
1295
|
+
# The skill reads the user's prompt from conversation context (it's already there).
|
|
1357
1296
|
|
|
1358
1297
|
# v1.0.243: Smart interview gate — LLM assesses prompt completeness
|
|
1359
|
-
# before blindly calling increment-planner. If details are missing,
|
|
1360
|
-
# ask targeted questions first. If complete, proceed directly.
|
|
1361
1298
|
DEEP_INTERVIEW_MSG=""
|
|
1362
1299
|
if [[ "$DEEP_INTERVIEW_ENABLED" == "true" ]]; then
|
|
1363
1300
|
DEEP_INTERVIEW_MSG=" Assess prompt completeness first — if gaps exist, ask 2-5 targeted questions before calling."
|
|
1364
1301
|
fi
|
|
1365
1302
|
|
|
1366
|
-
MSG="${WIP_WARNING}${AUTOLOAD_PREFIX}SKILL FIRST: \`Skill({ skill: \"sw:increment-planner\"
|
|
1303
|
+
MSG="${WIP_WARNING}${AUTOLOAD_PREFIX}SKILL FIRST: \`Skill({ skill: \"sw:increment-planner\" })\` — call BEFORE implementation.
|
|
1367
1304
|
Detection: ${INC_REASON} (confidence: ${INC_CONF}).${AGENT_DIRECTIVE}${DEEP_INTERVIEW_MSG}
|
|
1368
1305
|
After increment-planner, chain domain skills per tech stack (see CLAUDE.md Skill Chaining)."
|
|
1369
|
-
# Use approve+additionalContext so Claude can read and follow
|
|
1370
|
-
# the SKILL FIRST instructions (block erases prompt from context)
|
|
1371
1306
|
output_approve_with_context "$MSG"
|
|
1372
1307
|
exit 0
|
|
1373
1308
|
else
|
|
1374
|
-
# v1.0.
|
|
1375
|
-
|
|
1376
|
-
MSG="${WIP_WARNING}${AUTOLOAD_PREFIX}Increment suggested: \`Skill({ skill: \"sw:increment-planner\", args: \"${ESCAPED_PROMPT_SUGGEST}\" })\` or \`$CMD\`. Reason: $INC_REASON${AGENT_DIRECTIVE}"
|
|
1309
|
+
# v1.0.260: Removed prompt embedding to save context budget
|
|
1310
|
+
MSG="${WIP_WARNING}${AUTOLOAD_PREFIX}Increment suggested: \`Skill({ skill: \"sw:increment-planner\" })\` or \`$CMD\`. Reason: $INC_REASON${AGENT_DIRECTIVE}"
|
|
1377
1311
|
output_approve_with_context "$MSG"
|
|
1378
1312
|
exit 0
|
|
1379
1313
|
fi
|
|
1380
1314
|
;;
|
|
1381
1315
|
|
|
1382
1316
|
hotfix)
|
|
1383
|
-
# v1.0.
|
|
1384
|
-
|
|
1385
|
-
MSG="${WIP_WARNING}${AUTOLOAD_PREFIX}Hotfix detected: \`Skill({ skill: \"sw:increment-planner\", args: \"--type=hotfix ${ESCAPED_PROMPT_HOTFIX}\" })\`. Reason: $INC_REASON"
|
|
1317
|
+
# v1.0.260: Removed prompt embedding to save context budget
|
|
1318
|
+
MSG="${WIP_WARNING}${AUTOLOAD_PREFIX}Hotfix detected: \`Skill({ skill: \"sw:increment-planner\", args: \"--type=hotfix\" })\`. Reason: $INC_REASON"
|
|
1386
1319
|
output_approve_with_context "$MSG"
|
|
1387
1320
|
exit 0
|
|
1388
1321
|
;;
|
|
@@ -1396,13 +1329,11 @@ After increment-planner, chain domain skills per tech stack (see CLAUDE.md Skill
|
|
|
1396
1329
|
;;
|
|
1397
1330
|
|
|
1398
1331
|
small_fix)
|
|
1399
|
-
# v1.0.
|
|
1400
|
-
# Previously small_fix fell through with no output at all
|
|
1401
|
-
ESCAPED_PROMPT_SMALLFIX=$(truncate_and_escape_prompt "$PROMPT")
|
|
1332
|
+
# v1.0.260: Removed prompt embedding to save context budget
|
|
1402
1333
|
CMD_SMALLFIX="/sw:increment"
|
|
1403
1334
|
[[ -n "$INC_NAME" ]] && CMD_SMALLFIX="/sw:increment \"$INC_NAME\""
|
|
1404
1335
|
|
|
1405
|
-
MSG="${WIP_WARNING}${AUTOLOAD_PREFIX}Small change — consider tracking: \`Skill({ skill: \"sw:increment-planner\"
|
|
1336
|
+
MSG="${WIP_WARNING}${AUTOLOAD_PREFIX}Small change — consider tracking: \`Skill({ skill: \"sw:increment-planner\" })\` or \`$CMD_SMALLFIX\`. Reason: $INC_REASON${AGENT_DIRECTIVE}"
|
|
1406
1337
|
output_approve_with_context "$MSG"
|
|
1407
1338
|
exit 0
|
|
1408
1339
|
;;
|
|
@@ -1522,13 +1453,13 @@ After increment-planner, chain domain skills per tech stack (see CLAUDE.md Skill
|
|
|
1522
1453
|
# Exclude questions (starting with question words or ending with ?)
|
|
1523
1454
|
if ! echo "$PROMPT" | grep -qiE "^[[:space:]]*(what|how|why|explain|tell me|can you|does|should|is there|where|when|which)" && \
|
|
1524
1455
|
! echo "$PROMPT" | grep -qE "\?[[:space:]]*$"; then
|
|
1525
|
-
|
|
1456
|
+
# v1.0.260: Removed prompt embedding to save context budget
|
|
1526
1457
|
if [[ "$INCREMENT_MANDATORY_CONFIG" == "true" ]]; then
|
|
1527
|
-
FALLBACK_MSG="SKILL FIRST: \`Skill({ skill: \"sw:increment-planner\"
|
|
1458
|
+
FALLBACK_MSG="SKILL FIRST: \`Skill({ skill: \"sw:increment-planner\" })\` — call BEFORE implementation.
|
|
1528
1459
|
Detection: Implementation keywords detected (LLM unavailable, keyword fallback).
|
|
1529
1460
|
After increment-planner, chain domain skills per tech stack (see CLAUDE.md Skill Chaining)."
|
|
1530
1461
|
else
|
|
1531
|
-
FALLBACK_MSG="Increment suggested: \`Skill({ skill: \"sw:increment-planner\"
|
|
1462
|
+
FALLBACK_MSG="Increment suggested: \`Skill({ skill: \"sw:increment-planner\" })\`. Reason: Implementation keywords detected (LLM unavailable, keyword fallback)."
|
|
1532
1463
|
fi
|
|
1533
1464
|
echo "[$(date -Iseconds)] keyword-fallback | prompt_keywords_matched=true | mandatory=$INCREMENT_MANDATORY_CONFIG" >> "$LAZY_LOAD_LOG"
|
|
1534
1465
|
output_approve_with_context "$FALLBACK_MSG"
|
|
@@ -2232,56 +2163,50 @@ if echo "$PROMPT" | grep -qE "^/sw:[a-z]"; then
|
|
|
2232
2163
|
fi
|
|
2233
2164
|
|
|
2234
2165
|
# ==============================================================================
|
|
2235
|
-
# OUTPUT:
|
|
2166
|
+
# OUTPUT: Priority-based context assembly with budget (v1.0.260)
|
|
2236
2167
|
# ==============================================================================
|
|
2237
|
-
#
|
|
2238
|
-
#
|
|
2168
|
+
# Assembles final message by adding context items in priority order,
|
|
2169
|
+
# stopping when the budget is exhausted. This prevents blind concatenation
|
|
2170
|
+
# that wastes budget on low-priority items while truncating critical ones.
|
|
2171
|
+
#
|
|
2172
|
+
# Priority tiers:
|
|
2173
|
+
# P1 (critical): Plugin status (RESTART/Using), active increment status
|
|
2174
|
+
# P2 (important): LSP explicit request, WIP/interview gate
|
|
2175
|
+
# P3 (informational): LSP setup/install suggestions, archive suggestion
|
|
2176
|
+
|
|
2177
|
+
CONTEXT_BUDGET=2500 # Leave 500 chars headroom below 3000 max
|
|
2178
|
+
|
|
2179
|
+
# Helper: Append message to FINAL_MESSAGE if it fits within budget
|
|
2180
|
+
# Args: $1=message to append
|
|
2181
|
+
# Returns: 0 if appended, 1 if skipped (budget exceeded)
|
|
2182
|
+
_budget_append() {
|
|
2183
|
+
local msg="$1"
|
|
2184
|
+
[[ -z "$msg" ]] && return 0
|
|
2185
|
+
local new_len=$(( ${#FINAL_MESSAGE} + ${#msg} ))
|
|
2186
|
+
if [[ $new_len -le $CONTEXT_BUDGET ]]; then
|
|
2187
|
+
FINAL_MESSAGE="${FINAL_MESSAGE}${msg}"
|
|
2188
|
+
return 0
|
|
2189
|
+
fi
|
|
2190
|
+
return 1
|
|
2191
|
+
}
|
|
2239
2192
|
|
|
2240
2193
|
FINAL_MESSAGE=""
|
|
2241
2194
|
|
|
2242
|
-
#
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
fi
|
|
2246
|
-
|
|
2247
|
-
# v1.0.191: Add LSP environment setup warning if needed
|
|
2248
|
-
if [[ -n "$LSP_ENV_SETUP_MSG" ]]; then
|
|
2249
|
-
FINAL_MESSAGE="${FINAL_MESSAGE}${LSP_ENV_SETUP_MSG}"
|
|
2250
|
-
fi
|
|
2251
|
-
|
|
2252
|
-
# v1.0.191: Add LSP marketplace/plugin installation message if installed
|
|
2253
|
-
if [[ -n "$LSP_INSTALL_MSG" ]]; then
|
|
2254
|
-
FINAL_MESSAGE="${FINAL_MESSAGE}${LSP_INSTALL_MSG}"
|
|
2255
|
-
fi
|
|
2256
|
-
|
|
2257
|
-
# v1.0.203: Add LSP setup suggestion if languages detected but plugins not installed
|
|
2258
|
-
if [[ -n "$LSP_SETUP_SUGGESTION_MSG" ]]; then
|
|
2259
|
-
FINAL_MESSAGE="${FINAL_MESSAGE}${LSP_SETUP_SUGGESTION_MSG}"
|
|
2260
|
-
fi
|
|
2261
|
-
|
|
2262
|
-
# v1.0.180: Add explicit LSP request explanation if detected
|
|
2263
|
-
if [[ -n "$LSP_EXPLICIT_REQUEST_MSG" ]]; then
|
|
2264
|
-
FINAL_MESSAGE="${FINAL_MESSAGE}${LSP_EXPLICIT_REQUEST_MSG}"
|
|
2265
|
-
fi
|
|
2195
|
+
# P1: Critical — plugin status and active increment
|
|
2196
|
+
_budget_append "$AUTOLOAD_PLUGINS_MSG"
|
|
2197
|
+
_budget_append "$CONTEXT"
|
|
2266
2198
|
|
|
2267
|
-
#
|
|
2268
|
-
|
|
2269
|
-
FINAL_MESSAGE="${FINAL_MESSAGE}${ARCHIVE_SUGGESTION_MSG}"
|
|
2270
|
-
fi
|
|
2271
|
-
|
|
2272
|
-
# v1.0.243: Smart Interview Gate for non-incrementAssist paths
|
|
2273
|
-
# When deep interview is enabled but incrementAssist didn't trigger SKILL FIRST,
|
|
2274
|
-
# still inject the gate so LLM can gather context across conversational prompts.
|
|
2199
|
+
# P2: Important — LSP explicit request, interview gate
|
|
2200
|
+
_budget_append "$LSP_EXPLICIT_REQUEST_MSG"
|
|
2275
2201
|
if [[ -n "$SMART_INTERVIEW_GATE_MSG" ]]; then
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
${SMART_INTERVIEW_GATE_MSG}"
|
|
2202
|
+
_budget_append "\\n${SMART_INTERVIEW_GATE_MSG}"
|
|
2279
2203
|
fi
|
|
2280
2204
|
|
|
2281
|
-
#
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2205
|
+
# P3: Informational — LSP setup, archive, environment
|
|
2206
|
+
_budget_append "$LSP_ENV_SETUP_MSG"
|
|
2207
|
+
_budget_append "$LSP_INSTALL_MSG"
|
|
2208
|
+
_budget_append "$LSP_SETUP_SUGGESTION_MSG"
|
|
2209
|
+
_budget_append "$ARCHIVE_SUGGESTION_MSG"
|
|
2285
2210
|
|
|
2286
2211
|
if [[ -n "$FINAL_MESSAGE" ]]; then
|
|
2287
2212
|
output_approve_with_context "$FINAL_MESSAGE"
|
|
@@ -96,6 +96,41 @@ Map flags to extra `successCriteria` entries:
|
|
|
96
96
|
|
|
97
97
|
Always include `tasks_complete` and `acs_satisfied` as base criteria. Ensure `.specweave/state/` dir exists.
|
|
98
98
|
|
|
99
|
+
### Step 1.5a: MANDATORY - Complexity Check for Team-Lead Routing
|
|
100
|
+
|
|
101
|
+
**Before starting autonomous execution, check if this increment needs team-lead:**
|
|
102
|
+
|
|
103
|
+
1. Count pending tasks in tasks.md (count `[ ]` markers)
|
|
104
|
+
2. Detect domains from file paths in tasks.md and plan.md:
|
|
105
|
+
- Frontend: `.tsx`, `src/components/`, `src/pages/`, React/Vue keywords
|
|
106
|
+
- Backend: `src/api/`, `src/services/`, `src/routes/`, Express/NestJS keywords
|
|
107
|
+
- Database: `prisma/`, `migrations/`, SQL keywords
|
|
108
|
+
- DevOps: `Dockerfile`, `.github/`, `k8s/` keywords
|
|
109
|
+
- Testing: `tests/`, `e2e/`, `.test.` keywords
|
|
110
|
+
- Security: `src/auth/`, auth keywords
|
|
111
|
+
- Mobile: `ios/`, `android/`, React Native keywords
|
|
112
|
+
|
|
113
|
+
3. **If 3+ domains detected OR domain count suggests multi-agent benefit:**
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
⚠️ COMPLEXITY ASSESSMENT
|
|
117
|
+
══════════════════════════════════════════
|
|
118
|
+
Tasks: [N] pending | Domains: [N] ([list])
|
|
119
|
+
──────────────────────────────────────────
|
|
120
|
+
This increment spans 3+ domains. /sw:team-lead is recommended
|
|
121
|
+
for parallel execution with higher quality results.
|
|
122
|
+
⚡ Trade-off: ~2-3x more tokens, but parallel agents
|
|
123
|
+
produce better results for multi-domain work.
|
|
124
|
+
══════════════════════════════════════════
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Then use AskUserQuestion:
|
|
128
|
+
- Option A: "Use /sw:team-lead (Recommended)" — invoke team-lead and stop auto
|
|
129
|
+
- Option B: "Continue with /sw:auto (sequential)" — proceed normally
|
|
130
|
+
|
|
131
|
+
**In auto mode** (no user present): Auto-invoke `/sw:team-lead` for 3+ domains.
|
|
132
|
+
This is the default behavior per CLAUDE.md execution strategy.
|
|
133
|
+
|
|
99
134
|
### Step 1.5: MANDATORY - Display Stop Conditions
|
|
100
135
|
|
|
101
136
|
**You MUST output a stop conditions banner BEFORE starting work.** Detect test frameworks, count test files, then show:
|