create-next-pro-cli 0.1.30 → 0.1.32

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 (29) hide show
  1. package/README.md +16 -6
  2. package/create-next-pro-completion.sh +4 -3
  3. package/create-next-pro-completion.zsh +3 -3
  4. package/dist/bin.bun.js +514 -118
  5. package/dist/bin.node.js +579 -135
  6. package/dist/bin.node.js.map +1 -1
  7. package/package.json +6 -5
  8. package/templates/Page/page-ui.tsx +2 -2
  9. package/templates/Page/page-ui.user.tsx +17 -0
  10. package/templates/Projects/default/.agents/skills/create-next-pro-addapi/SKILL.md +61 -0
  11. package/templates/Projects/default/.agents/skills/create-next-pro-addcomponent/SKILL.md +67 -0
  12. package/templates/Projects/default/.agents/skills/create-next-pro-addlanguage/SKILL.md +68 -0
  13. package/templates/Projects/default/.agents/skills/create-next-pro-addlib/SKILL.md +65 -0
  14. package/templates/Projects/default/.agents/skills/create-next-pro-addpage/SKILL.md +89 -0
  15. package/templates/Projects/default/.agents/skills/create-next-pro-addtext/SKILL.md +63 -0
  16. package/templates/Projects/default/.agents/skills/create-next-pro-create-project/SKILL.md +76 -0
  17. package/templates/Projects/default/.agents/skills/create-next-pro-rmpage/SKILL.md +67 -0
  18. package/templates/Projects/default/.github/workflows/quality.yml +2 -1
  19. package/templates/Projects/default/AGENTS.md +91 -0
  20. package/templates/Projects/default/README.md +29 -9
  21. package/templates/Projects/default/bun.lock +114 -106
  22. package/templates/Projects/default/package.json +7 -5
  23. package/templates/Projects/default/pnpm-workspace.yaml +2 -1
  24. package/templates/Projects/default/scripts/audit-policy.ts +376 -0
  25. package/templates/Projects/default/scripts/audit.ts +72 -3
  26. package/templates/Projects/default/scripts/package-manager.ts +37 -0
  27. package/templates/Projects/default/tests/consumer/validate-template.ts +2 -0
  28. package/templates/Projects/default/tests/unit/audit-policy.test.ts +152 -0
  29. package/templates/Projects/default/tests/unit/template-baseline.test.ts +9 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-next-pro-cli",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
4
4
  "description": "Advanced Next.js project scaffolder with i18n, Tailwind, App Router and more.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -40,6 +40,7 @@
40
40
  "typecheck": "tsc --project tsconfig.json --noEmit",
41
41
  "language:check": "bun scripts/check-public-language.ts",
42
42
  "test": "bun test",
43
+ "audit": "bun templates/Projects/default/scripts/audit.ts",
43
44
  "clean": "rm -rf dist",
44
45
  "build": "bun run clean && bun run build:node && bun run build:bun && cp scripts/create-next-pro dist/create-next-pro && chmod +x dist/create-next-pro",
45
46
  "build:node": "tsup",
@@ -60,13 +61,13 @@
60
61
  ]
61
62
  },
62
63
  "overrides": {
63
- "brace-expansion": "2.0.3",
64
+ "brace-expansion": "2.1.2",
64
65
  "esbuild": "0.28.1",
65
- "fast-uri": "3.1.2",
66
+ "fast-uri": "3.1.4",
66
67
  "glob": "10.5.0",
67
- "js-yaml": "5.2.1",
68
+ "js-yaml": "5.2.2",
68
69
  "picomatch": "4.0.5",
69
- "postcss": "8.5.17",
70
+ "postcss": "8.5.23",
70
71
  "rollup": "4.62.2",
71
72
  "vite": "8.1.5"
72
73
  },
