create-pracht 0.6.1 → 0.6.2

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.
Files changed (35) hide show
  1. package/package.json +1 -1
  2. package/skills/add-auth/SKILL.md +63 -143
  3. package/skills/add-capabilities/SKILL.md +409 -0
  4. package/skills/add-content/SKILL.md +242 -0
  5. package/skills/add-db/SKILL.md +93 -202
  6. package/skills/add-i18n/SKILL.md +178 -217
  7. package/skills/add-images/SKILL.md +203 -0
  8. package/skills/add-observability/SKILL.md +118 -15
  9. package/skills/add-openapi/SKILL.md +209 -0
  10. package/skills/audit-a11y/SKILL.md +8 -9
  11. package/skills/audit-agent-surface/SKILL.md +335 -0
  12. package/skills/audit-auth/SKILL.md +16 -11
  13. package/skills/audit-bundles/SKILL.md +48 -12
  14. package/skills/audit-csrf/SKILL.md +9 -10
  15. package/skills/audit-deps/SKILL.md +8 -8
  16. package/skills/audit-headers/SKILL.md +9 -10
  17. package/skills/audit-islands/SKILL.md +9 -10
  18. package/skills/audit-loaders/SKILL.md +23 -8
  19. package/skills/audit-redirects/SKILL.md +9 -10
  20. package/skills/audit-secrets/SKILL.md +6 -6
  21. package/skills/audit-seo/SKILL.md +8 -8
  22. package/skills/audit-shells/SKILL.md +8 -9
  23. package/skills/configure-isg/SKILL.md +9 -10
  24. package/skills/migrate-nextjs/SKILL.md +200 -424
  25. package/skills/pracht-debug/SKILL.md +165 -128
  26. package/skills/pracht-deploy/SKILL.md +246 -331
  27. package/skills/pracht-scaffold/SKILL.md +123 -146
  28. package/skills/pracht-test-api/SKILL.md +10 -10
  29. package/skills/pre-deploy/SKILL.md +165 -200
  30. package/skills/scaffold-e2e/SKILL.md +11 -12
  31. package/skills/scaffold-tests/SKILL.md +10 -12
  32. package/skills/tune-render-mode/SKILL.md +7 -8
  33. package/skills/typed-routes/SKILL.md +9 -9
  34. package/skills/upgrade-pracht/SKILL.md +7 -8
  35. package/src/index.js +38 -0
package/src/index.js CHANGED
@@ -1436,6 +1436,12 @@ function createAgentInstructions({ adapter, agentTools, packageManager, router,
1436
1436
  // needs the explicit `run` form the same way npm does.
1437
1437
  const runCmd =
1438
1438
  packageManager === "npm" || packageManager === "bun" ? `${packageManager} run` : packageManager;
1439
+ // The pages router derives route ids from filenames, so the home page of a
1440
+ // pages app is `index` (`src/pages/index.tsx`); the manifest scaffold names
1441
+ // it `home` explicitly. Every id in the instructions below has to be one the
1442
+ // scaffold actually generated, or the first link an agent writes is the very
1443
+ // compile error these conventions exist to prevent.
1444
+ const homeRouteId = router === "pages" ? "index" : "home";
1439
1445
 
1440
1446
  const lines = [
1441
1447
  "# Pracht App",
@@ -1540,6 +1546,21 @@ function createAgentInstructions({ adapter, agentTools, packageManager, router,
1540
1546
  lines.push("- `netlify.toml` — Netlify build, publish, and functions configuration");
1541
1547
  }
1542
1548
 
1549
+ lines.push("");
1550
+ lines.push("## Conventions");
1551
+ lines.push("");
1552
+ lines.push(
1553
+ `- Navigate by route id, not by path: \`<Link route="${homeRouteId}">\`, ` +
1554
+ `\`href("${homeRouteId}")\`, \`navigate({ route: "${homeRouteId}" })\`. Dynamic routes take ` +
1555
+ "their segments through `params`. `<Link href>` is a type error — the id survives a path " +
1556
+ "change and `pracht typegen` types both the id and its params. Use a plain `<a href>` for " +
1557
+ "external and user-provided URLs.",
1558
+ );
1559
+ lines.push(
1560
+ "- Run `pracht typegen` once to type route ids, params, and `apiFetch()`; `pracht dev` keeps " +
1561
+ "them in sync.",
1562
+ );
1563
+
1543
1564
  if (agentTools) {
1544
1565
  lines.push("");
1545
1566
  lines.push("## Agent tooling");
@@ -1580,6 +1601,9 @@ function createReadme({
1580
1601
  const deployCommand = packageManager === "npm" ? "npm run deploy" : `${packageManager} deploy`;
1581
1602
  const typecheckCommand =
1582
1603
  packageManager === "npm" ? "npm run typecheck" : `${packageManager} typecheck`;
1604
+ // The pages router derives route ids from filenames, so its home page is
1605
+ // "index" where the manifest starter names it "home".
1606
+ const homeRouteId = router === "pages" ? "index" : "home";
1583
1607
 
1584
1608
  const lines = [
1585
1609
  `# ${projectName}`,
@@ -1663,6 +1687,20 @@ function createReadme({
1663
1687
  lines.push("- `src/api/health.ts` is a sample API route.");
1664
1688
  }
1665
1689
 
1690
+ // The one convention a new app trips over before it writes anything else,
1691
+ // and AGENTS.md — where the same note lives for coding agents — is only
1692
+ // seeded when agent tooling is enabled.
1693
+ lines.push("");
1694
+ lines.push("## Navigating");
1695
+ lines.push("");
1696
+ lines.push(
1697
+ `Pracht navigates by route id, not by path: \`<Link route="${homeRouteId}">\`, ` +
1698
+ `\`href("${homeRouteId}")\`, \`navigate({ route: "${homeRouteId}" })\`. Dynamic routes ` +
1699
+ "take their segments through `params`. The id survives a path change, and `pracht " +
1700
+ "typegen` types both the id and its params — so `<Link href>` is a compile error. Use a " +
1701
+ "plain `<a href>` for external and user-provided URLs.",
1702
+ );
1703
+
1666
1704
  if (packageManager === "pnpm") {
1667
1705
  lines.push(
1668
1706
  pnpmWorkspaceNotice