codeloop 0.1.17 → 0.1.20
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/LICENSE +21 -0
- package/README.md +76 -0
- package/dist/commands/doctor.d.ts +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +213 -10
- package/dist/commands/doctor.js.map +1 -1
- package/dist/index.js +28 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/geo-doctor.d.ts +36 -0
- package/dist/lib/geo-doctor.d.ts.map +1 -0
- package/dist/lib/geo-doctor.js +96 -0
- package/dist/lib/geo-doctor.js.map +1 -0
- package/dist/lib/stripe-doctor.d.ts +21 -0
- package/dist/lib/stripe-doctor.d.ts.map +1 -0
- package/dist/lib/stripe-doctor.js +54 -0
- package/dist/lib/stripe-doctor.js.map +1 -0
- package/dist/lib/tier-b-evidence.d.ts +26 -0
- package/dist/lib/tier-b-evidence.d.ts.map +1 -0
- package/dist/lib/tier-b-evidence.js +92 -0
- package/dist/lib/tier-b-evidence.js.map +1 -0
- package/dist/templates/claude-agents.d.ts +1 -4
- package/dist/templates/claude-agents.d.ts.map +1 -1
- package/dist/templates/claude-agents.js +1 -341
- package/dist/templates/claude-agents.js.map +1 -1
- package/dist/templates/claude-prompts.d.ts +1 -3
- package/dist/templates/claude-prompts.d.ts.map +1 -1
- package/dist/templates/claude-prompts.js +1 -44
- package/dist/templates/claude-prompts.js.map +1 -1
- package/dist/templates/config.d.ts +1 -1
- package/dist/templates/config.d.ts.map +1 -1
- package/dist/templates/config.js +1 -31
- package/dist/templates/config.js.map +1 -1
- package/dist/templates/cursor-rules.d.ts +1 -7
- package/dist/templates/cursor-rules.d.ts.map +1 -1
- package/dist/templates/cursor-rules.js +1 -684
- package/dist/templates/cursor-rules.js.map +1 -1
- package/dist/templates/cursor-skills.d.ts +1 -4
- package/dist/templates/cursor-skills.d.ts.map +1 -1
- package/dist/templates/cursor-skills.js +1 -156
- package/dist/templates/cursor-skills.js.map +1 -1
- package/dist/templates/global-rules.d.ts +1 -37
- package/dist/templates/global-rules.d.ts.map +1 -1
- package/dist/templates/global-rules.js +1 -164
- package/dist/templates/global-rules.js.map +1 -1
- package/dist/templates/mcp-config.d.ts +1 -31
- package/dist/templates/mcp-config.d.ts.map +1 -1
- package/dist/templates/mcp-config.js +1 -68
- package/dist/templates/mcp-config.js.map +1 -1
- package/dist/templates/specs.d.ts +1 -3
- package/dist/templates/specs.d.ts.map +1 -1
- package/dist/templates/specs.js +1 -67
- package/dist/templates/specs.js.map +1 -1
- package/package.json +26 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geo-doctor.js","sourceRoot":"","sources":["../../src/lib/geo-doctor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAsBH,MAAM,YAAY,GAAG,uBAAuB,CAAC;AAC7C,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAEjC,uEAAuE;AACvE,mDAAmD;AACnD,MAAM,MAAM,GAAgE;IAC1E,EAAE,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,wBAAwB,EAAE;IAChF,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE;IAChE,EAAE,IAAI,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,sBAAsB,EAAE;IAChF,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE;IAC9E,EAAE,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,qBAAqB,EAAE;IAChF,EAAE,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,gBAAgB,EAAE;IAC3E,EAAE,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EA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MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC;IAClD,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC;IAErD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,QAAgB,EAAE,IAAY;IACpD,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC5E,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type StripeMode = "live" | "test" | "unconfigured";
|
|
2
|
+
export interface StripeDoctorInput {
|
|
3
|
+
stripe_mode: StripeMode;
|
|
4
|
+
key_prefix: string | null;
|
|
5
|
+
webhook_signing_secret_present: boolean;
|
|
6
|
+
prices: Record<string, {
|
|
7
|
+
configured: boolean;
|
|
8
|
+
reachable: boolean | null;
|
|
9
|
+
}>;
|
|
10
|
+
last_event_at: string | null;
|
|
11
|
+
last_event_type: string | null;
|
|
12
|
+
idempotency_cache_size: number;
|
|
13
|
+
}
|
|
14
|
+
export interface StripeDoctorOutput {
|
|
15
|
+
/** "ok" — all green, "warn" — non-fatal anomalies, "error" — live mode without webhook secret etc. */
|
|
16
|
+
severity: "ok" | "warn" | "error";
|
|
17
|
+
lines: string[];
|
|
18
|
+
remediation: string[];
|
|
19
|
+
}
|
|
20
|
+
export declare function summariseStripeHealth(input: StripeDoctorInput): StripeDoctorOutput;
|
|
21
|
+
//# sourceMappingURL=stripe-doctor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripe-doctor.d.ts","sourceRoot":"","sources":["../../src/lib/stripe-doctor.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,cAAc,CAAC;AAE1D,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,UAAU,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,8BAA8B,EAAE,OAAO,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,OAAO,CAAC;QAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IAC3E,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,sBAAsB,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,kBAAkB;IACjC,sGAAsG;IACtG,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,OAAO,CAAC;IAClC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAYD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,iBAAiB,GACvB,kBAAkB,CAsEpB"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// packages/cli/src/lib/stripe-doctor.ts
|
|
2
|
+
//
|
|
3
|
+
// Phase A7 — Pure helper that turns a /v1/billing/health response into
|
|
4
|
+
// the lines the `codeloop doctor` CLI prints. Extracted from doctor.ts so
|
|
5
|
+
// it can be unit-tested without spinning up a backend.
|
|
6
|
+
const PRICE_LABELS = {
|
|
7
|
+
STRIPE_PRICE_SOLO: "Solo (mo)",
|
|
8
|
+
STRIPE_PRICE_TEAM: "Team (mo)",
|
|
9
|
+
STRIPE_PRICE_ENTERPRISE: "Enterprise (mo)",
|
|
10
|
+
STRIPE_PRICE_SOLO_ANNUAL: "Solo (yr)",
|
|
11
|
+
STRIPE_PRICE_TEAM_ANNUAL: "Team (yr)",
|
|
12
|
+
STRIPE_PRICE_ENTERPRISE_ANNUAL: "Enterprise (yr)",
|
|
13
|
+
STRIPE_LIFETIME_PRICE_ID: "Lifetime",
|
|
14
|
+
};
|
|
15
|
+
export function summariseStripeHealth(input) {
|
|
16
|
+
const lines = [];
|
|
17
|
+
const remediation = [];
|
|
18
|
+
let severity = "ok";
|
|
19
|
+
lines.push(`Stripe mode: ${input.stripe_mode.toUpperCase()}${input.key_prefix ? ` (${input.key_prefix}…)` : ""}`);
|
|
20
|
+
if (input.stripe_mode === "unconfigured") {
|
|
21
|
+
severity = "error";
|
|
22
|
+
remediation.push("Set STRIPE_SECRET_KEY in the backend environment (test or live).");
|
|
23
|
+
}
|
|
24
|
+
lines.push(`Webhook signing secret: ${input.webhook_signing_secret_present ? "present" : "MISSING"}`);
|
|
25
|
+
if (!input.webhook_signing_secret_present) {
|
|
26
|
+
severity = severity === "error" ? "error" : "error";
|
|
27
|
+
remediation.push("Set STRIPE_WEBHOOK_SECRET — without it /v1/billing/webhook will reject every delivery.");
|
|
28
|
+
}
|
|
29
|
+
const missing = Object.entries(input.prices).filter(([, v]) => !v.configured);
|
|
30
|
+
const unreachable = Object.entries(input.prices).filter(([, v]) => v.reachable === false);
|
|
31
|
+
if (missing.length === 0) {
|
|
32
|
+
lines.push("All price IDs configured");
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
severity = severity === "error" ? "error" : input.stripe_mode === "live" ? "error" : "warn";
|
|
36
|
+
lines.push(`${missing.length} price ID(s) not configured: ${missing
|
|
37
|
+
.map(([k]) => PRICE_LABELS[k] ?? k)
|
|
38
|
+
.join(", ")}`);
|
|
39
|
+
remediation.push("Run scripts/stripe-live-bootstrap.sh --apply to provision them idempotently.");
|
|
40
|
+
}
|
|
41
|
+
if (unreachable.length > 0) {
|
|
42
|
+
severity = "error";
|
|
43
|
+
lines.push(`${unreachable.length} configured price(s) DO NOT resolve in Stripe: ${unreachable
|
|
44
|
+
.map(([k]) => PRICE_LABELS[k] ?? k)
|
|
45
|
+
.join(", ")}`);
|
|
46
|
+
remediation.push("Re-run scripts/stripe-live-preflight.sh to identify the broken price IDs.");
|
|
47
|
+
}
|
|
48
|
+
lines.push(`Last webhook: ${input.last_event_at
|
|
49
|
+
? `${input.last_event_type} @ ${input.last_event_at}`
|
|
50
|
+
: "none received this process"}`);
|
|
51
|
+
lines.push(`Idempotency cache: ${input.idempotency_cache_size} entries`);
|
|
52
|
+
return { severity, lines, remediation };
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=stripe-doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripe-doctor.js","sourceRoot":"","sources":["../../src/lib/stripe-doctor.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,EAAE;AACF,uEAAuE;AACvE,0EAA0E;AAC1E,uDAAuD;AAqBvD,MAAM,YAAY,GAA2B;IAC3C,iBAAiB,EAAE,WAAW;IAC9B,iBAAiB,EAAE,WAAW;IAC9B,uBAAuB,EAAE,iBAAiB;IAC1C,wBAAwB,EAAE,WAAW;IACrC,wBAAwB,EAAE,WAAW;IACrC,8BAA8B,EAAE,iBAAiB;IACjD,wBAAwB,EAAE,UAAU;CACrC,CAAC;AAEF,MAAM,UAAU,qBAAqB,CACnC,KAAwB;IAExB,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,IAAI,QAAQ,GAAmC,IAAI,CAAC;IAEpD,KAAK,CAAC,IAAI,CACR,gBAAgB,KAAK,CAAC,WAAW,CAAC,WAAW,EAAE,GAC7C,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,UAAU,IAAI,CAAC,CAAC,CAAC,EACjD,EAAE,CACH,CAAC;IACF,IAAI,KAAK,CAAC,WAAW,KAAK,cAAc,EAAE,CAAC;QACzC,QAAQ,GAAG,OAAO,CAAC;QACnB,WAAW,CAAC,IAAI,CACd,kEAAkE,CACnE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,8EAA8E,CAC/E,CAAC;IACJ,CAAC;IACD,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,QAAQ,GAAG,OAAO,CAAC;QACnB,KAAK,CAAC,IAAI,CACR,GAAG,WAAW,CAAC,MAAM,kDAAkD,WAAW;aAC/E,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;aAClC,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAC;QACF,WAAW,CAAC,IAAI,CACd,2EAA2E,CAC5E,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,IAAI,CACR,iBACE,KAAK,CAAC,aAAa;QACjB,CAAC,CAAC,GAAG,KAAK,CAAC,eAAe,MAAM,KAAK,CAAC,aAAa,EAAE;QACrD,CAAC,CAAC,4BACN,EAAE,CACH,CAAC;IACF,KAAK,CAAC,IAAI,CAAC,sBAAsB,KAAK,CAAC,sBAAsB,UAAU,CAAC,CAAC;IAEzE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface TierBEvidenceRow {
|
|
2
|
+
rowId: string;
|
|
3
|
+
source: "tier-b" | "claude-code";
|
|
4
|
+
hasVideo: boolean;
|
|
5
|
+
hasMetadata: boolean;
|
|
6
|
+
capturedAt: string | null;
|
|
7
|
+
path: string;
|
|
8
|
+
}
|
|
9
|
+
export interface TierBEvidenceSummary {
|
|
10
|
+
rootDir: string;
|
|
11
|
+
exists: boolean;
|
|
12
|
+
rows: TierBEvidenceRow[];
|
|
13
|
+
}
|
|
14
|
+
export declare function scanTierBEvidence(rootDir?: string): TierBEvidenceSummary;
|
|
15
|
+
export interface TierBCoverage {
|
|
16
|
+
tierB: {
|
|
17
|
+
captured: string[];
|
|
18
|
+
missing: string[];
|
|
19
|
+
};
|
|
20
|
+
claudeCode: {
|
|
21
|
+
captured: string[];
|
|
22
|
+
missing: string[];
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare function summariseCoverage(summary: TierBEvidenceSummary): TierBCoverage;
|
|
26
|
+
//# sourceMappingURL=tier-b-evidence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tier-b-evidence.d.ts","sourceRoot":"","sources":["../../src/lib/tier-b-evidence.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,QAAQ,GAAG,aAAa,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,gBAAgB,EAAE,CAAC;CAC1B;AAoBD,wBAAgB,iBAAiB,CAC/B,OAAO,SAAoB,GAC1B,oBAAoB,CAiDtB;AAWD,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE;QACL,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC;IACF,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC;CACH;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,oBAAoB,GAAG,aAAa,CAuB9E"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
const TIER_B_ROW_RE = /^(2[0-9]\.[0-9]+)/;
|
|
4
|
+
function inferRowId(folderName) {
|
|
5
|
+
const m = folderName.match(TIER_B_ROW_RE);
|
|
6
|
+
return m ? m[1] : null;
|
|
7
|
+
}
|
|
8
|
+
function readMetadataTimestamp(path) {
|
|
9
|
+
try {
|
|
10
|
+
const obj = JSON.parse(readFileSync(path, "utf-8"));
|
|
11
|
+
return obj.captured_at ?? null;
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export function scanTierBEvidence(rootDir = "tier-b-evidence") {
|
|
18
|
+
const summary = {
|
|
19
|
+
rootDir,
|
|
20
|
+
exists: existsSync(rootDir),
|
|
21
|
+
rows: [],
|
|
22
|
+
};
|
|
23
|
+
if (!summary.exists)
|
|
24
|
+
return summary;
|
|
25
|
+
for (const entry of readdirSync(rootDir)) {
|
|
26
|
+
const full = join(rootDir, entry);
|
|
27
|
+
if (!statSync(full).isDirectory())
|
|
28
|
+
continue;
|
|
29
|
+
if (entry === "claude-code") {
|
|
30
|
+
for (const sub of readdirSync(full)) {
|
|
31
|
+
const subFull = join(full, sub);
|
|
32
|
+
if (!statSync(subFull).isDirectory())
|
|
33
|
+
continue;
|
|
34
|
+
const videoPath = join(subFull, "recording.mp4");
|
|
35
|
+
const metaPath = join(subFull, "metadata.json");
|
|
36
|
+
summary.rows.push({
|
|
37
|
+
rowId: sub,
|
|
38
|
+
source: "claude-code",
|
|
39
|
+
hasVideo: existsSync(videoPath) && statSync(videoPath).size > 0,
|
|
40
|
+
hasMetadata: existsSync(metaPath),
|
|
41
|
+
capturedAt: existsSync(metaPath) ? readMetadataTimestamp(metaPath) : null,
|
|
42
|
+
path: subFull,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
const rowId = inferRowId(entry);
|
|
48
|
+
if (!rowId)
|
|
49
|
+
continue;
|
|
50
|
+
const videoPath = join(full, "recording.mp4");
|
|
51
|
+
const metaPath = join(full, "metadata.json");
|
|
52
|
+
summary.rows.push({
|
|
53
|
+
rowId,
|
|
54
|
+
source: "tier-b",
|
|
55
|
+
hasVideo: existsSync(videoPath) && statSync(videoPath).size > 0,
|
|
56
|
+
hasMetadata: existsSync(metaPath),
|
|
57
|
+
capturedAt: existsSync(metaPath) ? readMetadataTimestamp(metaPath) : null,
|
|
58
|
+
path: full,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
summary.rows.sort((a, b) => {
|
|
62
|
+
if (a.source !== b.source)
|
|
63
|
+
return a.source.localeCompare(b.source);
|
|
64
|
+
return a.rowId.localeCompare(b.rowId);
|
|
65
|
+
});
|
|
66
|
+
return summary;
|
|
67
|
+
}
|
|
68
|
+
const TIER_B_EXPECTED_ROWS = ["24.6", "24.7", "24.8", "24.9", "24.12"];
|
|
69
|
+
const CLAUDE_EXPECTED_APPS = [
|
|
70
|
+
"nextjs-playwright",
|
|
71
|
+
"flutter-desktop",
|
|
72
|
+
"macos-swift",
|
|
73
|
+
"express-api",
|
|
74
|
+
"django-react",
|
|
75
|
+
];
|
|
76
|
+
export function summariseCoverage(summary) {
|
|
77
|
+
const tierBCaptured = new Set(summary.rows.filter((r) => r.source === "tier-b").map((r) => r.rowId));
|
|
78
|
+
const claudeRowIds = summary.rows
|
|
79
|
+
.filter((r) => r.source === "claude-code")
|
|
80
|
+
.map((r) => r.rowId);
|
|
81
|
+
return {
|
|
82
|
+
tierB: {
|
|
83
|
+
captured: TIER_B_EXPECTED_ROWS.filter((r) => tierBCaptured.has(r)),
|
|
84
|
+
missing: TIER_B_EXPECTED_ROWS.filter((r) => !tierBCaptured.has(r)),
|
|
85
|
+
},
|
|
86
|
+
claudeCode: {
|
|
87
|
+
captured: CLAUDE_EXPECTED_APPS.filter((app) => claudeRowIds.some((id) => id === app || id.startsWith(`${app}-`))),
|
|
88
|
+
missing: CLAUDE_EXPECTED_APPS.filter((app) => !claudeRowIds.some((id) => id === app || id.startsWith(`${app}-`))),
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
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L,KAAK,EAAE;YACL,QAAQ,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAClE,OAAO,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACnE;QACD,UAAU,EAAE;YACV,QAAQ,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAC5C,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAClE;YACD,OAAO,EAAE,oBAAoB,CAAC,MAAM,CAClC,CAAC,GAAG,EAAE,EAAE,CACN,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CACrE;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare const CODELOOP_QA_MD = "You are a QA verification specialist. Run CodeLoop visual review,\nvideo capture, and design comparison. Report structured issues with severity,\nevidence, and fix hints.\n\nFor UI projects, you MUST always perform ALL three:\n1. Screenshot review (codeloop_capture_screenshot for every page + codeloop_visual_review) \u2014 static per-page correctness\n2. Video capture review \u2014 codeloop_start_recording \u2192 use codeloop_interact to interact with EVERY\n element on every page (click, type, fill forms, test auth, validate errors, scroll, hover, drag)\n \u2192 codeloop_stop_recording \u2192 codeloop_interaction_replay \u2014 dynamic flow, transitions, animations\n3. Development log generation \u2014 codeloop_generate_dev_report \u2192 docs/DEVELOPMENT_LOG.md\n\nThe video MUST show the app changing state through active interaction using codeloop_interact.\nA recording of a static page is NOT valid evidence. The gate_check will REJECT static videos.\n\nUse codeloop_interact for ALL interactions \u2014 do NOT use raw osascript/PowerShell/xdotool.\ncodeloop_interact works on all platforms: macOS, Windows, Linux, browser (Playwright),\nAndroid emulator (adb), iOS Simulator (simctl), and supports Maestro flow generation.\n\nCRITICAL \u2014 WINDOW FOCUS (especially on single-monitor setups):\n- codeloop_capture_screenshot: ALWAYS pass app_name so the app is brought to front for capture\n- codeloop_start_recording: ALWAYS pass app_name (required) \u2014 brings app to front\n- codeloop_interact: AUTOMATICALLY brings the app to front before each interaction \u2014 this ensures\n interactions always hit the app window, NOT the IDE, even when the IDE regains focus between calls\n- codeloop_stop_recording: AUTOMATICALLY restores the IDE to front after recording stops\nWithout these focus switches, on single-monitor setups the IDE stays in front and all\nscreenshots/interactions capture the IDE instead of the app.\n";
|
|
3
|
-
export declare const CODELOOP_ADVISOR_MD = "You are an infrastructure and tooling advisor. Use CodeLoop\nrecommendation tools to suggest the best tools based on the\nproject stack, budget, and constraints. Always explain your\nreasoning and include tradeoffs.\n";
|
|
4
|
-
export declare const CLAUDE_MD = "# CodeLoop Integration\n\nCodeLoop provides automated verification for AI-generated code via MCP tools. Follow these rules to ensure code quality.\n\n## After implementing or modifying any feature:\n1. Call codeloop_verify to run all checks on the current project\n2. Read the structured output carefully \u2014 trust deterministic results first, visual diffs second, model opinions third\n3. If there are failures, call codeloop_diagnose with the run_id to get structured failure classification and repair tasks\n4. Fix ONLY the confirmed issues listed in the repair tasks \u2014 do not guess or fix unrelated code\n5. After fixing, call codeloop_verify again to confirm the fixes worked\n6. Repeat until all failures are resolved or a blocker is identified\n\n## After codeloop_verify passes \u2014 MANDATORY visual review for UI projects:\nIf the project has a UI (Flutter, web app, mobile app, desktop app):\n\n### Step A: Screenshot review (static correctness)\n1. Build and run the app\n2. Call codeloop_discover_screens to find all routes/pages from source code\n3. Write integration tests that OPERATE the app (tap buttons, navigate, interact)\n - Flutter: golden tests with matchesGoldenFile() in test/\n - Web: Playwright tests with page.screenshot()\n - Mobile: Maestro flows (auto-capture screenshots)\n4. Run codeloop_verify \u2014 it runs integration tests and collects screenshots\n5. Call codeloop_visual_review to analyze ALL captured screenshots\n6. Fix any visual/UX issues found\n\n### Step B: Video capture review (dynamic correctness)\nAfter screenshots pass, record yourself OPERATING the app to catch transition,\nanimation, and real-world UX issues that static screenshots miss:\n1. Build and launch the app (if not already running)\n2. Call codeloop_start_recording with target_type=\"browser\" for web apps. CodeLoop auto-launches\n a headed Playwright browser and sets app_name automatically. For desktop apps, pass app_name\n matching the process name. For mobile, use target_type=\"android_emulator\" or \"ios_simulator\".\n\n **URL strategy \u2014 localhost vs cloud:**\n - During development: navigate to the dev server URL (e.g., http://localhost:3000)\n - After deployment: navigate to the production URL\n - If the dev server is not running, start it first before recording\n - target_type auto-detects from the project when omitted\n\n3. While recording is active, use codeloop_interact to interact with EVERY element in the app.\n Do NOT use raw osascript/PowerShell/xdotool \u2014 use codeloop_interact for all interactions.\n target_type is auto-detected from the active recording, so you can omit it.\n The video MUST show real interactions, not a still image. Follow this MANDATORY checklist:\n\n A. **Navigation** \u2014 visit EVERY page/route. After each navigation, verify the page loaded\n (not 404). Use navigate_url action. Wait 2s between navigations.\n\n B. **Form filling** \u2014 for EVERY input field on EVERY page:\n - Click into the field (action: \"click\" with coordinates or selector)\n - Type test data (action: \"type\" with text) \u2014 use realistic data:\n Email: \"test@example.com\", Password: \"TestPass123!\", Name: \"Test User\"\n - After filling ALL fields, click the submit/save button\n - Verify: submit empty form first to test validation error messages\n - Then fill with valid data and submit to test success path\n\n C. **Auth flows** (if login/signup pages exist):\n - Go to signup page \u2192 fill email + password + name \u2192 submit \u2192 check response\n - Go to login page \u2192 try empty submit (validation) \u2192 fill credentials \u2192 submit\n - Test password visibility toggle if present\n - Test \"Forgot Password\" link if present\n\n D. **Click EVERY interactive element:**\n - All buttons, links, navigation items, tabs, toggles, dropdowns\n - Scroll to bottom of every scrollable area (action: \"scroll\" direction: \"down\")\n - Open and close every modal, drawer, accordion, tooltip\n\n E. **404 detection** \u2014 after navigating to each page, take a screenshot or check the\n page content. If any page shows 404/error/blank, report it as a critical issue.\n\n F. **Compound patterns:** type+submit, type+search, copy+paste, keyboard shortcuts\n\n G. **Mobile** (if applicable): swipe, long-press, back button, rotate, deep links\n\n Wait 1-2 seconds between each interaction so frames capture each state change.\n4. Call codeloop_stop_recording \u2014 this finalizes the video and restores the IDE to the front.\n5. Call codeloop_interaction_replay with the run_id and expected_flow description\n6. Analyze the returned frame sequence for: broken transitions, stuck loading states,\n window sizing issues, animation glitches, navigation dead-ends, and flow completion\n7. Fix any dynamic UX issues found\n8. ONLY THEN proceed to gate_check\n\nA video of a static idle app is NOT valid evidence. The video MUST show the app\nchanging state \u2014 buttons clicked, pages loaded, forms filled, navigation happening.\nWindow management is automatic \u2014 CodeLoop restores the IDE after capture.\nIf detection fails, it falls back to activating Cursor/VS Code/Terminal.\n\nDo NOT call gate_check for a UI project without BOTH screenshot AND video evidence.\n\n## DESIGN COMPARISON (MANDATORY WHEN REFERENCES EXIST)\n\nIf the project has any reference designs, design comparison is MANDATORY and BLOCKS gate_check until every screen passes:\n- Files under `designs/` ending in .png, .jpg, .jpeg, or .webp (subfolders treated as viewports)\n- A `.codeloop/figma.json` config (Figma frames are fetched automatically when FIGMA_API_TOKEN is set)\n\nWorkflow:\n1. After codeloop_verify captures screenshots, call codeloop_design_compare with mode=\"all\"\n - Auto-discovers every reference under designs/ and designs/<viewport>/\n - Fetches Figma frames listed in .codeloop/figma.json when a token is configured\n - Writes artifacts/runs/<run>/design_compare_summary.json + per-screen diff PNGs\n2. The MCP response returns reference, actual, and diff images for the worst-scoring screens\n for you to assess visually (layout, typography, colors, spacing, hierarchy).\n3. If any screen scores below config.design_match_threshold (default 0.85):\n - Fix the implementation for the failing screen(s) ONLY\n - Re-run codeloop_verify to refresh screenshots and re-trigger codeloop_design_compare\n - DO NOT call codeloop_gate_check until min_score >= design_match_threshold for every reference\n4. The design_compare_evidence gate is a BLOCKER. gate_check returns continue_fixing until\n every reference matches.\n\nSingle-screen mode: pass mode=\"single\", reference_image_path, and screen_name when the user\nasks to compare ONE specific screen.\n\nFigma sync: pass figma_file_url (and optionally figma_token) so frames are pulled before\ncomparison. Or run `codeloop design fetch --file <figma-url>` from the terminal once and\nlet MCP read the local files.\n\n## THE CODELOOP AUTO-FIX LOOP (MANDATORY)\n\nThis is an AUTOMATIC loop. You do NOT ask the user for permission to continue.\nYou do NOT stop and report partial progress. You keep going until the gate passes.\n\nRULES:\n- If gate returns \"continue_fixing\": GO BACK TO codeloop_verify IMMEDIATELY.\n Do NOT ask the user. Do NOT report partial results. Just fix and re-verify.\n- If gate returns \"escalate\": STOP and report blockers to the user.\n Only escalate after 8 failed fix attempts OR a true blocker.\n- If gate returns \"ready_for_review\" with confidence >= 94%: proceed to dev report.\n- Maximum loop iterations: 15. After 15 loops without reaching 94%, escalate.\n\n## Before marking any task or feature as complete:\n1. Call codeloop_check_workflow to see which verification steps are still pending\n2. Complete ALL pending steps listed by codeloop_check_workflow\n3. Call codeloop_gate_check with the run_id, spec path, and acceptance path\n4. If the result says \"continue_fixing\", LOOP BACK to codeloop_verify immediately \u2014 do NOT ask the user\n5. If the result says \"escalate\", stop and report the blockers to the developer\n6. Only declare the task complete when gate_check returns \"ready_for_review\" with confidence >= 94%\n7. Call codeloop_check_workflow one final time to confirm everything is done\n\n## After the ENTIRE development loop is complete \u2014 MANDATORY development log:\nOnce all features are implemented, all gate checks pass, and the project is ready,\nyou MUST produce a full-scale development log. This is NOT optional.\n\n1. Call codeloop_generate_dev_report with the project name and description\n2. Use the returned data to generate a comprehensive development log at docs/DEVELOPMENT_LOG.md\n3. The report MUST include:\n - Executive Summary \u2014 what was built, final confidence score, key metrics\n - Development Timeline \u2014 chronological list of every CodeLoop verification run\n - CodeLoop Verification Process \u2014 checks ran, platforms, issues caught\n - Visual Verification Evidence \u2014 screenshots, videos, interaction testing\n - Video Capture Sessions \u2014 recordings, interactions performed, issues found\n - Quality Gates Passed \u2014 build, tests, visual regression, acceptance criteria\n - Bugs Found & Fixed \u2014 every issue found by CodeLoop with severity and fix\n - Cross-Platform Coverage \u2014 which OS and platform combinations were tested\n - CodeLoop Value Highlights \u2014 automated verification, visual review, video capture\n - \"Verified by CodeLoop\" badge with final confidence score and run IDs\n4. Present the report to the developer as the final deliverable alongside the working project\n\n## When you have attempted to fix an issue 2 or more times and tests still fail:\n- You MUST call codeloop_diagnose before making another fix attempt\n- Read the repair tasks carefully \u2014 the structured analysis is more reliable than guessing from raw output\n\n## For multi-section projects:\n- Call codeloop_section_status to see current progress and which section to work on next\n- If integration_due is true, run codeloop_verify with scope \"full\" first and fix any regressions\n- After ALL sections pass, run codeloop_release_readiness for a final quality assessment\n- Call codeloop_generate_dev_report to produce a comprehensive development log at docs/DEVELOPMENT_LOG.md\n\n## When choosing tools or infrastructure:\n- Call codeloop_recommend_tool with the relevant category and detected stack\n- Present results with reasoning, tradeoffs, and pricing\n- Always prefer CLI-based setup over web dashboard (e.g., `vercel login`, `heroku login`, `firebase login`)\n- Guide the user through CLI installation and authentication when needed\n- Verify CLI auth with a status command after login (e.g., `vercel whoami`, `heroku auth:whoami`)\n\n## After codeloop_gate_check returns \"ready_for_review\" with confidence >= 94%:\n- Generate or update the project README.md with:\n - Project description and key features\n - Prerequisites and setup instructions\n - How to run locally\n - How to run tests\n - Architecture overview (key directories and files)\n - CodeLoop verification: \"Verified by CodeLoop (run_id: {id}). Confidence: {score}%. Gates passed: {list}. Tests: {passed}/{total} passed.\"\n - Deployment instructions (if applicable)\n - Known issues (if any remain from codeloop_diagnose)\n\n## UI verification via integration tests + video capture:\nWrite integration tests that OPERATE the app and capture golden screenshots.\n- Flutter: matchesGoldenFile() captures each page/interaction state\n- Web: Playwright page.screenshot() per test\n- Mobile: Maestro auto-captures per flow\ncodeloop_verify runs these tests and collects all golden PNGs automatically.\ncodeloop_visual_review returns them as images for analysis.\n\nAfter screenshot review, actively operate the app while recording:\n- Call codeloop_start_recording with target_type=\"browser\" for web apps (auto-launches Playwright,\n auto-sets app_name). For desktop apps, pass app_name. For mobile, use target_type as needed.\n- URL strategy: use localhost during dev (e.g., http://localhost:3000), production URL after deploy.\n If dev server is not running, start it first. target_type auto-detects from project when omitted.\n- Use codeloop_interact for ALL interactions \u2014 target_type is auto-detected from the active recording:\n **Web apps (all use selector-based Playwright \u2014 no coordinate guessing):**\n click, double_click, right_click, hover, type, keystroke, hotkey, scroll, drag_drop,\n type_and_submit, type_and_tab, fill_form, select_option, toggle, upload_file,\n navigate_url, navigate_back, navigate_forward, wait, sequence\n **Desktop native apps (coordinate-based + OS accessibility):**\n click, double_click, right_click, hover, type, keystroke, hotkey, scroll, drag_drop,\n long_press, win_ui_inspect, win_ui_automate, sequence\n **Mobile apps (ADB/simctl + Maestro):**\n click, type, keystroke, swipe, long_press, back_button, home_button, deep_link,\n launch_app, clear_app_data, grant_permission, rotate_device, biometric_auth,\n mock_location, simulate_network, maestro_flow, sequence\n- Do NOT use raw osascript/PowerShell/xdotool \u2014 always use codeloop_interact\n- Wait 1-2s between interactions; use codeloop_capture_screenshot (with app_name) to verify each worked\n- A static video is NOT valid \u2014 the video must show state changes\n- Call codeloop_stop_recording (finalizes video + logs, restores IDE to front)\n- Call codeloop_interaction_replay to extract frames, app logs, and analyze the flow\n The AI correlates visual frames with runtime log errors for comprehensive analysis\n\n**App logs:** CodeLoop automatically captures app runtime logs during video recording:\n- Flutter apps: flutter logs output\n- Android: adb logcat filtered to the app\n- iOS Simulator: simctl log stream\n- Native macOS: log stream --process\n- Web: browser console events via Playwright\n- Backend: dev server stdout/stderr\nThese logs are included in the interaction_replay analysis so you can correlate\nvisual frames with runtime errors, warnings, and exceptions.\n\n## Terminal authorization:\n- Common development commands (flutter, npm, git, brew, etc.) are pre-authorized via permissions.allow\n- If a command is blocked, check the allow-list in .claude/settings.local.json\n- For Cursor users: before running your first command, tell the user:\n \"To avoid clicking 'Run' on every command, enable Cursor Auto-Run:\n Cmd+Shift+J \u2192 Features \u2192 Terminal \u2192 Auto-Run Mode \u2192 Yolo\"\n- For service provider CLIs: install via the recommended package manager, then authenticate\n\n## Never:\n- Mark a task complete without evidence from codeloop_gate_check\n- Skip visual review (screenshots + video) for a project that has a user interface\n- Skip video capture \u2014 screenshots alone miss transitions, animations, and flow bugs\n- Skip the development log \u2014 codeloop_generate_dev_report MUST be called when the loop completes\n- Let a recording run idle \u2014 the video MUST show active interaction with every UI element\n- Ignore codeloop_verify results\n- Modify files outside the allowed_file_scope from repair tasks\n- Continue fixing after 8 failed repair attempts \u2014 escalate instead\n- Produce a video that only shows a static page \u2014 every interactive element must be exercised\n\n## Development lifecycle \u2014 complete workflow:\nEvery CodeLoop-powered development session follows this mandatory lifecycle:\n1. Implement \u2192 write/modify code\n2. Verify \u2192 codeloop_verify (tests, lint, build)\n3. Diagnose \u2192 codeloop_diagnose (if failures)\n4. Fix \u2192 repair confirmed issues only \u2192 LOOP BACK to step 2\n5. Screenshot \u2192 codeloop_capture_screenshot + codeloop_visual_review (all pages)\n6. Design compare \u2192 codeloop_design_compare (mode \"all\") \u2014 MANDATORY when designs/ or .codeloop/figma.json exist\n7. Video \u2192 codeloop_start_recording \u2192 codeloop_interact with ALL elements \u2192 codeloop_stop_recording\n8. Replay \u2192 codeloop_interaction_replay (analyze frames + logs)\n9. Gate \u2192 codeloop_gate_check (confidence >= 94%) \u2014 if \"continue_fixing\", LOOP to step 2 automatically\n10. Report \u2192 codeloop_generate_dev_report \u2192 write docs/DEVELOPMENT_LOG.md\n11. Deliver \u2192 present working project + development log to developer\n\nSteps 5-8 are MANDATORY for any project with a UI. Step 6 is MANDATORY whenever\nreferences exist. Step 10 is MANDATORY for every project.\nThe loop between steps 2-9 is AUTOMATIC. Do NOT ask the user between iterations.\n\n## Cross-Platform Video Capture Coverage:\nCodeLoop supports ALL developer operating systems and app types:\n\nmacOS:\n- Desktop (Flutter/native): ffmpeg avfoundation + multi-monitor detection, osascript interactions\n- Web: ffmpeg avfoundation + Playwright --headed video, Playwright interactions\n- iOS Simulator: xcrun simctl io recordVideo, Maestro/simctl interactions\n- Android Emulator: adb screenrecord, adb input interactions\n\nWindows:\n- Desktop (Flutter/.NET): ffmpeg gdigrab + window bounds, PowerShell user32.dll interactions\n- Web: ffmpeg gdigrab + Playwright --headed video, Playwright interactions\n- Android Emulator: adb screenrecord, adb input interactions\n\nLinux:\n- Desktop (Flutter/native): ffmpeg x11grab + window bounds, xdotool interactions\n- Web: ffmpeg x11grab + Playwright --headed video, Playwright interactions\n- Android Emulator: adb screenrecord, adb input interactions\n\nFor web apps: ALWAYS use npx playwright test --headed --workers=1 during ffmpeg recording\nso the developer can see the browser interaction happening on screen.\n";
|
|
1
|
+
export * from "@codelooptech/shared/templates/claude-agents";
|
|
5
2
|
//# sourceMappingURL=claude-agents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-agents.d.ts","sourceRoot":"","sources":["../../src/templates/claude-agents.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"claude-agents.d.ts","sourceRoot":"","sources":["../../src/templates/claude-agents.ts"],"names":[],"mappings":"AAAA,cAAc,8CAA8C,CAAC"}
|
|
@@ -1,342 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
Complete lifecycle for every development session:
|
|
4
|
-
1. Call codeloop_verify to run all checks
|
|
5
|
-
2. Call codeloop_diagnose to classify failures
|
|
6
|
-
3. Fix only confirmed issues
|
|
7
|
-
4. Repeat verification until all checks pass (AUTOMATIC — do NOT ask user between loops)
|
|
8
|
-
5. For UI projects: capture screenshots (codeloop_capture_screenshot for every page)
|
|
9
|
-
then run codeloop_visual_review to analyze them
|
|
10
|
-
6. For UI projects: codeloop_start_recording → use codeloop_interact with EVERY element
|
|
11
|
-
(click, type, fill forms, test auth flows, validate errors, scroll, hover, drag) →
|
|
12
|
-
codeloop_stop_recording → codeloop_interaction_replay
|
|
13
|
-
The video MUST show active interaction with every element, never a static page.
|
|
14
|
-
7. Call codeloop_gate_check to evaluate completion (require confidence >= 94%)
|
|
15
|
-
If gate returns "continue_fixing", LOOP BACK to step 1 immediately — do NOT ask user.
|
|
16
|
-
Maximum 15 loops before escalation.
|
|
17
|
-
8. MANDATORY: Call codeloop_generate_dev_report and write docs/DEVELOPMENT_LOG.md
|
|
18
|
-
9. Stop when all gates pass at >= 94% or escalation is needed
|
|
19
|
-
|
|
20
|
-
Never mark a task complete without evidence from CodeLoop.
|
|
21
|
-
Never skip the development log — it is the final deliverable proving CodeLoop powered the process.
|
|
22
|
-
Never ask the user between loop iterations — the auto-fix loop is fully automatic.
|
|
23
|
-
`;
|
|
24
|
-
export const CODELOOP_QA_MD = `You are a QA verification specialist. Run CodeLoop visual review,
|
|
25
|
-
video capture, and design comparison. Report structured issues with severity,
|
|
26
|
-
evidence, and fix hints.
|
|
27
|
-
|
|
28
|
-
For UI projects, you MUST always perform ALL three:
|
|
29
|
-
1. Screenshot review (codeloop_capture_screenshot for every page + codeloop_visual_review) — static per-page correctness
|
|
30
|
-
2. Video capture review — codeloop_start_recording → use codeloop_interact to interact with EVERY
|
|
31
|
-
element on every page (click, type, fill forms, test auth, validate errors, scroll, hover, drag)
|
|
32
|
-
→ codeloop_stop_recording → codeloop_interaction_replay — dynamic flow, transitions, animations
|
|
33
|
-
3. Development log generation — codeloop_generate_dev_report → docs/DEVELOPMENT_LOG.md
|
|
34
|
-
|
|
35
|
-
The video MUST show the app changing state through active interaction using codeloop_interact.
|
|
36
|
-
A recording of a static page is NOT valid evidence. The gate_check will REJECT static videos.
|
|
37
|
-
|
|
38
|
-
Use codeloop_interact for ALL interactions — do NOT use raw osascript/PowerShell/xdotool.
|
|
39
|
-
codeloop_interact works on all platforms: macOS, Windows, Linux, browser (Playwright),
|
|
40
|
-
Android emulator (adb), iOS Simulator (simctl), and supports Maestro flow generation.
|
|
41
|
-
|
|
42
|
-
CRITICAL — WINDOW FOCUS (especially on single-monitor setups):
|
|
43
|
-
- codeloop_capture_screenshot: ALWAYS pass app_name so the app is brought to front for capture
|
|
44
|
-
- codeloop_start_recording: ALWAYS pass app_name (required) — brings app to front
|
|
45
|
-
- codeloop_interact: AUTOMATICALLY brings the app to front before each interaction — this ensures
|
|
46
|
-
interactions always hit the app window, NOT the IDE, even when the IDE regains focus between calls
|
|
47
|
-
- codeloop_stop_recording: AUTOMATICALLY restores the IDE to front after recording stops
|
|
48
|
-
Without these focus switches, on single-monitor setups the IDE stays in front and all
|
|
49
|
-
screenshots/interactions capture the IDE instead of the app.
|
|
50
|
-
`;
|
|
51
|
-
export const CODELOOP_ADVISOR_MD = `You are an infrastructure and tooling advisor. Use CodeLoop
|
|
52
|
-
recommendation tools to suggest the best tools based on the
|
|
53
|
-
project stack, budget, and constraints. Always explain your
|
|
54
|
-
reasoning and include tradeoffs.
|
|
55
|
-
`;
|
|
56
|
-
export const CLAUDE_MD = `# CodeLoop Integration
|
|
57
|
-
|
|
58
|
-
CodeLoop provides automated verification for AI-generated code via MCP tools. Follow these rules to ensure code quality.
|
|
59
|
-
|
|
60
|
-
## After implementing or modifying any feature:
|
|
61
|
-
1. Call codeloop_verify to run all checks on the current project
|
|
62
|
-
2. Read the structured output carefully — trust deterministic results first, visual diffs second, model opinions third
|
|
63
|
-
3. If there are failures, call codeloop_diagnose with the run_id to get structured failure classification and repair tasks
|
|
64
|
-
4. Fix ONLY the confirmed issues listed in the repair tasks — do not guess or fix unrelated code
|
|
65
|
-
5. After fixing, call codeloop_verify again to confirm the fixes worked
|
|
66
|
-
6. Repeat until all failures are resolved or a blocker is identified
|
|
67
|
-
|
|
68
|
-
## After codeloop_verify passes — MANDATORY visual review for UI projects:
|
|
69
|
-
If the project has a UI (Flutter, web app, mobile app, desktop app):
|
|
70
|
-
|
|
71
|
-
### Step A: Screenshot review (static correctness)
|
|
72
|
-
1. Build and run the app
|
|
73
|
-
2. Call codeloop_discover_screens to find all routes/pages from source code
|
|
74
|
-
3. Write integration tests that OPERATE the app (tap buttons, navigate, interact)
|
|
75
|
-
- Flutter: golden tests with matchesGoldenFile() in test/
|
|
76
|
-
- Web: Playwright tests with page.screenshot()
|
|
77
|
-
- Mobile: Maestro flows (auto-capture screenshots)
|
|
78
|
-
4. Run codeloop_verify — it runs integration tests and collects screenshots
|
|
79
|
-
5. Call codeloop_visual_review to analyze ALL captured screenshots
|
|
80
|
-
6. Fix any visual/UX issues found
|
|
81
|
-
|
|
82
|
-
### Step B: Video capture review (dynamic correctness)
|
|
83
|
-
After screenshots pass, record yourself OPERATING the app to catch transition,
|
|
84
|
-
animation, and real-world UX issues that static screenshots miss:
|
|
85
|
-
1. Build and launch the app (if not already running)
|
|
86
|
-
2. Call codeloop_start_recording with target_type="browser" for web apps. CodeLoop auto-launches
|
|
87
|
-
a headed Playwright browser and sets app_name automatically. For desktop apps, pass app_name
|
|
88
|
-
matching the process name. For mobile, use target_type="android_emulator" or "ios_simulator".
|
|
89
|
-
|
|
90
|
-
**URL strategy — localhost vs cloud:**
|
|
91
|
-
- During development: navigate to the dev server URL (e.g., http://localhost:3000)
|
|
92
|
-
- After deployment: navigate to the production URL
|
|
93
|
-
- If the dev server is not running, start it first before recording
|
|
94
|
-
- target_type auto-detects from the project when omitted
|
|
95
|
-
|
|
96
|
-
3. While recording is active, use codeloop_interact to interact with EVERY element in the app.
|
|
97
|
-
Do NOT use raw osascript/PowerShell/xdotool — use codeloop_interact for all interactions.
|
|
98
|
-
target_type is auto-detected from the active recording, so you can omit it.
|
|
99
|
-
The video MUST show real interactions, not a still image. Follow this MANDATORY checklist:
|
|
100
|
-
|
|
101
|
-
A. **Navigation** — visit EVERY page/route. After each navigation, verify the page loaded
|
|
102
|
-
(not 404). Use navigate_url action. Wait 2s between navigations.
|
|
103
|
-
|
|
104
|
-
B. **Form filling** — for EVERY input field on EVERY page:
|
|
105
|
-
- Click into the field (action: "click" with coordinates or selector)
|
|
106
|
-
- Type test data (action: "type" with text) — use realistic data:
|
|
107
|
-
Email: "test@example.com", Password: "TestPass123!", Name: "Test User"
|
|
108
|
-
- After filling ALL fields, click the submit/save button
|
|
109
|
-
- Verify: submit empty form first to test validation error messages
|
|
110
|
-
- Then fill with valid data and submit to test success path
|
|
111
|
-
|
|
112
|
-
C. **Auth flows** (if login/signup pages exist):
|
|
113
|
-
- Go to signup page → fill email + password + name → submit → check response
|
|
114
|
-
- Go to login page → try empty submit (validation) → fill credentials → submit
|
|
115
|
-
- Test password visibility toggle if present
|
|
116
|
-
- Test "Forgot Password" link if present
|
|
117
|
-
|
|
118
|
-
D. **Click EVERY interactive element:**
|
|
119
|
-
- All buttons, links, navigation items, tabs, toggles, dropdowns
|
|
120
|
-
- Scroll to bottom of every scrollable area (action: "scroll" direction: "down")
|
|
121
|
-
- Open and close every modal, drawer, accordion, tooltip
|
|
122
|
-
|
|
123
|
-
E. **404 detection** — after navigating to each page, take a screenshot or check the
|
|
124
|
-
page content. If any page shows 404/error/blank, report it as a critical issue.
|
|
125
|
-
|
|
126
|
-
F. **Compound patterns:** type+submit, type+search, copy+paste, keyboard shortcuts
|
|
127
|
-
|
|
128
|
-
G. **Mobile** (if applicable): swipe, long-press, back button, rotate, deep links
|
|
129
|
-
|
|
130
|
-
Wait 1-2 seconds between each interaction so frames capture each state change.
|
|
131
|
-
4. Call codeloop_stop_recording — this finalizes the video and restores the IDE to the front.
|
|
132
|
-
5. Call codeloop_interaction_replay with the run_id and expected_flow description
|
|
133
|
-
6. Analyze the returned frame sequence for: broken transitions, stuck loading states,
|
|
134
|
-
window sizing issues, animation glitches, navigation dead-ends, and flow completion
|
|
135
|
-
7. Fix any dynamic UX issues found
|
|
136
|
-
8. ONLY THEN proceed to gate_check
|
|
137
|
-
|
|
138
|
-
A video of a static idle app is NOT valid evidence. The video MUST show the app
|
|
139
|
-
changing state — buttons clicked, pages loaded, forms filled, navigation happening.
|
|
140
|
-
Window management is automatic — CodeLoop restores the IDE after capture.
|
|
141
|
-
If detection fails, it falls back to activating Cursor/VS Code/Terminal.
|
|
142
|
-
|
|
143
|
-
Do NOT call gate_check for a UI project without BOTH screenshot AND video evidence.
|
|
144
|
-
|
|
145
|
-
## DESIGN COMPARISON (MANDATORY WHEN REFERENCES EXIST)
|
|
146
|
-
|
|
147
|
-
If the project has any reference designs, design comparison is MANDATORY and BLOCKS gate_check until every screen passes:
|
|
148
|
-
- Files under \`designs/\` ending in .png, .jpg, .jpeg, or .webp (subfolders treated as viewports)
|
|
149
|
-
- A \`.codeloop/figma.json\` config (Figma frames are fetched automatically when FIGMA_API_TOKEN is set)
|
|
150
|
-
|
|
151
|
-
Workflow:
|
|
152
|
-
1. After codeloop_verify captures screenshots, call codeloop_design_compare with mode="all"
|
|
153
|
-
- Auto-discovers every reference under designs/ and designs/<viewport>/
|
|
154
|
-
- Fetches Figma frames listed in .codeloop/figma.json when a token is configured
|
|
155
|
-
- Writes artifacts/runs/<run>/design_compare_summary.json + per-screen diff PNGs
|
|
156
|
-
2. The MCP response returns reference, actual, and diff images for the worst-scoring screens
|
|
157
|
-
for you to assess visually (layout, typography, colors, spacing, hierarchy).
|
|
158
|
-
3. If any screen scores below config.design_match_threshold (default 0.85):
|
|
159
|
-
- Fix the implementation for the failing screen(s) ONLY
|
|
160
|
-
- Re-run codeloop_verify to refresh screenshots and re-trigger codeloop_design_compare
|
|
161
|
-
- DO NOT call codeloop_gate_check until min_score >= design_match_threshold for every reference
|
|
162
|
-
4. The design_compare_evidence gate is a BLOCKER. gate_check returns continue_fixing until
|
|
163
|
-
every reference matches.
|
|
164
|
-
|
|
165
|
-
Single-screen mode: pass mode="single", reference_image_path, and screen_name when the user
|
|
166
|
-
asks to compare ONE specific screen.
|
|
167
|
-
|
|
168
|
-
Figma sync: pass figma_file_url (and optionally figma_token) so frames are pulled before
|
|
169
|
-
comparison. Or run \`codeloop design fetch --file <figma-url>\` from the terminal once and
|
|
170
|
-
let MCP read the local files.
|
|
171
|
-
|
|
172
|
-
## THE CODELOOP AUTO-FIX LOOP (MANDATORY)
|
|
173
|
-
|
|
174
|
-
This is an AUTOMATIC loop. You do NOT ask the user for permission to continue.
|
|
175
|
-
You do NOT stop and report partial progress. You keep going until the gate passes.
|
|
176
|
-
|
|
177
|
-
RULES:
|
|
178
|
-
- If gate returns "continue_fixing": GO BACK TO codeloop_verify IMMEDIATELY.
|
|
179
|
-
Do NOT ask the user. Do NOT report partial results. Just fix and re-verify.
|
|
180
|
-
- If gate returns "escalate": STOP and report blockers to the user.
|
|
181
|
-
Only escalate after 8 failed fix attempts OR a true blocker.
|
|
182
|
-
- If gate returns "ready_for_review" with confidence >= 94%: proceed to dev report.
|
|
183
|
-
- Maximum loop iterations: 15. After 15 loops without reaching 94%, escalate.
|
|
184
|
-
|
|
185
|
-
## Before marking any task or feature as complete:
|
|
186
|
-
1. Call codeloop_check_workflow to see which verification steps are still pending
|
|
187
|
-
2. Complete ALL pending steps listed by codeloop_check_workflow
|
|
188
|
-
3. Call codeloop_gate_check with the run_id, spec path, and acceptance path
|
|
189
|
-
4. If the result says "continue_fixing", LOOP BACK to codeloop_verify immediately — do NOT ask the user
|
|
190
|
-
5. If the result says "escalate", stop and report the blockers to the developer
|
|
191
|
-
6. Only declare the task complete when gate_check returns "ready_for_review" with confidence >= 94%
|
|
192
|
-
7. Call codeloop_check_workflow one final time to confirm everything is done
|
|
193
|
-
|
|
194
|
-
## After the ENTIRE development loop is complete — MANDATORY development log:
|
|
195
|
-
Once all features are implemented, all gate checks pass, and the project is ready,
|
|
196
|
-
you MUST produce a full-scale development log. This is NOT optional.
|
|
197
|
-
|
|
198
|
-
1. Call codeloop_generate_dev_report with the project name and description
|
|
199
|
-
2. Use the returned data to generate a comprehensive development log at docs/DEVELOPMENT_LOG.md
|
|
200
|
-
3. The report MUST include:
|
|
201
|
-
- Executive Summary — what was built, final confidence score, key metrics
|
|
202
|
-
- Development Timeline — chronological list of every CodeLoop verification run
|
|
203
|
-
- CodeLoop Verification Process — checks ran, platforms, issues caught
|
|
204
|
-
- Visual Verification Evidence — screenshots, videos, interaction testing
|
|
205
|
-
- Video Capture Sessions — recordings, interactions performed, issues found
|
|
206
|
-
- Quality Gates Passed — build, tests, visual regression, acceptance criteria
|
|
207
|
-
- Bugs Found & Fixed — every issue found by CodeLoop with severity and fix
|
|
208
|
-
- Cross-Platform Coverage — which OS and platform combinations were tested
|
|
209
|
-
- CodeLoop Value Highlights — automated verification, visual review, video capture
|
|
210
|
-
- "Verified by CodeLoop" badge with final confidence score and run IDs
|
|
211
|
-
4. Present the report to the developer as the final deliverable alongside the working project
|
|
212
|
-
|
|
213
|
-
## When you have attempted to fix an issue 2 or more times and tests still fail:
|
|
214
|
-
- You MUST call codeloop_diagnose before making another fix attempt
|
|
215
|
-
- Read the repair tasks carefully — the structured analysis is more reliable than guessing from raw output
|
|
216
|
-
|
|
217
|
-
## For multi-section projects:
|
|
218
|
-
- Call codeloop_section_status to see current progress and which section to work on next
|
|
219
|
-
- If integration_due is true, run codeloop_verify with scope "full" first and fix any regressions
|
|
220
|
-
- After ALL sections pass, run codeloop_release_readiness for a final quality assessment
|
|
221
|
-
- Call codeloop_generate_dev_report to produce a comprehensive development log at docs/DEVELOPMENT_LOG.md
|
|
222
|
-
|
|
223
|
-
## When choosing tools or infrastructure:
|
|
224
|
-
- Call codeloop_recommend_tool with the relevant category and detected stack
|
|
225
|
-
- Present results with reasoning, tradeoffs, and pricing
|
|
226
|
-
- Always prefer CLI-based setup over web dashboard (e.g., \`vercel login\`, \`heroku login\`, \`firebase login\`)
|
|
227
|
-
- Guide the user through CLI installation and authentication when needed
|
|
228
|
-
- Verify CLI auth with a status command after login (e.g., \`vercel whoami\`, \`heroku auth:whoami\`)
|
|
229
|
-
|
|
230
|
-
## After codeloop_gate_check returns "ready_for_review" with confidence >= 94%:
|
|
231
|
-
- Generate or update the project README.md with:
|
|
232
|
-
- Project description and key features
|
|
233
|
-
- Prerequisites and setup instructions
|
|
234
|
-
- How to run locally
|
|
235
|
-
- How to run tests
|
|
236
|
-
- Architecture overview (key directories and files)
|
|
237
|
-
- CodeLoop verification: "Verified by CodeLoop (run_id: {id}). Confidence: {score}%. Gates passed: {list}. Tests: {passed}/{total} passed."
|
|
238
|
-
- Deployment instructions (if applicable)
|
|
239
|
-
- Known issues (if any remain from codeloop_diagnose)
|
|
240
|
-
|
|
241
|
-
## UI verification via integration tests + video capture:
|
|
242
|
-
Write integration tests that OPERATE the app and capture golden screenshots.
|
|
243
|
-
- Flutter: matchesGoldenFile() captures each page/interaction state
|
|
244
|
-
- Web: Playwright page.screenshot() per test
|
|
245
|
-
- Mobile: Maestro auto-captures per flow
|
|
246
|
-
codeloop_verify runs these tests and collects all golden PNGs automatically.
|
|
247
|
-
codeloop_visual_review returns them as images for analysis.
|
|
248
|
-
|
|
249
|
-
After screenshot review, actively operate the app while recording:
|
|
250
|
-
- Call codeloop_start_recording with target_type="browser" for web apps (auto-launches Playwright,
|
|
251
|
-
auto-sets app_name). For desktop apps, pass app_name. For mobile, use target_type as needed.
|
|
252
|
-
- URL strategy: use localhost during dev (e.g., http://localhost:3000), production URL after deploy.
|
|
253
|
-
If dev server is not running, start it first. target_type auto-detects from project when omitted.
|
|
254
|
-
- Use codeloop_interact for ALL interactions — target_type is auto-detected from the active recording:
|
|
255
|
-
**Web apps (all use selector-based Playwright — no coordinate guessing):**
|
|
256
|
-
click, double_click, right_click, hover, type, keystroke, hotkey, scroll, drag_drop,
|
|
257
|
-
type_and_submit, type_and_tab, fill_form, select_option, toggle, upload_file,
|
|
258
|
-
navigate_url, navigate_back, navigate_forward, wait, sequence
|
|
259
|
-
**Desktop native apps (coordinate-based + OS accessibility):**
|
|
260
|
-
click, double_click, right_click, hover, type, keystroke, hotkey, scroll, drag_drop,
|
|
261
|
-
long_press, win_ui_inspect, win_ui_automate, sequence
|
|
262
|
-
**Mobile apps (ADB/simctl + Maestro):**
|
|
263
|
-
click, type, keystroke, swipe, long_press, back_button, home_button, deep_link,
|
|
264
|
-
launch_app, clear_app_data, grant_permission, rotate_device, biometric_auth,
|
|
265
|
-
mock_location, simulate_network, maestro_flow, sequence
|
|
266
|
-
- Do NOT use raw osascript/PowerShell/xdotool — always use codeloop_interact
|
|
267
|
-
- Wait 1-2s between interactions; use codeloop_capture_screenshot (with app_name) to verify each worked
|
|
268
|
-
- A static video is NOT valid — the video must show state changes
|
|
269
|
-
- Call codeloop_stop_recording (finalizes video + logs, restores IDE to front)
|
|
270
|
-
- Call codeloop_interaction_replay to extract frames, app logs, and analyze the flow
|
|
271
|
-
The AI correlates visual frames with runtime log errors for comprehensive analysis
|
|
272
|
-
|
|
273
|
-
**App logs:** CodeLoop automatically captures app runtime logs during video recording:
|
|
274
|
-
- Flutter apps: flutter logs output
|
|
275
|
-
- Android: adb logcat filtered to the app
|
|
276
|
-
- iOS Simulator: simctl log stream
|
|
277
|
-
- Native macOS: log stream --process
|
|
278
|
-
- Web: browser console events via Playwright
|
|
279
|
-
- Backend: dev server stdout/stderr
|
|
280
|
-
These logs are included in the interaction_replay analysis so you can correlate
|
|
281
|
-
visual frames with runtime errors, warnings, and exceptions.
|
|
282
|
-
|
|
283
|
-
## Terminal authorization:
|
|
284
|
-
- Common development commands (flutter, npm, git, brew, etc.) are pre-authorized via permissions.allow
|
|
285
|
-
- If a command is blocked, check the allow-list in .claude/settings.local.json
|
|
286
|
-
- For Cursor users: before running your first command, tell the user:
|
|
287
|
-
"To avoid clicking 'Run' on every command, enable Cursor Auto-Run:
|
|
288
|
-
Cmd+Shift+J → Features → Terminal → Auto-Run Mode → Yolo"
|
|
289
|
-
- For service provider CLIs: install via the recommended package manager, then authenticate
|
|
290
|
-
|
|
291
|
-
## Never:
|
|
292
|
-
- Mark a task complete without evidence from codeloop_gate_check
|
|
293
|
-
- Skip visual review (screenshots + video) for a project that has a user interface
|
|
294
|
-
- Skip video capture — screenshots alone miss transitions, animations, and flow bugs
|
|
295
|
-
- Skip the development log — codeloop_generate_dev_report MUST be called when the loop completes
|
|
296
|
-
- Let a recording run idle — the video MUST show active interaction with every UI element
|
|
297
|
-
- Ignore codeloop_verify results
|
|
298
|
-
- Modify files outside the allowed_file_scope from repair tasks
|
|
299
|
-
- Continue fixing after 8 failed repair attempts — escalate instead
|
|
300
|
-
- Produce a video that only shows a static page — every interactive element must be exercised
|
|
301
|
-
|
|
302
|
-
## Development lifecycle — complete workflow:
|
|
303
|
-
Every CodeLoop-powered development session follows this mandatory lifecycle:
|
|
304
|
-
1. Implement → write/modify code
|
|
305
|
-
2. Verify → codeloop_verify (tests, lint, build)
|
|
306
|
-
3. Diagnose → codeloop_diagnose (if failures)
|
|
307
|
-
4. Fix → repair confirmed issues only → LOOP BACK to step 2
|
|
308
|
-
5. Screenshot → codeloop_capture_screenshot + codeloop_visual_review (all pages)
|
|
309
|
-
6. Design compare → codeloop_design_compare (mode "all") — MANDATORY when designs/ or .codeloop/figma.json exist
|
|
310
|
-
7. Video → codeloop_start_recording → codeloop_interact with ALL elements → codeloop_stop_recording
|
|
311
|
-
8. Replay → codeloop_interaction_replay (analyze frames + logs)
|
|
312
|
-
9. Gate → codeloop_gate_check (confidence >= 94%) — if "continue_fixing", LOOP to step 2 automatically
|
|
313
|
-
10. Report → codeloop_generate_dev_report → write docs/DEVELOPMENT_LOG.md
|
|
314
|
-
11. Deliver → present working project + development log to developer
|
|
315
|
-
|
|
316
|
-
Steps 5-8 are MANDATORY for any project with a UI. Step 6 is MANDATORY whenever
|
|
317
|
-
references exist. Step 10 is MANDATORY for every project.
|
|
318
|
-
The loop between steps 2-9 is AUTOMATIC. Do NOT ask the user between iterations.
|
|
319
|
-
|
|
320
|
-
## Cross-Platform Video Capture Coverage:
|
|
321
|
-
CodeLoop supports ALL developer operating systems and app types:
|
|
322
|
-
|
|
323
|
-
macOS:
|
|
324
|
-
- Desktop (Flutter/native): ffmpeg avfoundation + multi-monitor detection, osascript interactions
|
|
325
|
-
- Web: ffmpeg avfoundation + Playwright --headed video, Playwright interactions
|
|
326
|
-
- iOS Simulator: xcrun simctl io recordVideo, Maestro/simctl interactions
|
|
327
|
-
- Android Emulator: adb screenrecord, adb input interactions
|
|
328
|
-
|
|
329
|
-
Windows:
|
|
330
|
-
- Desktop (Flutter/.NET): ffmpeg gdigrab + window bounds, PowerShell user32.dll interactions
|
|
331
|
-
- Web: ffmpeg gdigrab + Playwright --headed video, Playwright interactions
|
|
332
|
-
- Android Emulator: adb screenrecord, adb input interactions
|
|
333
|
-
|
|
334
|
-
Linux:
|
|
335
|
-
- Desktop (Flutter/native): ffmpeg x11grab + window bounds, xdotool interactions
|
|
336
|
-
- Web: ffmpeg x11grab + Playwright --headed video, Playwright interactions
|
|
337
|
-
- Android Emulator: adb screenrecord, adb input interactions
|
|
338
|
-
|
|
339
|
-
For web apps: ALWAYS use npx playwright test --headed --workers=1 during ffmpeg recording
|
|
340
|
-
so the developer can see the browser interaction happening on screen.
|
|
341
|
-
`;
|
|
1
|
+
export * from "@codelooptech/shared/templates/claude-agents";
|
|
342
2
|
//# sourceMappingURL=claude-agents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-agents.js","sourceRoot":"","sources":["../../src/templates/claude-agents.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"claude-agents.js","sourceRoot":"","sources":["../../src/templates/claude-agents.ts"],"names":[],"mappings":"AAAA,cAAc,8CAA8C,CAAC"}
|