@@ -5,12 +5,12 @@ import BackButton from "@/ui/_global/BackButton";
5
5
  export default function template() {
6
6
  const t = useTranslations("template");
7
7
  return (
8
- <main className="py-8 px-4 max-w-3xl mx-auto">
8
+ <main className="px-4 pb-8 pt-24 max-w-3xl mx-auto">
9
9
  <div className="flex items-center justify-between mb-6">
10
10
  <h1 className="text-2xl font-bold">{t("title")}</h1>
11
11
  <BackButton />
12
12
  </div>
13
- <p className="text-muted mb-8">{t("description")}</p>
13
+ <p className="text-muted-foreground mb-8">{t("description")}</p>
14
14
  <section className="grid grid-cols-1 md:grid-cols-2 gap-6"></section>
15
15
  </main>
16
16
  );
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import { useTranslations } from "next-intl";
3
+ import BackButton from "@/ui/_global/BackButton";
4
+
5
+ export default function template() {
6
+ const t = useTranslations("template");
7
+ return (
8
+ <section className="px-4 pb-8 pt-24 max-w-3xl mx-auto">
9
+ <div className="flex items-center justify-between mb-6">
10
+ <h1 className="text-2xl font-bold">{t("title")}</h1>
11
+ <BackButton />
12
+ </div>
13
+ <p className="text-muted-foreground mb-8">{t("description")}</p>
14
+ <section className="grid grid-cols-1 md:grid-cols-2 gap-6"></section>
15
+ </section>
16
+ );
17
+ }
@@ -0,0 +1,61 @@
1
+ ---
2
+ name: create-next-pro-addapi
3
+ description: Add an App Router API route to a generated create-next-pro project. Use when Codex needs to create a safe route.ts path, then replace the example response and review validation and authentication.
4
+ ---
5
+
6
+ # Add an API route
7
+
8
+ ## Preconditions
9
+
10
+ - Work from the generated project root containing `cnp.config.json`.
11
+ - Express nested route segments with dots, not filesystem separators.
12
+ - Use only safe non-empty segments.
13
+
14
+ ## Command
15
+
16
+ ```bash
17
+ create-next-pro addapi <route[.child...]> [--json]
18
+ ```
19
+
20
+ ## Effects
21
+
22
+ `addapi users.profile` creates or preserves:
23
+
24
+ ```text
25
+ src/app/api/users/profile/route.ts
26
+ ```
27
+
28
+ The command creates the route directory inside the project boundary and writes the template only when `route.ts` is missing. An existing handler is preserved and reported as `unchanged`.
29
+
30
+ ## Workflow
31
+
32
+ 1. Convert the intended URL hierarchy to a dot-separated logical name.
33
+ 2. Run the command with `--json`.
34
+ 3. Confirm the reported API route path is correct.
35
+ 4. Replace the generated example response with the required behavior.
36
+ 5. Add input validation, authorization, authentication, error handling, and tests appropriate to the endpoint.
37
+ 6. Run the project checks.
38
+
39
+ ## Examples
40
+
41
+ Create a health endpoint:
42
+
43
+ ```bash
44
+ create-next-pro addapi health
45
+ ```
46
+
47
+ Create a nested endpoint non-interactively:
48
+
49
+ ```bash
50
+ create-next-pro addapi users.profile --json
51
+ ```
52
+
53
+ ## Validate
54
+
55
+ ```bash
56
+ bun run check
57
+ # or: npm run check
58
+ # or: pnpm run check
59
+ ```
60
+
61
+ Do not report the API as implemented merely because the template was generated. Complete the required review next step and preserve an existing route handler.
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: create-next-pro-addcomponent
3
+ description: Add a global or page-scoped UI component to a generated create-next-pro project. Use when Codex needs to create a component and its locale message keys without overwriting existing component code.
4
+ ---
5
+
6
+ # Add a component
7
+
8
+ ## Preconditions
9
+
10
+ - Work from the generated project root containing `cnp.config.json`.
11
+ - Use one safe component-name segment.
12
+ - Use a simple or `Parent.Child` page scope when `--page` is present, and identify its existing route area explicitly.
13
+
14
+ ## Command
15
+
16
+ ```bash
17
+ create-next-pro addcomponent <Component> [--page <Page|Parent.Child> --area <public|user>] [--json]
18
+ ```
19
+
20
+ `-P` is the short form of `--page`. The option requires a page name and `--area`. A global component must not receive `--area`. Area values are exact lowercase values and `--area=value` is not supported.
21
+
22
+ ## Effects
23
+
24
+ Without `--page`, the command creates:
25
+
26
+ - `src/ui/_global/<Component>.tsx`
27
+ - a `<Component>` key in `messages/<locale>/_global_ui.json`
28
+
29
+ With `--page Account.Security --area user`, the command first resolves exactly that page in the area-aware route catalog, then creates:
30
+
31
+ - `src/ui/Account/Security/<Component>.tsx`
32
+ - a `<Component>` key in the `Account.Security` translation namespace
33
+
34
+ The component name is normalized to a TypeScript identifier. Existing component code and existing message keys are preserved and reported as `unchanged`. Missing pages return `TARGET_NOT_FOUND`; flat, unknown-group, or ambiguous routes return `INCONSISTENT_ROUTE` before any write.
35
+
36
+ ## Workflow
37
+
38
+ 1. Decide whether the component is global or owned by one page.
39
+ 2. Verify the page scope, area, and translation namespace when using `--page`.
40
+ 3. Run the complete command with `--json`.
41
+ 4. Inspect the component and per-locale message events.
42
+ 5. Implement the component behavior and review all generated translations.
43
+ 6. Run the project checks.
44
+
45
+ ## Examples
46
+
47
+ Create a global component:
48
+
49
+ ```bash
50
+ create-next-pro addcomponent Alert
51
+ ```
52
+
53
+ Create a component for a nested page:
54
+
55
+ ```bash
56
+ create-next-pro addcomponent PasswordForm --page Account.Security --area user --json
57
+ ```
58
+
59
+ ## Validate
60
+
61
+ ```bash
62
+ bun run check
63
+ # or: npm run check
64
+ # or: pnpm run check
65
+ ```
66
+
67
+ Confirm the component path and all translation paths reported by the JSON result. Do not claim that an existing component was regenerated when its event is `unchanged`.
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: create-next-pro-addlanguage
3
+ description: Add and register a two-letter locale in a generated create-next-pro project. Use when Codex needs to copy the default locale, update routing and the typed message registry, and then translate every copied message before delivery.
4
+ ---
5
+
6
+ # Add a language
7
+
8
+ ## Preconditions
9
+
10
+ - Work from the generated project root containing `cnp.config.json`.
11
+ - Confirm internationalization is enabled.
12
+ - Use a recognized lowercase two-letter language code.
13
+ - Keep the default locale directory, locale aggregator, routing file, and message registry consistent before running the command.
14
+
15
+ ## Command
16
+
17
+ ```bash
18
+ create-next-pro addlanguage <locale> [--json]
19
+ ```
20
+
21
+ Human mode offers an autocomplete menu when the locale is omitted. JSON mode always requires the locale argument.
22
+
23
+ ## Effects
24
+
25
+ For `addlanguage de`, the command:
26
+
27
+ - copies every file from `messages/<default-locale>/` to `messages/de/`;
28
+ - creates `messages/de.ts` with imports redirected to `./de/`;
29
+ - adds `de` to `src/lib/i18n/routing.ts`;
30
+ - imports and exposes `de` in `src/lib/i18n/messages.ts`.
31
+
32
+ The copied JSON values remain in the source language. They are not translated and are not ready for delivery.
33
+
34
+ A fully configured locale returns `unchanged`. A partially configured locale fails with `INCONSISTENT_LOCALE` before writing; inspect and repair the inconsistent files instead of retrying blindly.
35
+
36
+ ## Workflow
37
+
38
+ 1. Identify the current default locale and the target two-letter code.
39
+ 2. Run the complete command with `--json`.
40
+ 3. Inspect every `copied`, `created`, and `updated` event.
41
+ 4. Read the required `translate` next step and translate every listed JSON file into the target language.
42
+ 5. Keep placeholders, ICU syntax, keys, and nested object shapes unchanged while translating values.
43
+ 6. Review routing and the typed message registry.
44
+ 7. Run the project checks in every supported locale.
45
+
46
+ ## Examples
47
+
48
+ Select a locale interactively:
49
+
50
+ ```bash
51
+ create-next-pro addlanguage
52
+ ```
53
+
54
+ Add German non-interactively:
55
+
56
+ ```bash
57
+ create-next-pro addlanguage de --json
58
+ ```
59
+
60
+ ## Validate
61
+
62
+ ```bash
63
+ bun run check
64
+ # or: npm run check
65
+ # or: pnpm run check
66
+ ```
67
+
68
+ Do not mark the locale complete until every path in the `translate` next step has been reviewed and translated. Never expose `.env` values while testing authentication in the new locale.
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: create-next-pro-addlib
3
+ description: Add a library directory or library.module to a generated create-next-pro project. Use when Codex needs to create a reusable module and maintain its index exports while preserving existing implementation files.
4
+ ---
5
+
6
+ # Add a library
7
+
8
+ ## Preconditions
9
+
10
+ - Work from the generated project root containing `cnp.config.json`.
11
+ - Use `library` for an empty library shell or `library.module` for a generated module.
12
+ - Use at most two safe dot-separated segments.
13
+
14
+ ## Command
15
+
16
+ ```bash
17
+ create-next-pro addlib <library|library.module> [--json]
18
+ ```
19
+
20
+ ## Effects
21
+
22
+ `addlib analytics` creates or preserves:
23
+
24
+ - `src/lib/analytics/`
25
+ - `src/lib/analytics/index.ts`
26
+
27
+ `addlib analytics.trackEvent` additionally creates or preserves:
28
+
29
+ - `src/lib/analytics/trackEvent.ts`
30
+ - the corresponding import and export in `src/lib/analytics/index.ts`
31
+
32
+ Existing module implementations are never overwritten. The index is updated only when the required import or export is missing.
33
+
34
+ ## Workflow
35
+
36
+ 1. Choose whether the task needs only a library namespace or a concrete module.
37
+ 2. Run the command with `--json`.
38
+ 3. Inspect the directory, module, and index events.
39
+ 4. Implement and review the generated module placeholder.
40
+ 5. Ensure the index exports the module exactly once.
41
+ 6. Run the project checks.
42
+
43
+ ## Examples
44
+
45
+ Create a library shell:
46
+
47
+ ```bash
48
+ create-next-pro addlib analytics
49
+ ```
50
+
51
+ Create and register a module:
52
+
53
+ ```bash
54
+ create-next-pro addlib analytics.trackEvent --json
55
+ ```
56
+
57
+ ## Validate
58
+
59
+ ```bash
60
+ bun run check
61
+ # or: npm run check
62
+ # or: pnpm run check
63
+ ```
64
+
65
+ On a repeated command, expect the existing module to remain intact. Review the result events before editing the index manually.
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: create-next-pro-addpage
3
+ description: Add a simple or Parent.Child page to a generated create-next-pro project. Use when Codex needs to create App Router files, page UI, and localized messages while preserving existing page resources.
4
+ ---
5
+
6
+ # Add a page
7
+
8
+ ## Preconditions
9
+
10
+ - Work from the generated project root containing `cnp.config.json`.
11
+ - Use a safe logical page name with one segment or exactly `Parent.Child`.
12
+ - Choose the route area explicitly: `public` uses the public layout, while `user` uses the authenticated user layout.
13
+ - Inspect the requested route and UI scope before generating files. A logical page name can belong to only one area.
14
+
15
+ ## Command
16
+
17
+ ```bash
18
+ create-next-pro addpage <Page|Parent.Child> --area <public|user> [options] [--json]
19
+ ```
20
+
21
+ `--area` accepts only the exact lowercase values `public` and `user`. It may appear before or after the page name, but it cannot be repeated or written as `--area=value`. With no page name, human mode asks for both the name and area; JSON mode requires both explicitly.
22
+
23
+ With no file options, the command selects `layout`, `page`, and `loading`.
24
+
25
+ | Long option | Short option | Generated route file |
26
+ | ---------------- | ------------ | -------------------- |
27
+ | `--layout` | `-L` | `layout.tsx` |
28
+ | `--page` | `-P` | `page.tsx` |
29
+ | `--loading` | `-l` | `loading.tsx` |
30
+ | `--not-found` | `-n` | `not-found.tsx` |
31
+ | `--error` | `-e` | `error.tsx` |
32
+ | `--global-error` | `-g` | `global-error.tsx` |
33
+ | `--route` | `-r` | `route.ts` |
34
+ | `--template` | `-t` | `template.tsx` |
35
+ | `--default` | `-d` | `default.tsx` |
36
+
37
+ Short options can be combined, for example `-PLl`. Unknown options fail with `INVALID_ARGUMENT`.
38
+
39
+ ## Effects
40
+
41
+ For `Account.Security --area user`, expect resources under:
42
+
43
+ - `src/app/[locale]/(user)/Account/Security/`
44
+ - `src/ui/Account/Security/page-ui.tsx`
45
+ - `messages/<locale>/Account.json` at the `Security` namespace
46
+ - `messages/<locale>.ts` when the message file needs registration
47
+
48
+ The route area affects only the App Router path and layout. UI and message paths remain area-independent. Public page UI uses its own `<main>` landmark; user page UI uses `<section>` because the user layout already provides `<main>`.
49
+
50
+ The command creates only missing code files and preserves existing ones as `unchanged`. Repeating the command in the same area is idempotent and can add requested missing route files. Requesting the same logical page in the other area fails with `TARGET_EXISTS`. Flat historical routes or ambiguous route definitions fail with `INCONSISTENT_ROUTE` before any write.
51
+
52
+ ## Workflow
53
+
54
+ 1. Select the logical page name, area, and only the required route file options.
55
+ 2. Run the command with `--json`.
56
+ 3. Inspect route, UI, translation, and aggregator events separately.
57
+ 4. Review every generated UI and route file.
58
+ 5. Replace or translate placeholder messages in every locale.
59
+ 6. Run the project checks.
60
+
61
+ ## Examples
62
+
63
+ Create the default page resources:
64
+
65
+ ```bash
66
+ create-next-pro addpage Profile --area public
67
+ ```
68
+
69
+ Create only `page.tsx`, `layout.tsx`, and the page UI for a nested page:
70
+
71
+ ```bash
72
+ create-next-pro addpage Account.Security --area user -PL --json
73
+ ```
74
+
75
+ Create an error and not-found boundary:
76
+
77
+ ```bash
78
+ create-next-pro addpage Checkout --area public --error --not-found --json
79
+ ```
80
+
81
+ ## Validate
82
+
83
+ ```bash
84
+ bun run check
85
+ # or: npm run check
86
+ # or: pnpm run check
87
+ ```
88
+
89
+ Confirm every `created` or `updated` event path exists. A repeated command should preserve existing code and normally report those resources as `unchanged`.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: create-next-pro-addtext
3
+ description: Set a dot-separated translation key across every configured locale in a generated create-next-pro project. Use when Codex needs to create or replace one message value consistently and then localize the propagated text.
4
+ ---
5
+
6
+ # Add or update translation text
7
+
8
+ ## Preconditions
9
+
10
+ - Work from the generated project root containing `cnp.config.json`.
11
+ - Confirm internationalization is enabled and at least one locale directory exists.
12
+ - Use a path with a message file and at least one key, such as `dashboard.welcome`.
13
+
14
+ ## Command
15
+
16
+ ```bash
17
+ create-next-pro addtext <file.key[.nested...]> [text...] [--json]
18
+ ```
19
+
20
+ If text is omitted, the CLI derives a title-cased value from the final key. Provide the intended source text explicitly for agentic work.
21
+
22
+ ## Effects
23
+
24
+ The first path segment selects `messages/<locale>/<file>.json`. Remaining segments select the nested key. The command writes the same value to every configured locale:
25
+
26
+ - a missing file or key is created;
27
+ - a different existing value is updated with `replaced: true` in event detail;
28
+ - an identical value is reported as `unchanged`.
29
+
30
+ Invalid JSON or a scalar encountered where an object is required causes an error before any prepared writes are applied.
31
+
32
+ ## Workflow
33
+
34
+ 1. Inspect existing message files and select the canonical dot path.
35
+ 2. Run the command with explicit text and `--json`.
36
+ 3. Inspect every per-locale event and whether a previous value was replaced.
37
+ 4. Translate the propagated source value separately in each locale where required.
38
+ 5. Preserve message keys, interpolation placeholders, and ICU syntax.
39
+ 6. Run the project checks.
40
+
41
+ ## Examples
42
+
43
+ Set a value in human mode:
44
+
45
+ ```bash
46
+ create-next-pro addtext dashboard.welcome "Welcome back"
47
+ ```
48
+
49
+ Set a nested value non-interactively:
50
+
51
+ ```bash
52
+ create-next-pro addtext account.security.passwordHint "Use at least 12 characters" --json
53
+ ```
54
+
55
+ ## Validate
56
+
57
+ ```bash
58
+ bun run check
59
+ # or: npm run check
60
+ # or: pnpm run check
61
+ ```
62
+
63
+ The initial value is intentionally identical across locales. Complete the required translation next step rather than assuming propagation performed translation.
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: create-next-pro-create-project
3
+ description: Scaffold a new create-next-pro Next.js project. Use when Codex needs to create a generated project, select a safe destination, handle an existing target, or perform the initial install, environment setup, checks, and local start.
4
+ ---
5
+
6
+ # Create a project
7
+
8
+ ## Preconditions
9
+
10
+ - Work from the parent directory that should contain the new project.
11
+ - Choose a safe single-segment project name.
12
+ - Complete the CLI onboarding once in human mode if the JSON result reports `ONBOARDING_REQUIRED`.
13
+ - Inspect an existing destination before deciding whether deletion with `--force` is authorized.
14
+
15
+ ## Command
16
+
17
+ ```bash
18
+ create-next-pro <project-name> [--force] [--json]
19
+ ```
20
+
21
+ Use letters, digits, hyphens, or underscores in the project name. Do not pass an absolute path, a separator, `.` or `..`. JSON mode requires the project name. Without a name, human mode opens the interactive project assistant.
22
+
23
+ Use `--force` only when replacement of the exact child destination is intended. The CLI deletes that destination before copying the template and does not merge its contents.
24
+
25
+ ## Workflow
26
+
27
+ 1. Resolve the intended parent directory and project name.
28
+ 2. Run the command with `--json` for agentic execution.
29
+ 3. Require `status: "success"` and inspect every event.
30
+ 4. Confirm the project contains `package.json`, `tsconfig.json`, `cnp.config.json`, `AGENTS.md`, `.agents/skills`, and `.env.example`.
31
+ 5. Confirm `.env`, `.git`, caches, build output, and internal agent context were not copied.
32
+ 6. Enter the project and install with one package manager.
33
+ 7. Copy `.env.example` to the local `.env`, review the development values, run the full checks, and start the development server.
34
+
35
+ The scaffold updates the package name and import alias, removes the source template's `packageManager` field, and leaves the generated project free to use Bun, npm, or pnpm.
36
+
37
+ ## Examples
38
+
39
+ Human output:
40
+
41
+ ```bash
42
+ create-next-pro customer-portal
43
+ ```
44
+
45
+ Agentic output:
46
+
47
+ ```bash
48
+ create-next-pro customer-portal --json
49
+ ```
50
+
51
+ Explicitly replace an inspected destination:
52
+
53
+ ```bash
54
+ create-next-pro customer-portal --force --json
55
+ ```
56
+
57
+ Do not retry `TARGET_EXISTS` with `--force` automatically. Obtain authorization or choose another project name.
58
+
59
+ ## Validate
60
+
61
+ With Bun only:
62
+
63
+ ```bash
64
+ cd customer-portal
65
+ bun install
66
+ cp .env.example .env
67
+ bun run check
68
+ bun run dev
69
+ ```
70
+
71
+ Equivalent npm or pnpm workflows:
72
+
73
+ ```bash
74
+ npm install && npm run check
75
+ pnpm install && pnpm run check
76
+ ```
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: create-next-pro-rmpage
3
+ description: Remove a catalogued page and its associated route, UI, and message resources from a generated create-next-pro project. Use when Codex needs a confirmed, project-confined page deletion in direct or interactive mode.
4
+ ---
5
+
6
+ # Remove a page
7
+
8
+ ## Preconditions
9
+
10
+ - Work from the generated project root containing `cnp.config.json`.
11
+ - Confirm the target is a page that contains an actual `page.tsx` and appears in the CLI page catalog.
12
+ - Confirm whether the page belongs to the `public` or `user` route area.
13
+ - Review uncommitted work and references to the route before deletion.
14
+ - Use a simple logical name or `Parent.Child`, never a filesystem path.
15
+
16
+ ## Command
17
+
18
+ ```bash
19
+ create-next-pro rmpage [Page|Parent.Child] [--area <public|user>] [--json]
20
+ ```
21
+
22
+ With a page name, `--area` is required. Without a name, human mode displays an autocomplete tree grouped as `Public > ...` and `User > ...`, then asks for confirmation. Passing only `--area` filters that menu. JSON mode requires the explicit page name and area and never prompts. Area values are exact lowercase values and `--area=value` is not supported.
23
+
24
+ ## Effects
25
+
26
+ The command can remove:
27
+
28
+ - the page's App Router directory;
29
+ - the matching `src/ui` page directory;
30
+ - a top-level locale JSON file and its aggregator registration; or
31
+ - only the nested message key for `Parent.Child`.
32
+
33
+ The page catalog excludes technical directories and routes without `page.tsx`. Resolution uses the exact `{area, logicalName}` pair and deletion remains confined to the project. Shared parents and unrelated files are preserved. Flat historical routes, unknown route groups, and ambiguous route definitions fail with `INCONSISTENT_ROUTE` and are never deleted automatically.
34
+
35
+ ## Workflow
36
+
37
+ 1. Discover the target with the area-aware human autocomplete or confirm its logical name and area from the project structure.
38
+ 2. Inspect references, navigation entries, tests, and uncommitted changes that may depend on the page.
39
+ 3. Prefer an explicit name with `--json` for agentic deletion.
40
+ 4. Require a successful result and inspect every `deleted`, `updated`, and `unchanged` event.
41
+ 5. Confirm deleted paths are absent and preserved parents still exist.
42
+ 6. Remove or update references only after reviewing the CLI result.
43
+ 7. Run the project checks.
44
+
45
+ ## Examples
46
+
47
+ Select and confirm a page interactively:
48
+
49
+ ```bash
50
+ create-next-pro rmpage
51
+ ```
52
+
53
+ Remove a nested page non-interactively:
54
+
55
+ ```bash
56
+ create-next-pro rmpage Account.Security --area user --json
57
+ ```
58
+
59
+ ## Validate
60
+
61
+ ```bash
62
+ bun run check
63
+ # or: npm run check
64
+ # or: pnpm run check
65
+ ```
66
+
67
+ Treat `TARGET_NOT_FOUND` as a request or state mismatch. Treat `INCONSISTENT_ROUTE` as a request for manual route inspection, not permission to remove a flat or ambiguous route. Do not substitute a filesystem deletion command, and do not infer deletion from exit code alone.
@@ -42,7 +42,6 @@ jobs:
42
42
  pnpm install --no-frozen-lockfile
43
43
  fi
44
44
  - run: ${{ matrix.manager }} run check
45
- - run: ${{ matrix.manager }} run audit
46
45
  - name: Validate an isolated consumer
47
46
  env:
48
47
  CNP_PACKAGE_MANAGER: ${{ matrix.manager }}
@@ -53,3 +52,5 @@ jobs:
53
52
  - name: Run visual integration tests without Bun
54
53
  if: matrix.manager == 'npm'
55
54
  run: npm run test:e2e
55
+ - name: Run blocking security audit
56
+ run: ${{ matrix.manager }} run audit