@clue-ai/cli 0.0.8 → 0.0.10
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/README.md +37 -26
- package/bin/clue-cli.mjs +93 -54
- package/package.json +1 -1
- package/src/cli-invocation.mjs +34 -0
- package/src/command-spec.mjs +3 -0
- package/src/contracts.mjs +132 -127
- package/src/init-tool.mjs +2 -1
- package/src/lifecycle-guard.mjs +168 -103
- package/src/lifecycle-init.mjs +428 -17
- package/src/public-schema.cjs +4 -0
- package/src/semantic-agent-runner.mjs +3 -1
- package/src/setup-check.mjs +643 -47
- package/src/setup-help.mjs +69 -0
- package/src/setup-prepare.mjs +75 -15
- package/src/setup-tool.mjs +86 -40
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CLUE_CLI_INVOCATION_CONTRACT,
|
|
3
|
+
clueCliCommand,
|
|
4
|
+
} from "./cli-invocation.mjs";
|
|
5
|
+
|
|
6
|
+
export const AI_SETUP_HELP_VERSION = "2026-05-10.lifecycle-placement-only.v1";
|
|
7
|
+
|
|
8
|
+
export const buildAiSetupHelp = () => ({
|
|
9
|
+
name: "@clue-ai/cli AI setup help",
|
|
10
|
+
version: AI_SETUP_HELP_VERSION,
|
|
11
|
+
purpose:
|
|
12
|
+
"Machine-readable Clue setup contract for AI coding agents. Use this before editing a customer repository for Clue setup.",
|
|
13
|
+
cli_invocation: CLUE_CLI_INVOCATION_CONTRACT,
|
|
14
|
+
setup_execution_contract: {
|
|
15
|
+
agent_primary_task:
|
|
16
|
+
"Decide where to place ClueInit, ClueIdentify, ClueSetAccount, and ClueLogout in existing repository lifecycle boundaries, then apply only those minimal Clue SDK wiring changes.",
|
|
17
|
+
implementation_workstreams: ["sdk_lifecycle_placement"],
|
|
18
|
+
lifecycle_apis_in_scope: [
|
|
19
|
+
"ClueInit",
|
|
20
|
+
"ClueIdentify",
|
|
21
|
+
"ClueSetAccount",
|
|
22
|
+
"ClueLogout",
|
|
23
|
+
],
|
|
24
|
+
lifecycle_apis_out_of_scope_by_default: ["ClueTrack"],
|
|
25
|
+
allowed_change_scope: {
|
|
26
|
+
rule: "Only changes required to place ClueInit, ClueIdentify, ClueSetAccount, and ClueLogout are allowed.",
|
|
27
|
+
allowed: [
|
|
28
|
+
"Clue SDK dependency declarations and lockfile changes needed to install those SDKs",
|
|
29
|
+
"Clue SDK imports, bootstrap adapters, and single initialization points",
|
|
30
|
+
"backend-owned browser token endpoints required so frontend SDK code never exposes CLUE_API_KEY",
|
|
31
|
+
"Clue lifecycle calls at existing clear login, logout, account, workspace, organization, or tenant boundaries",
|
|
32
|
+
"tests or verification scripts directly proving the four lifecycle API placement decisions",
|
|
33
|
+
],
|
|
34
|
+
forbidden: [
|
|
35
|
+
"ClueTrack instrumentation unless the user explicitly requested product event tracking",
|
|
36
|
+
"semantic snapshot implementation or CI workflow edits during lifecycle placement",
|
|
37
|
+
"unrelated refactors, renames, file moves, formatting churn, or broad cleanup",
|
|
38
|
+
"business logic changes that are not required for Clue setup",
|
|
39
|
+
"auth/session flow rewrites beyond the minimal Clue hook insertion point",
|
|
40
|
+
"UI layout, styling, copy, or navigation changes unrelated to Clue setup",
|
|
41
|
+
"dependency upgrades unrelated to Clue SDK installability",
|
|
42
|
+
"hand-authored semantic snapshot artifacts or runtime request files",
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
setup_watch: {
|
|
46
|
+
owner: "user",
|
|
47
|
+
ai_agent_must_run: false,
|
|
48
|
+
command: clueCliCommand("setup-watch --local"),
|
|
49
|
+
rule: "Do not run setup-watch during implementation. setup-watch and the Clue setup screen require user-operated local services and real login/logout/account flows.",
|
|
50
|
+
ai_agent_responsibility:
|
|
51
|
+
"Report the command and required user verification as pending when it was not run by the user.",
|
|
52
|
+
},
|
|
53
|
+
completion_boundary: {
|
|
54
|
+
ai_may_claim: [
|
|
55
|
+
"Clue setup code changes were applied",
|
|
56
|
+
"static setup-check passed",
|
|
57
|
+
"SDK dependency install/import/build/typecheck checks passed when actually run",
|
|
58
|
+
],
|
|
59
|
+
ai_must_not_claim: [
|
|
60
|
+
"setup completed",
|
|
61
|
+
"event delivery verified",
|
|
62
|
+
"setup-watch passed",
|
|
63
|
+
"Clue setup screen verification passed",
|
|
64
|
+
],
|
|
65
|
+
final_status_when_setup_watch_not_user_verified:
|
|
66
|
+
"user_verification_pending",
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
});
|
package/src/setup-prepare.mjs
CHANGED
|
@@ -4,6 +4,10 @@ import {
|
|
|
4
4
|
buildSemanticWorkflowRequestFromFlags,
|
|
5
5
|
writeSemanticWorkflow,
|
|
6
6
|
} from "./init-tool.mjs";
|
|
7
|
+
import {
|
|
8
|
+
CLUE_CLI_INVOCATION_CONTRACT,
|
|
9
|
+
clueCliCommand,
|
|
10
|
+
} from "./cli-invocation.mjs";
|
|
7
11
|
import { runSetupDetect } from "./setup-detect.mjs";
|
|
8
12
|
|
|
9
13
|
const DEFAULT_SETUP_MANIFEST_PATH = ".clue/setup-manifest.json";
|
|
@@ -222,6 +226,9 @@ const buildEnvironmentInstructions = ({ manifest, setupContext }) => {
|
|
|
222
226
|
},
|
|
223
227
|
],
|
|
224
228
|
variables: [
|
|
229
|
+
{ name: "CLUE_PROJECT_KEY", value: setupContext.project_key },
|
|
230
|
+
{ name: "CLUE_ENVIRONMENT", value: setupContext.environment },
|
|
231
|
+
{ name: "CLUE_API_BASE_URL", value: setupContext.clue_api_base_url },
|
|
225
232
|
{
|
|
226
233
|
name: "CLUE_AI_PROVIDER",
|
|
227
234
|
value: aiProviderGuide.provider,
|
|
@@ -282,8 +289,7 @@ const summarizeEnvironmentInstructions = (instructions) => {
|
|
|
282
289
|
return {
|
|
283
290
|
status: "ready",
|
|
284
291
|
env_file_path: instructions.env_file_path,
|
|
285
|
-
message:
|
|
286
|
-
`${instructions.env_file_path} を開き、各サービスの env と GitHub Secrets に反映してください。`,
|
|
292
|
+
message: `${instructions.env_file_path} を開き、各サービスの env と GitHub Secrets に反映してください。`,
|
|
287
293
|
service_env_block_count: instructions.service_env_blocks.length,
|
|
288
294
|
github_secret_names: instructions.ci_github.secrets.map(
|
|
289
295
|
(entry) => entry.name,
|
|
@@ -326,8 +332,18 @@ export const runSetupPrepare = async ({
|
|
|
326
332
|
ai_next_scope: "blocked_until_backend_routes_are_detected",
|
|
327
333
|
machine_owned_artifacts: [],
|
|
328
334
|
ai_owned_workstreams: [
|
|
329
|
-
"
|
|
335
|
+
"sdk_lifecycle_placement_after_blockers_are_resolved",
|
|
330
336
|
],
|
|
337
|
+
ai_implementation_scope: {
|
|
338
|
+
rule: "AI implementation is limited to placing ClueInit, ClueIdentify, ClueSetAccount, and ClueLogout in existing lifecycle boundaries after blockers are resolved.",
|
|
339
|
+
lifecycle_apis: [
|
|
340
|
+
"ClueInit",
|
|
341
|
+
"ClueIdentify",
|
|
342
|
+
"ClueSetAccount",
|
|
343
|
+
"ClueLogout",
|
|
344
|
+
],
|
|
345
|
+
out_of_scope_by_default: ["ClueTrack"],
|
|
346
|
+
},
|
|
331
347
|
};
|
|
332
348
|
await writeJson({
|
|
333
349
|
repoRoot: resolvedRepoRoot,
|
|
@@ -340,8 +356,9 @@ export const runSetupPrepare = async ({
|
|
|
340
356
|
});
|
|
341
357
|
return {
|
|
342
358
|
...manifest,
|
|
343
|
-
environment_instructions:
|
|
344
|
-
|
|
359
|
+
environment_instructions: summarizeEnvironmentInstructions(
|
|
360
|
+
environmentInstructions,
|
|
361
|
+
),
|
|
345
362
|
};
|
|
346
363
|
}
|
|
347
364
|
|
|
@@ -349,9 +366,6 @@ export const runSetupPrepare = async ({
|
|
|
349
366
|
framework: candidate.framework,
|
|
350
367
|
backendRootPath: candidate.backend_root_path,
|
|
351
368
|
serviceKey: candidate.service_key,
|
|
352
|
-
projectKey: setupContext.project_key,
|
|
353
|
-
environment: setupContext.environment,
|
|
354
|
-
clueApiBaseUrl: setupContext.clue_api_base_url,
|
|
355
369
|
});
|
|
356
370
|
const workflow = await writeSemanticWorkflow({
|
|
357
371
|
repoRoot: resolvedRepoRoot,
|
|
@@ -373,6 +387,7 @@ export const runSetupPrepare = async ({
|
|
|
373
387
|
frontend_env_name: "CLUE_SERVICE_KEY",
|
|
374
388
|
producer_id_derivation: "producer_id defaults to service_key",
|
|
375
389
|
},
|
|
390
|
+
cli_invocation: CLUE_CLI_INVOCATION_CONTRACT,
|
|
376
391
|
clue_context: {
|
|
377
392
|
project_key: setupContext.project_key,
|
|
378
393
|
environment: setupContext.environment,
|
|
@@ -391,9 +406,11 @@ export const runSetupPrepare = async ({
|
|
|
391
406
|
: null,
|
|
392
407
|
},
|
|
393
408
|
lifecycle_verification: {
|
|
409
|
+
owner: "user",
|
|
410
|
+
ai_agent_must_run_setup_watch: false,
|
|
394
411
|
watch_target_format:
|
|
395
412
|
"frontend:<service-key>[init,identify,set-account,logout,event-sent]=<frontend-url>,backend:<service-key>[init,identify,set-account,logout,event-sent]=<backend-url>",
|
|
396
|
-
rule: "setup-watch --local uses the structured watch_targets below
|
|
413
|
+
rule: "setup-watch --local uses the structured watch_targets below, but it is user-operated verification. AI implementation agents must not run setup-watch automatically.",
|
|
397
414
|
watch_targets: buildWatchTargets(detection, candidate),
|
|
398
415
|
},
|
|
399
416
|
artifacts: {
|
|
@@ -403,12 +420,54 @@ export const runSetupPrepare = async ({
|
|
|
403
420
|
},
|
|
404
421
|
machine_owned_artifacts: [workflow.ci_workflow_path, setupManifestPath],
|
|
405
422
|
ai_must_not_edit: [workflow.ci_workflow_path],
|
|
406
|
-
ai_owned_workstreams: ["
|
|
423
|
+
ai_owned_workstreams: ["sdk_lifecycle_placement"],
|
|
424
|
+
ai_implementation_scope: {
|
|
425
|
+
rule: "AI implementation is limited to placing ClueInit, ClueIdentify, ClueSetAccount, and ClueLogout in existing lifecycle boundaries plus the minimal SDK wiring required for those calls.",
|
|
426
|
+
lifecycle_apis: [
|
|
427
|
+
"ClueInit",
|
|
428
|
+
"ClueIdentify",
|
|
429
|
+
"ClueSetAccount",
|
|
430
|
+
"ClueLogout",
|
|
431
|
+
],
|
|
432
|
+
out_of_scope_by_default: ["ClueTrack"],
|
|
433
|
+
},
|
|
407
434
|
required_final_check: {
|
|
408
|
-
command:
|
|
409
|
-
`
|
|
410
|
-
|
|
435
|
+
command: clueCliCommand(
|
|
436
|
+
`setup-check --framework ${candidate.framework} ` +
|
|
437
|
+
`--backend-root-path ${candidate.backend_root_path} --repo . --target ${target} --require-sdk-lifecycle`,
|
|
438
|
+
),
|
|
411
439
|
},
|
|
440
|
+
required_final_verification: [
|
|
441
|
+
{
|
|
442
|
+
id: "static_setup_check",
|
|
443
|
+
command: clueCliCommand(
|
|
444
|
+
`setup-check --framework ${candidate.framework} ` +
|
|
445
|
+
`--backend-root-path ${candidate.backend_root_path} --repo . --target ${target} --require-sdk-lifecycle`,
|
|
446
|
+
),
|
|
447
|
+
completion_meaning:
|
|
448
|
+
"static_passed_only_dependency_install_import_app_startup_and_event_delivery_still_required",
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
id: "sdk_dependency_install_and_import",
|
|
452
|
+
command:
|
|
453
|
+
"run the repository package-manager install plus frontend/backend SDK import checks in the target environments",
|
|
454
|
+
completion_meaning:
|
|
455
|
+
"required before claiming SDK lifecycle setup is complete",
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
id: "app_startup",
|
|
459
|
+
command:
|
|
460
|
+
"start the affected frontend/backend services and verify their configured local URLs respond",
|
|
461
|
+
completion_meaning:
|
|
462
|
+
"required before setup-watch local completion can be trusted",
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
id: "local_event_delivery",
|
|
466
|
+
command: `user runs ${clueCliCommand("setup-watch --local")}`,
|
|
467
|
+
completion_meaning:
|
|
468
|
+
"requires user-operated local services plus expected lifecycle event delivery; AI agents must report user_verification_pending when user evidence is not provided",
|
|
469
|
+
},
|
|
470
|
+
],
|
|
412
471
|
required_env_names: [
|
|
413
472
|
"CLUE_SERVICE_KEY",
|
|
414
473
|
"CLUE_API_KEY",
|
|
@@ -450,7 +509,8 @@ export const runSetupPrepare = async ({
|
|
|
450
509
|
...manifestWithEnvironmentArtifact.artifacts,
|
|
451
510
|
environment_file_path: environmentFilePath,
|
|
452
511
|
},
|
|
453
|
-
environment_instructions:
|
|
454
|
-
|
|
512
|
+
environment_instructions: summarizeEnvironmentInstructions(
|
|
513
|
+
environmentInstructions,
|
|
514
|
+
),
|
|
455
515
|
};
|
|
456
516
|
};
|
package/src/setup-tool.mjs
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
2
|
import { join, resolve } from "node:path";
|
|
3
3
|
import readline from "node:readline/promises";
|
|
4
|
+
import {
|
|
5
|
+
CLUE_CLI_BINARY_NAME,
|
|
6
|
+
CLUE_CLI_PACKAGE_NAME,
|
|
7
|
+
CLUE_CLI_RECOMMENDED_PREFIX,
|
|
8
|
+
clueCliCommand,
|
|
9
|
+
} from "./cli-invocation.mjs";
|
|
4
10
|
|
|
5
11
|
const SKILL_NAMES = [
|
|
6
12
|
"clue-setup-orchestrator",
|
|
@@ -11,6 +17,7 @@ const SKILL_NAMES = [
|
|
|
11
17
|
"clue-local-verification",
|
|
12
18
|
"clue-setup-report",
|
|
13
19
|
];
|
|
20
|
+
const SETUP_SKILL_CONTENT_VERSION = "2026-05-10.lifecycle-placement-only.v1";
|
|
14
21
|
|
|
15
22
|
const TARGETS = new Set(["codex", "claude_code"]);
|
|
16
23
|
|
|
@@ -33,11 +40,11 @@ const normalizeTarget = (target) => {
|
|
|
33
40
|
const skillBody = (name) => {
|
|
34
41
|
const descriptions = {
|
|
35
42
|
"clue-setup-orchestrator":
|
|
36
|
-
"Use first when running
|
|
43
|
+
"Use first when running Clue setup so lifecycle placement remains the only implementation workstream and read-only checks stay separate.",
|
|
37
44
|
"clue-route-semantic-snapshot":
|
|
38
45
|
"Use when checking backend route coverage and semantic snapshot readiness without hand-authoring generated snapshot files.",
|
|
39
46
|
"clue-semantic-gen":
|
|
40
|
-
"Use when
|
|
47
|
+
"Use when verifying the generated Clue semantic snapshot CI workflow without editing it during lifecycle placement.",
|
|
41
48
|
"clue-sdk-instrumentation":
|
|
42
49
|
"Use when adding ClueInit, ClueIdentify, ClueSetAccount, and ClueLogout lifecycle calls to a customer repository.",
|
|
43
50
|
"clue-setup-audit":
|
|
@@ -54,13 +61,13 @@ const skillBody = (name) => {
|
|
|
54
61
|
"clue-route-semantic-snapshot":
|
|
55
62
|
"Semantic route readiness agent. Owns backend route inventory/readiness validation only. It must not author generated snapshot content or SDK code.",
|
|
56
63
|
"clue-semantic-gen":
|
|
57
|
-
"Semantic generation CI agent. Owns machine-owned CI workflow verification
|
|
64
|
+
"Semantic generation CI verification agent. Owns read-only machine-owned CI workflow verification only during lifecycle placement. It must not hand-write snapshot content, refresh CI, or edit SDK lifecycle code.",
|
|
58
65
|
"clue-sdk-instrumentation":
|
|
59
|
-
"SDK lifecycle
|
|
66
|
+
"SDK lifecycle placement agent. Owns Clue SDK dependency, initialization, and ClueInit/ClueIdentify/ClueSetAccount/ClueLogout placement only.",
|
|
60
67
|
"clue-setup-audit":
|
|
61
68
|
"Read-only monitoring agent. Owns P0/P1 review for one completed workstream at a time. It must not edit files.",
|
|
62
69
|
"clue-local-verification":
|
|
63
|
-
"Read-only verification agent. Owns setup
|
|
70
|
+
"Read-only verification agent. Owns static setup checks, dependency/import/startup evidence, and user verification handoff. It must not edit files or run setup-watch automatically.",
|
|
64
71
|
"clue-setup-report":
|
|
65
72
|
"Final reporting agent. Owns concise completion evidence only after execution and monitoring gates pass.",
|
|
66
73
|
};
|
|
@@ -68,7 +75,7 @@ const skillBody = (name) => {
|
|
|
68
75
|
const owns = {
|
|
69
76
|
"clue-setup-orchestrator": [
|
|
70
77
|
"read `.clue/setup-manifest.json` first",
|
|
71
|
-
"assign exactly one
|
|
78
|
+
"assign exactly one implementation agent for SDK lifecycle placement",
|
|
72
79
|
"assign multiple read-only monitoring agents",
|
|
73
80
|
"stop on manifest blockers or P0/P1 findings",
|
|
74
81
|
],
|
|
@@ -98,7 +105,7 @@ const skillBody = (name) => {
|
|
|
98
105
|
],
|
|
99
106
|
"clue-local-verification": [
|
|
100
107
|
"`setup-check` evidence",
|
|
101
|
-
"`setup-watch --local` readiness",
|
|
108
|
+
"user-operated `setup-watch --local` handoff readiness",
|
|
102
109
|
"local URL confirmation without assuming ports",
|
|
103
110
|
],
|
|
104
111
|
"clue-setup-report": [
|
|
@@ -139,7 +146,8 @@ const skillBody = (name) => {
|
|
|
139
146
|
"clue-local-verification": [
|
|
140
147
|
"make edits",
|
|
141
148
|
"assume localhost ports",
|
|
142
|
-
"
|
|
149
|
+
"run `setup-watch --local` automatically during implementation",
|
|
150
|
+
"treat user-operated setup-watch or setup-screen event delivery as complete without user-provided evidence",
|
|
143
151
|
],
|
|
144
152
|
"clue-setup-report": [
|
|
145
153
|
"claim complete with unverified workstreams",
|
|
@@ -159,7 +167,7 @@ const skillBody = (name) => {
|
|
|
159
167
|
],
|
|
160
168
|
"clue-semantic-gen": [
|
|
161
169
|
"CI workflow verification result",
|
|
162
|
-
"
|
|
170
|
+
"blocker details when generated CI is missing or stale",
|
|
163
171
|
],
|
|
164
172
|
"clue-sdk-instrumentation": [
|
|
165
173
|
"implemented lifecycle locations",
|
|
@@ -171,7 +179,8 @@ const skillBody = (name) => {
|
|
|
171
179
|
"approval or blocked status for the reviewed workstream",
|
|
172
180
|
],
|
|
173
181
|
"clue-local-verification": [
|
|
174
|
-
"setup-check/
|
|
182
|
+
"setup-check, dependency/import/startup command evidence",
|
|
183
|
+
"user-operated setup-watch/setup-screen handoff status",
|
|
175
184
|
"passed, blocked, or cannot-run status with reasons",
|
|
176
185
|
],
|
|
177
186
|
"clue-setup-report": [
|
|
@@ -181,18 +190,22 @@ const skillBody = (name) => {
|
|
|
181
190
|
|
|
182
191
|
const steps = {
|
|
183
192
|
"clue-setup-orchestrator": [
|
|
184
|
-
"Use one
|
|
185
|
-
"
|
|
186
|
-
"Required
|
|
193
|
+
"Use one implementation agent for SDK lifecycle placement.",
|
|
194
|
+
"That implementation agent owns only ClueInit, ClueIdentify, ClueSetAccount, and ClueLogout placement plus minimal SDK wiring.",
|
|
195
|
+
"Required implementation agent: SDK Lifecycle Placement Agent only.",
|
|
196
|
+
"The AI implementation task is only to decide where ClueInit, ClueIdentify, ClueSetAccount, and ClueLogout belong in existing code and apply the minimal SDK wiring for those calls.",
|
|
187
197
|
"Run execution agents in parallel only when file ownership does not conflict; otherwise run them sequentially with monitor gates between workstreams.",
|
|
188
198
|
"Use multiple monitoring agents for read-only checks, or named review passes if subagents are unavailable.",
|
|
189
|
-
|
|
199
|
+
`The initial \`${clueCliCommand("setup --clue-api-key <key> --clue-api-base-url <url> --project-key <key> --environment <environment>")}\` command already performs repository discovery, semantic CI workflow generation, setup manifest generation, and writes service-specific environment guidance to \`.env.clue\` when backend routes can be detected.`,
|
|
190
200
|
"Before implementation, read `.clue/setup-manifest.json` and treat it as the mechanical setup source of truth.",
|
|
201
|
+
"Read `.clue/setup-manifest.json` `cli_invocation` before running any Clue CLI subcommand.",
|
|
202
|
+
`Before editing a customer repository, run \`${clueCliCommand("help --json")}\` and follow its setup_execution_contract.`,
|
|
191
203
|
"Use the service keys and watch targets from `.clue/setup-manifest.json`; do not invent service keys.",
|
|
192
204
|
"If `.clue/setup-manifest.json` has status `blocked`, stop and report its blockers instead of guessing.",
|
|
193
|
-
"Treat
|
|
194
|
-
"
|
|
195
|
-
"
|
|
205
|
+
"Treat semantic snapshot readiness and semantic CI as generated/static verification surfaces, not AI implementation workstreams.",
|
|
206
|
+
"Do not implement or refresh semantic snapshot CI during lifecycle placement; report a blocker if generated semantic artifacts are missing or stale.",
|
|
207
|
+
"Before lifecycle placement, read and apply `clue-sdk-instrumentation`.",
|
|
208
|
+
"After lifecycle placement, run a monitoring check with `clue-setup-audit` before continuing.",
|
|
196
209
|
"For final local verification, read and apply `clue-local-verification`.",
|
|
197
210
|
"For the final report, read and apply `clue-setup-report`.",
|
|
198
211
|
"Do not continue past P0/P1 monitoring findings until fixed or reported as blocked.",
|
|
@@ -203,12 +216,12 @@ const skillBody = (name) => {
|
|
|
203
216
|
"Do not create or commit `.clue/semantic-request.runtime.json`; the semantic CI request must be passed through the generated workflow environment instead of a repository file.",
|
|
204
217
|
"Keep route coverage/readiness checks separate from CI workflow creation and SDK lifecycle implementation.",
|
|
205
218
|
"Do not create CI workflow files or SDK lifecycle calls from this skill.",
|
|
206
|
-
|
|
207
|
-
|
|
219
|
+
`Do not create or commit \`.clue/semantic-routes.json\`; route inventory is dynamic and must be recomputed mechanically by \`${clueCliCommand("semantic-inventory")}\`, \`${clueCliCommand("setup-check")}\`, or \`${clueCliCommand("semantic-gen")}\`.`,
|
|
220
|
+
`If route inventory must be inspected locally, run \`${clueCliCommand("semantic-inventory --framework <framework> --backend-root-path <path> --repo .")}\` and review stdout instead of writing a repo file.`,
|
|
208
221
|
"Inspect only allowed source paths.",
|
|
209
222
|
"Identify the backend framework, backend root path, route files, controllers, handlers, and route declaration patterns from privacy-safe evidence.",
|
|
210
|
-
|
|
211
|
-
"If
|
|
223
|
+
`Run \`${clueCliCommand("semantic-inventory --framework <framework> --backend-root-path <path> --repo .")}\` whenever possible to verify route discovery without AI or secrets.`,
|
|
224
|
+
"If npm/npx cannot fetch the Clue CLI package, report a blocker with the exact command and error instead of searching for another CLI path.",
|
|
212
225
|
"Verify that every API route can be discovered from the selected backend root path and that unsupported frameworks are reported as blockers.",
|
|
213
226
|
"The semantic snapshot CI command must mechanically enumerate operation_source_key, method, path_template, route fingerprints, and privacy-safe evidence before AI interpretation.",
|
|
214
227
|
"AI interpretation may summarize each mechanically discovered route, but it must not create missing routes or operation_source_key values.",
|
|
@@ -222,10 +235,10 @@ const skillBody = (name) => {
|
|
|
222
235
|
"Use this skill as the source of truth for semantic snapshot CI workflow format.",
|
|
223
236
|
"Keep CI workflow creation separate from route coverage/readiness checks and SDK lifecycle implementation.",
|
|
224
237
|
"Do not author semantic snapshot content, runtime request files, or SDK lifecycle calls from this skill.",
|
|
225
|
-
|
|
226
|
-
"
|
|
227
|
-
"If
|
|
228
|
-
|
|
238
|
+
`Treat \`.github/workflows/clue-semantic-snapshot.yml\` as a machine-owned artifact generated by \`${clueCliCommand("setup")}\`; do not hand-edit it.`,
|
|
239
|
+
"During lifecycle placement, do not create, refresh, or hand-edit `.github/workflows/clue-semantic-snapshot.yml`; report a blocker if the generated workflow is missing or stale.",
|
|
240
|
+
"If npm/npx cannot fetch the Clue CLI package, report a blocker with the exact command and error instead of hand-writing the workflow.",
|
|
241
|
+
`The workflow must pass \`CLUE_SEMANTIC_REQUEST_JSON\` through the workflow environment and then call \`${clueCliCommand("semantic-gen --request-env CLUE_SEMANTIC_REQUEST_JSON --repo .")}\`.`,
|
|
229
242
|
"Do not create, commit, or stage `.clue/semantic-request.runtime.json` in the customer repository.",
|
|
230
243
|
"The workflow must not send GitHub actor, triggering_actor, sender, repository owner, repository name, or default branch to Clue.",
|
|
231
244
|
"The workflow should send only repository id, commit sha, workflow run id, project key variable, service key, framework, source path allowlist, source path denylist, and Clue API base URL variable.",
|
|
@@ -238,23 +251,30 @@ const skillBody = (name) => {
|
|
|
238
251
|
],
|
|
239
252
|
"clue-sdk-instrumentation": [
|
|
240
253
|
"Use this skill as the source of truth for Clue SDK lifecycle implementation.",
|
|
254
|
+
"The implementation scope is only ClueInit, ClueIdentify, ClueSetAccount, and ClueLogout placement in existing lifecycle boundaries.",
|
|
241
255
|
"Keep SDK lifecycle implementation separate from semantic snapshot and CI workflow work.",
|
|
242
256
|
"Do not create semantic snapshot content or semantic snapshot CI workflow files from this skill.",
|
|
243
257
|
"Do not create no-op wrappers around nonexistent `window.Clue*` globals or local placeholder functions.",
|
|
244
258
|
"Lifecycle calls must resolve to real Clue SDK imports or a real repository adapter that forwards to the Clue SDK.",
|
|
245
|
-
"
|
|
259
|
+
"Official Clue SDK public lifecycle APIs are no-throw and own SDK failure isolation.",
|
|
260
|
+
"Do not add per-call try/catch, try/except, `.catch`, or custom safe wrappers solely around official Clue SDK public lifecycle calls.",
|
|
246
261
|
"Never await a Clue lifecycle call in a way that can block login, logout, account selection, request handling, page rendering, or API responses.",
|
|
247
262
|
"Add or report the required SDK dependency instead of fabricating lifecycle APIs.",
|
|
248
|
-
"
|
|
249
|
-
|
|
263
|
+
"For frontend code, add the real `@clue-ai/browser-sdk` dependency when missing. Do not invent `clue-js-sdk`, `@clue/browser-sdk`, local placeholder modules, or dynamic imports that hide a missing SDK.",
|
|
264
|
+
`When lifecycle edits are clear, write an exact replacement plan to a temporary local JSON file and apply it with \`${clueCliCommand("lifecycle-apply --plan <plan-file> --repo .")}\`.`,
|
|
265
|
+
"If npm/npx cannot fetch the Clue CLI package, report a blocker with the exact command and error instead of manually applying replacement plans.",
|
|
250
266
|
"Delete the temporary lifecycle plan file after applying it unless the user explicitly asks to keep it for review.",
|
|
251
267
|
"Use environment variable names for Clue configuration values; do not paste project keys or API keys into code.",
|
|
252
|
-
|
|
253
|
-
"For browser code, use `CLUE_PROJECT_KEY`, `CLUE_ENVIRONMENT`, and `CLUE_INGEST_ENDPOINT`. Let the target framework expose or inject those values safely without hard-coding a Next.js-only prefix.",
|
|
268
|
+
`For local env files, use the service-specific env blocks written to \`.env.clue\` by \`${clueCliCommand("setup")}\`; do not ask the user to guess \`CLUE_SERVICE_KEY\`.`,
|
|
269
|
+
"For browser code, use `CLUE_PROJECT_KEY`, `CLUE_ENVIRONMENT`, `CLUE_SERVICE_KEY`, and `CLUE_INGEST_ENDPOINT`. Let the target framework expose or inject those values safely without hard-coding a Next.js-only prefix.",
|
|
270
|
+
"Never put `CLUE_API_KEY` in frontend code, frontend env files, browser bundles, or client-readable config.",
|
|
271
|
+
"When browser SDK ingest is configured, implement a backend-owned browser token endpoint that reads server-side `CLUE_API_KEY` and requests `POST /api/v1/ingest/browser-tokens` from Clue.",
|
|
272
|
+
"Configure frontend `ClueInit` with `browserTokenProvider` that calls the local backend token endpoint and returns the token string.",
|
|
273
|
+
"The browser token request must include project key, environment, service key, and the current browser origin; the backend must attach `x-clue-api-key` server-side when calling Clue.",
|
|
254
274
|
"For FastAPI code, add `clue-fastapi-sdk` to the backend dependency file when missing, import `clue_init_fastapi` plus `ClueIdentify`, `ClueSetAccount`, and `ClueLogout` where needed, and use `CLUE_PROJECT_KEY`, `CLUE_ENVIRONMENT`, `CLUE_API_KEY`, and `CLUE_INGEST_ENDPOINT`.",
|
|
255
275
|
"Use `CLUE_SERVICE_KEY` as the canonical local service identifier. Do not ask the user to manage a separate producer id; SDKs should send producer id as the service key for setup verification compatibility.",
|
|
256
276
|
"For frontend code, pass `serviceKey` from `CLUE_SERVICE_KEY` to `ClueInit`. Do not require a separate producer id unless the repository already has one for compatibility.",
|
|
257
|
-
"For Django code,
|
|
277
|
+
"For Django code, use `clue-django-sdk` only after package-manager or registry verification confirms it is installable; if it is not published or cannot be verified, report a blocker instead of adding a guessed dependency or import.",
|
|
258
278
|
"For other backend frameworks, use the matching Clue backend SDK if one exists; if no backend SDK exists, report a blocker instead of silently frontend-only setup.",
|
|
259
279
|
"Do not send raw email, raw person names, tokens, workspace names, organization names, or tenant names as lifecycle traits unless the repository already has an explicit Clue privacy policy allowing them.",
|
|
260
280
|
"Prefer stable ids and non-PII booleans/counts for ClueIdentify and ClueSetAccount traits.",
|
|
@@ -272,16 +292,20 @@ const skillBody = (name) => {
|
|
|
272
292
|
"Review changed files line by line.",
|
|
273
293
|
"Verify semantic snapshot, semantic CI, and SDK lifecycle responsibilities did not bleed into each other.",
|
|
274
294
|
"Reject hand-authored semantic snapshot content and runtime request files.",
|
|
275
|
-
|
|
295
|
+
`Reject semantic CI workflows that were not generated by or equivalent to \`${clueCliCommand("semantic-workflow")}\`.`,
|
|
276
296
|
"Reject semantic CI workflows that send GitHub actor, triggering_actor, sender, repository owner, repository name, or default branch to Clue.",
|
|
277
297
|
"Reject no-op lifecycle wrappers or lifecycle calls that do not resolve to a real Clue SDK import.",
|
|
298
|
+
"Reject wrong SDK package names. Frontend must use `@clue-ai/browser-sdk`; FastAPI must use `clue-fastapi-sdk`; Django must use `clue-django-sdk`.",
|
|
299
|
+
"Reject Django SDK setup when `clue-django-sdk` installability has not been verified.",
|
|
278
300
|
"Reject backend setup when backend routes exist but no backend Clue SDK dependency/import/init was added.",
|
|
279
|
-
"Reject lifecycle calls that
|
|
301
|
+
"Reject awaited lifecycle calls that can block host service behavior.",
|
|
280
302
|
"Reject setup that covers only one login path when multiple login success paths are clearly present.",
|
|
281
303
|
"Reject ClueInit inside React component lifecycle hooks, page components, sidebars, login/register success callbacks, or any repeated user interaction path.",
|
|
282
304
|
"Reject broad ClueTrack instrumentation and DOM clue tags.",
|
|
305
|
+
"Reject ClueTrack instrumentation unless the user explicitly requested product event tracking.",
|
|
283
306
|
"Confirm no project key, API key, secret, or env value appears in diff or report.",
|
|
284
307
|
"Confirm lifecycle insertions are minimal and reviewable.",
|
|
308
|
+
"Reject unrelated refactors, renames, file moves, formatting churn, broad cleanup, business logic rewrites, auth/session rewrites beyond minimal Clue hook insertion, and UI changes unrelated to Clue setup.",
|
|
285
309
|
],
|
|
286
310
|
"clue-local-verification": [
|
|
287
311
|
"Act as a read-only monitoring agent for local verification evidence.",
|
|
@@ -289,19 +313,28 @@ const skillBody = (name) => {
|
|
|
289
313
|
"Confirm generated skill files exist.",
|
|
290
314
|
"Confirm workflow files and SDK lifecycle imports/calls exist when those phases have run.",
|
|
291
315
|
"Confirm backend routes have a backend Clue SDK dependency/import/init when a backend exists.",
|
|
292
|
-
"Confirm
|
|
316
|
+
"Confirm install/import readiness separately from static lifecycle checks. `setup-check --require-sdk-lifecycle` is a static source check only and does not prove that npm/pip install, imports, app startup, or event delivery work.",
|
|
317
|
+
"Verify frontend SDK installability/import when frontend lifecycle code was added. Run the repository's package-manager install command when possible, then run a package-manager-level import/build/typecheck command. If this cannot run, report `blocked` or `partially complete`; do not call setup complete.",
|
|
318
|
+
'Verify backend SDK installability/import when backend lifecycle code was added. Run the repository\'s Python dependency install command when possible, then run an import check such as `python -c "import clue_fastapi_sdk"` or `python -c "import clue_django_sdk"` in the target environment. If this cannot run, report `blocked` or `partially complete`; do not call setup complete.',
|
|
319
|
+
`Confirm \`.github/workflows/clue-semantic-snapshot.yml\` calls \`${clueCliCommand("semantic-gen --request-env CLUE_SEMANTIC_REQUEST_JSON --repo .")}\`.`,
|
|
293
320
|
"Confirm the semantic workflow does not send GitHub actor, triggering_actor, sender, repository owner, repository name, or default branch to Clue.",
|
|
294
321
|
"Confirm `.clue/semantic-request.runtime.json` is not created, committed, or staged.",
|
|
295
|
-
|
|
296
|
-
|
|
322
|
+
`Run \`${clueCliCommand("setup-check --framework <framework> --backend-root-path <path> --repo . --target <codex|claude_code> --require-sdk-lifecycle")}\` when possible.`,
|
|
323
|
+
`Do not run \`${clueCliCommand("setup-watch --local")}\` automatically. setup-watch requires the user to operate real local frontend/backend services and login/logout/account flows.`,
|
|
324
|
+
"If the user has not provided setup-watch or setup-screen evidence, report event delivery verification as `user_verification_pending` and do not state `setup completed`.",
|
|
325
|
+
"Local static verification passed does not mean setup complete unless dependency install, SDK imports, app startup, and user-provided setup-watch or setup-screen event delivery were all verified.",
|
|
297
326
|
"Only include lifecycle checks that the implementation ownership plan expects for that service. If a service emits an undeclared lifecycle event, treat it as a possible duplicate instrumentation issue.",
|
|
298
327
|
"Never assume localhost ports. Ask the repository scripts, env examples, or the running service output for the actual frontend/backend URLs.",
|
|
299
|
-
"If
|
|
328
|
+
"If npm/npx cannot fetch the Clue CLI package, report a blocker with the exact command and error instead of searching for another CLI path.",
|
|
300
329
|
"Confirm only env names are reported.",
|
|
301
|
-
"Leave event delivery verification to the Clue setup screen.",
|
|
330
|
+
"Leave event delivery verification to the user-operated Clue setup screen or user-operated setup-watch.",
|
|
302
331
|
],
|
|
303
332
|
"clue-setup-report": [
|
|
304
333
|
"Use this skill only after execution and monitoring passes are finished.",
|
|
334
|
+
"Never claim `setup completed` from `setup-check --require-sdk-lifecycle` alone. That check is static and does not verify dependency installation, imports, app startup, or event delivery.",
|
|
335
|
+
"Completion requires all applicable evidence: SDK dependencies install successfully, SDK imports work in the target frontend/backend environments, the app starts, `setup-check --require-sdk-lifecycle` passes, and user-provided `setup-watch --local` or Clue setup screen evidence confirms expected event delivery.",
|
|
336
|
+
"If any SDK package is unpublished, install/import checks were not run, app startup was not verified, or user-operated setup-watch/setup-screen evidence was not provided, the final status must be `blocked`, `partially complete`, or `user_verification_pending`; it must not be `complete`.",
|
|
337
|
+
"For every completion claim, include the evidence source: command, exit status, output summary, file path, runtime URL, user-provided setup-watch result, or user-provided setup-screen result.",
|
|
305
338
|
"Summarize changed files.",
|
|
306
339
|
"List completed setup phases.",
|
|
307
340
|
"List skills used for each workstream.",
|
|
@@ -317,6 +350,7 @@ const skillBody = (name) => {
|
|
|
317
350
|
"---",
|
|
318
351
|
`name: ${name}`,
|
|
319
352
|
`description: ${descriptions[name]}`,
|
|
353
|
+
`setup_skill_version: ${SETUP_SKILL_CONTENT_VERSION}`,
|
|
320
354
|
"---",
|
|
321
355
|
"",
|
|
322
356
|
"# Agent Role",
|
|
@@ -337,9 +371,20 @@ const skillBody = (name) => {
|
|
|
337
371
|
"",
|
|
338
372
|
"# Shared Rules",
|
|
339
373
|
"",
|
|
340
|
-
"- For full Clue setup, use one
|
|
374
|
+
"- For full Clue setup, use one SDK lifecycle placement implementation agent and multiple monitoring agents for read-only checks.",
|
|
375
|
+
`- Clue CLI public npm package: \`${CLUE_CLI_PACKAGE_NAME}\`.`,
|
|
376
|
+
`- Clue CLI binary name exposed by that package: \`${CLUE_CLI_BINARY_NAME}\`; a global \`${CLUE_CLI_BINARY_NAME}\` install is not required.`,
|
|
377
|
+
`- Use \`${CLUE_CLI_RECOMMENDED_PREFIX} <command>\` for Clue CLI commands unless \`.clue/setup-manifest.json\` explicitly provides a different invocation.`,
|
|
378
|
+
`- If checking Clue CLI availability, run \`${CLUE_CLI_RECOMMENDED_PREFIX} --version\` or \`${CLUE_CLI_RECOMMENDED_PREFIX} --help\` and report the exact fetch/runtime error if it fails.`,
|
|
379
|
+
`- Before editing a customer repository, run \`${clueCliCommand("help --json")}\` and follow its setup_execution_contract.`,
|
|
380
|
+
`- Do not search for a global \`${CLUE_CLI_BINARY_NAME}\` binary or block on \`which ${CLUE_CLI_BINARY_NAME}\`; missing global binary is normal.`,
|
|
381
|
+
"- The AI implementation task is only to decide where ClueInit, ClueIdentify, ClueSetAccount, and ClueLogout belong in existing code and apply the minimal SDK wiring for those calls.",
|
|
382
|
+
"- Only changes required to place ClueInit, ClueIdentify, ClueSetAccount, and ClueLogout are allowed. Do not perform ClueTrack instrumentation unless the user explicitly requested product event tracking.",
|
|
383
|
+
"- Do not perform unrelated refactors, renames, file moves, formatting churn, broad cleanup, business logic rewrites, auth/session rewrites beyond minimal Clue hook insertion, UI changes unrelated to Clue setup, or unrelated dependency upgrades.",
|
|
384
|
+
"- Do not implement or refresh semantic snapshot CI during lifecycle placement; report a blocker if generated semantic artifacts are missing or stale.",
|
|
385
|
+
`- Do not run \`${clueCliCommand("setup-watch --local")}\` automatically. setup-watch and the Clue setup screen are user-operated verification steps, not implementation-agent responsibility.`,
|
|
341
386
|
"- The full setup must start with `clue-setup-orchestrator`.",
|
|
342
|
-
"-
|
|
387
|
+
"- The implementation agent owns only lifecycle placement; monitoring agents review one surface at a time and report P0/P1 issues.",
|
|
343
388
|
"- Do not continue past a P0/P1 monitoring finding until it is fixed or explicitly reported as blocked.",
|
|
344
389
|
"- If subagents are unavailable, run the same structure as separate named review passes and say so in the final report.",
|
|
345
390
|
"- Do not expose project keys, API keys, secrets, tokens, or environment variable values.",
|
|
@@ -347,6 +392,7 @@ const skillBody = (name) => {
|
|
|
347
392
|
"- Do not read `.env`, `.env.*`, secret files, logs, dumps, build output, coverage output, `node_modules`, vendor directories, dependency directories, or dependency output.",
|
|
348
393
|
"- Report only environment variable names, never values.",
|
|
349
394
|
"- Do not commit or push changes.",
|
|
395
|
+
"- Execution agents must not approve, certify, or mark their own work complete. Completion evidence must come from independent monitoring passes, command output, runtime checks, or user-provided setup-watch/setup-screen evidence.",
|
|
350
396
|
"- Prefer existing repository patterns and minimal diffs.",
|
|
351
397
|
"- If evidence is unclear, report a blocker instead of guessing.",
|
|
352
398
|
"- Do not merge semantic snapshot, semantic CI, SDK lifecycle, audit, verification, and report responsibilities into one undifferentiated task.",
|