create-pracht 0.6.0 → 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 +56 -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 -415
  25. package/skills/pracht-debug/SKILL.md +165 -120
  26. package/skills/pracht-deploy/SKILL.md +248 -329
  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 +166 -195
  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 +15 -11
  34. package/skills/upgrade-pracht/SKILL.md +12 -10
  35. package/src/index.js +43 -0
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: audit-loaders
3
- version: 1.1.0
3
+ version: 1.1.1
4
4
  description: |
5
- Audit pracht route loaders for serializability, leaked secrets,
6
- unsafe loader caching, browser-only API misuse, and missing AbortSignal plumbing.
7
- Use when asked to "audit loaders", "check loader data", "find serialization
8
- bugs", "are my loaders safe", or "loader security review".
5
+ Audit pracht route loaders for serializability, leaked secrets, unsafe
6
+ `loaderCache`, browser-only API use, and missing `AbortSignal` plumbing.
7
+ Use for "audit loaders", "check loader data", "find serialization bugs", "loader
8
+ security review".
9
9
  allowed-tools:
10
10
  - Bash
11
11
  - Read
@@ -21,8 +21,8 @@ ends up in the browser — including secrets you never meant to expose.
21
21
 
22
22
  ## Step 1: Enumerate routes
23
23
 
24
- If the pracht MCP server is registered (see docs/MCP.md), prefer its tools
25
- (`inspect_routes`, `inspect_api`, `inspect_build`, `doctor`, `verify`) over
24
+ MCP: when the pracht MCP server is registered (docs/MCP.md), prefer its
25
+ `inspect_routes`/`inspect_api`/`inspect_build`/`doctor`/`verify` tools over
26
26
  shelling out.
27
27
 
28
28
  ```bash
@@ -51,12 +51,27 @@ Flag returns that contain any of:
51
51
  | `Date`, `Map`, `Set`, `URL` | Not preserved by `JSON.stringify` |
52
52
  | Class instances | Lose prototype on the client |
53
53
  | `Function` / arrow values | Stripped silently |
54
- | `Promise` | Becomes `{}` |
54
+ | `Promise` (bare) | Becomes `{}` — wrap in `defer()` |
55
55
  | Circular refs | Throws at serialize time |
56
56
  | `Buffer` / typed arrays | Becomes `{}` or numeric keys |
57
57
  | `bigint` | `JSON.stringify` throws |
58
58
  | `undefined` in arrays/object | Drops keys; arrays become `null` |
59
59
 
60
+ A bare promise in loader data is always a bug — it serializes to `{}`. The fix
61
+ is `defer(promise)`, which marks the field as deferred and is read in the
62
+ component with `use()` inside a `<Suspense>` boundary. Flag a bare promise as an
63
+ `error` and point at `defer()`; a `defer()`ed field is correct and must not be
64
+ flagged.
65
+
66
+ Two `defer()` rules worth checking while you are in the loader:
67
+
68
+ - A deferred value must not redirect, throw `PrachtHttpError`, or set response
69
+ status or headers — by the time it settles the response is already committed.
70
+ Auth belongs in middleware or the awaited part of the loader.
71
+ - `defer(await …)` defeats the point and throws at runtime. Flag it.
72
+ - `defer()` must be returned from an enumerable data property, not hidden
73
+ behind a getter. An unresolved marker throws during serialization.
74
+
60
75
  Recommend converting to `string` (ISO for dates), plain arrays, or plain objects
61
76
  before return.
62
77
 
@@ -1,14 +1,13 @@
1
1
  ---
2
2
  name: audit-redirects
3
- version: 1.1.0
3
+ version: 1.1.1
4
4
  description: |
5
- Find open-redirect vulnerabilities in pracht loaders, middleware, and
6
- navigation calls. The framework guards both ends — the client router drops
7
- unsafe URL schemes, and the server `redirect()` helper rejects unsafe
8
- schemes and CRLF injection — but a hand-rolled 3xx Response bypasses every
9
- guard, and even a guarded redirect to an attacker-chosen origin can phish.
10
- Use when asked to "audit redirects", "check for open redirects", "is my
11
- ?redirect= param safe", or "review login redirect handling".
5
+ Find open redirects in pracht loaders, middleware, and navigation. The framework
6
+ rejects unsafe schemes and CRLF at both ends, but a hand-rolled 3xx Response
7
+ bypasses every guard, and even a guarded redirect to an attacker-chosen origin
8
+ can phish.
9
+ Use for "audit redirects", "check for open redirects", "is my ?redirect= param
10
+ safe", "review login redirect handling".
12
11
  allowed-tools:
13
12
  - Bash
14
13
  - Read
@@ -41,8 +40,8 @@ Bound the search first — do not grep the whole repo blind:
41
40
  pracht inspect routes --json
42
41
  ```
43
42
 
44
- If the pracht MCP server is registered (see `docs/MCP.md`), prefer its tools
45
- (`inspect_routes`, `inspect_api`, `inspect_build`, `doctor`, `verify`) over
43
+ MCP: when the pracht MCP server is registered (docs/MCP.md), prefer its
44
+ `inspect_routes`/`inspect_api`/`inspect_build`/`doctor`/`verify` tools over
46
45
  shelling out.
47
46
 
48
47
  The resolved graph gives you each route's `file`, `loaderFile`, and
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  name: audit-secrets
3
- version: 1.1.0
3
+ version: 1.1.1
4
4
  description: |
