@punks/cli 2.1.7 → 2.1.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 +2 -2
- package/dist/data/AGENTS.md +3 -1
- package/dist/data/catalog/hooks.ts +8 -0
- package/dist/data/catalog/lint.ts +28 -82
- package/dist/data/catalog/packs.ts +8 -6
- package/dist/data/catalog/skills.ts +48 -0
- package/dist/data/catalog/tools.ts +9 -1
- package/dist/data/hooks/format-edited-file.mjs +1 -1
- package/dist/data/hooks/scaffold-update-check.mjs +181 -0
- package/dist/data/hooks.test.ts +19 -2
- package/dist/data/scripts/sync-subagents.mjs +70 -37
- package/dist/data/subagents/manifest.mjs +120 -0
- package/dist/index.js +1916 -767
- package/dist/skills/agnostic/cli/dp-cli/SKILL.md +3 -3
- package/dist/skills/agnostic/cli/dp-cli/references/commands.md +1 -1
- package/dist/skills/agnostic/docs/docs-onboarding/SKILL.md +46 -0
- package/dist/skills/agnostic/docs/docs-onboarding/agents/openai.yaml +4 -0
- package/dist/skills/agnostic/docs/docs-onboarding/references/artifact-contract.md +67 -0
- package/dist/skills/agnostic/docs/upstream/mattpocock-writing-skills.md +41 -0
- package/dist/skills/agnostic/docs/writing-beats/SKILL.md +69 -0
- package/dist/skills/agnostic/docs/writing-fragments/SKILL.md +76 -0
- package/dist/skills/agnostic/docs/writing-shape/SKILL.md +75 -0
- package/dist/skills/agnostic/planning/create-plan/SKILL.md +17 -2
- package/dist/skills/agnostic/planning/create-plan/references/planner-phase.md +1 -1
- package/dist/skills/agnostic/planning/create-spec/SKILL.md +57 -12
- package/dist/skills/agnostic/planning/create-spec/references/backlog-sync.md +5 -2
- package/dist/skills/agnostic/planning/create-spec/references/discovery.md +24 -16
- package/dist/skills/agnostic/planning/create-spec/references/folder-naming.md +6 -2
- package/dist/skills/agnostic/planning/create-spec/references/wiki-bookkeeping.md +29 -5
- package/dist/skills/agnostic/planning/implement-spec/SKILL.md +34 -7
- package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +32 -9
- package/dist/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +4 -2
- package/dist/skills/agnostic/planning/implement-spec/references/parallel.md +3 -3
- package/dist/skills/agnostic/planning/implement-spec/references/sequential.md +16 -6
- package/dist/skills/agnostic/planning/stack/SKILL.md +89 -0
- package/dist/skills/agnostic/quality/autoreview/SKILL.md +191 -0
- package/dist/skills/agnostic/quality/autoreview/scripts/autoreview +1176 -0
- package/dist/skills/agnostic/quality/autoreview/scripts/test-review-harness +176 -0
- package/dist/skills/agnostic/requirements/write-backlog/SKILL.md +7 -5
- package/dist/skills/frameworks/tanstack-query/tanstack-query/SKILL.md +621 -830
- package/dist/skills/frameworks/tanstack-start/tanstack-start/SKILL.md +250 -0
- package/dist/skills/phases/delivery-phase/SKILL.md +6 -1
- package/dist/skills/phases/docs-ingest-phase/SKILL.md +28 -20
- package/dist/skills/phases/docs-ingest-phase/references/fumadocs-routing.md +8 -5
- package/dist/skills/phases/docs-ingest-phase/references/public-docs.md +82 -0
- package/dist/skills/phases/requirements-phase/SKILL.md +2 -0
- package/dist/skills/phases/review-phase/SKILL.md +26 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -51331,185 +51331,6 @@ var runMain2 = runMain;
|
|
|
51331
51331
|
|
|
51332
51332
|
// ../../node_modules/.bun/@effect+platform-bun@0.89.0+15f69c4693c05b6b/node_modules/@effect/platform-bun/dist/esm/BunRuntime.js
|
|
51333
51333
|
var runMain3 = runMain2;
|
|
51334
|
-
// src/github/issues.ts
|
|
51335
|
-
import { execFileSync } from "child_process";
|
|
51336
|
-
var githubApiBaseUrl = "https://api.github.com";
|
|
51337
|
-
var githubToken = () => {
|
|
51338
|
-
const envToken = process.env.GH_TOKEN?.trim() || process.env.GITHUB_TOKEN?.trim();
|
|
51339
|
-
if (envToken !== undefined && envToken.length > 0) {
|
|
51340
|
-
return envToken;
|
|
51341
|
-
}
|
|
51342
|
-
try {
|
|
51343
|
-
return execFileSync("gh", ["auth", "token"], {
|
|
51344
|
-
encoding: "utf8",
|
|
51345
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
51346
|
-
}).trim();
|
|
51347
|
-
} catch {
|
|
51348
|
-
return;
|
|
51349
|
-
}
|
|
51350
|
-
};
|
|
51351
|
-
var githubHeaders = (token) => ({
|
|
51352
|
-
accept: "application/vnd.github+json",
|
|
51353
|
-
authorization: `Bearer ${token}`,
|
|
51354
|
-
"content-type": "application/json",
|
|
51355
|
-
"x-github-api-version": "2022-11-28"
|
|
51356
|
-
});
|
|
51357
|
-
var parseRepository = (repository) => {
|
|
51358
|
-
const [owner, repo, extra] = repository.split("/");
|
|
51359
|
-
if (owner === undefined || owner.trim().length === 0 || repo === undefined || repo.trim().length === 0 || extra !== undefined) {
|
|
51360
|
-
throw new Error("GitHub repository must be in owner/name form.");
|
|
51361
|
-
}
|
|
51362
|
-
return { owner, repo };
|
|
51363
|
-
};
|
|
51364
|
-
var labelColor = (label) => {
|
|
51365
|
-
if (label === "harness-report") {
|
|
51366
|
-
return "5319e7";
|
|
51367
|
-
}
|
|
51368
|
-
if (label.startsWith("severity:")) {
|
|
51369
|
-
return "d93f0b";
|
|
51370
|
-
}
|
|
51371
|
-
if (label.startsWith("type:")) {
|
|
51372
|
-
return "1d76db";
|
|
51373
|
-
}
|
|
51374
|
-
if (label.startsWith("area:") || label.startsWith("surface:")) {
|
|
51375
|
-
return "0e8a16";
|
|
51376
|
-
}
|
|
51377
|
-
if (label.startsWith("pack:") || label.startsWith("command:")) {
|
|
51378
|
-
return "fbca04";
|
|
51379
|
-
}
|
|
51380
|
-
return "cfd3d7";
|
|
51381
|
-
};
|
|
51382
|
-
var labelDescription = (label) => label === "harness-report" ? "Created by dp report for Harness maintainer triage." : `dp report classifier: ${label}`;
|
|
51383
|
-
var createLabelIfMissing = async ({
|
|
51384
|
-
token,
|
|
51385
|
-
repository,
|
|
51386
|
-
label
|
|
51387
|
-
}) => {
|
|
51388
|
-
const { owner, repo } = parseRepository(repository);
|
|
51389
|
-
const response = await fetch(`${githubApiBaseUrl}/repos/${owner}/${repo}/labels`, {
|
|
51390
|
-
method: "POST",
|
|
51391
|
-
headers: githubHeaders(token),
|
|
51392
|
-
body: JSON.stringify({
|
|
51393
|
-
name: label,
|
|
51394
|
-
color: labelColor(label),
|
|
51395
|
-
description: labelDescription(label)
|
|
51396
|
-
})
|
|
51397
|
-
});
|
|
51398
|
-
if (response.ok || response.status === 422) {
|
|
51399
|
-
return;
|
|
51400
|
-
}
|
|
51401
|
-
throw new Error(`GitHub label setup failed for ${label}: ${response.status}`);
|
|
51402
|
-
};
|
|
51403
|
-
var createGitHubIssue = async ({
|
|
51404
|
-
repository,
|
|
51405
|
-
title,
|
|
51406
|
-
body,
|
|
51407
|
-
labels
|
|
51408
|
-
}) => {
|
|
51409
|
-
const token = githubToken();
|
|
51410
|
-
if (token === undefined || token.length === 0) {
|
|
51411
|
-
throw new Error("GitHub auth is required. Run `gh auth login` or set GH_TOKEN/GITHUB_TOKEN.");
|
|
51412
|
-
}
|
|
51413
|
-
for (const label of labels) {
|
|
51414
|
-
await createLabelIfMissing({ token, repository, label });
|
|
51415
|
-
}
|
|
51416
|
-
const { owner, repo } = parseRepository(repository);
|
|
51417
|
-
const response = await fetch(`${githubApiBaseUrl}/repos/${owner}/${repo}/issues`, {
|
|
51418
|
-
method: "POST",
|
|
51419
|
-
headers: githubHeaders(token),
|
|
51420
|
-
body: JSON.stringify({ title, body, labels })
|
|
51421
|
-
});
|
|
51422
|
-
if (!response.ok) {
|
|
51423
|
-
throw new Error(`GitHub issue creation failed: ${response.status}`);
|
|
51424
|
-
}
|
|
51425
|
-
const issue = await response.json();
|
|
51426
|
-
if (typeof issue.number !== "number" || typeof issue.html_url !== "string" || typeof issue.title !== "string") {
|
|
51427
|
-
throw new Error("GitHub issue creation returned an unexpected response.");
|
|
51428
|
-
}
|
|
51429
|
-
return {
|
|
51430
|
-
number: issue.number,
|
|
51431
|
-
htmlUrl: issue.html_url,
|
|
51432
|
-
title: issue.title
|
|
51433
|
-
};
|
|
51434
|
-
};
|
|
51435
|
-
|
|
51436
|
-
// src/telemetry/product.ts
|
|
51437
|
-
import { randomUUID } from "crypto";
|
|
51438
|
-
import { execFileSync as execFileSync2 } from "child_process";
|
|
51439
|
-
|
|
51440
|
-
// src/content/data.ts
|
|
51441
|
-
import { existsSync, readFileSync } from "fs";
|
|
51442
|
-
import path2 from "path";
|
|
51443
|
-
var findFirst8 = (candidates) => candidates.find((candidate) => existsSync(candidate));
|
|
51444
|
-
var findBundledPackageRoot = () => {
|
|
51445
|
-
let currentDirectory = path2.resolve(import.meta.dirname, "../..");
|
|
51446
|
-
while (true) {
|
|
51447
|
-
if (existsSync(path2.join(currentDirectory, "package.json"))) {
|
|
51448
|
-
return currentDirectory;
|
|
51449
|
-
}
|
|
51450
|
-
const parentDirectory = path2.dirname(currentDirectory);
|
|
51451
|
-
if (parentDirectory === currentDirectory) {
|
|
51452
|
-
break;
|
|
51453
|
-
}
|
|
51454
|
-
currentDirectory = parentDirectory;
|
|
51455
|
-
}
|
|
51456
|
-
return path2.resolve(import.meta.dirname, "../..");
|
|
51457
|
-
};
|
|
51458
|
-
var packageRoot = findBundledPackageRoot();
|
|
51459
|
-
var runtimeRoot = import.meta.dirname;
|
|
51460
|
-
var dataCandidates = [
|
|
51461
|
-
path2.join(runtimeRoot, "data"),
|
|
51462
|
-
path2.resolve(import.meta.dirname, "../data"),
|
|
51463
|
-
path2.join(packageRoot, "src/data"),
|
|
51464
|
-
path2.resolve(import.meta.dirname, "../../src/data")
|
|
51465
|
-
];
|
|
51466
|
-
var skillCandidates = [
|
|
51467
|
-
path2.join(runtimeRoot, "skills"),
|
|
51468
|
-
path2.join(packageRoot, "skills"),
|
|
51469
|
-
path2.resolve(import.meta.dirname, "../../skills"),
|
|
51470
|
-
path2.resolve(import.meta.dirname, "../skills")
|
|
51471
|
-
];
|
|
51472
|
-
var resolvedDataRoot = findFirst8(dataCandidates);
|
|
51473
|
-
var resolvedSkillsRoot = findFirst8(skillCandidates);
|
|
51474
|
-
if (resolvedDataRoot === undefined) {
|
|
51475
|
-
throw new Error("Could not locate bundled data directory.");
|
|
51476
|
-
}
|
|
51477
|
-
if (resolvedSkillsRoot === undefined) {
|
|
51478
|
-
throw new Error("Could not locate bundled skills directory.");
|
|
51479
|
-
}
|
|
51480
|
-
var dataRoot = resolvedDataRoot;
|
|
51481
|
-
var skillsRoot = resolvedSkillsRoot;
|
|
51482
|
-
var dataPath = (...segments) => path2.join(dataRoot, ...segments);
|
|
51483
|
-
var readDataFile = (...segments) => readFileSync(dataPath(...segments), "utf8");
|
|
51484
|
-
var readBaselineDataFile = (baselineDataRoot, ...segments) => readFileSync(path2.join(baselineDataRoot, ...segments), "utf8");
|
|
51485
|
-
var resolveBaselinePath = ({
|
|
51486
|
-
baselineRoot,
|
|
51487
|
-
baselineSkillsRoot,
|
|
51488
|
-
relativePath
|
|
51489
|
-
}) => {
|
|
51490
|
-
const resolvedPath = relativePath.startsWith("skills/") ? findFirst8([
|
|
51491
|
-
path2.join(baselineSkillsRoot, relativePath.slice("skills/".length)),
|
|
51492
|
-
path2.join(baselineRoot, relativePath)
|
|
51493
|
-
]) : findFirst8([path2.join(baselineRoot, relativePath)]);
|
|
51494
|
-
if (resolvedPath !== undefined) {
|
|
51495
|
-
return resolvedPath;
|
|
51496
|
-
}
|
|
51497
|
-
throw new Error(`Could not locate baseline asset: ${relativePath}`);
|
|
51498
|
-
};
|
|
51499
|
-
|
|
51500
|
-
// src/control-plane/config.ts
|
|
51501
|
-
var trimTrailingSlashes = (value6) => value6.trim().replace(/\/+$/u, "");
|
|
51502
|
-
var bundledControlPlaneUrl = () => {
|
|
51503
|
-
if (process.env.DP_DISABLE_BUNDLED_CONTROL_PLANE_URL === "1") {
|
|
51504
|
-
return;
|
|
51505
|
-
}
|
|
51506
|
-
const config2 = JSON.parse(readDataFile("control-plane.json"));
|
|
51507
|
-
return typeof config2.defaultUrl === "string" && config2.defaultUrl.trim().length > 0 ? trimTrailingSlashes(config2.defaultUrl) : undefined;
|
|
51508
|
-
};
|
|
51509
|
-
var resolveControlPlaneUrl = (explicitUrl) => {
|
|
51510
|
-
const baseUrl2 = explicitUrl?.trim() || process.env.DP_CONTROL_PLANE_URL?.trim() || bundledControlPlaneUrl();
|
|
51511
|
-
return baseUrl2 === undefined || baseUrl2.length === 0 ? undefined : trimTrailingSlashes(baseUrl2);
|
|
51512
|
-
};
|
|
51513
51334
|
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpApiClient.js
|
|
51514
51335
|
var exports_HttpApiClient = {};
|
|
51515
51336
|
__export(exports_HttpApiClient, {
|
|
@@ -51650,11 +51471,11 @@ var endpoint = (api, options8) => {
|
|
|
51650
51471
|
}).pipe(map17(() => client));
|
|
51651
51472
|
};
|
|
51652
51473
|
var paramsRegex = /:(\w+)\??/g;
|
|
51653
|
-
var compilePath = (
|
|
51654
|
-
const segments =
|
|
51474
|
+
var compilePath = (path2) => {
|
|
51475
|
+
const segments = path2.split(paramsRegex);
|
|
51655
51476
|
const len = segments.length;
|
|
51656
51477
|
if (len === 1) {
|
|
51657
|
-
return (_) =>
|
|
51478
|
+
return (_) => path2;
|
|
51658
51479
|
}
|
|
51659
51480
|
return (params2) => {
|
|
51660
51481
|
let url2 = segments[0];
|
|
@@ -51893,7 +51714,7 @@ var make76 = (method) => (name, ...args2) => {
|
|
|
51893
51714
|
});
|
|
51894
51715
|
}
|
|
51895
51716
|
return (segments, ...schemas) => {
|
|
51896
|
-
let
|
|
51717
|
+
let path2 = segments[0].replace(":", "::");
|
|
51897
51718
|
let pathSchema = none2();
|
|
51898
51719
|
if (schemas.length > 0) {
|
|
51899
51720
|
const obj = {};
|
|
@@ -51902,13 +51723,13 @@ var make76 = (method) => (name, ...args2) => {
|
|
|
51902
51723
|
const key = getParam(schema.ast) ?? String(i);
|
|
51903
51724
|
const optional5 = schema.ast._tag === "PropertySignatureTransformation" && schema.ast.from.isOptional || schema.ast._tag === "PropertySignatureDeclaration" && schema.ast.isOptional;
|
|
51904
51725
|
obj[key] = schema;
|
|
51905
|
-
|
|
51726
|
+
path2 += `:${key}${optional5 ? "?" : ""}${segments[i + 1].replace(":", "::")}`;
|
|
51906
51727
|
}
|
|
51907
51728
|
pathSchema = some2(Struct(obj));
|
|
51908
51729
|
}
|
|
51909
51730
|
return makeProto3({
|
|
51910
51731
|
name,
|
|
51911
|
-
path:
|
|
51732
|
+
path: path2,
|
|
51912
51733
|
method,
|
|
51913
51734
|
pathSchema,
|
|
51914
51735
|
urlParamsSchema: none2(),
|
|
@@ -52247,12 +52068,19 @@ var HarnessReportSeverity = exports_Schema.Literal("low", "medium", "high");
|
|
|
52247
52068
|
var HarnessReportStatus = exports_Schema.Literal("new", "triaged", "accepted", "wontfix", "resolved");
|
|
52248
52069
|
|
|
52249
52070
|
class HarnessReportInput extends exports_Schema.Class("HarnessReportInput")({
|
|
52250
|
-
title: exports_Schema.String,
|
|
52251
|
-
body: exports_Schema.String,
|
|
52071
|
+
title: exports_Schema.optional(exports_Schema.String),
|
|
52072
|
+
body: exports_Schema.optional(exports_Schema.String),
|
|
52252
52073
|
type: HarnessReportType,
|
|
52253
52074
|
severity: HarnessReportSeverity,
|
|
52254
52075
|
createdAt: IsoDateTimeString,
|
|
52255
52076
|
cliVersion: exports_Schema.String,
|
|
52077
|
+
area: exports_Schema.optional(exports_Schema.String),
|
|
52078
|
+
skillPack: exports_Schema.optional(exports_Schema.String),
|
|
52079
|
+
command: exports_Schema.optional(exports_Schema.String),
|
|
52080
|
+
expected: exports_Schema.optional(exports_Schema.String),
|
|
52081
|
+
actual: exports_Schema.optional(exports_Schema.String),
|
|
52082
|
+
steps: exports_Schema.optional(exports_Schema.String),
|
|
52083
|
+
labels: exports_Schema.optional(exports_Schema.Array(exports_Schema.String)),
|
|
52256
52084
|
projectUsageId: exports_Schema.optional(exports_Schema.String),
|
|
52257
52085
|
repository: exports_Schema.optional(ObservedRepositoryInput),
|
|
52258
52086
|
operator: exports_Schema.optional(OperatorIdentity),
|
|
@@ -52263,7 +52091,10 @@ class HarnessReportInput extends exports_Schema.Class("HarnessReportInput")({
|
|
|
52263
52091
|
class HarnessReportCreated extends exports_Schema.Class("HarnessReportCreated")({
|
|
52264
52092
|
reportId: exports_Schema.String,
|
|
52265
52093
|
status: HarnessReportStatus,
|
|
52266
|
-
githubUrl: exports_Schema.optional(exports_Schema.String)
|
|
52094
|
+
githubUrl: exports_Schema.optional(exports_Schema.String),
|
|
52095
|
+
title: exports_Schema.optional(exports_Schema.String),
|
|
52096
|
+
deduplicated: exports_Schema.optional(exports_Schema.Boolean),
|
|
52097
|
+
duplicateOf: exports_Schema.optional(exports_Schema.String)
|
|
52267
52098
|
}) {
|
|
52268
52099
|
}
|
|
52269
52100
|
|
|
@@ -52337,7 +52168,8 @@ class ProjectUsageSummary extends exports_Schema.Class("ProjectUsageSummary")({
|
|
|
52337
52168
|
}
|
|
52338
52169
|
|
|
52339
52170
|
class ProjectUsageList extends exports_Schema.Class("ProjectUsageList")({
|
|
52340
|
-
projects: exports_Schema.Array(ProjectUsageSummary)
|
|
52171
|
+
projects: exports_Schema.Array(ProjectUsageSummary),
|
|
52172
|
+
reports: exports_Schema.Array(HarnessReportSummary)
|
|
52341
52173
|
}) {
|
|
52342
52174
|
}
|
|
52343
52175
|
|
|
@@ -52403,14 +52235,100 @@ var recordProductTelemetryEvent = (options9) => exports_Effect.gen(function* ()
|
|
|
52403
52235
|
payload: options9.event
|
|
52404
52236
|
});
|
|
52405
52237
|
});
|
|
52238
|
+
var submitHarnessReport = (options9) => exports_Effect.gen(function* () {
|
|
52239
|
+
const client2 = yield* makeHarnessClient({
|
|
52240
|
+
baseUrl: options9.baseUrl
|
|
52241
|
+
});
|
|
52242
|
+
return yield* client2.reports.submit({
|
|
52243
|
+
payload: options9.report
|
|
52244
|
+
});
|
|
52245
|
+
});
|
|
52246
|
+
|
|
52247
|
+
// src/content/data.ts
|
|
52248
|
+
import { existsSync, readFileSync } from "fs";
|
|
52249
|
+
import path2 from "path";
|
|
52250
|
+
var findFirst8 = (candidates) => candidates.find((candidate) => existsSync(candidate));
|
|
52251
|
+
var findBundledPackageRoot = () => {
|
|
52252
|
+
let currentDirectory = path2.resolve(import.meta.dirname, "../..");
|
|
52253
|
+
while (true) {
|
|
52254
|
+
if (existsSync(path2.join(currentDirectory, "package.json"))) {
|
|
52255
|
+
return currentDirectory;
|
|
52256
|
+
}
|
|
52257
|
+
const parentDirectory = path2.dirname(currentDirectory);
|
|
52258
|
+
if (parentDirectory === currentDirectory) {
|
|
52259
|
+
break;
|
|
52260
|
+
}
|
|
52261
|
+
currentDirectory = parentDirectory;
|
|
52262
|
+
}
|
|
52263
|
+
return path2.resolve(import.meta.dirname, "../..");
|
|
52264
|
+
};
|
|
52265
|
+
var packageRoot = findBundledPackageRoot();
|
|
52266
|
+
var runtimeRoot = import.meta.dirname;
|
|
52267
|
+
var dataCandidates = [
|
|
52268
|
+
path2.join(runtimeRoot, "data"),
|
|
52269
|
+
path2.resolve(import.meta.dirname, "../data"),
|
|
52270
|
+
path2.join(packageRoot, "src/data"),
|
|
52271
|
+
path2.resolve(import.meta.dirname, "../../src/data")
|
|
52272
|
+
];
|
|
52273
|
+
var skillCandidates = [
|
|
52274
|
+
path2.join(runtimeRoot, "skills"),
|
|
52275
|
+
path2.join(packageRoot, "skills"),
|
|
52276
|
+
path2.resolve(import.meta.dirname, "../../skills"),
|
|
52277
|
+
path2.resolve(import.meta.dirname, "../skills")
|
|
52278
|
+
];
|
|
52279
|
+
var resolvedDataRoot = findFirst8(dataCandidates);
|
|
52280
|
+
var resolvedSkillsRoot = findFirst8(skillCandidates);
|
|
52281
|
+
if (resolvedDataRoot === undefined) {
|
|
52282
|
+
throw new Error("Could not locate bundled data directory.");
|
|
52283
|
+
}
|
|
52284
|
+
if (resolvedSkillsRoot === undefined) {
|
|
52285
|
+
throw new Error("Could not locate bundled skills directory.");
|
|
52286
|
+
}
|
|
52287
|
+
var dataRoot = resolvedDataRoot;
|
|
52288
|
+
var skillsRoot = resolvedSkillsRoot;
|
|
52289
|
+
var dataPath = (...segments) => path2.join(dataRoot, ...segments);
|
|
52290
|
+
var readDataFile = (...segments) => readFileSync(dataPath(...segments), "utf8");
|
|
52291
|
+
var readBaselineDataFile = (baselineDataRoot, ...segments) => readFileSync(path2.join(baselineDataRoot, ...segments), "utf8");
|
|
52292
|
+
var resolveBaselinePath = ({
|
|
52293
|
+
baselineRoot,
|
|
52294
|
+
baselineSkillsRoot,
|
|
52295
|
+
relativePath
|
|
52296
|
+
}) => {
|
|
52297
|
+
const resolvedPath = relativePath.startsWith("skills/") ? findFirst8([
|
|
52298
|
+
path2.join(baselineSkillsRoot, relativePath.slice("skills/".length)),
|
|
52299
|
+
path2.join(baselineRoot, relativePath)
|
|
52300
|
+
]) : findFirst8([path2.join(baselineRoot, relativePath)]);
|
|
52301
|
+
if (resolvedPath !== undefined) {
|
|
52302
|
+
return resolvedPath;
|
|
52303
|
+
}
|
|
52304
|
+
throw new Error(`Could not locate baseline asset: ${relativePath}`);
|
|
52305
|
+
};
|
|
52306
|
+
|
|
52307
|
+
// src/control-plane/config.ts
|
|
52308
|
+
var trimTrailingSlashes = (value6) => value6.trim().replace(/\/+$/u, "");
|
|
52309
|
+
var bundledControlPlaneUrl = () => {
|
|
52310
|
+
if (process.env.DP_DISABLE_BUNDLED_CONTROL_PLANE_URL === "1") {
|
|
52311
|
+
return;
|
|
52312
|
+
}
|
|
52313
|
+
const config2 = JSON.parse(readDataFile("control-plane.json"));
|
|
52314
|
+
return typeof config2.defaultUrl === "string" && config2.defaultUrl.trim().length > 0 ? trimTrailingSlashes(config2.defaultUrl) : undefined;
|
|
52315
|
+
};
|
|
52316
|
+
var resolveControlPlaneUrl = (explicitUrl) => {
|
|
52317
|
+
const baseUrl2 = explicitUrl?.trim() || process.env.DP_CONTROL_PLANE_URL?.trim() || bundledControlPlaneUrl();
|
|
52318
|
+
return baseUrl2 === undefined || baseUrl2.length === 0 ? undefined : trimTrailingSlashes(baseUrl2);
|
|
52319
|
+
};
|
|
52320
|
+
|
|
52321
|
+
// src/telemetry/product.ts
|
|
52322
|
+
import { randomUUID } from "crypto";
|
|
52323
|
+
import { execFileSync } from "child_process";
|
|
52406
52324
|
|
|
52407
52325
|
// package.json
|
|
52408
52326
|
var name = "@punks/cli";
|
|
52409
|
-
var version = "2.1.
|
|
52327
|
+
var version = "2.1.10";
|
|
52410
52328
|
// src/telemetry/product.ts
|
|
52411
52329
|
var git = (cwd, args2) => {
|
|
52412
52330
|
try {
|
|
52413
|
-
return
|
|
52331
|
+
return execFileSync("git", args2, {
|
|
52414
52332
|
cwd,
|
|
52415
52333
|
encoding: "utf8",
|
|
52416
52334
|
stdio: ["ignore", "pipe", "ignore"]
|
|
@@ -52670,15 +52588,15 @@ var renderCommandGuide = () => [
|
|
|
52670
52588
|
"usage:",
|
|
52671
52589
|
" \u2022 agents should activate `$dp-cli` before acting on `.devpunks` output",
|
|
52672
52590
|
" \u2022 start with `punks scaffold` to inspect the lifecycle",
|
|
52673
|
-
" \u2022 use `punks scaffold init` to choose the backlog provider and
|
|
52591
|
+
" \u2022 use `punks scaffold init` to choose the backlog provider and start docs onboarding/wiki output",
|
|
52674
52592
|
" \u2022 reconcile the seeded wiki into the real repo layout before writing durable docs",
|
|
52675
52593
|
" \u2022 use `punks scaffold setup` for repo-aware pack detection after repo boilerplate is ready",
|
|
52676
52594
|
" \u2022 use `punks update` after setup to pull newer scaffolded skills/prompts/manifests/hooks",
|
|
52677
|
-
" \u2022 use `punks report` when reusable Harness friction should
|
|
52678
|
-
" \u2022 reports
|
|
52595
|
+
" \u2022 use `punks report` when reusable Harness friction should open GitHub-backed triage",
|
|
52596
|
+
" \u2022 accepted reports return a GitHub issue URL; missing server GitHub credentials fail the command",
|
|
52679
52597
|
"",
|
|
52680
52598
|
"operator notes:",
|
|
52681
|
-
" \u2022 init copies
|
|
52599
|
+
" \u2022 init copies docs-onboarding, requirements/backlog/spec skills, backlog-provider pin, and the initial wiki structure",
|
|
52682
52600
|
" \u2022 `setup` remains the repo-aware pack-driven scaffold flow",
|
|
52683
52601
|
" \u2022 each command prints an operator-facing next-step prompt"
|
|
52684
52602
|
].join(`
|
|
@@ -52699,7 +52617,7 @@ var renderStageIntro = ({
|
|
|
52699
52617
|
"",
|
|
52700
52618
|
"usage:",
|
|
52701
52619
|
" \u2022 agents should activate `$dp-cli` before following generated output",
|
|
52702
|
-
" \u2022 use this to choose the backlog provider, scaffold requirements/backlog skills, and seed the initial wiki tree",
|
|
52620
|
+
" \u2022 use this to choose the backlog provider, scaffold docs-onboarding plus requirements/backlog/spec skills, and seed the initial wiki tree",
|
|
52703
52621
|
" \u2022 reconcile the wiki into the real repo layout, such as `apps/wiki` in a monorepo",
|
|
52704
52622
|
" \u2022 rerunning this command overwrites only the files for this stage",
|
|
52705
52623
|
" \u2022 read the generated prompt/output and follow it before running repo-aware setup"
|
|
@@ -52733,7 +52651,7 @@ var renderScaffoldGuide = () => [
|
|
|
52733
52651
|
"",
|
|
52734
52652
|
"commands:",
|
|
52735
52653
|
" \u203A punks scaffold init",
|
|
52736
|
-
" \u2514
|
|
52654
|
+
" \u2514 onboarding gate: pick backlog provider, scaffold `docs-onboarding`, reconstruct wiki/spec context",
|
|
52737
52655
|
" \u203A punks scaffold setup",
|
|
52738
52656
|
" \u2514 repo-aware setup: detect packs, scaffold prompts/manifests/hooks",
|
|
52739
52657
|
"",
|
|
@@ -52786,9 +52704,9 @@ var renderJsonLabel = () => paint(`${brandPalette.bold}${brandPalette.lilac}`, "
|
|
|
52786
52704
|
var renderDivider = () => paint(`${brandPalette.dim}${brandPalette.border}`, "\u2500".repeat(sectionWidth));
|
|
52787
52705
|
|
|
52788
52706
|
// src/cli/report-command.ts
|
|
52789
|
-
var
|
|
52790
|
-
var titleOption = exports_Options.text("title").pipe(exports_Options.withDescription("
|
|
52791
|
-
var bodyOption = exports_Options.text("body").pipe(exports_Options.withDescription("
|
|
52707
|
+
var messageOption = exports_Options.optional(exports_Options.text("message").pipe(exports_Options.withDescription("Raw report text for Harness triage.")));
|
|
52708
|
+
var titleOption = exports_Options.optional(exports_Options.text("title").pipe(exports_Options.withDescription("Deprecated: optional title hint. The API generates the final title.")));
|
|
52709
|
+
var bodyOption = exports_Options.optional(exports_Options.text("body").pipe(exports_Options.withDescription("Deprecated: optional body hint. The API generates the final body.")));
|
|
52792
52710
|
var typeOption = exports_Options.choice("type", [
|
|
52793
52711
|
"bug",
|
|
52794
52712
|
"docs",
|
|
@@ -52807,7 +52725,6 @@ var areaOption = exports_Options.choice("area", [
|
|
|
52807
52725
|
"other"
|
|
52808
52726
|
]).pipe(exports_Options.withDefault("other"), exports_Options.withDescription("Harness area."));
|
|
52809
52727
|
var repoRootOption = exports_Options.text("repo-root").pipe(exports_Options.withDefault(process.cwd()), exports_Options.withDescription("Repository root used for safe git context."));
|
|
52810
|
-
var repositoryOption = exports_Options.text("repository").pipe(exports_Options.withDefault(harnessReportsRepository), exports_Options.withDescription("GitHub repository that receives report issues."));
|
|
52811
52728
|
var skillPackOption = exports_Options.optional(exports_Options.text("skill-pack").pipe(exports_Options.withDescription("Affected skill pack, for example `dp-cli` or `docs-ingest-phase`.")));
|
|
52812
52729
|
var commandOption = exports_Options.optional(exports_Options.text("command").pipe(exports_Options.withDescription("Affected CLI command, for example `dp report` or `dp scaffold init`.")));
|
|
52813
52730
|
var expectedOption = exports_Options.optional(exports_Options.text("expected").pipe(exports_Options.withDescription("Expected behavior.")));
|
|
@@ -52828,16 +52745,33 @@ var csvLabels = (value6) => value6 === undefined ? [] : value6.split(",").map((l
|
|
|
52828
52745
|
var buildHarnessReport = ({
|
|
52829
52746
|
title,
|
|
52830
52747
|
body,
|
|
52748
|
+
message,
|
|
52831
52749
|
type: type2,
|
|
52832
52750
|
severity,
|
|
52833
|
-
|
|
52751
|
+
area,
|
|
52752
|
+
repoRoot,
|
|
52753
|
+
skillPack,
|
|
52754
|
+
command,
|
|
52755
|
+
expected,
|
|
52756
|
+
actual,
|
|
52757
|
+
steps,
|
|
52758
|
+
labels
|
|
52834
52759
|
}) => ({
|
|
52835
|
-
title:
|
|
52836
|
-
body: nonEmpty(body,
|
|
52760
|
+
...title === undefined ? {} : { title },
|
|
52761
|
+
body: nonEmpty(body ?? message ?? [actual, expected, steps].filter(Boolean).join(`
|
|
52762
|
+
|
|
52763
|
+
`), "body"),
|
|
52837
52764
|
type: type2,
|
|
52838
52765
|
severity,
|
|
52839
52766
|
createdAt: new Date().toISOString(),
|
|
52840
52767
|
cliVersion: version,
|
|
52768
|
+
area,
|
|
52769
|
+
...skillPack === undefined ? {} : { skillPack },
|
|
52770
|
+
...command === undefined ? {} : { command },
|
|
52771
|
+
...expected === undefined ? {} : { expected },
|
|
52772
|
+
...actual === undefined ? {} : { actual },
|
|
52773
|
+
...steps === undefined ? {} : { steps },
|
|
52774
|
+
...labels === undefined ? {} : { labels },
|
|
52841
52775
|
repository: observedRepository(repoRoot)
|
|
52842
52776
|
});
|
|
52843
52777
|
var buildHarnessReportLabels = ({
|
|
@@ -52861,76 +52795,14 @@ var buildHarnessReportLabels = ({
|
|
|
52861
52795
|
].filter((label) => label !== undefined && label.length > 0);
|
|
52862
52796
|
return [...new Set(labels)];
|
|
52863
52797
|
};
|
|
52864
|
-
var buildHarnessReportIssueBody = ({
|
|
52865
|
-
report,
|
|
52866
|
-
area,
|
|
52867
|
-
skillPack,
|
|
52868
|
-
command,
|
|
52869
|
-
expected,
|
|
52870
|
-
actual,
|
|
52871
|
-
steps
|
|
52872
|
-
}) => {
|
|
52873
|
-
const metadata = {
|
|
52874
|
-
schema: "harness-report.v1",
|
|
52875
|
-
type: report.type,
|
|
52876
|
-
severity: report.severity,
|
|
52877
|
-
area,
|
|
52878
|
-
skillPack,
|
|
52879
|
-
command,
|
|
52880
|
-
createdAt: report.createdAt,
|
|
52881
|
-
cliVersion: report.cliVersion,
|
|
52882
|
-
repository: report.repository
|
|
52883
|
-
};
|
|
52884
|
-
const optionalSections = [
|
|
52885
|
-
expected === undefined ? undefined : `## Expected
|
|
52886
|
-
|
|
52887
|
-
${expected}`,
|
|
52888
|
-
actual === undefined ? undefined : `## Actual
|
|
52889
|
-
|
|
52890
|
-
${actual}`,
|
|
52891
|
-
steps === undefined ? undefined : `## Evidence / Steps
|
|
52892
|
-
|
|
52893
|
-
${steps}`
|
|
52894
|
-
].filter((section) => section !== undefined);
|
|
52895
|
-
return [
|
|
52896
|
-
"<!-- harness-report",
|
|
52897
|
-
JSON.stringify(metadata, null, 2),
|
|
52898
|
-
"-->",
|
|
52899
|
-
`## Summary
|
|
52900
|
-
|
|
52901
|
-
${report.body}`,
|
|
52902
|
-
...optionalSections,
|
|
52903
|
-
"## Classification",
|
|
52904
|
-
[
|
|
52905
|
-
`- Type: ${report.type}`,
|
|
52906
|
-
`- Severity: ${report.severity}`,
|
|
52907
|
-
`- Area: ${area}`,
|
|
52908
|
-
skillPack === undefined ? undefined : `- Skill pack: ${skillPack}`,
|
|
52909
|
-
command === undefined ? undefined : `- Command: ${command}`,
|
|
52910
|
-
`- CLI version: ${report.cliVersion}`
|
|
52911
|
-
].filter((line4) => line4 !== undefined).join(`
|
|
52912
|
-
`),
|
|
52913
|
-
"## Observed Repository",
|
|
52914
|
-
[
|
|
52915
|
-
`- Remote: ${report.repository?.remoteUrl ?? "unknown"}`,
|
|
52916
|
-
`- Host: ${report.repository?.remoteHost ?? "unknown"}`,
|
|
52917
|
-
`- Path: ${report.repository?.remotePath ?? "unknown"}`,
|
|
52918
|
-
`- Commit: ${report.repository?.commitSha ?? "unknown"}`,
|
|
52919
|
-
`- Dirty: ${report.repository?.dirty === undefined ? "unknown" : String(report.repository.dirty)}`
|
|
52920
|
-
].join(`
|
|
52921
|
-
`)
|
|
52922
|
-
].join(`
|
|
52923
|
-
|
|
52924
|
-
`);
|
|
52925
|
-
};
|
|
52926
52798
|
var reportCommand = exports_Command.make("report", {
|
|
52799
|
+
message: messageOption,
|
|
52927
52800
|
title: titleOption,
|
|
52928
52801
|
body: bodyOption,
|
|
52929
52802
|
type: typeOption,
|
|
52930
52803
|
severity: severityOption,
|
|
52931
52804
|
area: areaOption,
|
|
52932
52805
|
repoRoot: repoRootOption,
|
|
52933
|
-
repository: repositoryOption,
|
|
52934
52806
|
skillPack: skillPackOption,
|
|
52935
52807
|
command: commandOption,
|
|
52936
52808
|
expected: expectedOption,
|
|
@@ -52939,13 +52811,13 @@ var reportCommand = exports_Command.make("report", {
|
|
|
52939
52811
|
labels: labelsOption,
|
|
52940
52812
|
json: jsonOption
|
|
52941
52813
|
}, ({
|
|
52814
|
+
message,
|
|
52942
52815
|
title,
|
|
52943
52816
|
body,
|
|
52944
52817
|
type: type2,
|
|
52945
52818
|
severity,
|
|
52946
52819
|
area,
|
|
52947
52820
|
repoRoot,
|
|
52948
|
-
repository,
|
|
52949
52821
|
skillPack,
|
|
52950
52822
|
command,
|
|
52951
52823
|
expected,
|
|
@@ -52955,7 +52827,9 @@ var reportCommand = exports_Command.make("report", {
|
|
|
52955
52827
|
json: json2
|
|
52956
52828
|
}) => exports_Effect.tryPromise({
|
|
52957
52829
|
try: async () => {
|
|
52958
|
-
const
|
|
52830
|
+
const titleValue = optionalValue(title);
|
|
52831
|
+
const bodyValue = optionalValue(body);
|
|
52832
|
+
const messageValue = optionalValue(message);
|
|
52959
52833
|
const skillPackValue = optionalValue(skillPack);
|
|
52960
52834
|
const commandValue = optionalValue(command);
|
|
52961
52835
|
const expectedValue = optionalValue(expected);
|
|
@@ -52970,40 +52844,53 @@ var reportCommand = exports_Command.make("report", {
|
|
|
52970
52844
|
...commandValue === undefined ? {} : { command: commandValue },
|
|
52971
52845
|
...extraLabels === undefined ? {} : { extraLabels }
|
|
52972
52846
|
});
|
|
52973
|
-
const
|
|
52974
|
-
|
|
52975
|
-
|
|
52976
|
-
|
|
52977
|
-
|
|
52978
|
-
|
|
52979
|
-
|
|
52980
|
-
|
|
52981
|
-
|
|
52982
|
-
|
|
52983
|
-
|
|
52984
|
-
}
|
|
52847
|
+
const report = buildHarnessReport({
|
|
52848
|
+
...titleValue === undefined ? {} : { title: titleValue },
|
|
52849
|
+
...bodyValue === undefined ? {} : { body: bodyValue },
|
|
52850
|
+
...messageValue === undefined ? {} : { message: messageValue },
|
|
52851
|
+
type: type2,
|
|
52852
|
+
severity,
|
|
52853
|
+
area,
|
|
52854
|
+
repoRoot,
|
|
52855
|
+
...skillPackValue === undefined ? {} : { skillPack: skillPackValue },
|
|
52856
|
+
...commandValue === undefined ? {} : { command: commandValue },
|
|
52857
|
+
...expectedValue === undefined ? {} : { expected: expectedValue },
|
|
52858
|
+
...actualValue === undefined ? {} : { actual: actualValue },
|
|
52859
|
+
...stepsValue === undefined ? {} : { steps: stepsValue },
|
|
52985
52860
|
labels: issueLabels
|
|
52986
52861
|
});
|
|
52862
|
+
const baseUrl2 = resolveControlPlaneUrl();
|
|
52863
|
+
if (baseUrl2 === undefined) {
|
|
52864
|
+
throw new Error("Harness report API URL is not configured.");
|
|
52865
|
+
}
|
|
52866
|
+
const submitted = await exports_Effect.runPromise(submitHarnessReport({ baseUrl: baseUrl2, report }));
|
|
52867
|
+
if (submitted.githubUrl === undefined) {
|
|
52868
|
+
throw new Error("Harness report API did not return a GitHub issue URL.");
|
|
52869
|
+
}
|
|
52987
52870
|
await exports_Effect.runPromise(submitCliEventEffect("cli.harness.report.submitted", {
|
|
52988
52871
|
cwd: repoRoot
|
|
52989
52872
|
}));
|
|
52990
52873
|
if (json2) {
|
|
52991
52874
|
console.log(renderJsonLabel());
|
|
52992
|
-
console.log(JSON.stringify(
|
|
52875
|
+
console.log(JSON.stringify(submitted, null, 2));
|
|
52993
52876
|
return;
|
|
52994
52877
|
}
|
|
52995
|
-
console.log(renderCommandSection("Harness report issue
|
|
52878
|
+
console.log(renderCommandSection(submitted.deduplicated === true ? "Harness report matched existing issue" : "Harness report submitted", [
|
|
52879
|
+
`Issue: ${submitted.githubUrl}`,
|
|
52880
|
+
submitted.title === undefined ? undefined : `Title: ${submitted.title}`,
|
|
52881
|
+
`Status: ${submitted.status}`
|
|
52882
|
+
].filter((line4) => line4 !== undefined).join(`
|
|
52996
52883
|
`)));
|
|
52997
52884
|
},
|
|
52998
|
-
catch: (cause3) => cause3 instanceof Error ? cause3 : new Error("Harness report
|
|
52999
|
-
})).pipe(exports_Command.withDescription("
|
|
52885
|
+
catch: (cause3) => cause3 instanceof Error ? cause3 : new Error("Harness report submission failed.")
|
|
52886
|
+
})).pipe(exports_Command.withDescription("Submit reusable Harness friction to GitHub-backed maintainer triage."));
|
|
53000
52887
|
|
|
53001
52888
|
// src/cli/scaffold-command.ts
|
|
53002
52889
|
import path13 from "path";
|
|
53003
52890
|
|
|
53004
52891
|
// src/baseline/resolve.ts
|
|
53005
52892
|
import { createHash } from "crypto";
|
|
53006
|
-
import { execFileSync as
|
|
52893
|
+
import { execFileSync as execFileSync2 } from "child_process";
|
|
53007
52894
|
import { existsSync as existsSync2, mkdirSync, mkdtempSync, readFileSync as readFileSync3, rmSync, writeFileSync } from "fs";
|
|
53008
52895
|
import { tmpdir as tmpdir2 } from "os";
|
|
53009
52896
|
import path5 from "path";
|
|
@@ -53013,6 +52900,13 @@ import path3 from "path";
|
|
|
53013
52900
|
|
|
53014
52901
|
// src/data/catalog/hooks.ts
|
|
53015
52902
|
var hookCatalog = [
|
|
52903
|
+
{
|
|
52904
|
+
id: "scaffold-update-check",
|
|
52905
|
+
harness: "shared",
|
|
52906
|
+
outputPath: ".agents/hooks/scaffold-update-check.mjs",
|
|
52907
|
+
description: "Shared session-start hook that reports whether managed Harness scaffold output is current.",
|
|
52908
|
+
sourcePath: "hooks/scaffold-update-check.mjs"
|
|
52909
|
+
},
|
|
53016
52910
|
{
|
|
53017
52911
|
id: "format-edited-file",
|
|
53018
52912
|
harness: "shared",
|
|
@@ -53024,25 +52918,25 @@ var hookCatalog = [
|
|
|
53024
52918
|
|
|
53025
52919
|
// src/data/catalog/lint.ts
|
|
53026
52920
|
var sharedReactPlacement = {
|
|
53027
|
-
recommendedConfigFile: ".
|
|
52921
|
+
recommendedConfigFile: "oxlint.config.ts",
|
|
53028
52922
|
recommendedFiles: ["<detected-react-workspace>/**/*.{js,jsx,ts,tsx}"],
|
|
53029
52923
|
recommendedWorkspaces: ["detected React workspaces"],
|
|
53030
52924
|
placementNotes: "Add as an override for detected React-rendered code. Keep backend packages outside this override unless they render React."
|
|
53031
52925
|
};
|
|
53032
52926
|
var webOnlyPlacement = {
|
|
53033
|
-
recommendedConfigFile: ".
|
|
52927
|
+
recommendedConfigFile: "oxlint.config.ts",
|
|
53034
52928
|
recommendedFiles: ["<detected-nextjs-workspace>/**/*.{js,jsx,ts,tsx}"],
|
|
53035
52929
|
recommendedWorkspaces: ["detected Next.js workspaces"],
|
|
53036
52930
|
placementNotes: "Place this in the Next.js app override. If the repo uses a different frontend app path, retarget the file globs to that workspace before composing the final Oxlint config."
|
|
53037
52931
|
};
|
|
53038
52932
|
var effectPlacement = {
|
|
53039
|
-
recommendedConfigFile: ".
|
|
52933
|
+
recommendedConfigFile: "oxlint.config.ts",
|
|
53040
52934
|
recommendedFiles: ["<detected-effect-workspace>/**/*.{js,jsx,ts,tsx}"],
|
|
53041
52935
|
recommendedWorkspaces: ["detected Effect workspaces"],
|
|
53042
52936
|
placementNotes: "Apply this only where Effect code lives. If the target repo renames or splits backend workspaces, move the override with those code paths instead of broadening it repo-wide."
|
|
53043
52937
|
};
|
|
53044
52938
|
var vitestPlacement = {
|
|
53045
|
-
recommendedConfigFile: ".
|
|
52939
|
+
recommendedConfigFile: "oxlint.config.ts",
|
|
53046
52940
|
recommendedFiles: [
|
|
53047
52941
|
"<detected-test-workspace>/**/*.{test,spec}.{js,jsx,ts,tsx}",
|
|
53048
52942
|
"<detected-test-workspace>/src/test/**/*.{js,jsx,ts,tsx}"
|
|
@@ -53053,38 +52947,19 @@ var vitestPlacement = {
|
|
|
53053
52947
|
var lintCatalog = [
|
|
53054
52948
|
{
|
|
53055
52949
|
id: "react-core",
|
|
53056
|
-
description: "
|
|
53057
|
-
|
|
52950
|
+
description: "Ultracite React preset for rendered app and shared UI code.",
|
|
52951
|
+
oxlintPresets: ["react"],
|
|
52952
|
+
plugins: [],
|
|
53058
52953
|
jsPlugins: [],
|
|
53059
52954
|
settings: {},
|
|
53060
|
-
rules: {
|
|
53061
|
-
"react/rules-of-hooks": "error",
|
|
53062
|
-
"react/exhaustive-deps": "error",
|
|
53063
|
-
"react/forward-ref-uses-ref": "error",
|
|
53064
|
-
"react/jsx-key": "error",
|
|
53065
|
-
"react/jsx-no-comment-textnodes": "error",
|
|
53066
|
-
"react/jsx-no-duplicate-props": "error",
|
|
53067
|
-
"react/jsx-no-target-blank": "error",
|
|
53068
|
-
"react/jsx-no-undef": "error",
|
|
53069
|
-
"react/jsx-no-useless-fragment": "error",
|
|
53070
|
-
"react/no-children-prop": "error",
|
|
53071
|
-
"react/no-danger-with-children": "error",
|
|
53072
|
-
"react/no-direct-mutation-state": "error",
|
|
53073
|
-
"react/no-find-dom-node": "error",
|
|
53074
|
-
"react/no-render-return-value": "error",
|
|
53075
|
-
"react/no-string-refs": "error",
|
|
53076
|
-
"react/no-this-in-sfc": "error",
|
|
53077
|
-
"react/no-unknown-property": "error",
|
|
53078
|
-
"react/no-unescaped-entities": "error",
|
|
53079
|
-
"react/no-unsafe": "error",
|
|
53080
|
-
"react/void-dom-elements-no-children": "error"
|
|
53081
|
-
},
|
|
52955
|
+
rules: {},
|
|
53082
52956
|
requiredDevDependencies: [],
|
|
53083
52957
|
placement: sharedReactPlacement
|
|
53084
52958
|
},
|
|
53085
52959
|
{
|
|
53086
52960
|
id: "react-hooks",
|
|
53087
52961
|
description: "React Hooks lint rules via the JS plugin bridge for Oxlint.",
|
|
52962
|
+
oxlintPresets: [],
|
|
53088
52963
|
plugins: [],
|
|
53089
52964
|
jsPlugins: [
|
|
53090
52965
|
{
|
|
@@ -53094,6 +52969,7 @@ var lintCatalog = [
|
|
|
53094
52969
|
],
|
|
53095
52970
|
settings: {},
|
|
53096
52971
|
rules: {
|
|
52972
|
+
"react-hooks-js/exhaustive-deps": "error",
|
|
53097
52973
|
"react-hooks-js/component-hook-factories": "error",
|
|
53098
52974
|
"react-hooks-js/config": "error",
|
|
53099
52975
|
"react-hooks-js/error-boundaries": "error",
|
|
@@ -53104,6 +52980,7 @@ var lintCatalog = [
|
|
|
53104
52980
|
"react-hooks-js/preserve-manual-memoization": "error",
|
|
53105
52981
|
"react-hooks-js/purity": "error",
|
|
53106
52982
|
"react-hooks-js/refs": "error",
|
|
52983
|
+
"react-hooks-js/rules-of-hooks": "error",
|
|
53107
52984
|
"react-hooks-js/set-state-in-effect": "error",
|
|
53108
52985
|
"react-hooks-js/set-state-in-render": "error",
|
|
53109
52986
|
"react-hooks-js/static-components": "error",
|
|
@@ -53116,6 +52993,7 @@ var lintCatalog = [
|
|
|
53116
52993
|
{
|
|
53117
52994
|
id: "react-you-might-not-need-an-effect",
|
|
53118
52995
|
description: "Guidance rules that push React code away from unnecessary effects.",
|
|
52996
|
+
oxlintPresets: [],
|
|
53119
52997
|
plugins: [],
|
|
53120
52998
|
jsPlugins: [
|
|
53121
52999
|
{
|
|
@@ -53128,7 +53006,6 @@ var lintCatalog = [
|
|
|
53128
53006
|
"react-you-might-not-need-an-effect-js/no-adjust-state-on-prop-change": "error",
|
|
53129
53007
|
"react-you-might-not-need-an-effect-js/no-chain-state-updates": "error",
|
|
53130
53008
|
"react-you-might-not-need-an-effect-js/no-derived-state": "error",
|
|
53131
|
-
"react-you-might-not-need-an-effect-js/no-empty-effect": "error",
|
|
53132
53009
|
"react-you-might-not-need-an-effect-js/no-event-handler": "error",
|
|
53133
53010
|
"react-you-might-not-need-an-effect-js/no-initialize-state": "error",
|
|
53134
53011
|
"react-you-might-not-need-an-effect-js/no-pass-data-to-parent": "error",
|
|
@@ -53140,31 +53017,12 @@ var lintCatalog = [
|
|
|
53140
53017
|
},
|
|
53141
53018
|
{
|
|
53142
53019
|
id: "next-core",
|
|
53143
|
-
description: "Next.js
|
|
53144
|
-
|
|
53020
|
+
description: "Ultracite Next.js preset for the main web application.",
|
|
53021
|
+
oxlintPresets: ["next"],
|
|
53022
|
+
plugins: [],
|
|
53145
53023
|
jsPlugins: [],
|
|
53146
53024
|
settings: {},
|
|
53147
|
-
rules: {
|
|
53148
|
-
"nextjs/inline-script-id": "error",
|
|
53149
|
-
"nextjs/next-script-for-ga": "error",
|
|
53150
|
-
"nextjs/no-assign-module-variable": "error",
|
|
53151
|
-
"nextjs/no-async-client-component": "error",
|
|
53152
|
-
"nextjs/no-before-interactive-script-outside-document": "error",
|
|
53153
|
-
"nextjs/no-css-tags": "error",
|
|
53154
|
-
"nextjs/no-document-import-in-page": "error",
|
|
53155
|
-
"nextjs/no-duplicate-head": "error",
|
|
53156
|
-
"nextjs/no-head-element": "error",
|
|
53157
|
-
"nextjs/no-head-import-in-document": "error",
|
|
53158
|
-
"nextjs/no-html-link-for-pages": "error",
|
|
53159
|
-
"nextjs/no-img-element": "error",
|
|
53160
|
-
"nextjs/no-page-custom-font": "error",
|
|
53161
|
-
"nextjs/no-script-component-in-head": "error",
|
|
53162
|
-
"nextjs/no-styled-jsx-in-document": "error",
|
|
53163
|
-
"nextjs/no-sync-scripts": "error",
|
|
53164
|
-
"nextjs/no-title-in-document-head": "error",
|
|
53165
|
-
"nextjs/no-typos": "error",
|
|
53166
|
-
"nextjs/no-unwanted-polyfillio": "error"
|
|
53167
|
-
},
|
|
53025
|
+
rules: {},
|
|
53168
53026
|
requiredDevDependencies: [],
|
|
53169
53027
|
placement: {
|
|
53170
53028
|
...webOnlyPlacement,
|
|
@@ -53173,25 +53031,13 @@ var lintCatalog = [
|
|
|
53173
53031
|
},
|
|
53174
53032
|
{
|
|
53175
53033
|
id: "tanstack-query-core",
|
|
53176
|
-
description: "TanStack
|
|
53034
|
+
description: "Ultracite TanStack preset for query/router/start framework linting.",
|
|
53035
|
+
oxlintPresets: ["tanstack"],
|
|
53177
53036
|
plugins: [],
|
|
53178
|
-
jsPlugins: [
|
|
53179
|
-
{
|
|
53180
|
-
name: "tanstack-query-js",
|
|
53181
|
-
specifier: "@tanstack/eslint-plugin-query"
|
|
53182
|
-
}
|
|
53183
|
-
],
|
|
53037
|
+
jsPlugins: [],
|
|
53184
53038
|
settings: {},
|
|
53185
|
-
rules: {
|
|
53186
|
-
|
|
53187
|
-
"tanstack-query-js/infinite-query-property-order": "error",
|
|
53188
|
-
"tanstack-query-js/mutation-property-order": "error",
|
|
53189
|
-
"tanstack-query-js/no-rest-destructuring": "warn",
|
|
53190
|
-
"tanstack-query-js/no-unstable-deps": "error",
|
|
53191
|
-
"tanstack-query-js/no-void-query-fn": "error",
|
|
53192
|
-
"tanstack-query-js/stable-query-client": "error"
|
|
53193
|
-
},
|
|
53194
|
-
requiredDevDependencies: ["@tanstack/eslint-plugin-query"],
|
|
53039
|
+
rules: {},
|
|
53040
|
+
requiredDevDependencies: [],
|
|
53195
53041
|
placement: {
|
|
53196
53042
|
...webOnlyPlacement,
|
|
53197
53043
|
placementNotes: "Scope this to client code that owns TanStack Query usage. Keep it out of server-only or shared non-query packages unless those paths actually create queries or mutations."
|
|
@@ -53200,6 +53046,7 @@ var lintCatalog = [
|
|
|
53200
53046
|
{
|
|
53201
53047
|
id: "effect-no-barrel-imports",
|
|
53202
53048
|
description: "Effect architectural rule that blocks barrel-package imports.",
|
|
53049
|
+
oxlintPresets: [],
|
|
53203
53050
|
plugins: [],
|
|
53204
53051
|
jsPlugins: [
|
|
53205
53052
|
{
|
|
@@ -53221,20 +53068,12 @@ var lintCatalog = [
|
|
|
53221
53068
|
},
|
|
53222
53069
|
{
|
|
53223
53070
|
id: "vitest-core",
|
|
53224
|
-
description: "Vitest
|
|
53225
|
-
|
|
53071
|
+
description: "Ultracite Vitest preset for repo-owned test globs.",
|
|
53072
|
+
oxlintPresets: ["vitest"],
|
|
53073
|
+
plugins: [],
|
|
53226
53074
|
jsPlugins: [],
|
|
53227
|
-
settings: {
|
|
53228
|
-
|
|
53229
|
-
typecheck: false
|
|
53230
|
-
}
|
|
53231
|
-
},
|
|
53232
|
-
rules: {
|
|
53233
|
-
"vitest/consistent-each-for": "warn",
|
|
53234
|
-
"vitest/no-conditional-tests": "error",
|
|
53235
|
-
"vitest/no-import-node-test": "error",
|
|
53236
|
-
"vitest/warn-todo": "warn"
|
|
53237
|
-
},
|
|
53075
|
+
settings: {},
|
|
53076
|
+
rules: {},
|
|
53238
53077
|
requiredDevDependencies: [],
|
|
53239
53078
|
placement: vitestPlacement
|
|
53240
53079
|
}
|
|
@@ -53337,12 +53176,12 @@ var packCatalog = [
|
|
|
53337
53176
|
id: "docs",
|
|
53338
53177
|
category: "default",
|
|
53339
53178
|
triggerPackages: [],
|
|
53340
|
-
description: "Default docs pack: docs
|
|
53341
|
-
skills: ["docs-ingest-phase"],
|
|
53179
|
+
description: "Default docs pack: docs ingest plus public-doc writing primitives.",
|
|
53180
|
+
skills: ["docs-ingest-phase", "writing-fragments", "writing-beats", "writing-shape"],
|
|
53342
53181
|
lintAssets: [],
|
|
53343
53182
|
hooks: [],
|
|
53344
53183
|
promptSurfaces: ["shared-agents", "root-prompt-spec", "docs-prompt-spec"],
|
|
53345
|
-
promptDetails: ["shared docs baseline", "docs scope spec"]
|
|
53184
|
+
promptDetails: ["shared docs baseline", "public-doc writing flow", "docs scope spec"]
|
|
53346
53185
|
},
|
|
53347
53186
|
{
|
|
53348
53187
|
id: "drizzle",
|
|
@@ -53447,6 +53286,7 @@ var packCatalog = [
|
|
|
53447
53286
|
"create-spec",
|
|
53448
53287
|
"create-plan",
|
|
53449
53288
|
"implement-spec",
|
|
53289
|
+
"stack",
|
|
53450
53290
|
"resolve-debt-phase"
|
|
53451
53291
|
],
|
|
53452
53292
|
lintAssets: [],
|
|
@@ -53471,7 +53311,7 @@ var packCatalog = [
|
|
|
53471
53311
|
triggerPackages: ["react", "react-dom"],
|
|
53472
53312
|
description: "React guidance pack.",
|
|
53473
53313
|
skills: ["async-react-patterns", "vercel-composition-patterns", "vercel-react-best-practices"],
|
|
53474
|
-
lintAssets: ["react-core", "react-
|
|
53314
|
+
lintAssets: ["react-core", "react-you-might-not-need-an-effect"],
|
|
53475
53315
|
hooks: [],
|
|
53476
53316
|
promptSurfaces: ["shared-agents", "root-prompt-spec", "workspace-prompt-spec"],
|
|
53477
53317
|
promptDetails: ["shared react structure baseline", "workspace react composition rules"]
|
|
@@ -53480,8 +53320,8 @@ var packCatalog = [
|
|
|
53480
53320
|
id: "research",
|
|
53481
53321
|
category: "default",
|
|
53482
53322
|
triggerPackages: [],
|
|
53483
|
-
description: "Default research pack: parallel research, review, and architecture inspection.",
|
|
53484
|
-
skills: ["parallel-research", "review-phase", "improve-codebase-architecture"],
|
|
53323
|
+
description: "Default research pack: parallel research, structured review, and architecture inspection.",
|
|
53324
|
+
skills: ["parallel-research", "review-phase", "autoreview", "improve-codebase-architecture"],
|
|
53485
53325
|
lintAssets: [],
|
|
53486
53326
|
hooks: [],
|
|
53487
53327
|
promptSurfaces: ["shared-agents", "root-prompt-spec", "workspace-prompt-spec"],
|
|
@@ -53695,6 +53535,38 @@ var skillCatalog = [
|
|
|
53695
53535
|
framework: null,
|
|
53696
53536
|
requiresTools: []
|
|
53697
53537
|
},
|
|
53538
|
+
{
|
|
53539
|
+
id: "docs-onboarding",
|
|
53540
|
+
sourceDirectory: "skills/agnostic/docs/docs-onboarding",
|
|
53541
|
+
tier: "agnostic",
|
|
53542
|
+
language: null,
|
|
53543
|
+
framework: null,
|
|
53544
|
+
requiresTools: []
|
|
53545
|
+
},
|
|
53546
|
+
{
|
|
53547
|
+
id: "writing-fragments",
|
|
53548
|
+
sourceDirectory: "skills/agnostic/docs/writing-fragments",
|
|
53549
|
+
tier: "agnostic",
|
|
53550
|
+
language: null,
|
|
53551
|
+
framework: null,
|
|
53552
|
+
requiresTools: []
|
|
53553
|
+
},
|
|
53554
|
+
{
|
|
53555
|
+
id: "writing-beats",
|
|
53556
|
+
sourceDirectory: "skills/agnostic/docs/writing-beats",
|
|
53557
|
+
tier: "agnostic",
|
|
53558
|
+
language: null,
|
|
53559
|
+
framework: null,
|
|
53560
|
+
requiresTools: []
|
|
53561
|
+
},
|
|
53562
|
+
{
|
|
53563
|
+
id: "writing-shape",
|
|
53564
|
+
sourceDirectory: "skills/agnostic/docs/writing-shape",
|
|
53565
|
+
tier: "agnostic",
|
|
53566
|
+
language: null,
|
|
53567
|
+
framework: null,
|
|
53568
|
+
requiresTools: []
|
|
53569
|
+
},
|
|
53698
53570
|
{
|
|
53699
53571
|
id: "effect-authoring",
|
|
53700
53572
|
sourceDirectory: "skills/frameworks/effect/effect-authoring",
|
|
@@ -53783,6 +53655,14 @@ var skillCatalog = [
|
|
|
53783
53655
|
framework: null,
|
|
53784
53656
|
requiresTools: []
|
|
53785
53657
|
},
|
|
53658
|
+
{
|
|
53659
|
+
id: "stack",
|
|
53660
|
+
sourceDirectory: "skills/agnostic/planning/stack",
|
|
53661
|
+
tier: "agnostic",
|
|
53662
|
+
language: null,
|
|
53663
|
+
framework: null,
|
|
53664
|
+
requiresTools: ["stack"]
|
|
53665
|
+
},
|
|
53786
53666
|
{
|
|
53787
53667
|
id: "next-best-practices",
|
|
53788
53668
|
sourceDirectory: "skills/frameworks/nextjs/next-best-practices",
|
|
@@ -53895,6 +53775,14 @@ var skillCatalog = [
|
|
|
53895
53775
|
framework: null,
|
|
53896
53776
|
requiresTools: []
|
|
53897
53777
|
},
|
|
53778
|
+
{
|
|
53779
|
+
id: "autoreview",
|
|
53780
|
+
sourceDirectory: "skills/agnostic/quality/autoreview",
|
|
53781
|
+
tier: "agnostic",
|
|
53782
|
+
language: null,
|
|
53783
|
+
framework: null,
|
|
53784
|
+
requiresTools: []
|
|
53785
|
+
},
|
|
53898
53786
|
{
|
|
53899
53787
|
id: "simplify",
|
|
53900
53788
|
sourceDirectory: "skills/agnostic/quality/simplify",
|
|
@@ -53983,9 +53871,11 @@ var toolCatalog = [
|
|
|
53983
53871
|
},
|
|
53984
53872
|
{
|
|
53985
53873
|
id: "opensrc",
|
|
53986
|
-
packageName: "opensrc",
|
|
53874
|
+
packageName: "opensrc@^0.7.2",
|
|
53987
53875
|
requiredBins: ["node"],
|
|
53988
|
-
ensureCommands: []
|
|
53876
|
+
ensureCommands: [],
|
|
53877
|
+
versionCommand: ["opensrc", "--version"],
|
|
53878
|
+
minimumVersion: "0.7.2"
|
|
53989
53879
|
},
|
|
53990
53880
|
{
|
|
53991
53881
|
id: "portless",
|
|
@@ -53998,6 +53888,12 @@ var toolCatalog = [
|
|
|
53998
53888
|
packageName: "skills",
|
|
53999
53889
|
requiredBins: ["node"],
|
|
54000
53890
|
ensureCommands: []
|
|
53891
|
+
},
|
|
53892
|
+
{
|
|
53893
|
+
id: "stack",
|
|
53894
|
+
packageName: "@kitlangton/stack",
|
|
53895
|
+
requiredBins: ["node"],
|
|
53896
|
+
ensureCommands: []
|
|
54001
53897
|
}
|
|
54002
53898
|
];
|
|
54003
53899
|
|
|
@@ -54055,6 +53951,7 @@ var assetArchiveName = "scaffold-baseline.tgz";
|
|
|
54055
53951
|
var cacheRoot = () => path5.join(process.env.XDG_CACHE_HOME ?? path5.join(process.env.HOME ?? tmpdir2(), ".cache"), "devpunks", "baselines");
|
|
54056
53952
|
var sha256File = (filePath) => createHash("sha256").update(readFileSync3(filePath)).digest("hex");
|
|
54057
53953
|
var isSafeTarPath = (entry) => entry.length > 0 && !path5.isAbsolute(entry) && !entry.split("/").includes("..");
|
|
53954
|
+
var isSafePathSegment = (value6) => value6.length > 0 && value6 !== "." && value6 !== ".." && !value6.includes("/") && !value6.includes("\\");
|
|
54058
53955
|
var isBaselineReleaseTag = (tag6) => tag6.startsWith("baseline/stable/") && !/^v\d+\.\d+\.\d+(?:$|-)/u.test(tag6);
|
|
54059
53956
|
var fetchJson = async (url2, timeoutMs) => {
|
|
54060
53957
|
const controller = new AbortController;
|
|
@@ -54087,7 +53984,7 @@ var download = async (url2, targetPath, timeoutMs) => {
|
|
|
54087
53984
|
}
|
|
54088
53985
|
};
|
|
54089
53986
|
var extractSafeTgz = (archivePath, targetDirectory) => {
|
|
54090
|
-
const listing =
|
|
53987
|
+
const listing = execFileSync2("tar", ["-tzf", archivePath], {
|
|
54091
53988
|
encoding: "utf8"
|
|
54092
53989
|
}).split(/\r?\n/u).filter((line4) => line4.length > 0);
|
|
54093
53990
|
const unsafe = listing.find((entry) => !isSafeTarPath(entry));
|
|
@@ -54095,7 +53992,7 @@ var extractSafeTgz = (archivePath, targetDirectory) => {
|
|
|
54095
53992
|
throw new Error(`Unsafe baseline archive path: ${unsafe}`);
|
|
54096
53993
|
}
|
|
54097
53994
|
mkdirSync(targetDirectory, { recursive: true });
|
|
54098
|
-
|
|
53995
|
+
execFileSync2("tar", ["-xzf", archivePath, "-C", targetDirectory], {
|
|
54099
53996
|
stdio: "ignore"
|
|
54100
53997
|
});
|
|
54101
53998
|
};
|
|
@@ -54116,6 +54013,9 @@ var submitArtifactPullTelemetry = async (baseline, cwd) => {
|
|
|
54116
54013
|
}));
|
|
54117
54014
|
};
|
|
54118
54015
|
var materializeControlPlaneBaseline = async (resolution, refresh, timeoutMs) => {
|
|
54016
|
+
if (!isSafePathSegment(resolution.version)) {
|
|
54017
|
+
throw new Error(`Unsafe control plane baseline version: ${resolution.version}`);
|
|
54018
|
+
}
|
|
54119
54019
|
const targetDirectory = path5.join(cacheRoot(), "control-plane", resolution.version);
|
|
54120
54020
|
if (!refresh && existsSync2(path5.join(targetDirectory, "baseline.json"))) {
|
|
54121
54021
|
return {
|
|
@@ -54692,7 +54592,7 @@ var PromptLive = exports_Effect.acquireRelease(exports_Effect.sync(() => createI
|
|
|
54692
54592
|
})));
|
|
54693
54593
|
|
|
54694
54594
|
// src/scaffold/run.ts
|
|
54695
|
-
import { execFileSync as
|
|
54595
|
+
import { execFileSync as execFileSync5 } from "child_process";
|
|
54696
54596
|
import { mkdirSync as mkdirSync3, writeFileSync as writeFileSync4 } from "fs";
|
|
54697
54597
|
import { homedir as homedir2 } from "os";
|
|
54698
54598
|
import path11 from "path";
|
|
@@ -55081,7 +54981,7 @@ var hasBackendSurface = (result) => exports_Array.some(result.detectedTechnologi
|
|
|
55081
54981
|
import path8 from "path";
|
|
55082
54982
|
|
|
55083
54983
|
// src/core/tools.ts
|
|
55084
|
-
import { execFileSync as
|
|
54984
|
+
import { execFileSync as execFileSync3 } from "child_process";
|
|
55085
54985
|
import { accessSync, constants as constants2 } from "fs";
|
|
55086
54986
|
import { homedir } from "os";
|
|
55087
54987
|
import path7 from "path";
|
|
@@ -55110,11 +55010,15 @@ var defaultRuntime3 = {
|
|
|
55110
55010
|
cwd: homedir(),
|
|
55111
55011
|
commandExists: commandExistsOnPath,
|
|
55112
55012
|
execFile: (command, args2, options9) => {
|
|
55113
|
-
|
|
55013
|
+
execFileSync3(command, [...args2], {
|
|
55114
55014
|
cwd: options9?.cwd,
|
|
55115
55015
|
stdio: options9?.stdio === "inherit" ? ["ignore", "inherit", "inherit"] : "ignore"
|
|
55116
55016
|
});
|
|
55117
|
-
}
|
|
55017
|
+
},
|
|
55018
|
+
execFileOutput: (command, args2, options9) => execFileSync3(command, [...args2], {
|
|
55019
|
+
cwd: options9?.cwd,
|
|
55020
|
+
encoding: "utf8"
|
|
55021
|
+
})
|
|
55118
55022
|
};
|
|
55119
55023
|
var detectGlobalPackageManager = (runtime5) => {
|
|
55120
55024
|
if (runtime5.commandExists("bun")) {
|
|
@@ -55138,6 +55042,39 @@ var globalInstallCommandFor = (packageManager, packageName) => {
|
|
|
55138
55042
|
return ["npm", "install", "-g", packageName];
|
|
55139
55043
|
}
|
|
55140
55044
|
};
|
|
55045
|
+
var parseVersionParts = (value6) => {
|
|
55046
|
+
const match19 = value6.match(/\d+(?:\.\d+){0,2}/u);
|
|
55047
|
+
if (match19 === null)
|
|
55048
|
+
return null;
|
|
55049
|
+
return match19[0].split(".").map((part) => Number.parseInt(part, 10));
|
|
55050
|
+
};
|
|
55051
|
+
var compareVersions = (actual, minimum) => {
|
|
55052
|
+
const length5 = Math.max(actual.length, minimum.length);
|
|
55053
|
+
for (let index = 0;index < length5; index += 1) {
|
|
55054
|
+
const actualPart = actual[index] ?? 0;
|
|
55055
|
+
const minimumPart = minimum[index] ?? 0;
|
|
55056
|
+
if (actualPart > minimumPart)
|
|
55057
|
+
return 1;
|
|
55058
|
+
if (actualPart < minimumPart)
|
|
55059
|
+
return -1;
|
|
55060
|
+
}
|
|
55061
|
+
return 0;
|
|
55062
|
+
};
|
|
55063
|
+
var isMinimumVersionSatisfied = (tool, runtime5, cwd) => {
|
|
55064
|
+
if (tool.minimumVersion === undefined || tool.versionCommand === undefined) {
|
|
55065
|
+
return true;
|
|
55066
|
+
}
|
|
55067
|
+
const [command, ...args2] = tool.versionCommand;
|
|
55068
|
+
if (command === undefined || runtime5.execFileOutput === undefined) {
|
|
55069
|
+
return true;
|
|
55070
|
+
}
|
|
55071
|
+
const actual = parseVersionParts(runtime5.execFileOutput(command, args2, { cwd }));
|
|
55072
|
+
const minimum = parseVersionParts(tool.minimumVersion);
|
|
55073
|
+
if (actual === null || minimum === null) {
|
|
55074
|
+
throw new Error(`Cannot verify required tool version from \`${tool.versionCommand.join(" ")}\`.`);
|
|
55075
|
+
}
|
|
55076
|
+
return compareVersions(actual, minimum) >= 0;
|
|
55077
|
+
};
|
|
55141
55078
|
var ensureToolsInstalled = (toolIds, baseline = bundledBaseline, runtime5 = defaultRuntime3) => {
|
|
55142
55079
|
const packageManager = detectGlobalPackageManager(runtime5);
|
|
55143
55080
|
const statuses = [];
|
|
@@ -55156,7 +55093,8 @@ var ensureToolsInstalled = (toolIds, baseline = bundledBaseline, runtime5 = defa
|
|
|
55156
55093
|
if (missingPrerequisites.length > 0) {
|
|
55157
55094
|
throw new Error(`Cannot install required tool \`${toolId}\` because ${missingPrerequisites.join(", ")} is not available on PATH.`);
|
|
55158
55095
|
}
|
|
55159
|
-
const
|
|
55096
|
+
const versionContract = tool;
|
|
55097
|
+
const alreadyPresent = runtime5.commandExists(toolId) && isMinimumVersionSatisfied(versionContract, runtime5, cwd);
|
|
55160
55098
|
if (!alreadyPresent) {
|
|
55161
55099
|
const [command, ...args2] = globalInstallCommandFor(globalPackageManager, tool.packageName);
|
|
55162
55100
|
runtime5.execFile(command, args2, {
|
|
@@ -55166,6 +55104,9 @@ var ensureToolsInstalled = (toolIds, baseline = bundledBaseline, runtime5 = defa
|
|
|
55166
55104
|
if (!runtime5.commandExists(toolId)) {
|
|
55167
55105
|
throw new Error(`Tried to install required tool \`${toolId}\`, but the binary is still not available on PATH afterwards.`);
|
|
55168
55106
|
}
|
|
55107
|
+
if (!isMinimumVersionSatisfied(versionContract, runtime5, cwd)) {
|
|
55108
|
+
throw new Error(`Tried to install required tool \`${toolId}\`, but the installed version does not satisfy ${versionContract.minimumVersion}.`);
|
|
55109
|
+
}
|
|
55169
55110
|
}
|
|
55170
55111
|
for (const [command, ...args2] of tool.ensureCommands) {
|
|
55171
55112
|
runtime5.execFile(command, args2, {
|
|
@@ -55319,6 +55260,7 @@ var formatConfirmationSummary = (result, baseline = bundledBaseline) => [
|
|
|
55319
55260
|
`output directory: ${result.outputDirectory}`,
|
|
55320
55261
|
...section("shared core files:", formatList(result.promptOutputs)),
|
|
55321
55262
|
...section("lint spec files:", formatList(result.lintSpecFiles)),
|
|
55263
|
+
...section("source guide files:", formatList(result.sourceGuideFiles)),
|
|
55322
55264
|
...section("skill files:", formatList(result.skillFiles)),
|
|
55323
55265
|
...section("prompt spec files:", formatList(result.promptSpecFiles)),
|
|
55324
55266
|
...section("subagent scaffold files:", formatList(result.subagentFiles)),
|
|
@@ -55358,6 +55300,7 @@ var formatAgentHandoffSummary = (result) => [
|
|
|
55358
55300
|
...formatList([
|
|
55359
55301
|
...result.promptOutputs,
|
|
55360
55302
|
...result.lintSpecFiles,
|
|
55303
|
+
...result.sourceGuideFiles,
|
|
55361
55304
|
...result.skillFiles,
|
|
55362
55305
|
...result.promptSpecFiles,
|
|
55363
55306
|
...result.subagentFiles,
|
|
@@ -55374,13 +55317,15 @@ var formatAgentHandoffSummary = (result) => [
|
|
|
55374
55317
|
" 4a. Never put phase skills in scoped `AGENTS.md` primary-skill lines. Keep `requirements-phase`, `delivery-phase`, `debugging-phase`, `review-phase`, `resolve-debt-phase`, and `docs-ingest-phase` as global orchestration entrypoints only.",
|
|
55375
55318
|
" 5. Treat every authored root/docs/workspace `AGENTS.md` file as the neutral scoped prompt source and create a sibling `CLAUDE.md` symlink mirror beside each one.",
|
|
55376
55319
|
" 6. Keep `.agents/AGENTS.md` as the shared global prompt source behind the scoped prompt tree; `.claude/CLAUDE.md` should mirror that neutral file.",
|
|
55377
|
-
" 7.
|
|
55378
|
-
" 8.
|
|
55379
|
-
" 9.
|
|
55380
|
-
" 10.
|
|
55381
|
-
" 11.
|
|
55382
|
-
" 12.
|
|
55383
|
-
" 13.
|
|
55320
|
+
" 7. Before relying on subagents, verify the active harness global/project settings enable subagent execution, then verify `.agents/subagents/manifest.mjs` and selected specialist path/guidance/skill coverage. Repair settings/setup or execute locally if the guard fails.",
|
|
55321
|
+
" 8. Keep `.agents/hooks/` as the neutral hook source, `.agents/skills/` as the main skill directory, and `.agents/scripts/sync-subagents.mjs` as the harness sync entrypoint. Only `.claude/skills` should mirror `.agents/skills`.",
|
|
55322
|
+
" 9. Reconcile `.agents/subagents/manifest.mjs` with both `.agents/subagents/manifest.prompt.md` and `.devpunks/specs/subagents/manifest-spec.json`.",
|
|
55323
|
+
" 10. Update owned paths / guidance file references in the subagent manifest to match the real repo shape.",
|
|
55324
|
+
" 11. Use `portless` as the local-dev URL baseline. Prefer stable subdomains over raw `localhost:<port>` values in env examples, endpoint defaults, callback URLs, allowed origins, CORS, and app-to-app proxies.",
|
|
55325
|
+
" 12. If adopting Oxlint or Oxfmt, replace existing lint/format setup deliberately: package scripts, task pipelines, CI, editor/docs references, and hooks should agree on the new tools.",
|
|
55326
|
+
" 13. Before authoring final prompts or implementation plans, identify the core detected libraries whose source behavior matters.",
|
|
55327
|
+
" 14. If an `opensrc/<package>.md` guide exists for a package, read that card first, then run its `opensrc path --cwd . <package>` command or fallback repository lookup.",
|
|
55328
|
+
" 15. Inspect the returned checkout paths. Clone the major framework/runtime libraries you will reason about; do not clone every dependency mechanically."
|
|
55384
55329
|
].join(`
|
|
55385
55330
|
`);
|
|
55386
55331
|
var formatSelectionPreview = (options9) => [
|
|
@@ -55532,7 +55477,7 @@ var finalizePackSelection = (resolved, additions, removals) => {
|
|
|
55532
55477
|
var canRemovePack = (resolved, packId) => resolved.preselectedPacks.includes(packId) && !resolved.defaultPacks.includes(packId);
|
|
55533
55478
|
|
|
55534
55479
|
// src/scaffold/output.ts
|
|
55535
|
-
import { execFileSync as
|
|
55480
|
+
import { execFileSync as execFileSync4 } from "child_process";
|
|
55536
55481
|
import { createHash as createHash2 } from "crypto";
|
|
55537
55482
|
import {
|
|
55538
55483
|
cpSync,
|
|
@@ -55578,11 +55523,13 @@ When a nested \`AGENTS.md\` lists "Primary skills here", treat those skill names
|
|
|
55578
55523
|
|
|
55579
55524
|
Do not rely only on the root instructions when a scoped \`AGENTS.md\` exists.
|
|
55580
55525
|
|
|
55581
|
-
For code review requests, take a review stance: findings first, severity ordered, with precise file/line references. Use \`
|
|
55526
|
+
For code review requests, take a review stance: findings first, severity ordered, with precise file/line references. Use \`autoreview\` as the core review runtime. \`simplify\`, \`improve-codebase-architecture\`, and scoped \`AGENTS.md\` skills are the mandatory review lenses, not optional extras. For every reviewed path, inspect the nearest scoped \`AGENTS.md\` prompt and verify adherence to every listed primary skill.
|
|
55582
55527
|
|
|
55583
55528
|
Use \`parallel-research\` for readonly repo orientation when the work can be split across independent questions, subsystems, artifacts, or hypotheses. Keep the immediate blocking path local, delegate sidecar reading only, synthesize findings before deciding, and skip it for code-writing or tightly coupled work.
|
|
55584
55529
|
|
|
55585
|
-
|
|
55530
|
+
Before delegating to subagents, verify the active harness global/project settings actually enable subagent execution, then verify repo-local routing. For Codex, \`.codex/config.toml\` should have an \`[agents]\` section with usable thread/depth limits. For Claude Code, OpenCode, Cursor, or other harnesses, check their equivalent global/project agent settings before trusting repo-local mirrors. Then confirm \`.agents/subagents/manifest.mjs\` exists and the selected specialist has matching owned paths, guidance files, and skills. If that guard fails, repair settings or execute locally; do not claim worker coverage from an inactive harness.
|
|
55531
|
+
|
|
55532
|
+
When inspecting external library internals, prefer official docs first. If \`opensrc/<package>.md\` exists, read that guide card before resolving cached source. Then use \`opensrc path --cwd . <package>\` for packages or \`opensrc path owner/repo\` for repositories, and inspect the returned absolute path.
|
|
55586
55533
|
|
|
55587
55534
|
Use \`portless\` for local development URLs instead of baking raw \`localhost:<port>\` values into docs, env examples, endpoint defaults, callback URLs, allowed origins, CORS lists, or app-to-app proxy targets.
|
|
55588
55535
|
|
|
@@ -55769,7 +55716,7 @@ var renderPromptSpecMarkdown = (spec) => [
|
|
|
55769
55716
|
"## Source inspection",
|
|
55770
55717
|
"",
|
|
55771
55718
|
"- No arbitrary concrete `opensrc` repositories are invented by scaffold.",
|
|
55772
|
-
"- During post-scaffold setup, decide which detected core libraries materially affect prompt or lint authoring, then
|
|
55719
|
+
"- During post-scaffold setup, decide which detected core libraries materially affect prompt or lint authoring, then read any matching `opensrc/<package>.md` guide before running `opensrc path --cwd . <package>` or `opensrc path owner/repo`.",
|
|
55773
55720
|
...spec.opensrcReferences.length === 0 ? [] : [
|
|
55774
55721
|
"",
|
|
55775
55722
|
"## Curated opensrc examples",
|
|
@@ -55798,6 +55745,7 @@ var renderAgentHandoffMarkdown = ({
|
|
|
55798
55745
|
promptOutputs,
|
|
55799
55746
|
promptSpecFiles,
|
|
55800
55747
|
lintSpecFiles,
|
|
55748
|
+
sourceGuideFiles,
|
|
55801
55749
|
skillFiles,
|
|
55802
55750
|
subagentFiles,
|
|
55803
55751
|
scriptFiles,
|
|
@@ -55817,6 +55765,7 @@ var renderAgentHandoffMarkdown = ({
|
|
|
55817
55765
|
"- Shared global prompt scaffolding under `.agents/`.",
|
|
55818
55766
|
"- Prompt specs under `.devpunks/specs/prompts/`.",
|
|
55819
55767
|
"- Selected lint asset specs under `.devpunks/specs/lint/`.",
|
|
55768
|
+
"- Source guide cards under `opensrc/` when detected packages need `opensrc` context.",
|
|
55820
55769
|
"- Subagent manifest scaffolding/specs under `.agents/subagents/` and `.devpunks/specs/subagents/`.",
|
|
55821
55770
|
`- Scaffold manifest at \`${scaffoldManifestFile}\`.`,
|
|
55822
55771
|
`- Required tools manifest at \`${requiredToolsFile}\`.`,
|
|
@@ -55843,12 +55792,14 @@ var renderAgentHandoffMarkdown = ({
|
|
|
55843
55792
|
"5. Author every root/docs/workspace `AGENTS.md` file as the neutral prompt source of truth and create a sibling `CLAUDE.md` symlink mirror beside each one instead of maintaining duplicated prompt bodies.",
|
|
55844
55793
|
"6. Keep `.agents/AGENTS.md` as the shared global guidance source behind the scoped prompt tree; `.claude/CLAUDE.md` should stay a symlink mirror of that neutral file.",
|
|
55845
55794
|
"7. Keep portless as the repo-wide local URL baseline: prefer stable local subdomains over raw localhost ports where env examples, endpoint constants, callback URLs, allowed origins, CORS, or app-to-app proxy targets are configured.",
|
|
55846
|
-
"8.
|
|
55795
|
+
"8. Inspect the applied Oxlint configs and lint asset specs. Scaffold creates or patches nearest package/app configs and adds missing lint dev dependencies; preserve local policy when making follow-up edits.",
|
|
55847
55796
|
"9. Keep `.agents/hooks/` as the neutral hook source of truth; harness hook mirrors should point back to it.",
|
|
55848
|
-
"10.
|
|
55849
|
-
"11.
|
|
55850
|
-
"12.
|
|
55851
|
-
"13.
|
|
55797
|
+
"10. Before relying on subagents, verify the active harness global/project settings enable subagent execution, then verify `.agents/subagents/manifest.mjs` and the selected specialist's owned paths, guidance files, and skills. Repair settings/setup or execute locally when the guard fails.",
|
|
55798
|
+
"11. Use `.agents/scripts/sync-subagents.mjs` to regenerate harness-native agents, hook mirrors, shared prompt mirrors, and the `.claude/skills` compatibility mirror when the neutral manifest changes.",
|
|
55799
|
+
"12. Populate or reconcile `.agents/subagents/manifest.mjs` using both the manifest spec JSON and the manifest prompt markdown.",
|
|
55800
|
+
"13. Adjust owned paths and guidance file references in the subagent manifest to match the real repo layout. Monorepo vs single-repo shape affects these paths.",
|
|
55801
|
+
"14. Before authoring final prompts or implementation plans, identify the core detected libraries whose source behavior matters. If an `opensrc/<package>.md` guide exists for a package, read that card first, then run its `opensrc path --cwd . <package>` command or fallback repository lookup.",
|
|
55802
|
+
"15. Inspect the returned checkout paths. Clone the major framework/runtime libraries you will reason about; do not clone every dependency mechanically.",
|
|
55852
55803
|
"",
|
|
55853
55804
|
"## Shared core files",
|
|
55854
55805
|
"",
|
|
@@ -55866,6 +55817,10 @@ var renderAgentHandoffMarkdown = ({
|
|
|
55866
55817
|
"",
|
|
55867
55818
|
...lintSpecFiles.map((file6) => `- \`${file6}\``),
|
|
55868
55819
|
"",
|
|
55820
|
+
"## Source guide files",
|
|
55821
|
+
"",
|
|
55822
|
+
...sourceGuideFiles.map((file6) => `- \`${file6}\``),
|
|
55823
|
+
"",
|
|
55869
55824
|
"## Subagent files",
|
|
55870
55825
|
"",
|
|
55871
55826
|
...subagentFiles.map((file6) => `- \`${file6}\``),
|
|
@@ -55892,17 +55847,17 @@ var renderLintSpecMarkdown = ({
|
|
|
55892
55847
|
}) => [
|
|
55893
55848
|
"# Lint Asset Handoff",
|
|
55894
55849
|
"",
|
|
55895
|
-
"Use these selected Oxlint assets to
|
|
55896
|
-
"
|
|
55850
|
+
"Use these selected Oxlint assets to audit the config changes scaffold applied to the target repo.",
|
|
55851
|
+
"Scaffold writes nearest package/app `oxlint.config.ts` files where selected assets apply. Ultracite presets provide the baseline, and asset-specific plugin/rule overlays stay explicit.",
|
|
55897
55852
|
"If you adopt Oxlint or Oxfmt, replace the repo's existing lint/format entrypoints deliberately: update package scripts, task pipelines, editor/docs references, and agent hooks together so old ESLint/Prettier commands do not remain as stale defaults.",
|
|
55898
55853
|
"If the repo already has lint/format tooling, preserve project-specific ignores, generated-file exclusions, and CI behavior while migrating; do not overwrite working config wholesale.",
|
|
55899
55854
|
"",
|
|
55900
55855
|
"## Baseline",
|
|
55901
55856
|
"",
|
|
55902
|
-
hasExistingOxlintConfig ? "- The target repo already has
|
|
55857
|
+
hasExistingOxlintConfig ? "- The target repo already has a root Oxlint config. Package/app configs may still be created when that is the closest scoped home for selected pack rules." : `- The target repo does not appear to have a root Oxlint config. \`${starterConfigFile}\` remains a root starter reference, while package/app configs are applied where assets are selected.`,
|
|
55903
55858
|
"- Preserve asset granularity: add or adjust rules asset-by-asset instead of collapsing everything into one opaque override.",
|
|
55904
55859
|
"- Keep JS plugin aliases stable when composing the final Oxlint config so future regen stays diff-friendly.",
|
|
55905
|
-
"-
|
|
55860
|
+
"- Keep `ultracite/oxlint/core` first, then layer framework presets and local asset overlays.",
|
|
55906
55861
|
"",
|
|
55907
55862
|
"## Selected assets",
|
|
55908
55863
|
"",
|
|
@@ -55911,6 +55866,7 @@ var renderLintSpecMarkdown = ({
|
|
|
55911
55866
|
"",
|
|
55912
55867
|
`- Description: ${asset.description}`,
|
|
55913
55868
|
`- Source packs: ${asset.sourcePacks.map((packId) => `\`${packId}\``).join(", ")}`,
|
|
55869
|
+
`- Oxlint presets: ${asset.oxlintPresets.length === 0 ? "`(none)`" : asset.oxlintPresets.map((preset) => `\`ultracite/oxlint/${preset}\``).join(", ")}`,
|
|
55914
55870
|
`- Recommended config file: \`${asset.placement.recommendedConfigFile}\``,
|
|
55915
55871
|
`- Recommended workspaces: ${asset.placement.recommendedWorkspaces.length === 0 ? "`(none)`" : asset.placement.recommendedWorkspaces.map((workspace) => `\`${workspace}\``).join(", ")}`,
|
|
55916
55872
|
`- Recommended files: ${asset.placement.recommendedFiles.length === 0 ? "`(none)`" : asset.placement.recommendedFiles.map((file6) => `\`${file6}\``).join(", ")}`,
|
|
@@ -55921,6 +55877,179 @@ var renderLintSpecMarkdown = ({
|
|
|
55921
55877
|
].join(`
|
|
55922
55878
|
`);
|
|
55923
55879
|
|
|
55880
|
+
// src/content/source-guides.ts
|
|
55881
|
+
var sourceGuideCatalog = [
|
|
55882
|
+
{
|
|
55883
|
+
id: "effect",
|
|
55884
|
+
title: "Effect Source Guide",
|
|
55885
|
+
packageSpec: "effect",
|
|
55886
|
+
fallbackSpec: "Effect-TS/effect",
|
|
55887
|
+
technologies: ["effect"],
|
|
55888
|
+
packs: ["effect"],
|
|
55889
|
+
useWhen: [
|
|
55890
|
+
"Effect runtime, Schema, Layer, Stream, or service behavior affects implementation.",
|
|
55891
|
+
"Official docs are not specific enough for the call path being changed."
|
|
55892
|
+
],
|
|
55893
|
+
inspectFirst: ["packages/effect/src", "packages/effect/test", "packages/platform/src"]
|
|
55894
|
+
},
|
|
55895
|
+
{
|
|
55896
|
+
id: "nextjs",
|
|
55897
|
+
title: "Next.js Source Guide",
|
|
55898
|
+
packageSpec: "next",
|
|
55899
|
+
fallbackSpec: "vercel/next.js",
|
|
55900
|
+
technologies: ["nextjs"],
|
|
55901
|
+
packs: ["nextjs"],
|
|
55902
|
+
useWhen: [
|
|
55903
|
+
"App Router, cache, middleware, route-handler, or build behavior affects implementation.",
|
|
55904
|
+
"Framework behavior differs across installed Next.js versions."
|
|
55905
|
+
],
|
|
55906
|
+
inspectFirst: ["packages/next/src", "test/e2e", "test/integration"]
|
|
55907
|
+
},
|
|
55908
|
+
{
|
|
55909
|
+
id: "react",
|
|
55910
|
+
title: "React Source Guide",
|
|
55911
|
+
packageSpec: "react",
|
|
55912
|
+
fallbackSpec: "facebook/react",
|
|
55913
|
+
technologies: ["react"],
|
|
55914
|
+
packs: ["react"],
|
|
55915
|
+
useWhen: [
|
|
55916
|
+
"React rendering, hooks, suspense, or client/server integration behavior affects implementation.",
|
|
55917
|
+
"Docs explain the API but not the runtime edge case being debugged."
|
|
55918
|
+
],
|
|
55919
|
+
inspectFirst: ["packages/react/src", "packages/react-reconciler/src"]
|
|
55920
|
+
},
|
|
55921
|
+
{
|
|
55922
|
+
id: "tanstack-query",
|
|
55923
|
+
title: "TanStack Query Source Guide",
|
|
55924
|
+
packageSpec: "@tanstack/react-query",
|
|
55925
|
+
fallbackSpec: "TanStack/query",
|
|
55926
|
+
technologies: ["tanstack-query"],
|
|
55927
|
+
packs: ["tanstack-query"],
|
|
55928
|
+
useWhen: [
|
|
55929
|
+
"Query invalidation, mutation, cache, hydration, or observer behavior affects implementation.",
|
|
55930
|
+
"A usage pattern depends on library internals or version-specific behavior."
|
|
55931
|
+
],
|
|
55932
|
+
inspectFirst: ["packages/react-query/src", "packages/query-core/src"]
|
|
55933
|
+
},
|
|
55934
|
+
{
|
|
55935
|
+
id: "better-auth",
|
|
55936
|
+
title: "Better Auth Source Guide",
|
|
55937
|
+
packageSpec: "better-auth",
|
|
55938
|
+
fallbackSpec: "better-auth/better-auth",
|
|
55939
|
+
technologies: ["better-auth"],
|
|
55940
|
+
packs: ["better-auth"],
|
|
55941
|
+
useWhen: [
|
|
55942
|
+
"Session, adapter, plugin, OAuth, OTP, or cookie behavior affects implementation.",
|
|
55943
|
+
"Security-sensitive auth behavior needs source-backed verification."
|
|
55944
|
+
],
|
|
55945
|
+
inspectFirst: ["packages/better-auth/src", "packages/cli/src"]
|
|
55946
|
+
},
|
|
55947
|
+
{
|
|
55948
|
+
id: "drizzle",
|
|
55949
|
+
title: "Drizzle Source Guide",
|
|
55950
|
+
packageSpec: "drizzle-orm",
|
|
55951
|
+
fallbackSpec: "drizzle-team/drizzle-orm",
|
|
55952
|
+
technologies: ["drizzle"],
|
|
55953
|
+
packs: ["drizzle"],
|
|
55954
|
+
useWhen: [
|
|
55955
|
+
"Query builder, migration, relation, or dialect behavior affects implementation.",
|
|
55956
|
+
"Database behavior depends on generated SQL or package-specific edge cases."
|
|
55957
|
+
],
|
|
55958
|
+
inspectFirst: ["drizzle-orm/src", "drizzle-kit/src"]
|
|
55959
|
+
},
|
|
55960
|
+
{
|
|
55961
|
+
id: "trpc",
|
|
55962
|
+
title: "tRPC Source Guide",
|
|
55963
|
+
packageSpec: "@trpc/server",
|
|
55964
|
+
fallbackSpec: "trpc/trpc",
|
|
55965
|
+
technologies: ["trpc"],
|
|
55966
|
+
packs: ["trpc"],
|
|
55967
|
+
useWhen: [
|
|
55968
|
+
"Router, procedure, transformer, client, or middleware behavior affects implementation.",
|
|
55969
|
+
"Type-level contracts need source-backed verification."
|
|
55970
|
+
],
|
|
55971
|
+
inspectFirst: ["packages/server/src", "packages/client/src", "packages/react-query/src"]
|
|
55972
|
+
},
|
|
55973
|
+
{
|
|
55974
|
+
id: "elysia",
|
|
55975
|
+
title: "Elysia Source Guide",
|
|
55976
|
+
packageSpec: "elysia",
|
|
55977
|
+
fallbackSpec: "elysiajs/elysia",
|
|
55978
|
+
technologies: ["elysia"],
|
|
55979
|
+
packs: ["elysia"],
|
|
55980
|
+
useWhen: [
|
|
55981
|
+
"Route, plugin, schema, context, or lifecycle behavior affects implementation.",
|
|
55982
|
+
"Runtime behavior needs verification beyond API docs."
|
|
55983
|
+
],
|
|
55984
|
+
inspectFirst: ["src", "test"]
|
|
55985
|
+
}
|
|
55986
|
+
];
|
|
55987
|
+
var sourceGuideFile = (guide) => `opensrc/${guide.id}.md`;
|
|
55988
|
+
var sourceGuidesForSelection = ({
|
|
55989
|
+
detectedTechnologies,
|
|
55990
|
+
finalPacks
|
|
55991
|
+
}) => {
|
|
55992
|
+
const technologies = new Set(detectedTechnologies);
|
|
55993
|
+
const packs = new Set(finalPacks);
|
|
55994
|
+
return sourceGuideCatalog.filter((guide) => guide.technologies.some((technology) => technologies.has(technology)) || guide.packs.some((pack2) => packs.has(pack2)));
|
|
55995
|
+
};
|
|
55996
|
+
var summarizeSourceGuide = (guide) => ({
|
|
55997
|
+
id: guide.id,
|
|
55998
|
+
title: guide.title,
|
|
55999
|
+
file: sourceGuideFile(guide),
|
|
56000
|
+
packageSpec: guide.packageSpec,
|
|
56001
|
+
...guide.fallbackSpec === undefined ? {} : { fallbackSpec: guide.fallbackSpec }
|
|
56002
|
+
});
|
|
56003
|
+
var renderSourceGuideReadme = (guides) => [
|
|
56004
|
+
"# opensrc",
|
|
56005
|
+
"",
|
|
56006
|
+
"This directory is an index for source code inspected through the global `opensrc` cache.",
|
|
56007
|
+
"",
|
|
56008
|
+
"It does not contain cloned package source. Each guide card points agents to the right `opensrc path` command, why the source matters, and where to start reading.",
|
|
56009
|
+
"",
|
|
56010
|
+
"Use these cards before inspecting package internals. Prefer official docs first, then resolve live source with `opensrc path --cwd . <package>` or the fallback repository command.",
|
|
56011
|
+
"",
|
|
56012
|
+
"## Guides",
|
|
56013
|
+
"",
|
|
56014
|
+
...guides.map((guide) => `- [${guide.title}](./${guide.id}.md)`)
|
|
56015
|
+
].join(`
|
|
56016
|
+
`);
|
|
56017
|
+
var renderSourceGuide = (guide) => [
|
|
56018
|
+
`# ${guide.title}`,
|
|
56019
|
+
"",
|
|
56020
|
+
"This is an index card for the global `opensrc` cache. Do not commit cloned source here.",
|
|
56021
|
+
"",
|
|
56022
|
+
"## Resolve Source",
|
|
56023
|
+
"",
|
|
56024
|
+
"```bash",
|
|
56025
|
+
`opensrc path --cwd . ${guide.packageSpec}`,
|
|
56026
|
+
"```",
|
|
56027
|
+
...guide.fallbackSpec === undefined ? [] : [
|
|
56028
|
+
"",
|
|
56029
|
+
"Fallback repository lookup:",
|
|
56030
|
+
"",
|
|
56031
|
+
"```bash",
|
|
56032
|
+
`opensrc path ${guide.fallbackSpec}`,
|
|
56033
|
+
"```"
|
|
56034
|
+
],
|
|
56035
|
+
"",
|
|
56036
|
+
"## Use When",
|
|
56037
|
+
"",
|
|
56038
|
+
...guide.useWhen.map((item) => `- ${item}`),
|
|
56039
|
+
"",
|
|
56040
|
+
"## Inspect First",
|
|
56041
|
+
"",
|
|
56042
|
+
...guide.inspectFirst.map((item) => `- \`${item}\``),
|
|
56043
|
+
"",
|
|
56044
|
+
"## Rules",
|
|
56045
|
+
"",
|
|
56046
|
+
"- Prefer official docs first when they answer the question.",
|
|
56047
|
+
"- Use `opensrc path --cwd .` so npm package resolution can use this repo's lockfile.",
|
|
56048
|
+
"- Keep the cloned source in the global `~/.opensrc` cache unless the user explicitly asks for a different cache root.",
|
|
56049
|
+
"- Do not copy upstream source into this directory."
|
|
56050
|
+
].join(`
|
|
56051
|
+
`);
|
|
56052
|
+
|
|
55924
56053
|
// src/content/hooks.ts
|
|
55925
56054
|
var hookRegistryForBaseline = (baseline = bundledBaseline) => baseline.hooks;
|
|
55926
56055
|
|
|
@@ -55949,6 +56078,7 @@ var resolveLintAssetsForPacks = (packIds, baseline = bundledBaseline) => {
|
|
|
55949
56078
|
id: asset.id,
|
|
55950
56079
|
description: asset.description,
|
|
55951
56080
|
sourcePacks: [packId],
|
|
56081
|
+
oxlintPresets: asset.oxlintPresets,
|
|
55952
56082
|
plugins: asset.plugins,
|
|
55953
56083
|
jsPlugins: asset.jsPlugins,
|
|
55954
56084
|
settings: asset.settings,
|
|
@@ -55980,6 +56110,70 @@ var subagentSpecialistNote = ({
|
|
|
55980
56110
|
workspacePath,
|
|
55981
56111
|
targetFile
|
|
55982
56112
|
}) => scope5 === "docs" ? "Own docs maintenance and keep durable repo docs aligned with implemented reality." : `Own changes under ${workspacePath ?? targetFile} and defer cross-workspace orchestration to the root agent.`;
|
|
56113
|
+
var workflowCapabilityPacks = {
|
|
56114
|
+
"workflow-planning": {
|
|
56115
|
+
description: "Default workflow planning pack for spec discovery, spec review, and plan review.",
|
|
56116
|
+
skills: [
|
|
56117
|
+
"create-spec",
|
|
56118
|
+
"create-plan",
|
|
56119
|
+
"parallel-research",
|
|
56120
|
+
"swarm-planner",
|
|
56121
|
+
"tdd",
|
|
56122
|
+
"simplify",
|
|
56123
|
+
"stack"
|
|
56124
|
+
]
|
|
56125
|
+
},
|
|
56126
|
+
"workflow-requirements": {
|
|
56127
|
+
description: "Default workflow requirements pack for grill synthesis and backlog shaping.",
|
|
56128
|
+
skills: ["requirements-phase", "requirements-grill", "write-backlog"]
|
|
56129
|
+
},
|
|
56130
|
+
"workflow-review": {
|
|
56131
|
+
description: "Default workflow review pack for readonly artifact checks.",
|
|
56132
|
+
skills: ["review-phase", "simplify"]
|
|
56133
|
+
}
|
|
56134
|
+
};
|
|
56135
|
+
var workflowSpecialists = [
|
|
56136
|
+
{
|
|
56137
|
+
id: "planning-discovery",
|
|
56138
|
+
ownedPaths: ["."],
|
|
56139
|
+
guidanceFiles: ["AGENTS.md"],
|
|
56140
|
+
packs: ["workflow-planning"],
|
|
56141
|
+
skills: ["parallel-research", "create-spec"],
|
|
56142
|
+
notes: "Use for bounded readonly orientation before spec or plan writing: gather evidence, contradictions, overlapping work, and open questions without solution design."
|
|
56143
|
+
},
|
|
56144
|
+
{
|
|
56145
|
+
id: "requirements-synthesizer",
|
|
56146
|
+
ownedPaths: ["."],
|
|
56147
|
+
guidanceFiles: ["AGENTS.md"],
|
|
56148
|
+
packs: ["workflow-requirements"],
|
|
56149
|
+
skills: ["requirements-phase", "requirements-grill", "write-backlog"],
|
|
56150
|
+
notes: "Use for readonly compression of grill/status/log artifacts into accepted, rejected, superseded, parked, and unresolved decisions."
|
|
56151
|
+
},
|
|
56152
|
+
{
|
|
56153
|
+
id: "backlog-shaper",
|
|
56154
|
+
ownedPaths: ["."],
|
|
56155
|
+
guidanceFiles: ["AGENTS.md"],
|
|
56156
|
+
packs: ["workflow-requirements"],
|
|
56157
|
+
skills: ["requirements-phase", "write-backlog"],
|
|
56158
|
+
notes: "Use for draft-only module, epic, and story shaping from closed requirements; provider sync and final backlog decisions stay with the parent."
|
|
56159
|
+
},
|
|
56160
|
+
{
|
|
56161
|
+
id: "spec-reviewer",
|
|
56162
|
+
ownedPaths: ["."],
|
|
56163
|
+
guidanceFiles: ["AGENTS.md"],
|
|
56164
|
+
packs: ["workflow-planning", "workflow-review"],
|
|
56165
|
+
skills: ["create-spec", "review-phase", "simplify"],
|
|
56166
|
+
notes: "Use for readonly review of drafted specs before user review, checking invented requirements, contradictions, missing constraints, and vague acceptance criteria."
|
|
56167
|
+
},
|
|
56168
|
+
{
|
|
56169
|
+
id: "plan-reviewer",
|
|
56170
|
+
ownedPaths: ["."],
|
|
56171
|
+
guidanceFiles: ["AGENTS.md"],
|
|
56172
|
+
packs: ["workflow-planning", "workflow-review"],
|
|
56173
|
+
skills: ["create-plan", "swarm-planner", "tdd", "simplify"],
|
|
56174
|
+
notes: "Use for readonly review of plans before yielding, checking dependencies, ordering, invalid parallelism, unsafe write overlap, RED targets, validation, and assigned skills."
|
|
56175
|
+
}
|
|
56176
|
+
];
|
|
55983
56177
|
var renderSubagentManifestPrompt = ({
|
|
55984
56178
|
workspaces,
|
|
55985
56179
|
finalPacks
|
|
@@ -55999,6 +56193,7 @@ var renderSubagentManifestPrompt = ({
|
|
|
55999
56193
|
"## Requirements",
|
|
56000
56194
|
"",
|
|
56001
56195
|
"- Keep capability packs narrow and reusable.",
|
|
56196
|
+
"- Include default workflow archetypes for planning and requirements inner steps: `planning-discovery`, `requirements-synthesizer`, `backlog-shaper`, `spec-reviewer`, and `plan-reviewer`.",
|
|
56002
56197
|
"- Keep specialist agents scoped by owned paths and guidance files.",
|
|
56003
56198
|
"- Include `simplify` in every implementation-focused specialist.",
|
|
56004
56199
|
"- Keep docs ownership in a dedicated docs specialist when `docs/` exists.",
|
|
@@ -56013,26 +56208,33 @@ var renderSubagentManifestModule = ({
|
|
|
56013
56208
|
if (spec.specialists.length === 0) {
|
|
56014
56209
|
return fallback;
|
|
56015
56210
|
}
|
|
56016
|
-
const
|
|
56017
|
-
|
|
56018
|
-
|
|
56019
|
-
|
|
56020
|
-
|
|
56021
|
-
|
|
56022
|
-
|
|
56023
|
-
|
|
56024
|
-
|
|
56025
|
-
|
|
56211
|
+
const baseWorkflowSpecialists = spec.finalPacks.includes("subagents") ? workflowSpecialists.filter((workflowSpecialist) => !spec.specialists.some((specialist) => specialist.id === workflowSpecialist.id)) : [];
|
|
56212
|
+
const baseSpecialists = [
|
|
56213
|
+
...baseWorkflowSpecialists,
|
|
56214
|
+
...spec.finalPacks.includes("research") && !spec.specialists.some((specialist) => specialist.id === "code-review") ? [
|
|
56215
|
+
{
|
|
56216
|
+
id: "code-review",
|
|
56217
|
+
ownedPaths: ["."],
|
|
56218
|
+
guidanceFiles: ["AGENTS.md"],
|
|
56219
|
+
packs: ["research"],
|
|
56220
|
+
skills: ["simplify", "improve-codebase-architecture"],
|
|
56221
|
+
notes: "Use for findings-first review across changed code, simplification opportunities, and grounded architecture-friction findings."
|
|
56222
|
+
}
|
|
56223
|
+
] : []
|
|
56224
|
+
];
|
|
56026
56225
|
const specialists = [...baseSpecialists, ...spec.specialists];
|
|
56027
56226
|
const selectedPacks = [...new Set(specialists.flatMap((specialist) => specialist.packs))];
|
|
56028
56227
|
const packDescriptions = new Map(baseline.packs.map((pack2) => [pack2.id, pack2.description]));
|
|
56029
|
-
const capabilityPacks = Object.fromEntries(selectedPacks.map((packId) =>
|
|
56030
|
-
packId
|
|
56031
|
-
|
|
56032
|
-
|
|
56033
|
-
|
|
56034
|
-
|
|
56035
|
-
|
|
56228
|
+
const capabilityPacks = Object.fromEntries(selectedPacks.map((packId) => {
|
|
56229
|
+
const workflowPack = workflowCapabilityPacks[packId];
|
|
56230
|
+
return [
|
|
56231
|
+
packId,
|
|
56232
|
+
workflowPack ?? {
|
|
56233
|
+
description: packDescriptions.get(packId) ?? `${packId} guidance pack.`,
|
|
56234
|
+
skills: skillsForPack(packId, baseline)
|
|
56235
|
+
}
|
|
56236
|
+
];
|
|
56237
|
+
}));
|
|
56036
56238
|
const agents = specialists.map((specialist) => ({
|
|
56037
56239
|
name: specialist.id,
|
|
56038
56240
|
description: specialist.notes,
|
|
@@ -56143,100 +56345,386 @@ var migrateLegacySkillDirectories = ({
|
|
|
56143
56345
|
rmSync2(absoluteDirectory, { recursive: true, force: true });
|
|
56144
56346
|
}
|
|
56145
56347
|
};
|
|
56146
|
-
var selectedHookIds = (finalPacks, baseline) => uniqueSorted(
|
|
56147
|
-
|
|
56348
|
+
var selectedHookIds = (finalPacks, baseline) => uniqueSorted([
|
|
56349
|
+
"scaffold-update-check",
|
|
56350
|
+
...finalPacks.flatMap((packId) => hooksForPack(packId, baseline))
|
|
56351
|
+
]);
|
|
56352
|
+
var oxlintConfigCandidates = ["oxlint.config.ts", ".oxlintrc.json", ".oxlintrc.jsonc"];
|
|
56148
56353
|
var existingOxlintConfigFiles = (scanDirectory) => oxlintConfigCandidates.filter((candidate) => existsSync5(path10.join(scanDirectory, candidate)));
|
|
56149
56354
|
var oxlintStarterConfig = {
|
|
56150
|
-
|
|
56151
|
-
|
|
56152
|
-
|
|
56153
|
-
|
|
56154
|
-
|
|
56155
|
-
|
|
56156
|
-
|
|
56157
|
-
|
|
56158
|
-
|
|
56159
|
-
|
|
56160
|
-
|
|
56161
|
-
|
|
56162
|
-
|
|
56163
|
-
|
|
56164
|
-
|
|
56165
|
-
|
|
56166
|
-
|
|
56167
|
-
|
|
56168
|
-
|
|
56169
|
-
|
|
56170
|
-
|
|
56171
|
-
|
|
56172
|
-
|
|
56173
|
-
};
|
|
56174
|
-
var detectedWorkspaces = (scanDirectory, detection) => detection.manifests.map((manifest) => path10.posix.dirname(relativePosixPath(scanDirectory, manifest.path))).filter((workspace) => workspace !== "" && workspace !== ".").toSorted();
|
|
56175
|
-
var packsForWorkspace = ({
|
|
56176
|
-
relativeWorkspacePath,
|
|
56177
|
-
manifest,
|
|
56178
|
-
finalPacks
|
|
56179
|
-
}) => {
|
|
56180
|
-
const dependencyNames = manifest?.dependencies ?? [];
|
|
56181
|
-
const dependencies = new Set(dependencyNames);
|
|
56182
|
-
const selectedPacks = new Set(finalPacks);
|
|
56183
|
-
const hasDependency = (name2) => dependencies.has(name2);
|
|
56184
|
-
const hasDependencyPrefix = (prefix) => dependencyNames.some((name2) => name2.startsWith(prefix));
|
|
56185
|
-
const hasBackendDependency = () => hasDependency("better-auth") || hasDependency("drizzle-orm") || hasDependency("drizzle-kit") || hasDependency("elysia") || hasDependencyPrefix("@trpc/");
|
|
56186
|
-
const hasFrontendDependency = () => hasDependency("next") || hasDependency("react") || hasDependency("react-dom") || hasDependency("@tanstack/react-query");
|
|
56187
|
-
const hasFrontendWorkspaceName = () => relativeWorkspacePath.split("/").some((segment) => segment === "frontend" || segment === "ui" || segment === "web") || (manifest?.packageName?.replace(/^@[^/]+\//u, "").split(/[^a-zA-Z0-9]+/u).filter((segment) => segment.length > 0).map((segment) => segment.toLowerCase()).some((segment) => segment === "frontend" || segment === "ui" || segment === "web") ?? false);
|
|
56188
|
-
const hasBackendWorkspaceName2 = () => relativeWorkspacePath.split("/").some((segment) => segment === "api" || segment === "backend" || segment === "server" || segment === "services") || (manifest?.packageName?.replace(/^@[^/]+\//u, "").split(/[^a-zA-Z0-9]+/u).filter((segment) => segment.length > 0).map((segment) => segment.toLowerCase()).some((segment) => segment === "api" || segment === "backend" || segment === "server" || segment === "service") ?? false);
|
|
56189
|
-
const isFrontendWorkspace = hasFrontendDependency() || hasFrontendWorkspaceName();
|
|
56190
|
-
const isBackendWorkspace = hasBackendDependency() || hasBackendWorkspaceName2();
|
|
56191
|
-
const packs = [];
|
|
56192
|
-
if (selectedPacks.has("quality")) {
|
|
56193
|
-
packs.push("quality");
|
|
56194
|
-
}
|
|
56195
|
-
if (selectedPacks.has("research")) {
|
|
56196
|
-
packs.push("research");
|
|
56197
|
-
}
|
|
56198
|
-
if (selectedPacks.has("typescript") && relativeWorkspacePath !== ".agents" && relativeWorkspacePath !== "docs") {
|
|
56199
|
-
packs.push("typescript");
|
|
56200
|
-
}
|
|
56201
|
-
if (relativeWorkspacePath === ".agents") {
|
|
56202
|
-
if (selectedPacks.has("subagents")) {
|
|
56203
|
-
packs.push("subagents");
|
|
56355
|
+
extends: ["ultracite/oxlint/core"],
|
|
56356
|
+
configFile: "oxlint.config.ts"
|
|
56357
|
+
};
|
|
56358
|
+
var oxlintConfigFileName = "oxlint.config.ts";
|
|
56359
|
+
var ultraciteCorePreset = "core";
|
|
56360
|
+
var defaultDevDependencyVersion = "latest";
|
|
56361
|
+
var isRecord3 = (value6) => typeof value6 === "object" && value6 !== null && !Array.isArray(value6);
|
|
56362
|
+
var stripJsonComments = (content) => {
|
|
56363
|
+
let result = "";
|
|
56364
|
+
let inString = false;
|
|
56365
|
+
let escaped = false;
|
|
56366
|
+
let inLineComment = false;
|
|
56367
|
+
let inBlockComment = false;
|
|
56368
|
+
for (let index = 0;index < content.length; index += 1) {
|
|
56369
|
+
const char4 = content[index];
|
|
56370
|
+
const next = content[index + 1];
|
|
56371
|
+
if (inLineComment) {
|
|
56372
|
+
if (char4 === `
|
|
56373
|
+
`) {
|
|
56374
|
+
inLineComment = false;
|
|
56375
|
+
result += char4;
|
|
56376
|
+
}
|
|
56377
|
+
continue;
|
|
56204
56378
|
}
|
|
56205
|
-
if (
|
|
56206
|
-
|
|
56379
|
+
if (inBlockComment) {
|
|
56380
|
+
if (char4 === "*" && next === "/") {
|
|
56381
|
+
inBlockComment = false;
|
|
56382
|
+
index += 1;
|
|
56383
|
+
}
|
|
56384
|
+
continue;
|
|
56207
56385
|
}
|
|
56208
|
-
|
|
56209
|
-
|
|
56210
|
-
|
|
56211
|
-
|
|
56212
|
-
packs.push("turborepo");
|
|
56386
|
+
if (!inString && char4 === "/" && next === "/") {
|
|
56387
|
+
inLineComment = true;
|
|
56388
|
+
index += 1;
|
|
56389
|
+
continue;
|
|
56213
56390
|
}
|
|
56214
|
-
if (
|
|
56215
|
-
|
|
56391
|
+
if (!inString && char4 === "/" && next === "*") {
|
|
56392
|
+
inBlockComment = true;
|
|
56393
|
+
index += 1;
|
|
56394
|
+
continue;
|
|
56216
56395
|
}
|
|
56217
|
-
|
|
56218
|
-
|
|
56396
|
+
result += char4;
|
|
56397
|
+
if (char4 === "\\" && inString) {
|
|
56398
|
+
escaped = !escaped;
|
|
56399
|
+
continue;
|
|
56219
56400
|
}
|
|
56220
|
-
|
|
56221
|
-
|
|
56222
|
-
|
|
56223
|
-
if (
|
|
56224
|
-
|
|
56401
|
+
if (char4 === '"' && !escaped) {
|
|
56402
|
+
inString = !inString;
|
|
56403
|
+
}
|
|
56404
|
+
if (char4 !== "\\") {
|
|
56405
|
+
escaped = false;
|
|
56225
56406
|
}
|
|
56226
|
-
return uniqueSorted(packs);
|
|
56227
56407
|
}
|
|
56228
|
-
|
|
56229
|
-
|
|
56230
|
-
|
|
56408
|
+
return result.replace(/,\s*([}\]])/gu, "$1");
|
|
56409
|
+
};
|
|
56410
|
+
var readJsonRecord = (filePath) => {
|
|
56411
|
+
const parsed = JSON.parse(stripJsonComments(readFileSync6(filePath, "utf8")));
|
|
56412
|
+
return isRecord3(parsed) ? parsed : {};
|
|
56413
|
+
};
|
|
56414
|
+
var encodePrettyJson = (value6) => `${JSON.stringify(value6, null, 2)}
|
|
56415
|
+
`;
|
|
56416
|
+
var encodePrettyTsObject = (value6) => JSON.stringify(value6, null, 2);
|
|
56417
|
+
var sourceOrOutputPath = ({
|
|
56418
|
+
scanDirectory,
|
|
56419
|
+
outputDirectory,
|
|
56420
|
+
relativePath
|
|
56421
|
+
}) => {
|
|
56422
|
+
const outputPath = path10.join(outputDirectory, relativePath);
|
|
56423
|
+
if (existsSync5(outputPath)) {
|
|
56424
|
+
return outputPath;
|
|
56425
|
+
}
|
|
56426
|
+
const sourcePath = path10.join(scanDirectory, relativePath);
|
|
56427
|
+
return existsSync5(sourcePath) ? sourcePath : null;
|
|
56428
|
+
};
|
|
56429
|
+
var ensureStringArray = (value6) => Array.isArray(value6) ? value6.filter((entry) => typeof entry === "string") : [];
|
|
56430
|
+
var ensureStringOrStringArray = (value6) => {
|
|
56431
|
+
if (typeof value6 === "string") {
|
|
56432
|
+
return [value6];
|
|
56433
|
+
}
|
|
56434
|
+
return ensureStringArray(value6);
|
|
56435
|
+
};
|
|
56436
|
+
var jsPluginMatches = (value6, plugin) => {
|
|
56437
|
+
if (typeof value6 === "string") {
|
|
56438
|
+
return value6 === plugin.name || value6 === plugin.specifier;
|
|
56439
|
+
}
|
|
56440
|
+
return isRecord3(value6) && (value6.name === plugin.name || value6.specifier === plugin.specifier || value6.name === plugin.name && value6.specifier === plugin.specifier);
|
|
56441
|
+
};
|
|
56442
|
+
var presetImportName = (preset) => preset.replace(/[^a-zA-Z0-9]+/gu, " ").replace(/(?:^|\s)([a-zA-Z0-9])/gu, (_match, char4) => char4.toUpperCase());
|
|
56443
|
+
var oxlintPresetLocalName = (preset) => preset === ultraciteCorePreset ? "core" : `ultracite${presetImportName(preset)}`;
|
|
56444
|
+
var lintPresetsForAssets = (assets) => uniqueSorted([ultraciteCorePreset, ...assets.flatMap((asset) => asset.oxlintPresets)]);
|
|
56445
|
+
var mergeLintAssetsIntoLocalOxlintConfig = (existingConfig, assets) => {
|
|
56446
|
+
const { $schema: _schema, extends: _extends, ...existingLocalConfig } = existingConfig;
|
|
56447
|
+
const nextConfig = { ...existingLocalConfig };
|
|
56448
|
+
const plugins = ensureStringArray(nextConfig.plugins);
|
|
56449
|
+
const jsPlugins = Array.isArray(nextConfig.jsPlugins) ? [...nextConfig.jsPlugins] : [];
|
|
56450
|
+
const settings = isRecord3(nextConfig.settings) ? { ...nextConfig.settings } : {};
|
|
56451
|
+
const rules = isRecord3(nextConfig.rules) ? { ...nextConfig.rules } : {};
|
|
56452
|
+
for (const asset of assets) {
|
|
56453
|
+
for (const plugin of asset.plugins) {
|
|
56454
|
+
if (!plugins.includes(plugin)) {
|
|
56455
|
+
plugins.push(plugin);
|
|
56456
|
+
}
|
|
56231
56457
|
}
|
|
56232
|
-
|
|
56233
|
-
|
|
56458
|
+
for (const plugin of asset.jsPlugins) {
|
|
56459
|
+
if (!jsPlugins.some((entry) => jsPluginMatches(entry, plugin))) {
|
|
56460
|
+
jsPlugins.push({ name: plugin.name, specifier: plugin.specifier });
|
|
56461
|
+
}
|
|
56234
56462
|
}
|
|
56235
|
-
|
|
56236
|
-
|
|
56463
|
+
for (const [key, value6] of Object.entries(asset.settings)) {
|
|
56464
|
+
if (!(key in settings)) {
|
|
56465
|
+
settings[key] = value6;
|
|
56466
|
+
}
|
|
56237
56467
|
}
|
|
56238
|
-
|
|
56239
|
-
|
|
56468
|
+
for (const [key, value6] of Object.entries(asset.rules)) {
|
|
56469
|
+
if (!(key in rules)) {
|
|
56470
|
+
rules[key] = value6;
|
|
56471
|
+
}
|
|
56472
|
+
}
|
|
56473
|
+
}
|
|
56474
|
+
return {
|
|
56475
|
+
...nextConfig,
|
|
56476
|
+
...plugins.length > 0 ? { plugins: uniqueSorted(plugins) } : {},
|
|
56477
|
+
...jsPlugins.length > 0 ? { jsPlugins } : {},
|
|
56478
|
+
...Object.keys(settings).length > 0 ? { settings } : {},
|
|
56479
|
+
...Object.keys(rules).length > 0 ? { rules } : {}
|
|
56480
|
+
};
|
|
56481
|
+
};
|
|
56482
|
+
var encodeOxlintConfigTs = ({
|
|
56483
|
+
existingConfig,
|
|
56484
|
+
assets
|
|
56485
|
+
}) => {
|
|
56486
|
+
const presets = lintPresetsForAssets(assets);
|
|
56487
|
+
const imports = presets.map((preset) => `import ${oxlintPresetLocalName(preset)} from "ultracite/oxlint/${preset}";`);
|
|
56488
|
+
const existingExtends = ensureStringOrStringArray(existingConfig.extends);
|
|
56489
|
+
const extendsEntries = [
|
|
56490
|
+
...existingExtends.map((entry) => JSON.stringify(entry)),
|
|
56491
|
+
...presets.map(oxlintPresetLocalName)
|
|
56492
|
+
];
|
|
56493
|
+
const localConfig = mergeLintAssetsIntoLocalOxlintConfig(existingConfig, assets);
|
|
56494
|
+
return [
|
|
56495
|
+
'import { defineConfig } from "oxlint";',
|
|
56496
|
+
...imports,
|
|
56497
|
+
"",
|
|
56498
|
+
`const localConfig = ${encodePrettyTsObject(localConfig)};`,
|
|
56499
|
+
"",
|
|
56500
|
+
"export default defineConfig({",
|
|
56501
|
+
` extends: [${extendsEntries.join(", ")}],`,
|
|
56502
|
+
" ignorePatterns: core.ignorePatterns,",
|
|
56503
|
+
" ...localConfig,",
|
|
56504
|
+
"});",
|
|
56505
|
+
""
|
|
56506
|
+
].join(`
|
|
56507
|
+
`);
|
|
56508
|
+
};
|
|
56509
|
+
var rootPackageJsonRecord = ({
|
|
56510
|
+
scanDirectory,
|
|
56511
|
+
outputDirectory
|
|
56512
|
+
}) => {
|
|
56513
|
+
const rootPackageJsonPath = sourceOrOutputPath({
|
|
56514
|
+
scanDirectory,
|
|
56515
|
+
outputDirectory,
|
|
56516
|
+
relativePath: "package.json"
|
|
56517
|
+
});
|
|
56518
|
+
return rootPackageJsonPath === null ? null : readJsonRecord(rootPackageJsonPath);
|
|
56519
|
+
};
|
|
56520
|
+
var dependencyVersionFor = ({
|
|
56521
|
+
rootPackageJson,
|
|
56522
|
+
packageName,
|
|
56523
|
+
isRootWorkspace
|
|
56524
|
+
}) => {
|
|
56525
|
+
const dependencySections = [
|
|
56526
|
+
rootPackageJson?.devDependencies,
|
|
56527
|
+
rootPackageJson?.dependencies,
|
|
56528
|
+
rootPackageJson?.peerDependencies,
|
|
56529
|
+
rootPackageJson?.optionalDependencies
|
|
56530
|
+
];
|
|
56531
|
+
for (const section2 of dependencySections) {
|
|
56532
|
+
if (isRecord3(section2) && typeof section2[packageName] === "string") {
|
|
56533
|
+
return section2[packageName];
|
|
56534
|
+
}
|
|
56535
|
+
}
|
|
56536
|
+
const workspaces = rootPackageJson?.workspaces;
|
|
56537
|
+
const catalog = isRecord3(workspaces) ? workspaces.catalog : undefined;
|
|
56538
|
+
if (!isRootWorkspace && isRecord3(catalog) && typeof catalog[packageName] === "string") {
|
|
56539
|
+
return "catalog:";
|
|
56540
|
+
}
|
|
56541
|
+
return defaultDevDependencyVersion;
|
|
56542
|
+
};
|
|
56543
|
+
var packageHasDependency = (packageJson, packageName) => [
|
|
56544
|
+
packageJson.dependencies,
|
|
56545
|
+
packageJson.devDependencies,
|
|
56546
|
+
packageJson.peerDependencies,
|
|
56547
|
+
packageJson.optionalDependencies
|
|
56548
|
+
].filter(isRecord3).some((section2) => typeof section2[packageName] === "string");
|
|
56549
|
+
var patchPackageJsonDependencies = ({
|
|
56550
|
+
packageJson,
|
|
56551
|
+
packageNames,
|
|
56552
|
+
rootPackageJson,
|
|
56553
|
+
isRootWorkspace
|
|
56554
|
+
}) => {
|
|
56555
|
+
const nextPackageJson = { ...packageJson };
|
|
56556
|
+
const devDependencies = isRecord3(nextPackageJson.devDependencies) ? { ...nextPackageJson.devDependencies } : {};
|
|
56557
|
+
for (const packageName of packageNames) {
|
|
56558
|
+
if (packageHasDependency(nextPackageJson, packageName)) {
|
|
56559
|
+
continue;
|
|
56560
|
+
}
|
|
56561
|
+
devDependencies[packageName] = dependencyVersionFor({
|
|
56562
|
+
rootPackageJson,
|
|
56563
|
+
packageName,
|
|
56564
|
+
isRootWorkspace
|
|
56565
|
+
});
|
|
56566
|
+
}
|
|
56567
|
+
nextPackageJson.devDependencies = Object.fromEntries(Object.entries(devDependencies).toSorted(([left3], [right3]) => left3.localeCompare(right3)));
|
|
56568
|
+
return nextPackageJson;
|
|
56569
|
+
};
|
|
56570
|
+
var lintTargetManifests = (detection) => {
|
|
56571
|
+
if (!detection.monorepo) {
|
|
56572
|
+
return detection.manifests;
|
|
56573
|
+
}
|
|
56574
|
+
return detection.manifests.filter((manifest) => path10.posix.dirname(toPosixPath(manifest.relativePath)) !== ".");
|
|
56575
|
+
};
|
|
56576
|
+
var existingJsonOxlintConfigPath = ({
|
|
56577
|
+
scanDirectory,
|
|
56578
|
+
outputDirectory,
|
|
56579
|
+
workspacePath
|
|
56580
|
+
}) => {
|
|
56581
|
+
const candidates = [".oxlintrc.json", ".oxlintrc.jsonc"].map((fileName) => workspacePath === "." ? fileName : path10.posix.join(workspacePath, fileName));
|
|
56582
|
+
for (const candidate of candidates) {
|
|
56583
|
+
const configPath = sourceOrOutputPath({
|
|
56584
|
+
scanDirectory,
|
|
56585
|
+
outputDirectory,
|
|
56586
|
+
relativePath: candidate
|
|
56587
|
+
});
|
|
56588
|
+
if (configPath !== null) {
|
|
56589
|
+
return configPath;
|
|
56590
|
+
}
|
|
56591
|
+
}
|
|
56592
|
+
return null;
|
|
56593
|
+
};
|
|
56594
|
+
var writeAppliedLintConfigs = ({
|
|
56595
|
+
scanDirectory,
|
|
56596
|
+
outputDirectory,
|
|
56597
|
+
detection,
|
|
56598
|
+
finalPacks,
|
|
56599
|
+
baseline
|
|
56600
|
+
}) => {
|
|
56601
|
+
const rootPackageJson = rootPackageJsonRecord({ scanDirectory, outputDirectory });
|
|
56602
|
+
const applied = [];
|
|
56603
|
+
for (const manifest of lintTargetManifests(detection)) {
|
|
56604
|
+
const manifestRelativePath = toPosixPath(manifest.relativePath);
|
|
56605
|
+
const workspacePath = path10.posix.dirname(manifestRelativePath);
|
|
56606
|
+
const normalizedWorkspacePath = workspacePath === "." ? "." : workspacePath;
|
|
56607
|
+
const workspacePacks = packsForWorkspace({
|
|
56608
|
+
relativeWorkspacePath: normalizedWorkspacePath,
|
|
56609
|
+
manifest,
|
|
56610
|
+
finalPacks,
|
|
56611
|
+
baseline
|
|
56612
|
+
});
|
|
56613
|
+
const assets = resolveLintAssetsForPacks(workspacePacks, baseline);
|
|
56614
|
+
if (assets.length === 0) {
|
|
56615
|
+
continue;
|
|
56616
|
+
}
|
|
56617
|
+
const configFile = normalizedWorkspacePath === "." ? oxlintConfigFileName : path10.posix.join(normalizedWorkspacePath, oxlintConfigFileName);
|
|
56618
|
+
const existingConfigPath = existingJsonOxlintConfigPath({
|
|
56619
|
+
scanDirectory,
|
|
56620
|
+
outputDirectory,
|
|
56621
|
+
workspacePath: normalizedWorkspacePath
|
|
56622
|
+
});
|
|
56623
|
+
const existingConfig = existingConfigPath === null ? {} : readJsonRecord(existingConfigPath);
|
|
56624
|
+
writeArtifact({
|
|
56625
|
+
outputDirectory,
|
|
56626
|
+
relativePath: configFile,
|
|
56627
|
+
content: encodeOxlintConfigTs({ existingConfig, assets })
|
|
56628
|
+
});
|
|
56629
|
+
const packageJsonFile = manifestRelativePath;
|
|
56630
|
+
const packageJsonPath = sourceOrOutputPath({
|
|
56631
|
+
scanDirectory,
|
|
56632
|
+
outputDirectory,
|
|
56633
|
+
relativePath: packageJsonFile
|
|
56634
|
+
});
|
|
56635
|
+
const packageJson = packageJsonPath === null ? {} : readJsonRecord(packageJsonPath);
|
|
56636
|
+
const requiredDevDependencies = uniqueSorted([
|
|
56637
|
+
"oxlint",
|
|
56638
|
+
"ultracite",
|
|
56639
|
+
...assets.flatMap((asset) => asset.requiredDevDependencies)
|
|
56640
|
+
]);
|
|
56641
|
+
const patchedPackageJson = patchPackageJsonDependencies({
|
|
56642
|
+
packageJson,
|
|
56643
|
+
packageNames: requiredDevDependencies,
|
|
56644
|
+
rootPackageJson,
|
|
56645
|
+
isRootWorkspace: normalizedWorkspacePath === "."
|
|
56646
|
+
});
|
|
56647
|
+
writeArtifact({
|
|
56648
|
+
outputDirectory,
|
|
56649
|
+
relativePath: packageJsonFile,
|
|
56650
|
+
content: encodePrettyJson(patchedPackageJson)
|
|
56651
|
+
});
|
|
56652
|
+
applied.push({
|
|
56653
|
+
workspace: normalizedWorkspacePath,
|
|
56654
|
+
configFile,
|
|
56655
|
+
packageJsonFile,
|
|
56656
|
+
assets: assets.map((asset) => asset.id),
|
|
56657
|
+
requiredDevDependencies
|
|
56658
|
+
});
|
|
56659
|
+
}
|
|
56660
|
+
return applied.toSorted((left3, right3) => left3.workspace.localeCompare(right3.workspace));
|
|
56661
|
+
};
|
|
56662
|
+
var detectedWorkspaces = (scanDirectory, detection) => detection.manifests.map((manifest) => path10.posix.dirname(relativePosixPath(scanDirectory, manifest.path))).filter((workspace) => workspace !== "" && workspace !== ".").toSorted();
|
|
56663
|
+
var packsForWorkspace = ({
|
|
56664
|
+
relativeWorkspacePath,
|
|
56665
|
+
manifest,
|
|
56666
|
+
finalPacks
|
|
56667
|
+
}) => {
|
|
56668
|
+
const dependencyNames = manifest?.dependencies ?? [];
|
|
56669
|
+
const dependencies = new Set(dependencyNames);
|
|
56670
|
+
const selectedPacks = new Set(finalPacks);
|
|
56671
|
+
const hasDependency = (name2) => dependencies.has(name2);
|
|
56672
|
+
const hasDependencyPrefix = (prefix) => dependencyNames.some((name2) => name2.startsWith(prefix));
|
|
56673
|
+
const hasBackendDependency = () => hasDependency("better-auth") || hasDependency("drizzle-orm") || hasDependency("drizzle-kit") || hasDependency("elysia") || hasDependencyPrefix("@trpc/");
|
|
56674
|
+
const hasFrontendDependency = () => hasDependency("next") || hasDependency("react") || hasDependency("react-dom") || hasDependency("@tanstack/react-query");
|
|
56675
|
+
const hasFrontendWorkspaceName = () => relativeWorkspacePath.split("/").some((segment) => segment === "frontend" || segment === "ui" || segment === "web") || (manifest?.packageName?.replace(/^@[^/]+\//u, "").split(/[^a-zA-Z0-9]+/u).filter((segment) => segment.length > 0).map((segment) => segment.toLowerCase()).some((segment) => segment === "frontend" || segment === "ui" || segment === "web") ?? false);
|
|
56676
|
+
const hasBackendWorkspaceName2 = () => relativeWorkspacePath.split("/").some((segment) => segment === "api" || segment === "backend" || segment === "server" || segment === "services") || (manifest?.packageName?.replace(/^@[^/]+\//u, "").split(/[^a-zA-Z0-9]+/u).filter((segment) => segment.length > 0).map((segment) => segment.toLowerCase()).some((segment) => segment === "api" || segment === "backend" || segment === "server" || segment === "service") ?? false);
|
|
56677
|
+
const isFrontendWorkspace = hasFrontendDependency() || hasFrontendWorkspaceName();
|
|
56678
|
+
const isBackendWorkspace = hasBackendDependency() || hasBackendWorkspaceName2();
|
|
56679
|
+
const packs = [];
|
|
56680
|
+
if (selectedPacks.has("quality")) {
|
|
56681
|
+
packs.push("quality");
|
|
56682
|
+
}
|
|
56683
|
+
if (selectedPacks.has("research")) {
|
|
56684
|
+
packs.push("research");
|
|
56685
|
+
}
|
|
56686
|
+
if (selectedPacks.has("typescript") && relativeWorkspacePath !== ".agents" && relativeWorkspacePath !== "docs") {
|
|
56687
|
+
packs.push("typescript");
|
|
56688
|
+
}
|
|
56689
|
+
if (relativeWorkspacePath === ".agents") {
|
|
56690
|
+
if (selectedPacks.has("subagents")) {
|
|
56691
|
+
packs.push("subagents");
|
|
56692
|
+
}
|
|
56693
|
+
if (selectedPacks.has("docs")) {
|
|
56694
|
+
packs.push("docs");
|
|
56695
|
+
}
|
|
56696
|
+
return uniqueSorted(packs);
|
|
56697
|
+
}
|
|
56698
|
+
if (relativeWorkspacePath === ".") {
|
|
56699
|
+
if (selectedPacks.has("turborepo")) {
|
|
56700
|
+
packs.push("turborepo");
|
|
56701
|
+
}
|
|
56702
|
+
if (selectedPacks.has("subagents")) {
|
|
56703
|
+
packs.push("subagents");
|
|
56704
|
+
}
|
|
56705
|
+
if (selectedPacks.has("docs")) {
|
|
56706
|
+
packs.push("docs");
|
|
56707
|
+
}
|
|
56708
|
+
return uniqueSorted([...packs, ...finalPacks]);
|
|
56709
|
+
}
|
|
56710
|
+
if (relativeWorkspacePath === "docs") {
|
|
56711
|
+
if (selectedPacks.has("docs")) {
|
|
56712
|
+
packs.push("docs");
|
|
56713
|
+
}
|
|
56714
|
+
return uniqueSorted(packs);
|
|
56715
|
+
}
|
|
56716
|
+
if (isFrontendWorkspace) {
|
|
56717
|
+
if (selectedPacks.has("frontend")) {
|
|
56718
|
+
packs.push("frontend");
|
|
56719
|
+
}
|
|
56720
|
+
if (selectedPacks.has("react")) {
|
|
56721
|
+
packs.push("react");
|
|
56722
|
+
}
|
|
56723
|
+
if (selectedPacks.has("nextjs")) {
|
|
56724
|
+
packs.push("nextjs");
|
|
56725
|
+
}
|
|
56726
|
+
if (selectedPacks.has("tanstack-query")) {
|
|
56727
|
+
packs.push("tanstack-query");
|
|
56240
56728
|
}
|
|
56241
56729
|
}
|
|
56242
56730
|
if (isBackendWorkspace && !isFrontendWorkspace) {
|
|
@@ -56490,6 +56978,9 @@ var managedKindForPath = (relativePath) => {
|
|
|
56490
56978
|
if (relativePath.startsWith(".devpunks/specs/lint/")) {
|
|
56491
56979
|
return "lint-spec";
|
|
56492
56980
|
}
|
|
56981
|
+
if (relativePath.startsWith("opensrc/")) {
|
|
56982
|
+
return "source-guide";
|
|
56983
|
+
}
|
|
56493
56984
|
if (relativePath.startsWith(".agents/skills/")) {
|
|
56494
56985
|
return "skill";
|
|
56495
56986
|
}
|
|
@@ -56574,17 +57065,24 @@ var writeScaffoldOutput = ({
|
|
|
56574
57065
|
const promptOutputs = [];
|
|
56575
57066
|
const promptSpecFiles = [];
|
|
56576
57067
|
const lintSpecFiles = [];
|
|
57068
|
+
const sourceGuideFiles = [];
|
|
56577
57069
|
const skillFiles = [];
|
|
56578
57070
|
const subagentFiles = [];
|
|
56579
57071
|
const scriptFiles = [];
|
|
56580
57072
|
const hookFiles = [];
|
|
56581
57073
|
const harnessFiles = [];
|
|
56582
57074
|
const finalSkills = selectedSkills(finalPacks, baseline);
|
|
56583
|
-
const hasOxlint = detectionHasPackage(detection, "oxlint");
|
|
56584
57075
|
const hasOxfmt = detectionHasPackage(detection, "oxfmt");
|
|
56585
57076
|
const hasPython = detection.detectedLanguages.includes("python");
|
|
56586
57077
|
const finalHookIds = selectedHookIds(finalPacks, baseline).filter((hookId) => hookId !== "format-edited-file" || hasOxfmt || hasPython);
|
|
56587
|
-
const lintAssets =
|
|
57078
|
+
const lintAssets = resolveLintAssetsForPacks(finalPacks, baseline);
|
|
57079
|
+
const appliedLintConfigs = writeAppliedLintConfigs({
|
|
57080
|
+
scanDirectory,
|
|
57081
|
+
outputDirectory,
|
|
57082
|
+
detection,
|
|
57083
|
+
finalPacks,
|
|
57084
|
+
baseline
|
|
57085
|
+
});
|
|
56588
57086
|
const lintAssetIdsByPack = Object.fromEntries(finalPacks.map((packId) => [
|
|
56589
57087
|
packId,
|
|
56590
57088
|
lintAssets.filter((asset) => asset.sourcePacks.includes(packId)).map((asset) => asset.id)
|
|
@@ -56601,6 +57099,11 @@ var writeScaffoldOutput = ({
|
|
|
56601
57099
|
baseline
|
|
56602
57100
|
}));
|
|
56603
57101
|
const opensrcReferences = collectOpensrcReferences(promptSpecs);
|
|
57102
|
+
const sourceGuides = sourceGuidesForSelection({
|
|
57103
|
+
detectedTechnologies: detection.detectedTechnologies,
|
|
57104
|
+
finalPacks
|
|
57105
|
+
});
|
|
57106
|
+
const sourceGuideSummaries = sourceGuides.map(summarizeSourceGuide);
|
|
56604
57107
|
generatedFiles.push(writeArtifact({
|
|
56605
57108
|
outputDirectory,
|
|
56606
57109
|
relativePath: ".agents/AGENTS.md",
|
|
@@ -56622,6 +57125,24 @@ var writeScaffoldOutput = ({
|
|
|
56622
57125
|
}));
|
|
56623
57126
|
promptSpecFiles.push(promptSpec.specFile);
|
|
56624
57127
|
}
|
|
57128
|
+
if (sourceGuides.length > 0) {
|
|
57129
|
+
const readmeFile = "opensrc/README.md";
|
|
57130
|
+
generatedFiles.push(writeArtifact({
|
|
57131
|
+
outputDirectory,
|
|
57132
|
+
relativePath: readmeFile,
|
|
57133
|
+
content: renderSourceGuideReadme(sourceGuides)
|
|
57134
|
+
}));
|
|
57135
|
+
sourceGuideFiles.push(readmeFile);
|
|
57136
|
+
for (const guide of sourceGuides) {
|
|
57137
|
+
const guideFile = sourceGuideFile(guide);
|
|
57138
|
+
generatedFiles.push(writeArtifact({
|
|
57139
|
+
outputDirectory,
|
|
57140
|
+
relativePath: guideFile,
|
|
57141
|
+
content: renderSourceGuide(guide)
|
|
57142
|
+
}));
|
|
57143
|
+
sourceGuideFiles.push(guideFile);
|
|
57144
|
+
}
|
|
57145
|
+
}
|
|
56625
57146
|
if (lintAssets.length > 0) {
|
|
56626
57147
|
const lintAssetsFile = ".devpunks/specs/lint/assets.json";
|
|
56627
57148
|
generatedFiles.push(writeArtifact({
|
|
@@ -56638,10 +57159,15 @@ var writeScaffoldOutput = ({
|
|
|
56638
57159
|
finalPacks,
|
|
56639
57160
|
selectedAssetIds: lintAssets.map((asset) => asset.id),
|
|
56640
57161
|
selectedAssetsByPack: lintAssetIdsByPack,
|
|
56641
|
-
requiredDevDependencies: uniqueSorted(
|
|
57162
|
+
requiredDevDependencies: uniqueSorted([
|
|
57163
|
+
"oxlint",
|
|
57164
|
+
"ultracite",
|
|
57165
|
+
...lintAssets.flatMap((asset) => asset.requiredDevDependencies)
|
|
57166
|
+
]),
|
|
56642
57167
|
existingRootOxlintConfigFiles: rootOxlintConfigFiles,
|
|
56643
57168
|
starterConfigFile: lintStarterConfigFile,
|
|
56644
|
-
|
|
57169
|
+
ultraciteCorePreset: "ultracite/oxlint/core",
|
|
57170
|
+
appliedLintConfigs
|
|
56645
57171
|
})
|
|
56646
57172
|
}));
|
|
56647
57173
|
lintSpecFiles.push(lintSelectionFile);
|
|
@@ -56727,7 +57253,7 @@ var writeScaffoldOutput = ({
|
|
|
56727
57253
|
}));
|
|
56728
57254
|
hookFiles.push(hook.outputPath);
|
|
56729
57255
|
}
|
|
56730
|
-
|
|
57256
|
+
execFileSync4(process.execPath, [path10.join(outputDirectory, syncScriptFile)], {
|
|
56731
57257
|
cwd: outputDirectory,
|
|
56732
57258
|
stdio: "ignore"
|
|
56733
57259
|
});
|
|
@@ -56737,12 +57263,14 @@ var writeScaffoldOutput = ({
|
|
|
56737
57263
|
}
|
|
56738
57264
|
generatedFiles.push(...harnessFiles);
|
|
56739
57265
|
const requiredToolsFile = ".devpunks/required-tools.json";
|
|
57266
|
+
const requiredToolIds = requiredToolsForSkills(finalSkills, baseline);
|
|
56740
57267
|
generatedFiles.push(writeArtifact({
|
|
56741
57268
|
outputDirectory,
|
|
56742
57269
|
relativePath: requiredToolsFile,
|
|
56743
57270
|
content: encodeJson({
|
|
56744
57271
|
skills: finalSkills,
|
|
56745
|
-
tools:
|
|
57272
|
+
tools: requiredToolIds,
|
|
57273
|
+
toolContracts: baseline.tools.filter((tool) => requiredToolIds.includes(tool.id))
|
|
56746
57274
|
})
|
|
56747
57275
|
}));
|
|
56748
57276
|
const agentHandoffFile = ".devpunks/AGENT-HANDOFF.md";
|
|
@@ -56758,6 +57286,7 @@ var writeScaffoldOutput = ({
|
|
|
56758
57286
|
promptOutputs: promptOutputs.toSorted(),
|
|
56759
57287
|
promptSpecFiles: promptSpecFiles.toSorted(),
|
|
56760
57288
|
lintSpecFiles: lintSpecFiles.toSorted(),
|
|
57289
|
+
sourceGuideFiles: sourceGuideFiles.toSorted(),
|
|
56761
57290
|
skillFiles: skillFiles.toSorted(),
|
|
56762
57291
|
scaffoldManifestFile: ".devpunks/scaffold-manifest.json",
|
|
56763
57292
|
requiredToolsFile,
|
|
@@ -56791,6 +57320,7 @@ var writeScaffoldOutput = ({
|
|
|
56791
57320
|
promptOutputs,
|
|
56792
57321
|
promptSpecFiles,
|
|
56793
57322
|
lintSpecFiles,
|
|
57323
|
+
sourceGuideFiles,
|
|
56794
57324
|
skillFiles,
|
|
56795
57325
|
subagentFiles,
|
|
56796
57326
|
scriptFiles,
|
|
@@ -56800,7 +57330,9 @@ var writeScaffoldOutput = ({
|
|
|
56800
57330
|
requiredToolsFile,
|
|
56801
57331
|
promptSpecs,
|
|
56802
57332
|
opensrcReferences,
|
|
57333
|
+
sourceGuides: sourceGuideSummaries,
|
|
56803
57334
|
lintAssets,
|
|
57335
|
+
appliedLintConfigs,
|
|
56804
57336
|
subagentManifestSpec,
|
|
56805
57337
|
baseline: baseline.summary,
|
|
56806
57338
|
version,
|
|
@@ -56822,6 +57354,7 @@ var writeScaffoldOutput = ({
|
|
|
56822
57354
|
promptOutputs: promptOutputs.toSorted(),
|
|
56823
57355
|
promptSpecFiles: promptSpecFiles.toSorted(),
|
|
56824
57356
|
lintSpecFiles: lintSpecFiles.toSorted(),
|
|
57357
|
+
sourceGuideFiles: sourceGuideFiles.toSorted(),
|
|
56825
57358
|
skillFiles: skillFiles.toSorted(),
|
|
56826
57359
|
subagentFiles: subagentFiles.toSorted(),
|
|
56827
57360
|
scriptFiles: scriptFiles.toSorted(),
|
|
@@ -56834,6 +57367,7 @@ var writeScaffoldOutput = ({
|
|
|
56834
57367
|
managedFiles: managedFilesWithManifest,
|
|
56835
57368
|
promptSpecs,
|
|
56836
57369
|
opensrcReferences,
|
|
57370
|
+
sourceGuides: sourceGuideSummaries,
|
|
56837
57371
|
lintAssets,
|
|
56838
57372
|
subagentManifestSpec,
|
|
56839
57373
|
generatedFiles: generatedFiles.toSorted()
|
|
@@ -56843,7 +57377,7 @@ var writeScaffoldOutput = ({
|
|
|
56843
57377
|
// src/scaffold/run.ts
|
|
56844
57378
|
var yesValues = new Set(["", "y", "yes"]);
|
|
56845
57379
|
var encodeJson2 = encodeSync(parseJson(Unknown));
|
|
56846
|
-
var
|
|
57380
|
+
var encodePrettyJson2 = (value6) => JSON.stringify(JSON.parse(encodeJson2(value6)), null, 2);
|
|
56847
57381
|
var agentSystemPromptFile = ".devpunks/AGENT-SYSTEM-PROMPT.md";
|
|
56848
57382
|
var clipboardWorkingDirectory = homedir2();
|
|
56849
57383
|
var writeAgentSystemPrompt = ({
|
|
@@ -56876,7 +57410,7 @@ var tryClipboardCommand = ({
|
|
|
56876
57410
|
}
|
|
56877
57411
|
};
|
|
56878
57412
|
var defaultClipboardExecFile = (command, args2, options9) => {
|
|
56879
|
-
|
|
57413
|
+
execFileSync5(command, [...args2], {
|
|
56880
57414
|
cwd: options9.cwd,
|
|
56881
57415
|
input: options9.input,
|
|
56882
57416
|
stdio: ["pipe", "ignore", "ignore"]
|
|
@@ -57066,6 +57600,7 @@ var runScaffold = ({
|
|
|
57066
57600
|
promptOutputs: scaffoldOutput.promptOutputs,
|
|
57067
57601
|
promptSpecFiles: scaffoldOutput.promptSpecFiles,
|
|
57068
57602
|
lintSpecFiles: scaffoldOutput.lintSpecFiles,
|
|
57603
|
+
sourceGuideFiles: scaffoldOutput.sourceGuideFiles,
|
|
57069
57604
|
skillFiles: scaffoldOutput.skillFiles,
|
|
57070
57605
|
subagentFiles: scaffoldOutput.subagentFiles,
|
|
57071
57606
|
scriptFiles: scaffoldOutput.scriptFiles,
|
|
@@ -57080,6 +57615,7 @@ var runScaffold = ({
|
|
|
57080
57615
|
managedFiles: scaffoldOutput.managedFiles,
|
|
57081
57616
|
promptSpecs: scaffoldOutput.promptSpecs,
|
|
57082
57617
|
opensrcReferences: scaffoldOutput.opensrcReferences,
|
|
57618
|
+
sourceGuides: scaffoldOutput.sourceGuides,
|
|
57083
57619
|
lintAssets: scaffoldOutput.lintAssets,
|
|
57084
57620
|
subagentManifestSpec: scaffoldOutput.subagentManifestSpec,
|
|
57085
57621
|
generatedFiles: [...scaffoldOutput.generatedFiles, agentSystemPromptFile],
|
|
@@ -57109,6 +57645,7 @@ var runScaffold = ({
|
|
|
57109
57645
|
promptOutputs: scaffoldOutput.promptOutputs,
|
|
57110
57646
|
promptSpecFiles: scaffoldOutput.promptSpecFiles,
|
|
57111
57647
|
lintSpecFiles: scaffoldOutput.lintSpecFiles,
|
|
57648
|
+
sourceGuideFiles: scaffoldOutput.sourceGuideFiles,
|
|
57112
57649
|
skillFiles: scaffoldOutput.skillFiles,
|
|
57113
57650
|
subagentFiles: scaffoldOutput.subagentFiles,
|
|
57114
57651
|
scriptFiles: scaffoldOutput.scriptFiles,
|
|
@@ -57123,6 +57660,7 @@ var runScaffold = ({
|
|
|
57123
57660
|
managedFiles: scaffoldOutput.managedFiles,
|
|
57124
57661
|
promptSpecs: scaffoldOutput.promptSpecs,
|
|
57125
57662
|
opensrcReferences: scaffoldOutput.opensrcReferences,
|
|
57663
|
+
sourceGuides: scaffoldOutput.sourceGuides,
|
|
57126
57664
|
lintAssets: scaffoldOutput.lintAssets,
|
|
57127
57665
|
subagentManifestSpec: scaffoldOutput.subagentManifestSpec,
|
|
57128
57666
|
generatedFiles: [...scaffoldOutput.generatedFiles, writtenAgentSystemPromptFile]
|
|
@@ -57155,7 +57693,7 @@ var runScaffold = ({
|
|
|
57155
57693
|
yield* prompt4.writeLine("");
|
|
57156
57694
|
yield* prompt4.writeLine(renderDivider());
|
|
57157
57695
|
yield* prompt4.writeLine(renderJsonLabel());
|
|
57158
|
-
yield* prompt4.writeLine(
|
|
57696
|
+
yield* prompt4.writeLine(encodePrettyJson2(result));
|
|
57159
57697
|
}
|
|
57160
57698
|
yield* submitCliEventEffect("cli.scaffold.setup.completed", {
|
|
57161
57699
|
cwd: scanDirectory,
|
|
@@ -57180,9 +57718,10 @@ import {
|
|
|
57180
57718
|
import path12 from "path";
|
|
57181
57719
|
|
|
57182
57720
|
// src/content/wiki.ts
|
|
57183
|
-
var makeWikiScaffoldTemplate = (wikiRoot) =>
|
|
57184
|
-
|
|
57185
|
-
|
|
57721
|
+
var makeWikiScaffoldTemplate = (wikiRoot, wikiFramework = "next") => {
|
|
57722
|
+
const template = {
|
|
57723
|
+
wikiRoot,
|
|
57724
|
+
agentsMarkdown: `# Wiki Schema
|
|
57186
57725
|
|
|
57187
57726
|
This file defines how any agent operates within \`${wikiRoot}/\`. Read it before creating or modifying wiki content.
|
|
57188
57727
|
|
|
@@ -57315,10 +57854,10 @@ When processing source material into routed domain knowledge:
|
|
|
57315
57854
|
- \`docs/\` owns implemented architecture and reference (the "how it works now")
|
|
57316
57855
|
- \`content/docs/project/tech-debt/<domain>/<spec>/<debt-slug>.md\` owns persistent implementation drift tied to one spec; keep temporary execution notes in the spec folder instead
|
|
57317
57856
|
`,
|
|
57318
|
-
|
|
57319
|
-
|
|
57320
|
-
|
|
57321
|
-
|
|
57857
|
+
files: [
|
|
57858
|
+
{
|
|
57859
|
+
path: "package.json",
|
|
57860
|
+
content: `{
|
|
57322
57861
|
"name": "@repo/wiki",
|
|
57323
57862
|
"version": "0.0.0",
|
|
57324
57863
|
"private": true,
|
|
@@ -57355,10 +57894,17 @@ When processing source material into routed domain knowledge:
|
|
|
57355
57894
|
}
|
|
57356
57895
|
}
|
|
57357
57896
|
`
|
|
57358
|
-
|
|
57359
|
-
|
|
57360
|
-
|
|
57361
|
-
|
|
57897
|
+
},
|
|
57898
|
+
{
|
|
57899
|
+
path: ".gitignore",
|
|
57900
|
+
content: `node_modules
|
|
57901
|
+
.next
|
|
57902
|
+
.source
|
|
57903
|
+
`
|
|
57904
|
+
},
|
|
57905
|
+
{
|
|
57906
|
+
path: "next.config.mjs",
|
|
57907
|
+
content: `import { createMDX } from "fumadocs-mdx/next";
|
|
57362
57908
|
|
|
57363
57909
|
const withMDX = createMDX();
|
|
57364
57910
|
|
|
@@ -57377,10 +57923,10 @@ const config = {
|
|
|
57377
57923
|
|
|
57378
57924
|
export default withMDX(config);
|
|
57379
57925
|
`
|
|
57380
|
-
|
|
57381
|
-
|
|
57382
|
-
|
|
57383
|
-
|
|
57926
|
+
},
|
|
57927
|
+
{
|
|
57928
|
+
path: "scripts/sync-content.mjs",
|
|
57929
|
+
content: `import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
57384
57930
|
import path from "node:path";
|
|
57385
57931
|
import { fileURLToPath } from "node:url";
|
|
57386
57932
|
|
|
@@ -57598,10 +58144,10 @@ if (repoRoot) {
|
|
|
57598
58144
|
console.log("No repository root detected; using checked-in wiki content.");
|
|
57599
58145
|
}
|
|
57600
58146
|
`
|
|
57601
|
-
|
|
57602
|
-
|
|
57603
|
-
|
|
57604
|
-
|
|
58147
|
+
},
|
|
58148
|
+
{
|
|
58149
|
+
path: "postcss.config.mjs",
|
|
58150
|
+
content: `const config = {
|
|
57605
58151
|
plugins: {
|
|
57606
58152
|
"@tailwindcss/postcss": {},
|
|
57607
58153
|
},
|
|
@@ -57609,10 +58155,10 @@ if (repoRoot) {
|
|
|
57609
58155
|
|
|
57610
58156
|
export default config;
|
|
57611
58157
|
`
|
|
57612
|
-
|
|
57613
|
-
|
|
57614
|
-
|
|
57615
|
-
|
|
58158
|
+
},
|
|
58159
|
+
{
|
|
58160
|
+
path: "source.config.ts",
|
|
58161
|
+
content: `import { metaSchema, pageSchema } from "fumadocs-core/source/schema";
|
|
57616
58162
|
import { remarkMdxMermaid } from "fumadocs-core/mdx-plugins";
|
|
57617
58163
|
import { defineConfig, defineDocs } from "fumadocs-mdx/config";
|
|
57618
58164
|
import { z } from "zod";
|
|
@@ -57641,10 +58187,10 @@ export default defineConfig({
|
|
|
57641
58187
|
},
|
|
57642
58188
|
});
|
|
57643
58189
|
`
|
|
57644
|
-
|
|
57645
|
-
|
|
57646
|
-
|
|
57647
|
-
|
|
58190
|
+
},
|
|
58191
|
+
{
|
|
58192
|
+
path: "tsconfig.json",
|
|
58193
|
+
content: `{
|
|
57648
58194
|
"compilerOptions": {
|
|
57649
58195
|
"target": "ESNext",
|
|
57650
58196
|
"lib": ["dom", "dom.iterable", "esnext"],
|
|
@@ -57676,10 +58222,10 @@ export default defineConfig({
|
|
|
57676
58222
|
"exclude": ["node_modules"]
|
|
57677
58223
|
}
|
|
57678
58224
|
`
|
|
57679
|
-
|
|
57680
|
-
|
|
57681
|
-
|
|
57682
|
-
|
|
58225
|
+
},
|
|
58226
|
+
{
|
|
58227
|
+
path: "src/app/global.css",
|
|
58228
|
+
content: `@import "tailwindcss";
|
|
57683
58229
|
@import "fumadocs-ui/css/neutral.css";
|
|
57684
58230
|
@import "fumadocs-ui/css/preset.css";
|
|
57685
58231
|
|
|
@@ -57691,10 +58237,10 @@ body {
|
|
|
57691
58237
|
background-color: var(--color-fd-background);
|
|
57692
58238
|
}
|
|
57693
58239
|
`
|
|
57694
|
-
|
|
57695
|
-
|
|
57696
|
-
|
|
57697
|
-
|
|
58240
|
+
},
|
|
58241
|
+
{
|
|
58242
|
+
path: "src/app/layout.tsx",
|
|
58243
|
+
content: `import { RootProvider } from "fumadocs-ui/provider/next";
|
|
57698
58244
|
import type { Metadata } from "next";
|
|
57699
58245
|
import { Inter } from "next/font/google";
|
|
57700
58246
|
|
|
@@ -57724,10 +58270,10 @@ export default function Layout({ children }: LayoutProps<"/">) {
|
|
|
57724
58270
|
);
|
|
57725
58271
|
}
|
|
57726
58272
|
`
|
|
57727
|
-
|
|
57728
|
-
|
|
57729
|
-
|
|
57730
|
-
|
|
58273
|
+
},
|
|
58274
|
+
{
|
|
58275
|
+
path: "src/app/(home)/layout.tsx",
|
|
58276
|
+
content: `import { HomeLayout } from "fumadocs-ui/layouts/home";
|
|
57731
58277
|
|
|
57732
58278
|
import { baseOptions } from "@/lib/layout.shared";
|
|
57733
58279
|
|
|
@@ -57735,10 +58281,10 @@ export default function Layout({ children }: LayoutProps<"/">) {
|
|
|
57735
58281
|
return <HomeLayout {...baseOptions()}>{children}</HomeLayout>;
|
|
57736
58282
|
}
|
|
57737
58283
|
`
|
|
57738
|
-
|
|
57739
|
-
|
|
57740
|
-
|
|
57741
|
-
|
|
58284
|
+
},
|
|
58285
|
+
{
|
|
58286
|
+
path: "src/app/(home)/page.tsx",
|
|
58287
|
+
content: `import Link from "next/link";
|
|
57742
58288
|
|
|
57743
58289
|
export default function HomePage() {
|
|
57744
58290
|
return (
|
|
@@ -57755,10 +58301,10 @@ export default function HomePage() {
|
|
|
57755
58301
|
);
|
|
57756
58302
|
}
|
|
57757
58303
|
`
|
|
57758
|
-
|
|
57759
|
-
|
|
57760
|
-
|
|
57761
|
-
|
|
58304
|
+
},
|
|
58305
|
+
{
|
|
58306
|
+
path: "src/app/docs/layout.tsx",
|
|
58307
|
+
content: `import { DocsLayout } from "fumadocs-ui/layouts/docs";
|
|
57762
58308
|
|
|
57763
58309
|
import { baseOptions } from "@/lib/layout.shared";
|
|
57764
58310
|
import { getDocsPageTree } from "@/lib/source";
|
|
@@ -57771,16 +58317,16 @@ export default function Layout({ children }: LayoutProps<"/docs">) {
|
|
|
57771
58317
|
);
|
|
57772
58318
|
}
|
|
57773
58319
|
`
|
|
57774
|
-
|
|
57775
|
-
|
|
57776
|
-
|
|
57777
|
-
|
|
58320
|
+
},
|
|
58321
|
+
{
|
|
58322
|
+
path: "src/app/docs/[[...slug]]/page.tsx",
|
|
58323
|
+
content: `import { DocsBody, DocsDescription, DocsPage, DocsTitle } from "fumadocs-ui/layouts/docs/page";
|
|
57778
58324
|
import { createRelativeLink } from "fumadocs-ui/mdx";
|
|
57779
58325
|
import type { Metadata } from "next";
|
|
57780
58326
|
import { notFound, redirect } from "next/navigation";
|
|
57781
58327
|
|
|
57782
58328
|
import { getMDXComponents } from "@/components/mdx";
|
|
57783
|
-
import { source } from "@/lib/source";
|
|
58329
|
+
import { getPageImage, source } from "@/lib/source";
|
|
57784
58330
|
|
|
57785
58331
|
export default async function Page(props: PageProps<"/docs/[[...slug]]">) {
|
|
57786
58332
|
const params = await props.params;
|
|
@@ -57818,6 +58364,9 @@ export async function generateMetadata(
|
|
|
57818
58364
|
return {
|
|
57819
58365
|
title: page.data.title,
|
|
57820
58366
|
description: page.data.description,
|
|
58367
|
+
openGraph: {
|
|
58368
|
+
images: getPageImage(page).url,
|
|
58369
|
+
},
|
|
57821
58370
|
};
|
|
57822
58371
|
}
|
|
57823
58372
|
|
|
@@ -57828,10 +58377,10 @@ function redirectSectionLanding(slug?: string[]) {
|
|
|
57828
58377
|
if (joinedSlug === "wiki") redirect("/docs/project");
|
|
57829
58378
|
}
|
|
57830
58379
|
`
|
|
57831
|
-
|
|
57832
|
-
|
|
57833
|
-
|
|
57834
|
-
|
|
58380
|
+
},
|
|
58381
|
+
{
|
|
58382
|
+
path: "src/app/api/search/route.ts",
|
|
58383
|
+
content: `import { createFromSource } from "fumadocs-core/search/server";
|
|
57835
58384
|
|
|
57836
58385
|
import { source } from "@/lib/source";
|
|
57837
58386
|
|
|
@@ -57839,10 +58388,43 @@ export const { GET } = createFromSource(source, {
|
|
|
57839
58388
|
language: "english",
|
|
57840
58389
|
});
|
|
57841
58390
|
`
|
|
57842
|
-
|
|
58391
|
+
},
|
|
58392
|
+
{
|
|
58393
|
+
path: "src/app/og/docs/[...slug]/route.tsx",
|
|
58394
|
+
content: `import { generate as DefaultImage } from "fumadocs-ui/og";
|
|
58395
|
+
import { notFound } from "next/navigation";
|
|
58396
|
+
import { ImageResponse } from "next/og";
|
|
58397
|
+
|
|
58398
|
+
import { appName } from "@/lib/shared";
|
|
58399
|
+
import { getPageImage, source } from "@/lib/source";
|
|
58400
|
+
|
|
58401
|
+
export const revalidate = false;
|
|
58402
|
+
|
|
58403
|
+
export async function GET(_req: Request, { params }: RouteContext<"/og/docs/[...slug]">) {
|
|
58404
|
+
const { slug } = await params;
|
|
58405
|
+
const page = source.getPage(slug.slice(0, -1));
|
|
58406
|
+
if (!page) notFound();
|
|
58407
|
+
|
|
58408
|
+
return new ImageResponse(
|
|
58409
|
+
<DefaultImage title={page.data.title} description={page.data.description} site={appName} />,
|
|
57843
58410
|
{
|
|
57844
|
-
|
|
57845
|
-
|
|
58411
|
+
width: 1200,
|
|
58412
|
+
height: 630,
|
|
58413
|
+
},
|
|
58414
|
+
);
|
|
58415
|
+
}
|
|
58416
|
+
|
|
58417
|
+
export function generateStaticParams() {
|
|
58418
|
+
return source.getPages().map((page) => ({
|
|
58419
|
+
lang: page.locale,
|
|
58420
|
+
slug: getPageImage(page).segments,
|
|
58421
|
+
}));
|
|
58422
|
+
}
|
|
58423
|
+
`
|
|
58424
|
+
},
|
|
58425
|
+
{
|
|
58426
|
+
path: "src/components/mdx.tsx",
|
|
58427
|
+
content: `import defaultMdxComponents from "fumadocs-ui/mdx";
|
|
57846
58428
|
import type { MDXComponents } from "mdx/types";
|
|
57847
58429
|
|
|
57848
58430
|
import { Mermaid } from "@/components/mdx/mermaid";
|
|
@@ -57861,10 +58443,10 @@ declare global {
|
|
|
57861
58443
|
type MDXProvidedComponents = ReturnType<typeof getMDXComponents>;
|
|
57862
58444
|
}
|
|
57863
58445
|
`
|
|
57864
|
-
|
|
57865
|
-
|
|
57866
|
-
|
|
57867
|
-
|
|
58446
|
+
},
|
|
58447
|
+
{
|
|
58448
|
+
path: "src/components/mdx/mermaid.tsx",
|
|
58449
|
+
content: `"use client";
|
|
57868
58450
|
|
|
57869
58451
|
import { use, useEffect, useId, useState } from "react";
|
|
57870
58452
|
import { useTheme } from "next-themes";
|
|
@@ -57918,10 +58500,10 @@ function MermaidContent({ chart }: { chart: string }) {
|
|
|
57918
58500
|
);
|
|
57919
58501
|
}
|
|
57920
58502
|
`
|
|
57921
|
-
|
|
57922
|
-
|
|
57923
|
-
|
|
57924
|
-
|
|
58503
|
+
},
|
|
58504
|
+
{
|
|
58505
|
+
path: "src/lib/layout.shared.tsx",
|
|
58506
|
+
content: `import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared";
|
|
57925
58507
|
|
|
57926
58508
|
import { appName, gitConfig } from "./shared";
|
|
57927
58509
|
|
|
@@ -57934,10 +58516,10 @@ export function baseOptions(): BaseLayoutProps {
|
|
|
57934
58516
|
};
|
|
57935
58517
|
}
|
|
57936
58518
|
`
|
|
57937
|
-
|
|
57938
|
-
|
|
57939
|
-
|
|
57940
|
-
|
|
58519
|
+
},
|
|
58520
|
+
{
|
|
58521
|
+
path: "src/lib/shared.ts",
|
|
58522
|
+
content: `export const appName = "Project Wiki";
|
|
57941
58523
|
export const docsRoute = "/docs";
|
|
57942
58524
|
export const docsImageRoute = "/og/docs";
|
|
57943
58525
|
export const docsContentRoute = "/llms.mdx/docs";
|
|
@@ -57949,10 +58531,10 @@ export const gitConfig = {
|
|
|
57949
58531
|
docsPath: "${wikiRoot}/content/docs",
|
|
57950
58532
|
};
|
|
57951
58533
|
`
|
|
57952
|
-
|
|
57953
|
-
|
|
57954
|
-
|
|
57955
|
-
|
|
58534
|
+
},
|
|
58535
|
+
{
|
|
58536
|
+
path: "src/lib/source.ts",
|
|
58537
|
+
content: `import { docs } from "collections/server";
|
|
57956
58538
|
import type { Folder, Item, Node, Root } from "fumadocs-core/page-tree";
|
|
57957
58539
|
import { loader } from "fumadocs-core/source";
|
|
57958
58540
|
import { lucideIconsPlugin } from "fumadocs-core/source/lucide-icons";
|
|
@@ -58019,18 +58601,18 @@ export function getPageMarkdownUrl(page: (typeof source)["$inferPage"]) {
|
|
|
58019
58601
|
};
|
|
58020
58602
|
}
|
|
58021
58603
|
`
|
|
58022
|
-
|
|
58023
|
-
|
|
58024
|
-
|
|
58025
|
-
|
|
58604
|
+
},
|
|
58605
|
+
{
|
|
58606
|
+
path: "content/docs/meta.json",
|
|
58607
|
+
content: `{
|
|
58026
58608
|
"title": "Project Docs",
|
|
58027
58609
|
"pages": ["project"]
|
|
58028
58610
|
}
|
|
58029
58611
|
`
|
|
58030
|
-
|
|
58031
|
-
|
|
58032
|
-
|
|
58033
|
-
|
|
58612
|
+
},
|
|
58613
|
+
{
|
|
58614
|
+
path: "content/docs/project/meta.json",
|
|
58615
|
+
content: `{
|
|
58034
58616
|
"title": "Project",
|
|
58035
58617
|
"description": "Internal project operations",
|
|
58036
58618
|
"pages": [
|
|
@@ -58046,10 +58628,10 @@ export function getPageMarkdownUrl(page: (typeof source)["$inferPage"]) {
|
|
|
58046
58628
|
]
|
|
58047
58629
|
}
|
|
58048
58630
|
`
|
|
58049
|
-
|
|
58050
|
-
|
|
58051
|
-
|
|
58052
|
-
|
|
58631
|
+
},
|
|
58632
|
+
{
|
|
58633
|
+
path: "content/docs/project/index.mdx",
|
|
58634
|
+
content: `---
|
|
58053
58635
|
title: Project
|
|
58054
58636
|
description: Internal project operations and guidance
|
|
58055
58637
|
surface: project
|
|
@@ -58058,20 +58640,20 @@ permission: project
|
|
|
58058
58640
|
|
|
58059
58641
|
This surface is for specs, implementation notes, maintenance logs, decisions, repo guidance, runbooks, and durable project context.
|
|
58060
58642
|
`
|
|
58061
|
-
|
|
58062
|
-
|
|
58063
|
-
|
|
58064
|
-
|
|
58643
|
+
},
|
|
58644
|
+
{
|
|
58645
|
+
path: "content/docs/project/domains/meta.json",
|
|
58646
|
+
content: `{
|
|
58065
58647
|
"title": "Domains",
|
|
58066
58648
|
"pages": [
|
|
58067
58649
|
"index"
|
|
58068
58650
|
]
|
|
58069
58651
|
}
|
|
58070
58652
|
`
|
|
58071
|
-
|
|
58072
|
-
|
|
58073
|
-
|
|
58074
|
-
|
|
58653
|
+
},
|
|
58654
|
+
{
|
|
58655
|
+
path: "content/docs/project/domains/index.mdx",
|
|
58656
|
+
content: `---
|
|
58075
58657
|
title: Domains
|
|
58076
58658
|
description: Project-owned domain source index
|
|
58077
58659
|
surface: project
|
|
@@ -58082,166 +58664,549 @@ Use this section for project-side domain source indexes when the repo defines du
|
|
|
58082
58664
|
|
|
58083
58665
|
Readable domain articles should live at the project-owned routes the repo defines, such as \`/docs/cli\` or \`/docs/harness\`. Do not create \`${wikiRoot}/domains\`; domain source indexes belong here under \`${wikiRoot}/content/docs/project/domains\`.
|
|
58084
58666
|
`
|
|
58085
|
-
|
|
58086
|
-
|
|
58087
|
-
|
|
58088
|
-
|
|
58667
|
+
},
|
|
58668
|
+
{
|
|
58669
|
+
path: "content/docs/project/grilling/meta.json",
|
|
58670
|
+
content: `{
|
|
58089
58671
|
"title": "Grilling",
|
|
58090
58672
|
"pages": ["index"]
|
|
58091
58673
|
}
|
|
58092
58674
|
`
|
|
58093
|
-
|
|
58094
|
-
|
|
58095
|
-
|
|
58096
|
-
|
|
58675
|
+
},
|
|
58676
|
+
{
|
|
58677
|
+
path: "content/docs/project/grilling/index.mdx",
|
|
58678
|
+
content: `---
|
|
58097
58679
|
title: Grilling
|
|
58098
58680
|
description: Requirements discovery logs and status artifacts
|
|
58099
58681
|
surface: project
|
|
58100
58682
|
permission: project
|
|
58101
58683
|
---
|
|
58102
58684
|
|
|
58103
|
-
Use this section for durable requirements-grill outputs that should be discoverable in the wiki.
|
|
58104
|
-
`
|
|
58105
|
-
|
|
58106
|
-
|
|
58107
|
-
|
|
58108
|
-
|
|
58109
|
-
"title": "Specs",
|
|
58110
|
-
"pages": ["index"]
|
|
58685
|
+
Use this section for durable requirements-grill outputs that should be discoverable in the wiki.
|
|
58686
|
+
`
|
|
58687
|
+
},
|
|
58688
|
+
{
|
|
58689
|
+
path: "content/docs/project/specs/meta.json",
|
|
58690
|
+
content: `{
|
|
58691
|
+
"title": "Specs",
|
|
58692
|
+
"pages": ["index"]
|
|
58693
|
+
}
|
|
58694
|
+
`
|
|
58695
|
+
},
|
|
58696
|
+
{
|
|
58697
|
+
path: "content/docs/project/specs/index.mdx",
|
|
58698
|
+
content: `---
|
|
58699
|
+
title: Specs
|
|
58700
|
+
description: Approved specs and implementation notes
|
|
58701
|
+
surface: project
|
|
58702
|
+
permission: project
|
|
58703
|
+
---
|
|
58704
|
+
|
|
58705
|
+
Use this section for approved specs and implementation notes that should be browsable in the wiki.
|
|
58706
|
+
`
|
|
58707
|
+
},
|
|
58708
|
+
{
|
|
58709
|
+
path: "content/docs/project/tech-debt/meta.json",
|
|
58710
|
+
content: `{
|
|
58711
|
+
"title": "Tech Debts",
|
|
58712
|
+
"pages": ["index"]
|
|
58713
|
+
}
|
|
58714
|
+
`
|
|
58715
|
+
},
|
|
58716
|
+
{
|
|
58717
|
+
path: "content/docs/project/tech-debt/index.mdx",
|
|
58718
|
+
content: `---
|
|
58719
|
+
title: Tech Debts
|
|
58720
|
+
description: Persistent implementation drift tied to specs
|
|
58721
|
+
surface: project
|
|
58722
|
+
permission: project
|
|
58723
|
+
---
|
|
58724
|
+
|
|
58725
|
+
Use this section for accepted or resolved debt artifacts that need long-lived project visibility.
|
|
58726
|
+
`
|
|
58727
|
+
},
|
|
58728
|
+
{
|
|
58729
|
+
path: "content/docs/project/maintenance/meta.json",
|
|
58730
|
+
content: `{
|
|
58731
|
+
"title": "Maintenance",
|
|
58732
|
+
"pages": ["index"]
|
|
58733
|
+
}
|
|
58734
|
+
`
|
|
58735
|
+
},
|
|
58736
|
+
{
|
|
58737
|
+
path: "content/docs/project/maintenance/index.mdx",
|
|
58738
|
+
content: `---
|
|
58739
|
+
title: Maintenance
|
|
58740
|
+
description: Maintenance logs and operational records
|
|
58741
|
+
surface: project
|
|
58742
|
+
permission: project
|
|
58743
|
+
---
|
|
58744
|
+
|
|
58745
|
+
Use this section for durable maintenance records.
|
|
58746
|
+
`
|
|
58747
|
+
},
|
|
58748
|
+
{
|
|
58749
|
+
path: "content/docs/project/runbooks/meta.json",
|
|
58750
|
+
content: `{
|
|
58751
|
+
"title": "Runbooks",
|
|
58752
|
+
"pages": ["index"]
|
|
58753
|
+
}
|
|
58754
|
+
`
|
|
58755
|
+
},
|
|
58756
|
+
{
|
|
58757
|
+
path: "content/docs/project/runbooks/index.mdx",
|
|
58758
|
+
content: `---
|
|
58759
|
+
title: Runbooks
|
|
58760
|
+
description: Operator procedures and recovery notes
|
|
58761
|
+
surface: project
|
|
58762
|
+
permission: project
|
|
58763
|
+
---
|
|
58764
|
+
|
|
58765
|
+
Use this section for operator runbooks.
|
|
58766
|
+
`
|
|
58767
|
+
},
|
|
58768
|
+
{
|
|
58769
|
+
path: "content/docs/project/decisions/meta.json",
|
|
58770
|
+
content: `{
|
|
58771
|
+
"title": "Decisions",
|
|
58772
|
+
"pages": ["index"]
|
|
58773
|
+
}
|
|
58774
|
+
`
|
|
58775
|
+
},
|
|
58776
|
+
{
|
|
58777
|
+
path: "content/docs/project/decisions/index.mdx",
|
|
58778
|
+
content: `---
|
|
58779
|
+
title: Decisions
|
|
58780
|
+
description: Durable project decisions
|
|
58781
|
+
surface: project
|
|
58782
|
+
permission: project
|
|
58783
|
+
---
|
|
58784
|
+
|
|
58785
|
+
Use this section for decisions that should outlive a single implementation run.
|
|
58786
|
+
`
|
|
58787
|
+
},
|
|
58788
|
+
{
|
|
58789
|
+
path: "content/docs/project/repo-guidance/meta.json",
|
|
58790
|
+
content: `{
|
|
58791
|
+
"title": "Repo Guidance",
|
|
58792
|
+
"pages": ["index"]
|
|
58793
|
+
}
|
|
58794
|
+
`
|
|
58795
|
+
},
|
|
58796
|
+
{
|
|
58797
|
+
path: "content/docs/project/repo-guidance/index.mdx",
|
|
58798
|
+
content: `---
|
|
58799
|
+
title: Repo Guidance
|
|
58800
|
+
description: Repository-specific operating guidance
|
|
58801
|
+
surface: project
|
|
58802
|
+
permission: project
|
|
58803
|
+
---
|
|
58804
|
+
|
|
58805
|
+
Use this section for durable repository guidance that agents should discover through the wiki.
|
|
58806
|
+
`
|
|
58807
|
+
}
|
|
58808
|
+
],
|
|
58809
|
+
indexMarkdown: `# Wiki Index
|
|
58810
|
+
|
|
58811
|
+
Use this file as the top-level page map for the wiki.
|
|
58812
|
+
|
|
58813
|
+
Seed sections as the repo grows:
|
|
58814
|
+
|
|
58815
|
+
- Domains
|
|
58816
|
+
- Specs
|
|
58817
|
+
- Decisions
|
|
58818
|
+
- Recent ingest activity
|
|
58819
|
+
`,
|
|
58820
|
+
logMarkdown: `# Wiki Log
|
|
58821
|
+
|
|
58822
|
+
Append ingest activity here. Keep only the most recent 50 entries.
|
|
58823
|
+
`,
|
|
58824
|
+
rawSubdirectories: ["assets", "external", "meetings"],
|
|
58825
|
+
topLevelDirectories: ["content/docs/project", "raw", "specs"]
|
|
58826
|
+
};
|
|
58827
|
+
if (wikiFramework === "next") {
|
|
58828
|
+
return template;
|
|
58829
|
+
}
|
|
58830
|
+
return {
|
|
58831
|
+
...template,
|
|
58832
|
+
files: [
|
|
58833
|
+
...template.files.filter((file6) => !tanstackReplacementPaths.has(file6.path)),
|
|
58834
|
+
...makeTanstackStartWikiFiles()
|
|
58835
|
+
]
|
|
58836
|
+
};
|
|
58837
|
+
};
|
|
58838
|
+
var tanstackReplacementPaths = new Set([
|
|
58839
|
+
"package.json",
|
|
58840
|
+
".gitignore",
|
|
58841
|
+
"next.config.mjs",
|
|
58842
|
+
"postcss.config.mjs",
|
|
58843
|
+
"tsconfig.json",
|
|
58844
|
+
"src/app/global.css",
|
|
58845
|
+
"src/app/layout.tsx",
|
|
58846
|
+
"src/app/(home)/layout.tsx",
|
|
58847
|
+
"src/app/(home)/page.tsx",
|
|
58848
|
+
"src/app/docs/layout.tsx",
|
|
58849
|
+
"src/app/docs/[[...slug]]/page.tsx",
|
|
58850
|
+
"src/app/og/docs/[...slug]/route.tsx",
|
|
58851
|
+
"src/app/api/search/route.ts",
|
|
58852
|
+
"src/lib/source.ts"
|
|
58853
|
+
]);
|
|
58854
|
+
var makeTanstackStartWikiFiles = () => [
|
|
58855
|
+
{
|
|
58856
|
+
path: "package.json",
|
|
58857
|
+
content: `{
|
|
58858
|
+
"name": "@repo/wiki",
|
|
58859
|
+
"version": "0.0.0",
|
|
58860
|
+
"private": true,
|
|
58861
|
+
"type": "module",
|
|
58862
|
+
"sideEffects": false,
|
|
58863
|
+
"scripts": {
|
|
58864
|
+
"build": "node ./scripts/sync-content.mjs && fumadocs-mdx && vite build",
|
|
58865
|
+
"check": "oxlint . && oxfmt --check .",
|
|
58866
|
+
"check-types": "node ./scripts/sync-content.mjs && fumadocs-mdx && tsc --noEmit",
|
|
58867
|
+
"dev": "vite dev --port=4000",
|
|
58868
|
+
"postinstall": "fumadocs-mdx",
|
|
58869
|
+
"preview": "vite preview",
|
|
58870
|
+
"start": "node .output/server/index.mjs"
|
|
58871
|
+
},
|
|
58872
|
+
"dependencies": {
|
|
58873
|
+
"@tanstack/react-router": "1.170.8",
|
|
58874
|
+
"@tanstack/react-start": "1.168.13",
|
|
58875
|
+
"fumadocs-core": "16.8.7",
|
|
58876
|
+
"fumadocs-mdx": "14.3.2",
|
|
58877
|
+
"fumadocs-ui": "16.8.7",
|
|
58878
|
+
"lucide-react": "^1.14.0",
|
|
58879
|
+
"mermaid": "11.15.0",
|
|
58880
|
+
"next-themes": "0.4.6",
|
|
58881
|
+
"react": "^19.2.5",
|
|
58882
|
+
"react-dom": "^19.2.5",
|
|
58883
|
+
"tailwind-merge": "^3.5.0",
|
|
58884
|
+
"zod": "^4.1.13"
|
|
58885
|
+
},
|
|
58886
|
+
"devDependencies": {
|
|
58887
|
+
"@tailwindcss/vite": "^4.3.0",
|
|
58888
|
+
"@types/mdx": "^2.0.13",
|
|
58889
|
+
"@types/node": "^25.6.0",
|
|
58890
|
+
"@types/react": "^19.2.14",
|
|
58891
|
+
"@types/react-dom": "^19.2.3",
|
|
58892
|
+
"@vitejs/plugin-react": "^6.0.2",
|
|
58893
|
+
"nitro": "3.0.260522-beta",
|
|
58894
|
+
"tailwindcss": "^4.2.4",
|
|
58895
|
+
"typescript": "^5.8.3",
|
|
58896
|
+
"vite": "^8.0.14",
|
|
58897
|
+
"vite-tsconfig-paths": "^5.1.4"
|
|
58898
|
+
}
|
|
58899
|
+
}
|
|
58900
|
+
`
|
|
58901
|
+
},
|
|
58902
|
+
{
|
|
58903
|
+
path: ".gitignore",
|
|
58904
|
+
content: `node_modules
|
|
58905
|
+
.cache
|
|
58906
|
+
.vercel
|
|
58907
|
+
.output
|
|
58908
|
+
.nitro
|
|
58909
|
+
.tanstack
|
|
58910
|
+
.next
|
|
58911
|
+
.source
|
|
58912
|
+
/build/
|
|
58913
|
+
/api/
|
|
58914
|
+
/server/build
|
|
58915
|
+
`
|
|
58916
|
+
},
|
|
58917
|
+
{
|
|
58918
|
+
path: "vite.config.ts",
|
|
58919
|
+
content: `import { tanstackStart } from "@tanstack/react-start/plugin/vite";
|
|
58920
|
+
import react from "@vitejs/plugin-react";
|
|
58921
|
+
import mdx from "fumadocs-mdx/vite";
|
|
58922
|
+
import { nitro } from "nitro/vite";
|
|
58923
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
58924
|
+
import { defineConfig } from "vite";
|
|
58925
|
+
import tsconfigPaths from "vite-tsconfig-paths";
|
|
58926
|
+
|
|
58927
|
+
export default defineConfig({
|
|
58928
|
+
server: {
|
|
58929
|
+
port: 4000,
|
|
58930
|
+
},
|
|
58931
|
+
plugins: [
|
|
58932
|
+
mdx(await import("./source.config")),
|
|
58933
|
+
tailwindcss(),
|
|
58934
|
+
tsconfigPaths({
|
|
58935
|
+
projects: ["./tsconfig.json"],
|
|
58936
|
+
}),
|
|
58937
|
+
tanstackStart({
|
|
58938
|
+
prerender: {
|
|
58939
|
+
enabled: true,
|
|
58940
|
+
},
|
|
58941
|
+
}),
|
|
58942
|
+
react(),
|
|
58943
|
+
nitro({
|
|
58944
|
+
preset: "node-server",
|
|
58945
|
+
}),
|
|
58946
|
+
],
|
|
58947
|
+
});
|
|
58948
|
+
`
|
|
58949
|
+
},
|
|
58950
|
+
{
|
|
58951
|
+
path: "tsconfig.json",
|
|
58952
|
+
content: `{
|
|
58953
|
+
"compilerOptions": {
|
|
58954
|
+
"target": "ESNext",
|
|
58955
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
58956
|
+
"allowJs": true,
|
|
58957
|
+
"skipLibCheck": true,
|
|
58958
|
+
"strict": true,
|
|
58959
|
+
"forceConsistentCasingInFileNames": true,
|
|
58960
|
+
"noEmit": true,
|
|
58961
|
+
"esModuleInterop": true,
|
|
58962
|
+
"module": "esnext",
|
|
58963
|
+
"moduleResolution": "bundler",
|
|
58964
|
+
"resolveJsonModule": true,
|
|
58965
|
+
"isolatedModules": true,
|
|
58966
|
+
"jsx": "react-jsx",
|
|
58967
|
+
"paths": {
|
|
58968
|
+
"@/*": ["./src/*"],
|
|
58969
|
+
"collections/*": ["./.source/*"]
|
|
58970
|
+
}
|
|
58971
|
+
},
|
|
58972
|
+
"include": ["**/*.ts", "**/*.tsx", ".source/**/*.ts"],
|
|
58973
|
+
"exclude": ["node_modules"]
|
|
58974
|
+
}
|
|
58975
|
+
`
|
|
58976
|
+
},
|
|
58977
|
+
{
|
|
58978
|
+
path: "src/styles/app.css",
|
|
58979
|
+
content: `@import "tailwindcss";
|
|
58980
|
+
@import "fumadocs-ui/css/neutral.css";
|
|
58981
|
+
@import "fumadocs-ui/css/preset.css";
|
|
58982
|
+
|
|
58983
|
+
:root {
|
|
58984
|
+
--fd-layout-width: 1680px;
|
|
58985
|
+
}
|
|
58986
|
+
|
|
58987
|
+
html {
|
|
58988
|
+
scrollbar-gutter: stable;
|
|
58989
|
+
}
|
|
58990
|
+
|
|
58991
|
+
body {
|
|
58992
|
+
background-color: var(--color-fd-background);
|
|
58111
58993
|
}
|
|
58112
58994
|
`
|
|
58113
|
-
|
|
58114
|
-
|
|
58115
|
-
|
|
58116
|
-
|
|
58117
|
-
title: Specs
|
|
58118
|
-
description: Approved specs and implementation notes
|
|
58119
|
-
surface: project
|
|
58120
|
-
permission: project
|
|
58121
|
-
---
|
|
58995
|
+
},
|
|
58996
|
+
{
|
|
58997
|
+
path: "src/router.tsx",
|
|
58998
|
+
content: `import { createRouter } from "@tanstack/react-router";
|
|
58122
58999
|
|
|
58123
|
-
|
|
58124
|
-
|
|
58125
|
-
|
|
58126
|
-
|
|
58127
|
-
|
|
58128
|
-
|
|
58129
|
-
|
|
58130
|
-
|
|
59000
|
+
import { routeTree } from "./routeTree.gen";
|
|
59001
|
+
|
|
59002
|
+
export function getRouter() {
|
|
59003
|
+
return createRouter({
|
|
59004
|
+
routeTree,
|
|
59005
|
+
defaultPreload: "intent",
|
|
59006
|
+
scrollRestoration: true,
|
|
59007
|
+
});
|
|
58131
59008
|
}
|
|
58132
59009
|
`
|
|
58133
|
-
|
|
58134
|
-
|
|
58135
|
-
|
|
58136
|
-
|
|
58137
|
-
|
|
58138
|
-
|
|
58139
|
-
|
|
58140
|
-
|
|
58141
|
-
|
|
59010
|
+
},
|
|
59011
|
+
{
|
|
59012
|
+
path: "src/routes/__root.tsx",
|
|
59013
|
+
content: `import { createRootRoute, HeadContent, Outlet, Scripts } from "@tanstack/react-router";
|
|
59014
|
+
import { RootProvider } from "fumadocs-ui/provider/tanstack";
|
|
59015
|
+
|
|
59016
|
+
import appCss from "@/styles/app.css?url";
|
|
59017
|
+
|
|
59018
|
+
export const Route = createRootRoute({
|
|
59019
|
+
head: () => ({
|
|
59020
|
+
meta: [
|
|
59021
|
+
{ charSet: "utf-8" },
|
|
59022
|
+
{ name: "viewport", content: "width=device-width, initial-scale=1" },
|
|
59023
|
+
{ title: "Project Wiki" },
|
|
59024
|
+
{ name: "robots", content: "noindex, nofollow" },
|
|
59025
|
+
],
|
|
59026
|
+
links: [{ rel: "stylesheet", href: appCss }],
|
|
59027
|
+
}),
|
|
59028
|
+
component: RootComponent,
|
|
59029
|
+
});
|
|
58142
59030
|
|
|
58143
|
-
|
|
58144
|
-
|
|
58145
|
-
|
|
58146
|
-
|
|
58147
|
-
|
|
58148
|
-
|
|
58149
|
-
|
|
58150
|
-
|
|
59031
|
+
function RootComponent() {
|
|
59032
|
+
return (
|
|
59033
|
+
<html lang="en" suppressHydrationWarning>
|
|
59034
|
+
<head>
|
|
59035
|
+
<HeadContent />
|
|
59036
|
+
</head>
|
|
59037
|
+
<body className="flex flex-col min-h-screen">
|
|
59038
|
+
<RootProvider>
|
|
59039
|
+
<Outlet />
|
|
59040
|
+
</RootProvider>
|
|
59041
|
+
<Scripts />
|
|
59042
|
+
</body>
|
|
59043
|
+
</html>
|
|
59044
|
+
);
|
|
58151
59045
|
}
|
|
58152
59046
|
`
|
|
58153
|
-
|
|
58154
|
-
|
|
58155
|
-
|
|
58156
|
-
|
|
58157
|
-
title: Maintenance
|
|
58158
|
-
description: Maintenance logs and operational records
|
|
58159
|
-
surface: project
|
|
58160
|
-
permission: project
|
|
58161
|
-
---
|
|
59047
|
+
},
|
|
59048
|
+
{
|
|
59049
|
+
path: "src/routes/index.tsx",
|
|
59050
|
+
content: `import { createFileRoute, Link } from "@tanstack/react-router";
|
|
58162
59051
|
|
|
58163
|
-
|
|
58164
|
-
|
|
58165
|
-
|
|
58166
|
-
|
|
58167
|
-
|
|
58168
|
-
|
|
58169
|
-
|
|
58170
|
-
|
|
59052
|
+
export const Route = createFileRoute("/")({
|
|
59053
|
+
component: HomePage,
|
|
59054
|
+
});
|
|
59055
|
+
|
|
59056
|
+
function HomePage() {
|
|
59057
|
+
return (
|
|
59058
|
+
<main className="flex flex-col justify-center text-center flex-1">
|
|
59059
|
+
<h1 className="text-2xl font-bold mb-4">Project Wiki</h1>
|
|
59060
|
+
<p>
|
|
59061
|
+
Open{" "}
|
|
59062
|
+
<Link to="/docs/$" params={{ _splat: "project" }} className="font-medium underline">
|
|
59063
|
+
/docs/project
|
|
59064
|
+
</Link>
|
|
59065
|
+
.
|
|
59066
|
+
</p>
|
|
59067
|
+
</main>
|
|
59068
|
+
);
|
|
58171
59069
|
}
|
|
58172
59070
|
`
|
|
58173
|
-
|
|
58174
|
-
|
|
58175
|
-
|
|
58176
|
-
|
|
58177
|
-
|
|
58178
|
-
|
|
58179
|
-
|
|
58180
|
-
|
|
58181
|
-
|
|
59071
|
+
},
|
|
59072
|
+
{
|
|
59073
|
+
path: "src/routes/docs/$.tsx",
|
|
59074
|
+
content: `import { createFileRoute, notFound, redirect } from "@tanstack/react-router";
|
|
59075
|
+
import { createServerFn } from "@tanstack/react-start";
|
|
59076
|
+
import browserCollections from "collections/browser";
|
|
59077
|
+
import { useFumadocsLoader } from "fumadocs-core/source/client";
|
|
59078
|
+
import { DocsLayout } from "fumadocs-ui/layouts/docs";
|
|
59079
|
+
import { DocsBody, DocsDescription, DocsPage, DocsTitle } from "fumadocs-ui/layouts/docs/page";
|
|
59080
|
+
import { Suspense } from "react";
|
|
59081
|
+
|
|
59082
|
+
import { useMDXComponents } from "@/components/mdx";
|
|
59083
|
+
import { baseOptions } from "@/lib/layout.shared";
|
|
59084
|
+
import { getDocsPageTree, source } from "@/lib/source";
|
|
58182
59085
|
|
|
58183
|
-
|
|
58184
|
-
|
|
58185
|
-
|
|
58186
|
-
|
|
58187
|
-
|
|
58188
|
-
|
|
58189
|
-
|
|
58190
|
-
|
|
59086
|
+
export const Route = createFileRoute("/docs/$")({
|
|
59087
|
+
component: Page,
|
|
59088
|
+
loader: async ({ params }) => {
|
|
59089
|
+
const slugs = params._splat?.split("/") ?? [];
|
|
59090
|
+
if (slugs.length === 0 || slugs[0] === "wiki") {
|
|
59091
|
+
throw redirect({ to: "/docs/$", params: { _splat: "project" } });
|
|
59092
|
+
}
|
|
59093
|
+
|
|
59094
|
+
const data = await serverLoader({ data: slugs });
|
|
59095
|
+
await clientLoader.preload(data.path);
|
|
59096
|
+
return data;
|
|
59097
|
+
},
|
|
59098
|
+
});
|
|
59099
|
+
|
|
59100
|
+
const serverLoader = createServerFn({ method: "GET" })
|
|
59101
|
+
.inputValidator((slugs: string[]) => slugs)
|
|
59102
|
+
.handler(async ({ data: slugs }) => {
|
|
59103
|
+
const page = source.getPage(slugs);
|
|
59104
|
+
if (!page) throw notFound();
|
|
59105
|
+
|
|
59106
|
+
return {
|
|
59107
|
+
path: page.path,
|
|
59108
|
+
pageTree: await source.serializePageTree(getDocsPageTree()),
|
|
59109
|
+
};
|
|
59110
|
+
});
|
|
59111
|
+
|
|
59112
|
+
const clientLoader = browserCollections.docs.createClientLoader({
|
|
59113
|
+
component({ toc, frontmatter, default: MDX }) {
|
|
59114
|
+
return (
|
|
59115
|
+
<DocsPage toc={toc}>
|
|
59116
|
+
<DocsTitle>{frontmatter.title}</DocsTitle>
|
|
59117
|
+
<DocsDescription>{frontmatter.description}</DocsDescription>
|
|
59118
|
+
<DocsBody>
|
|
59119
|
+
<MDX components={useMDXComponents()} />
|
|
59120
|
+
</DocsBody>
|
|
59121
|
+
</DocsPage>
|
|
59122
|
+
);
|
|
59123
|
+
},
|
|
59124
|
+
});
|
|
59125
|
+
|
|
59126
|
+
function Page() {
|
|
59127
|
+
const { path, pageTree } = useFumadocsLoader(Route.useLoaderData());
|
|
59128
|
+
|
|
59129
|
+
return (
|
|
59130
|
+
<DocsLayout {...baseOptions()} tree={pageTree}>
|
|
59131
|
+
<Suspense>{clientLoader.useContent(path)}</Suspense>
|
|
59132
|
+
</DocsLayout>
|
|
59133
|
+
);
|
|
58191
59134
|
}
|
|
58192
59135
|
`
|
|
58193
|
-
|
|
58194
|
-
|
|
58195
|
-
|
|
58196
|
-
|
|
58197
|
-
|
|
58198
|
-
description: Durable project decisions
|
|
58199
|
-
surface: project
|
|
58200
|
-
permission: project
|
|
58201
|
-
---
|
|
59136
|
+
},
|
|
59137
|
+
{
|
|
59138
|
+
path: "src/routes/api/search.ts",
|
|
59139
|
+
content: `import { createFileRoute } from "@tanstack/react-router";
|
|
59140
|
+
import { createFromSource } from "fumadocs-core/search/server";
|
|
58202
59141
|
|
|
58203
|
-
|
|
58204
|
-
|
|
59142
|
+
import { source } from "@/lib/source";
|
|
59143
|
+
|
|
59144
|
+
const server = createFromSource(source, {
|
|
59145
|
+
language: "english",
|
|
59146
|
+
});
|
|
59147
|
+
|
|
59148
|
+
export const Route = createFileRoute("/api/search")({
|
|
59149
|
+
server: {
|
|
59150
|
+
handlers: {
|
|
59151
|
+
GET: async ({ request }) => server.GET(request),
|
|
58205
59152
|
},
|
|
58206
|
-
|
|
58207
|
-
|
|
58208
|
-
content: `{
|
|
58209
|
-
"title": "Repo Guidance",
|
|
58210
|
-
"pages": ["index"]
|
|
58211
|
-
}
|
|
59153
|
+
},
|
|
59154
|
+
});
|
|
58212
59155
|
`
|
|
58213
|
-
|
|
58214
|
-
|
|
58215
|
-
|
|
58216
|
-
|
|
58217
|
-
|
|
58218
|
-
|
|
58219
|
-
|
|
58220
|
-
permission: project
|
|
58221
|
-
---
|
|
59156
|
+
},
|
|
59157
|
+
{
|
|
59158
|
+
path: "src/lib/source.ts",
|
|
59159
|
+
content: `import { docs } from "collections/server";
|
|
59160
|
+
import type { Folder, Item, Node, Root } from "fumadocs-core/page-tree";
|
|
59161
|
+
import { loader } from "fumadocs-core/source";
|
|
59162
|
+
import { lucideIconsPlugin } from "fumadocs-core/source/lucide-icons";
|
|
58222
59163
|
|
|
58223
|
-
|
|
58224
|
-
`
|
|
58225
|
-
}
|
|
58226
|
-
],
|
|
58227
|
-
indexMarkdown: `# Wiki Index
|
|
59164
|
+
import { docsRoute } from "./shared";
|
|
58228
59165
|
|
|
58229
|
-
|
|
59166
|
+
export const source = loader({
|
|
59167
|
+
baseUrl: docsRoute,
|
|
59168
|
+
source: docs.toFumadocsSource(),
|
|
59169
|
+
plugins: [lucideIconsPlugin()],
|
|
59170
|
+
});
|
|
58230
59171
|
|
|
58231
|
-
|
|
59172
|
+
export function getDocsPageTree(): Root {
|
|
59173
|
+
const tree = source.getPageTree();
|
|
59174
|
+
const project = findTopLevelFolder(tree, "Project");
|
|
59175
|
+
const projectIndex = findPageByUrl(tree.children, "/docs/project");
|
|
58232
59176
|
|
|
58233
|
-
|
|
58234
|
-
|
|
58235
|
-
|
|
58236
|
-
|
|
58237
|
-
|
|
58238
|
-
|
|
59177
|
+
return {
|
|
59178
|
+
...tree,
|
|
59179
|
+
children: [
|
|
59180
|
+
{
|
|
59181
|
+
type: "folder",
|
|
59182
|
+
name: "Internals",
|
|
59183
|
+
description: "Internal project operations, specs, runbooks, and decisions",
|
|
59184
|
+
root: true,
|
|
59185
|
+
index: projectIndex,
|
|
59186
|
+
children: project?.children ?? [],
|
|
59187
|
+
},
|
|
59188
|
+
],
|
|
59189
|
+
};
|
|
59190
|
+
}
|
|
58239
59191
|
|
|
58240
|
-
|
|
58241
|
-
|
|
58242
|
-
|
|
58243
|
-
|
|
58244
|
-
|
|
59192
|
+
function findTopLevelFolder(tree: Root, name: string): Folder | undefined {
|
|
59193
|
+
return tree.children.find((node): node is Folder => node.type === "folder" && node.name === name);
|
|
59194
|
+
}
|
|
59195
|
+
|
|
59196
|
+
function findPageByUrl(nodes: Node[], url: string): Item | undefined {
|
|
59197
|
+
for (const node of nodes) {
|
|
59198
|
+
if (node.type === "page" && node.url === url) return node;
|
|
59199
|
+
if (node.type === "folder") {
|
|
59200
|
+
if (node.index?.url === url) return node.index;
|
|
59201
|
+
|
|
59202
|
+
const child = findPageByUrl(node.children, url);
|
|
59203
|
+
if (child) return child;
|
|
59204
|
+
}
|
|
59205
|
+
}
|
|
59206
|
+
}
|
|
59207
|
+
`
|
|
59208
|
+
}
|
|
59209
|
+
];
|
|
58245
59210
|
|
|
58246
59211
|
// src/content/stage-scaffold.ts
|
|
58247
59212
|
var backlogProviderLabels = {
|
|
@@ -58250,17 +59215,22 @@ var backlogProviderLabels = {
|
|
|
58250
59215
|
linear: "Linear",
|
|
58251
59216
|
monday: "monday.com"
|
|
58252
59217
|
};
|
|
59218
|
+
var wikiFrameworkLabels = {
|
|
59219
|
+
next: "Next.js",
|
|
59220
|
+
"tanstack-start": "TanStack Start"
|
|
59221
|
+
};
|
|
58253
59222
|
var stageScaffoldCatalog = [
|
|
58254
59223
|
{
|
|
58255
59224
|
id: "init",
|
|
58256
|
-
summary: "
|
|
58257
|
-
skills: ["requirements-grill", "write-backlog"],
|
|
59225
|
+
summary: "Docs onboarding, requirements grill, spec reconstruction, backlog authoring, and wiki docs seed.",
|
|
59226
|
+
skills: ["docs-onboarding", "requirements-grill", "write-backlog", "create-spec"],
|
|
58258
59227
|
renderPrompt: ({
|
|
58259
59228
|
wikiRoot,
|
|
58260
|
-
backlogProvider
|
|
59229
|
+
backlogProvider,
|
|
59230
|
+
wikiFramework
|
|
58261
59231
|
}) => `You are the operator agent continuing a \`punks scaffold init\` run.
|
|
58262
59232
|
|
|
58263
|
-
|
|
59233
|
+
Activate \`$docs-onboarding\` now. Inspect the codebase, existing docs, and the selected backlog provider. Build the Project Map, run the targeted requirements grill, then call \`create-spec\` to reconstruct evidence-backed specs into the scaffolded wiki.
|
|
58264
59234
|
|
|
58265
59235
|
Scaffolded wiki base:
|
|
58266
59236
|
- treat \`${wikiRoot}\` as the dedicated wiki root for specs, raw inputs, routed project docs, and ingest bookkeeping
|
|
@@ -58270,20 +59240,29 @@ Scaffolded wiki base:
|
|
|
58270
59240
|
- keep using the reconciled wiki root when later steps create specs, plans, or ingest domain knowledge
|
|
58271
59241
|
|
|
58272
59242
|
Generated skills:
|
|
59243
|
+
- \`.agents/skills/docs-onboarding\`
|
|
58273
59244
|
- \`.agents/skills/requirements-grill\`
|
|
58274
59245
|
- \`.agents/skills/write-backlog\`
|
|
59246
|
+
- \`.agents/skills/create-spec\`
|
|
58275
59247
|
|
|
58276
59248
|
Backlog provider:
|
|
58277
59249
|
- selected provider: ${backlogProviderLabels[backlogProvider]} (\`${backlogProvider}\`)
|
|
58278
59250
|
- keep this provider pinned unless the user explicitly changes it
|
|
58279
59251
|
- when backlog writing starts, use the matching \`write-backlog\` provider payload guidance
|
|
58280
59252
|
|
|
59253
|
+
Wiki framework:
|
|
59254
|
+
- selected framework: ${wikiFrameworkLabels[wikiFramework]} (\`${wikiFramework}\`)
|
|
59255
|
+
- keep this framework pinned unless the user explicitly changes it
|
|
59256
|
+
- \`punks update\` uses this pinned framework when checking wiki scaffold drift
|
|
59257
|
+
|
|
58281
59258
|
Post-command guidance:
|
|
58282
59259
|
1. Read the repository guidance and inspect the generated files.
|
|
58283
59260
|
2. Move, rename, or refactor the generated wiki and skill output when needed so it matches the actual repo layout.
|
|
58284
59261
|
3. Report what changed and what remains unresolved.
|
|
58285
|
-
4.
|
|
58286
|
-
5.
|
|
59262
|
+
4. Activate \`$docs-onboarding\` immediately and let it inspect code, docs, and backlog context before writing onboarding artifacts.
|
|
59263
|
+
5. Let \`docs-onboarding\` run the targeted requirements grill and call \`create-spec\` after grill closure.
|
|
59264
|
+
6. Use \`write-backlog\` only after accepted requirements are ready for backlog mutation.
|
|
59265
|
+
7. Use \`punks scaffold setup\` only after the repo shape is ready for repo-aware AI setup.
|
|
58287
59266
|
|
|
58288
59267
|
When the generated init output matches the repo, the next CLI step is:
|
|
58289
59268
|
- \`punks scaffold setup\``
|
|
@@ -58298,6 +59277,10 @@ var backlogProviderLabels2 = {
|
|
|
58298
59277
|
linear: "Linear",
|
|
58299
59278
|
monday: "monday.com"
|
|
58300
59279
|
};
|
|
59280
|
+
var wikiFrameworkLabels2 = {
|
|
59281
|
+
next: "Next.js",
|
|
59282
|
+
"tanstack-start": "TanStack Start"
|
|
59283
|
+
};
|
|
58301
59284
|
var promptBacklogProvider = ({
|
|
58302
59285
|
prompt: prompt4
|
|
58303
59286
|
}) => exports_Effect.gen(function* () {
|
|
@@ -58332,20 +59315,52 @@ Selected backlog provider: ${backlogProviderLabels2[provider]} (\`${provider}\`)
|
|
|
58332
59315
|
|
|
58333
59316
|
Keep this provider pinned unless the user explicitly changes it. When requirements are ready for backlog writing, use \`write-backlog\` with the matching provider payload guidance.
|
|
58334
59317
|
`;
|
|
59318
|
+
var promptWikiFramework = ({
|
|
59319
|
+
prompt: prompt4
|
|
59320
|
+
}) => exports_Effect.gen(function* () {
|
|
59321
|
+
const answer = yield* prompt4.singleSelect({
|
|
59322
|
+
message: "Select wiki framework",
|
|
59323
|
+
defaultValue: "next",
|
|
59324
|
+
choices: [
|
|
59325
|
+
{
|
|
59326
|
+
title: "Next.js",
|
|
59327
|
+
value: "next",
|
|
59328
|
+
description: "default"
|
|
59329
|
+
},
|
|
59330
|
+
{
|
|
59331
|
+
title: "TanStack Start",
|
|
59332
|
+
value: "tanstack-start"
|
|
59333
|
+
}
|
|
59334
|
+
]
|
|
59335
|
+
});
|
|
59336
|
+
return answer;
|
|
59337
|
+
});
|
|
59338
|
+
var renderWikiFrameworkMarkdown = (framework) => `# Wiki Framework
|
|
59339
|
+
|
|
59340
|
+
Selected wiki framework: ${wikiFrameworkLabels2[framework]} (\`${framework}\`).
|
|
59341
|
+
|
|
59342
|
+
Keep this framework pinned unless the user explicitly changes it. \`punks update\` uses this value when checking wiki scaffold drift.
|
|
59343
|
+
`;
|
|
58335
59344
|
var copySkillDirectory = ({
|
|
58336
59345
|
outputDirectory,
|
|
58337
59346
|
skillId,
|
|
58338
59347
|
baseline
|
|
58339
59348
|
}) => {
|
|
58340
|
-
const
|
|
59349
|
+
const baselineSkill = skillRegistryByIdForBaseline(baseline)[skillId];
|
|
59350
|
+
const bundledSkill = skillRegistryByIdForBaseline(bundledBaseline)[skillId];
|
|
59351
|
+
const skill = baselineSkill ?? bundledSkill;
|
|
59352
|
+
if (skill === undefined) {
|
|
59353
|
+
throw new Error(`Unknown scaffold skill: ${skillId}`);
|
|
59354
|
+
}
|
|
59355
|
+
const skillBaseline = baselineSkill === undefined ? bundledBaseline : baseline;
|
|
58341
59356
|
const targetDirectory = path12.posix.join(".agents/skills", skillId);
|
|
58342
59357
|
const absoluteTargetDirectory = path12.join(outputDirectory, targetDirectory);
|
|
58343
59358
|
mkdirSync4(path12.join(outputDirectory, ".agents/skills"), { recursive: true });
|
|
58344
59359
|
rmSync3(absoluteTargetDirectory, { recursive: true, force: true });
|
|
58345
59360
|
cpSync2(resolveBaselinePath({
|
|
58346
|
-
baselineRoot:
|
|
58347
|
-
baselineSkillsRoot:
|
|
58348
|
-
relativePath: sourceDirectory
|
|
59361
|
+
baselineRoot: skillBaseline.root,
|
|
59362
|
+
baselineSkillsRoot: skillBaseline.skillsRoot,
|
|
59363
|
+
relativePath: skill.sourceDirectory
|
|
58349
59364
|
}), absoluteTargetDirectory, { recursive: true });
|
|
58350
59365
|
return targetDirectory;
|
|
58351
59366
|
};
|
|
@@ -58383,39 +59398,118 @@ var withSyncContentPrefix = (script) => {
|
|
|
58383
59398
|
return script;
|
|
58384
59399
|
return `${syncContentPrefix}${script}`;
|
|
58385
59400
|
};
|
|
59401
|
+
var mergePackageSection = (current, expected) => ({
|
|
59402
|
+
...current,
|
|
59403
|
+
...Object.fromEntries(Object.entries(expected).filter(([key, value6]) => current[key] !== value6))
|
|
59404
|
+
});
|
|
59405
|
+
var tanstackStartDependencies = {
|
|
59406
|
+
"@tanstack/react-router": "1.170.8",
|
|
59407
|
+
"@tanstack/react-start": "1.168.13",
|
|
59408
|
+
"fumadocs-core": "16.8.7",
|
|
59409
|
+
"fumadocs-mdx": "14.3.2",
|
|
59410
|
+
"fumadocs-ui": "16.8.7",
|
|
59411
|
+
"lucide-react": "^1.14.0",
|
|
59412
|
+
mermaid: "11.15.0",
|
|
59413
|
+
"next-themes": "0.4.6",
|
|
59414
|
+
react: "^19.2.5",
|
|
59415
|
+
"react-dom": "^19.2.5",
|
|
59416
|
+
"tailwind-merge": "^3.5.0",
|
|
59417
|
+
zod: "^4.1.13"
|
|
59418
|
+
};
|
|
59419
|
+
var tanstackStartDevDependencies = {
|
|
59420
|
+
"@tailwindcss/vite": "^4.3.0",
|
|
59421
|
+
"@types/mdx": "^2.0.13",
|
|
59422
|
+
"@types/node": "^25.6.0",
|
|
59423
|
+
"@types/react": "^19.2.14",
|
|
59424
|
+
"@types/react-dom": "^19.2.3",
|
|
59425
|
+
"@vitejs/plugin-react": "^6.0.2",
|
|
59426
|
+
nitro: "3.0.260522-beta",
|
|
59427
|
+
tailwindcss: "^4.2.4",
|
|
59428
|
+
typescript: "^5.8.3",
|
|
59429
|
+
vite: "^8.0.14",
|
|
59430
|
+
"vite-tsconfig-paths": "^5.1.4"
|
|
59431
|
+
};
|
|
58386
59432
|
var updateExistingWikiPackage = ({
|
|
58387
59433
|
outputDirectory,
|
|
58388
|
-
packagePath
|
|
59434
|
+
packagePath,
|
|
59435
|
+
wikiFramework
|
|
58389
59436
|
}) => {
|
|
58390
59437
|
if (!existsSync6(packagePath))
|
|
58391
59438
|
return null;
|
|
58392
59439
|
const packageJson = JSON.parse(readFileSync7(packagePath, "utf8"));
|
|
58393
59440
|
const scripts = packageJson.scripts;
|
|
58394
59441
|
const dependencies = packageJson.dependencies ?? {};
|
|
58395
|
-
const
|
|
58396
|
-
|
|
58397
|
-
mermaid:
|
|
58398
|
-
"next-themes":
|
|
58399
|
-
};
|
|
58400
|
-
const
|
|
59442
|
+
const devDependencies = packageJson.devDependencies ?? {};
|
|
59443
|
+
const expectedDependencies = wikiFramework === "next" ? {
|
|
59444
|
+
mermaid: "11.15.0",
|
|
59445
|
+
"next-themes": "0.4.6"
|
|
59446
|
+
} : tanstackStartDependencies;
|
|
59447
|
+
const expectedDevDependencies = wikiFramework === "next" ? {} : tanstackStartDevDependencies;
|
|
59448
|
+
const nextDependencies = mergePackageSection(dependencies, expectedDependencies);
|
|
59449
|
+
const nextDevDependencies = mergePackageSection(devDependencies, expectedDevDependencies);
|
|
59450
|
+
const nextScripts = wikiFramework === "next" ? scripts === undefined ? undefined : {
|
|
58401
59451
|
...scripts,
|
|
58402
59452
|
build: withSyncContentPrefix(scripts.build),
|
|
58403
59453
|
"check-types": withSyncContentPrefix(scripts["check-types"]),
|
|
58404
59454
|
"types:check": withSyncContentPrefix(scripts["types:check"])
|
|
59455
|
+
} : {
|
|
59456
|
+
...scripts,
|
|
59457
|
+
build: "node ./scripts/sync-content.mjs && fumadocs-mdx && vite build",
|
|
59458
|
+
check: "oxlint . && oxfmt --check .",
|
|
59459
|
+
"check-types": "node ./scripts/sync-content.mjs && fumadocs-mdx && tsc --noEmit",
|
|
59460
|
+
dev: "vite dev --port=4000",
|
|
59461
|
+
postinstall: "fumadocs-mdx",
|
|
59462
|
+
preview: "vite preview",
|
|
59463
|
+
start: "node .output/server/index.mjs"
|
|
58405
59464
|
};
|
|
58406
59465
|
const dependenciesChanged = Object.entries(nextDependencies).some(([key, value6]) => dependencies[key] !== value6);
|
|
59466
|
+
const devDependenciesChanged = Object.entries(nextDevDependencies).some(([key, value6]) => devDependencies[key] !== value6);
|
|
58407
59467
|
const scriptsChanged = nextScripts !== undefined && Object.entries(nextScripts).some(([key, value6]) => scripts?.[key] !== value6);
|
|
58408
|
-
const changed = dependenciesChanged || scriptsChanged;
|
|
59468
|
+
const changed = dependenciesChanged || devDependenciesChanged || scriptsChanged;
|
|
58409
59469
|
if (!changed)
|
|
58410
59470
|
return null;
|
|
58411
59471
|
writeFileSync5(packagePath, JSON.stringify({
|
|
58412
59472
|
...packageJson,
|
|
58413
59473
|
dependencies: nextDependencies,
|
|
59474
|
+
...packageJson.devDependencies === undefined && wikiFramework === "next" ? {} : { devDependencies: nextDevDependencies },
|
|
58414
59475
|
...nextScripts === undefined ? {} : { scripts: nextScripts }
|
|
58415
59476
|
}, null, 2) + `
|
|
58416
59477
|
`);
|
|
58417
59478
|
return relativePosixPath2(outputDirectory, packagePath);
|
|
58418
59479
|
};
|
|
59480
|
+
var updateExistingTanstackViteConfig = ({
|
|
59481
|
+
outputDirectory,
|
|
59482
|
+
viteConfigPath
|
|
59483
|
+
}) => {
|
|
59484
|
+
if (!existsSync6(viteConfigPath))
|
|
59485
|
+
return null;
|
|
59486
|
+
const content = readFileSync7(viteConfigPath, "utf8");
|
|
59487
|
+
const nextContent = content.replace(/preset:\s*["']vercel["']/u, 'preset: "node-server"').replace(/preset:\s*["']node["']/u, 'preset: "node-server"');
|
|
59488
|
+
if (nextContent === content)
|
|
59489
|
+
return null;
|
|
59490
|
+
writeFileSync5(viteConfigPath, nextContent);
|
|
59491
|
+
return relativePosixPath2(outputDirectory, viteConfigPath);
|
|
59492
|
+
};
|
|
59493
|
+
var updateExistingWikiGitignore = ({
|
|
59494
|
+
outputDirectory,
|
|
59495
|
+
gitignorePath,
|
|
59496
|
+
expectedContent
|
|
59497
|
+
}) => {
|
|
59498
|
+
if (expectedContent === undefined || !existsSync6(gitignorePath))
|
|
59499
|
+
return null;
|
|
59500
|
+
const content = readFileSync7(gitignorePath, "utf8");
|
|
59501
|
+
const existingLines = new Set(content.split(/\r?\n/u).map((line4) => line4.trim()).filter(Boolean));
|
|
59502
|
+
const missingLines = expectedContent.split(/\r?\n/u).map((line4) => line4.trim()).filter((line4) => line4 !== "" && !existingLines.has(line4));
|
|
59503
|
+
if (missingLines.length === 0)
|
|
59504
|
+
return null;
|
|
59505
|
+
const contentWithTrailingNewline = content.endsWith(`
|
|
59506
|
+
`) || content === "" ? content : `${content}
|
|
59507
|
+
`;
|
|
59508
|
+
writeFileSync5(gitignorePath, `${contentWithTrailingNewline}${missingLines.join(`
|
|
59509
|
+
`)}
|
|
59510
|
+
`);
|
|
59511
|
+
return relativePosixPath2(outputDirectory, gitignorePath);
|
|
59512
|
+
};
|
|
58419
59513
|
var hasFlatRoutePage = (directoryPath) => existsSync6(`${directoryPath}.md`) || existsSync6(`${directoryPath}.mdx`);
|
|
58420
59514
|
var isNestedRouteSeedBlockedByFlatPage = ({
|
|
58421
59515
|
wikiDirectory,
|
|
@@ -58431,9 +59525,10 @@ var scaffoldWiki = ({
|
|
|
58431
59525
|
outputDirectory,
|
|
58432
59526
|
wikiRoot,
|
|
58433
59527
|
targetRoot,
|
|
58434
|
-
backlogProvider
|
|
59528
|
+
backlogProvider,
|
|
59529
|
+
wikiFramework
|
|
58435
59530
|
}) => {
|
|
58436
|
-
const template = makeWikiScaffoldTemplate(wikiRoot);
|
|
59531
|
+
const template = makeWikiScaffoldTemplate(wikiRoot, wikiFramework);
|
|
58437
59532
|
const createdFiles = [];
|
|
58438
59533
|
const wikiDirectory = path12.join(outputDirectory, targetRoot);
|
|
58439
59534
|
for (const directory3 of template.topLevelDirectories) {
|
|
@@ -58481,11 +59576,29 @@ var scaffoldWiki = ({
|
|
|
58481
59576
|
}
|
|
58482
59577
|
const updatedPackageFile = updateExistingWikiPackage({
|
|
58483
59578
|
outputDirectory,
|
|
58484
|
-
packagePath: path12.join(wikiDirectory, "package.json")
|
|
59579
|
+
packagePath: path12.join(wikiDirectory, "package.json"),
|
|
59580
|
+
wikiFramework
|
|
58485
59581
|
});
|
|
58486
59582
|
if (updatedPackageFile !== null && !createdFiles.includes(updatedPackageFile)) {
|
|
58487
59583
|
createdFiles.push(updatedPackageFile);
|
|
58488
59584
|
}
|
|
59585
|
+
const updatedGitignoreFile = updateExistingWikiGitignore({
|
|
59586
|
+
outputDirectory,
|
|
59587
|
+
gitignorePath: path12.join(wikiDirectory, ".gitignore"),
|
|
59588
|
+
expectedContent: template.files.find((file6) => file6.path === ".gitignore")?.content
|
|
59589
|
+
});
|
|
59590
|
+
if (updatedGitignoreFile !== null && !createdFiles.includes(updatedGitignoreFile)) {
|
|
59591
|
+
createdFiles.push(updatedGitignoreFile);
|
|
59592
|
+
}
|
|
59593
|
+
if (wikiFramework === "tanstack-start") {
|
|
59594
|
+
const updatedViteConfig = updateExistingTanstackViteConfig({
|
|
59595
|
+
outputDirectory,
|
|
59596
|
+
viteConfigPath: path12.join(wikiDirectory, "vite.config.ts")
|
|
59597
|
+
});
|
|
59598
|
+
if (updatedViteConfig !== null && !createdFiles.includes(updatedViteConfig)) {
|
|
59599
|
+
createdFiles.push(updatedViteConfig);
|
|
59600
|
+
}
|
|
59601
|
+
}
|
|
58489
59602
|
const agentsPath = path12.join(wikiDirectory, "AGENTS.md");
|
|
58490
59603
|
const agentsFile = writeMissingFile({
|
|
58491
59604
|
outputDirectory,
|
|
@@ -58526,11 +59639,20 @@ var scaffoldWiki = ({
|
|
|
58526
59639
|
if (backlogProviderFile !== null) {
|
|
58527
59640
|
createdFiles.push(backlogProviderFile);
|
|
58528
59641
|
}
|
|
59642
|
+
const wikiFrameworkFile = writeMissingFile({
|
|
59643
|
+
outputDirectory,
|
|
59644
|
+
targetPath: path12.join(wikiDirectory, "wiki-framework.md"),
|
|
59645
|
+
content: renderWikiFrameworkMarkdown(wikiFramework)
|
|
59646
|
+
});
|
|
59647
|
+
if (wikiFrameworkFile !== null) {
|
|
59648
|
+
createdFiles.push(wikiFrameworkFile);
|
|
59649
|
+
}
|
|
58529
59650
|
return createdFiles.toSorted();
|
|
58530
59651
|
};
|
|
58531
59652
|
var scaffoldWikiForDirectory = ({
|
|
58532
59653
|
outputDirectory,
|
|
58533
|
-
monorepo
|
|
59654
|
+
monorepo,
|
|
59655
|
+
wikiFramework = "next"
|
|
58534
59656
|
}) => {
|
|
58535
59657
|
const wikiTarget = stageWikiTarget({
|
|
58536
59658
|
outputDirectory,
|
|
@@ -58540,7 +59662,8 @@ var scaffoldWikiForDirectory = ({
|
|
|
58540
59662
|
outputDirectory,
|
|
58541
59663
|
wikiRoot: wikiTarget.wikiRoot,
|
|
58542
59664
|
targetRoot: wikiTarget.targetRoot,
|
|
58543
|
-
backlogProvider: "github"
|
|
59665
|
+
backlogProvider: "github",
|
|
59666
|
+
wikiFramework
|
|
58544
59667
|
});
|
|
58545
59668
|
};
|
|
58546
59669
|
var isWikiOutputDirectory = (outputDirectory) => {
|
|
@@ -58571,6 +59694,7 @@ var runStageScaffold = ({
|
|
|
58571
59694
|
}) => exports_Effect.gen(function* () {
|
|
58572
59695
|
const stage = stageScaffoldById[commandId];
|
|
58573
59696
|
const backlogProvider = yield* promptBacklogProvider({ prompt: prompt4 });
|
|
59697
|
+
const wikiFramework = yield* promptWikiFramework({ prompt: prompt4 });
|
|
58574
59698
|
const detection = yield* detectRepository(outputDirectory).pipe(exports_Effect.catchAll(() => exports_Effect.succeed(null)));
|
|
58575
59699
|
const skillFiles = stage.skills.map((skillId) => copySkillDirectory({
|
|
58576
59700
|
outputDirectory,
|
|
@@ -58584,10 +59708,15 @@ var runStageScaffold = ({
|
|
|
58584
59708
|
const wikiFiles = scaffoldWiki({
|
|
58585
59709
|
outputDirectory,
|
|
58586
59710
|
...wikiTarget,
|
|
58587
|
-
backlogProvider
|
|
59711
|
+
backlogProvider,
|
|
59712
|
+
wikiFramework
|
|
58588
59713
|
});
|
|
58589
59714
|
removeHarnessDirectoriesFromGitignore(outputDirectory);
|
|
58590
|
-
const operatorPrompt = stage.renderPrompt({
|
|
59715
|
+
const operatorPrompt = stage.renderPrompt({
|
|
59716
|
+
wikiRoot: wikiTarget.wikiRoot,
|
|
59717
|
+
backlogProvider,
|
|
59718
|
+
wikiFramework
|
|
59719
|
+
});
|
|
58591
59720
|
yield* prompt4.writeLine(renderScaffoldTitle());
|
|
58592
59721
|
yield* prompt4.writeLine("");
|
|
58593
59722
|
yield* prompt4.writeLine(renderStageIntro({
|
|
@@ -58608,6 +59737,8 @@ var runStageScaffold = ({
|
|
|
58608
59737
|
yield* prompt4.writeLine("");
|
|
58609
59738
|
yield* prompt4.writeLine(renderCommandSection("Backlog provider", `${backlogProviderLabels2[backlogProvider]} (${backlogProvider})`));
|
|
58610
59739
|
yield* prompt4.writeLine("");
|
|
59740
|
+
yield* prompt4.writeLine(renderCommandSection("Wiki framework", `${wikiFrameworkLabels2[wikiFramework]} (${wikiFramework})`));
|
|
59741
|
+
yield* prompt4.writeLine("");
|
|
58611
59742
|
yield* prompt4.writeLine(renderCommandSection("Operator prompt", operatorPrompt));
|
|
58612
59743
|
yield* submitCliEventEffect("cli.scaffold.init.completed", {
|
|
58613
59744
|
cwd: outputDirectory,
|
|
@@ -58619,7 +59750,8 @@ var runStageScaffold = ({
|
|
|
58619
59750
|
outputDirectory,
|
|
58620
59751
|
skillFiles,
|
|
58621
59752
|
wikiFiles,
|
|
58622
|
-
backlogProvider
|
|
59753
|
+
backlogProvider,
|
|
59754
|
+
wikiFramework
|
|
58623
59755
|
};
|
|
58624
59756
|
});
|
|
58625
59757
|
|
|
@@ -58686,7 +59818,7 @@ var setupCommand = exports_Command.make("setup", {
|
|
|
58686
59818
|
message: error4.message
|
|
58687
59819
|
})))))).pipe(exports_Command.withDescription("Repo-aware AI setup. Agents: activate $dp-cli, then reconcile .devpunks output with the real repo layout."));
|
|
58688
59820
|
var scaffoldCommand = exports_Command.make("scaffold", {}, () => exports_Effect.sync(() => console.log(renderScaffoldGuide()))).pipe(exports_Command.withDescription("Scaffold init or setup. Agents: activate $dp-cli before following generated handoffs."), exports_Command.withSubcommands([
|
|
58689
|
-
stageCommand("init", "Seed requirements/backlog skills and wiki structure. Agents: activate $dp-cli
|
|
59821
|
+
stageCommand("init", "Seed docs onboarding, requirements/backlog/spec skills, and wiki structure. Agents: activate $dp-cli, then $docs-onboarding."),
|
|
58690
59822
|
setupCommand
|
|
58691
59823
|
]));
|
|
58692
59824
|
|
|
@@ -58695,7 +59827,7 @@ import path15 from "path";
|
|
|
58695
59827
|
|
|
58696
59828
|
// src/update/run.ts
|
|
58697
59829
|
import { createHash as createHash3 } from "crypto";
|
|
58698
|
-
import { execFileSync as
|
|
59830
|
+
import { execFileSync as execFileSync6 } from "child_process";
|
|
58699
59831
|
import {
|
|
58700
59832
|
cpSync as cpSync3,
|
|
58701
59833
|
existsSync as existsSync7,
|
|
@@ -59624,7 +60756,7 @@ function splitLines4(text12) {
|
|
|
59624
60756
|
var scaffoldManifestFile = ".devpunks/scaffold-manifest.json";
|
|
59625
60757
|
var yesValues2 = new Set(["", "y", "yes"]);
|
|
59626
60758
|
var encodeJson3 = encodeSync(parseJson(Unknown));
|
|
59627
|
-
var
|
|
60759
|
+
var encodePrettyJson3 = (value6) => JSON.stringify(JSON.parse(encodeJson3(value6)), null, 2);
|
|
59628
60760
|
var managedFileSchema = Struct({
|
|
59629
60761
|
path: String$,
|
|
59630
60762
|
sha256: String$,
|
|
@@ -59832,13 +60964,15 @@ var buildWikiAlignment = ({
|
|
|
59832
60964
|
const wikiRoot = detection.monorepo ? "apps/wiki" : "wiki";
|
|
59833
60965
|
copyIfExists({ rootDirectory, targetDirectory: expectedDirectory, relativePath: wikiRoot });
|
|
59834
60966
|
copyIfExists({ rootDirectory, targetDirectory: expectedDirectory, relativePath: "docs" });
|
|
60967
|
+
const wikiFramework = readWikiFrameworkPin(path14.join(expectedDirectory, wikiRoot));
|
|
59835
60968
|
scaffoldWikiForDirectory({
|
|
59836
60969
|
outputDirectory: expectedDirectory,
|
|
59837
|
-
monorepo: detection.monorepo
|
|
60970
|
+
monorepo: detection.monorepo,
|
|
60971
|
+
wikiFramework
|
|
59838
60972
|
});
|
|
59839
60973
|
const syncScript = path14.join(expectedDirectory, wikiRoot, "scripts", "sync-content.mjs");
|
|
59840
60974
|
if (existsSync7(syncScript)) {
|
|
59841
|
-
|
|
60975
|
+
execFileSync6(process.execPath, [syncScript], {
|
|
59842
60976
|
cwd: expectedDirectory,
|
|
59843
60977
|
stdio: "ignore"
|
|
59844
60978
|
});
|
|
@@ -59858,6 +60992,17 @@ var buildWikiAlignment = ({
|
|
|
59858
60992
|
})
|
|
59859
60993
|
};
|
|
59860
60994
|
};
|
|
60995
|
+
var readWikiFrameworkPin = (wikiDirectory) => {
|
|
60996
|
+
const pinPath = path14.join(wikiDirectory, "wiki-framework.md");
|
|
60997
|
+
if (!existsSync7(pinPath))
|
|
60998
|
+
return "next";
|
|
60999
|
+
const content = readFileSync8(pinPath, "utf8");
|
|
61000
|
+
if (content.includes("`tanstack-start`"))
|
|
61001
|
+
return "tanstack-start";
|
|
61002
|
+
if (content.includes("`next`"))
|
|
61003
|
+
return "next";
|
|
61004
|
+
return "next";
|
|
61005
|
+
};
|
|
59861
61006
|
var buildGitignoreCleanup = ({
|
|
59862
61007
|
rootDirectory,
|
|
59863
61008
|
expectedDirectory
|
|
@@ -60069,7 +61214,7 @@ var runUpdate = ({
|
|
|
60069
61214
|
if (emitJson) {
|
|
60070
61215
|
yield* prompt4.writeLine("");
|
|
60071
61216
|
yield* prompt4.writeLine(renderJsonLabel());
|
|
60072
|
-
yield* prompt4.writeLine(
|
|
61217
|
+
yield* prompt4.writeLine(encodePrettyJson3(result));
|
|
60073
61218
|
}
|
|
60074
61219
|
rmSync4(expectedDirectory, { recursive: true, force: true });
|
|
60075
61220
|
rmSync4(wikiAlignment.expectedDirectory, { recursive: true, force: true });
|
|
@@ -60559,6 +61704,7 @@ var askYesNo = async (question) => {
|
|
|
60559
61704
|
readline2.close();
|
|
60560
61705
|
}
|
|
60561
61706
|
};
|
|
61707
|
+
var isPromptAbort = (error4) => error4 instanceof Error && error4.name === "AbortError";
|
|
60562
61708
|
var runInteractiveCliUpdate = async () => {
|
|
60563
61709
|
if (!shouldAskForSelfUpdate()) {
|
|
60564
61710
|
return false;
|
|
@@ -60696,7 +61842,10 @@ if (process.env[startupCheckWorkerEnv] === "1") {
|
|
|
60696
61842
|
startBackgroundStartupChecks();
|
|
60697
61843
|
cli(process.argv).pipe(exports_Effect.provide(exports_Layer.mergeAll(exports_BunContext.layer)), exports_BunRuntime.runMain);
|
|
60698
61844
|
}
|
|
60699
|
-
} catch {
|
|
61845
|
+
} catch (error4) {
|
|
61846
|
+
if (isPromptAbort(error4)) {
|
|
61847
|
+
process.exit(130);
|
|
61848
|
+
}
|
|
60700
61849
|
cli(process.argv).pipe(exports_Effect.provide(exports_Layer.mergeAll(exports_BunContext.layer)), exports_BunRuntime.runMain);
|
|
60701
61850
|
}
|
|
60702
61851
|
}
|