5
- Detect environment variables and secrets that leak from the server into
6
- the client bundle via loader return values, hydration state, or accidental
7
- imports of server-only modules from client code paths.
8
- Use when asked to "audit secrets", "find leaked env vars", "is my API key
9
- exposed", "check client bundle for secrets", or "scan for credential leaks".
5
+ Detect environment variables and secrets reaching the client bundle via loader
6
+ return values, hydration state, or server-only modules imported from client code
7
+ paths.
8
+ Use for "audit secrets", "find leaked env vars", "is my API key exposed", "scan
9
+ for credential leaks".
10
10
  allowed-tools:
11
11
  - Bash
12
12
  - Read
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  name: audit-seo
3
- version: 1.1.0
3
+ version: 1.1.1
4
4
  description: |
5
- Per-route SEO audit for a pracht app: `head()` coverage, title/description
6
- presence, Open Graph and Twitter card completeness, canonical URLs, robots
7
- rules, and a generated `sitemap.xml` derived from the route manifest.
8
- Use when asked to "audit SEO", "check meta tags", "generate a sitemap",
9
- "are my OG cards set", or "review robots.txt".
5
+ Per-route SEO audit: `head()` coverage, title and description presence, Open
6
+ Graph and Twitter cards, canonicals, robots rules, plus a `sitemap.xml`
7
+ generated from the route manifest.
8
+ Use for "audit SEO", "check meta tags", "generate a sitemap", "are my OG cards
9
+ set", "review robots.txt".
10
10
  allowed-tools:
11
11
  - Bash
12
12
  - Read
@@ -23,8 +23,8 @@ coverage and generates the static SEO artifacts.
23
23
 
24
24
  ## Step 1: Inventory
25
25
 
26
- If the pracht MCP server is registered (see docs/MCP.md), prefer its tools
27
- (`inspect_routes`, `inspect_api`, `inspect_build`, `doctor`, `verify`) over
26
+ MCP: when the pracht MCP server is registered (docs/MCP.md), prefer its
27
+ `inspect_routes`/`inspect_api`/`inspect_build`/`doctor`/`verify` tools over
28
28
  shelling out.
29
29
 
30
30
  ```bash
@@ -1,13 +1,12 @@
1
1
  ---
2
2
  name: audit-shells
3
- version: 1.1.0
3
+ version: 1.1.1
4
4
  description: |
5
- Audit pracht shells for composition bugs: missing `Loading()` on SPA-using
6
- shells, accidental `<html>`/`<head>`/`<body>` rendering, shells that swallow
7
- children, unused shells, and redundant `ErrorBoundary` exports (shell-level
8
- boundaries are valid fallbacks; routes win when both declare one).
9
- Use when asked to "audit shells", "check shell composition", "find unused
10
- shells", or "is my layout structured correctly".
5
+ Audit pracht shells: missing `Loading()` on SPA routes, `<html>`/`<head>`/
6
+ `<body>` rendered inside a shell, shells that never render `children`, unused
7
+ shells, and `ErrorBoundary` exports shadowed by every route under them.
8
+ Use for "audit shells", "check shell composition", "find unused shells", "is my
9
+ layout structured correctly".
11
10
  allowed-tools:
12
11
  - Bash
13
12
  - Read
@@ -24,8 +23,8 @@ component.
24
23
 
25
24
  ## Step 1: Enumerate
26
25
 
27
- If the pracht MCP server is registered (see docs/MCP.md), prefer its tools
28
- (`inspect_routes`, `inspect_api`, `inspect_build`, `doctor`, `verify`) over
26
+ MCP: when the pracht MCP server is registered (docs/MCP.md), prefer its
27
+ `inspect_routes`/`inspect_api`/`inspect_build`/`doctor`/`verify` tools over
29
28
  shelling out.
30
29
 
31
30
  ```bash
@@ -1,14 +1,13 @@
1
1
  ---
2
2
  name: configure-isg
3
- version: 1.0.0
3
+ version: 1.0.1
4
4
  description: |
5
- Wire ISG (incremental static generation) revalidation correctly for the
6
- project's adapter: route-level timeRevalidate/webhookRevalidate policies,
7
- the authenticated /__pracht/revalidate webhook, Cloudflare Workers Caching,
8
- Vercel native ISR, and cache-key pitfalls — then verify it locally.
9
- Use when asked to "set up ISG", "configure revalidation", "add a
10
- revalidation webhook", "my ISG page never updates", or "cache this page at
11
- the edge".
5
+ Wire ISG revalidation for the project's adapter: route-level
6
+ `timeRevalidate`/`webhookRevalidate`, the authenticated `/__pracht/revalidate`
7
+ webhook, Cloudflare Workers Cache, Vercel ISR, and cache-key pitfalls — then
8
+ verify locally.
9
+ Use for "set up ISG", "configure revalidation", "add a revalidation webhook", "my
10
+ ISG page never updates", "cache this page at the edge".
12
11
  allowed-tools:
13
12
  - Bash
14
13
  - Read
@@ -30,8 +29,8 @@ webhook, and the adapter-specific cache correctly.
30
29
 
31
30
  ## Step 1: Identify adapter and candidate routes
32
31
 
33
- If the pracht MCP server is registered (see docs/MCP.md), prefer its tools
34
- (`inspect_routes`, `inspect_api`, `inspect_build`, `doctor`, `verify`) over
32
+ MCP: when the pracht MCP server is registered (docs/MCP.md), prefer its
33
+ `inspect_routes`/`inspect_api`/`inspect_build`/`doctor`/`verify` tools over
35
34
  shelling out.
36
35
 
37
36
  ```bash