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
@@ -0,0 +1,91 @@
1
+ # Project Agent Instructions
2
+
3
+ This repository was generated by `create-next-pro`. Follow these instructions when an agent creates or evolves project resources with the CLI.
4
+
5
+ ## Work from the correct directory
6
+
7
+ - Run project creation from the parent directory that will contain the new project.
8
+ - Run every `add*` command and `rmpage` from the generated project root, where `cnp.config.json` is located.
9
+ - Prefer the installed `create-next-pro` executable. If it is unavailable, use `bunx create-next-pro-cli`, `npx create-next-pro-cli`, or `pnpm dlx create-next-pro-cli` with the same arguments.
10
+ - Read the linked command skill before invoking a mutation.
11
+
12
+ ## Choose one package manager
13
+
14
+ Bun is the primary example in this project. A Bun workflow does not require a separate Node.js installation. npm and pnpm remain supported alternatives for generated projects.
15
+
16
+ Use one command family consistently in a working copy:
17
+
18
+ ```bash
19
+ bun install
20
+ bun run check
21
+ bun run dev
22
+ ```
23
+
24
+ ```bash
25
+ npm install
26
+ npm run check
27
+ npm run dev
28
+ ```
29
+
30
+ ```bash
31
+ pnpm install
32
+ pnpm run check
33
+ pnpm run dev
34
+ ```
35
+
36
+ Do not commit an additional lockfile unless the project has intentionally changed its package manager policy.
37
+
38
+ ## Use the agentic output contract
39
+
40
+ - Add `--json` to non-interactive agent commands.
41
+ - Pass every required argument in JSON mode. The CLI never opens prompts in that mode.
42
+ - Parse the single JSON document from standard output. Do not scrape the human renderer.
43
+ - Check `status`, `events`, `nextSteps`, and `error`, not only `exitCode`.
44
+ - Treat `success`, `unchanged`, and `cancelled` as exit code `0`. Treat `failed` as exit code `1`.
45
+ - Verify every `created`, `copied`, or `updated` path and confirm every `deleted` path is absent.
46
+ - Complete all required `nextSteps` before considering the task finished.
47
+
48
+ ## Protect project data
49
+
50
+ - Never print, commit, or include `.env` values in prompts, logs, events, or reports.
51
+ - Use `.env.example` as the public development contract. Create a local file with `cp .env.example .env`, then replace credentials for production.
52
+ - Use `--force` only after resolving and inspecting the exact destination. It deletes the existing child destination before scaffolding.
53
+ - Pass logical names, not filesystem paths. Names use safe dot-separated segments such as `account.security`; never pass absolute paths, slashes, empty segments, or `..`.
54
+ - Select `--area public` or `--area user` explicitly for page creation, direct page removal, and page-scoped components. A route area controls the layout and authorization boundary without changing the public URL.
55
+ - Preserve existing source files. The add commands report existing resources as `unchanged` instead of overwriting them.
56
+ - Use `rmpage` only for a page returned by the area-aware CLI page catalog, and inspect deletion events before making follow-up edits.
57
+
58
+ ## CLI operations
59
+
60
+ | Operation | Purpose | Skill |
61
+ | ---------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
62
+ | Create a project | Scaffold the complete Next.js project in a new child directory. | [`$create-next-pro-create-project`](.agents/skills/create-next-pro-create-project/SKILL.md) |
63
+ | `addpage` | Add an explicitly zoned route, page UI, and localized messages. | [`$create-next-pro-addpage`](.agents/skills/create-next-pro-addpage/SKILL.md) |
64
+ | `addcomponent` | Add a global or area-qualified page component and messages. | [`$create-next-pro-addcomponent`](.agents/skills/create-next-pro-addcomponent/SKILL.md) |
65
+ | `addlib` | Add a library directory or a library module and export. | [`$create-next-pro-addlib`](.agents/skills/create-next-pro-addlib/SKILL.md) |
66
+ | `addapi` | Add an App Router API route handler. | [`$create-next-pro-addapi`](.agents/skills/create-next-pro-addapi/SKILL.md) |
67
+ | `addlanguage` | Copy and register a new locale that must then be translated. | [`$create-next-pro-addlanguage`](.agents/skills/create-next-pro-addlanguage/SKILL.md) |
68
+ | `addtext` | Set one translation path across all configured locales. | [`$create-next-pro-addtext`](.agents/skills/create-next-pro-addtext/SKILL.md) |
69
+ | `rmpage` | Remove one area-qualified page and its resources safely. | [`$create-next-pro-rmpage`](.agents/skills/create-next-pro-rmpage/SKILL.md) |
70
+
71
+ ## Global options
72
+
73
+ - `--json`: emit one deterministic JSON document without prompts or decorative output.
74
+ - `--force`: replace an existing project destination during project creation only.
75
+ - `--reconfigure`: rerun the interactive CLI configuration assistant.
76
+ - `--help`: display public command help.
77
+ - `--version` or `-v`: display the CLI version.
78
+
79
+ ## Page-area option
80
+
81
+ - `--area public`: target the public route group and layout.
82
+ - `--area user`: target the authenticated user route group and layout.
83
+ - The option is required for direct `addpage`, direct `rmpage`, and `addcomponent --page` commands. It is rejected for global components.
84
+ - Do not infer an area from a page name or persist one as a project-wide default.
85
+
86
+ ## Finish every mutation
87
+
88
+ 1. Inspect the CLI result and all changed paths.
89
+ 2. Complete required review or translation steps.
90
+ 3. Run `bun run check`, `npm run check`, or `pnpm run check` with the selected package manager.
91
+ 4. Report the command, status, affected paths, and any remaining required work.
@@ -4,21 +4,27 @@ Next.js App Router template for `create-next-pro-cli`.
4
4
 
5
5
  ## Runtime
6
6
 
7
- Choose Bun, npm, or pnpm for dependency installation and project scripts. The
8
- repository keeps `bun.lock` as its reproducible source lockfile, while npm and
9
- pnpm consumers create their own lockfiles in their working copies.
7
+ Choose one runtime and package-manager path for dependency installation and
8
+ project scripts. The repository keeps `bun.lock` as its reproducible source
9
+ lockfile, while npm and pnpm consumers create their own lockfiles in their
10
+ working copies.
10
11
 
11
- Required:
12
+ Bun-only path:
13
+
14
+ ```bash
15
+ bun --version
16
+ ```
17
+
18
+ Node.js path:
12
19
 
13
20
  ```bash
14
21
  node --version
15
- bun --version # optional
16
- npm --version # optional
17
- pnpm --version # optional
22
+ npm --version # or: pnpm --version
18
23
  ```
19
24
 
20
- Node must satisfy `>=24.0.0`. Bun must satisfy `>=1.3.14` when selected, and
21
- pnpm 11 or later is supported.
25
+ Bun must satisfy `>=1.3.14` when selected and does not require a separate
26
+ Node.js installation. The Node.js path requires Node.js `>=24.0.0`; pnpm 11 or
27
+ later is supported.
22
28
 
23
29
  The npm `allowScripts` policy and pnpm `allowBuilds` policy approve only the
24
30
  native build steps required by Next.js and the file-watcher toolchain. Security
@@ -87,6 +93,20 @@ Replace `bun run` with `npm run` or `pnpm run` for the selected manager. The
87
93
  `audit` and `test:consumer` scripts detect the invoking manager without shell
88
94
  commands, including on Windows.
89
95
 
96
+ ## Agent workflows
97
+
98
+ Codex-compatible project guidance is available in `AGENTS.md`. Focused command
99
+ skills under `.agents/skills` document project creation and every public
100
+ `add*`/`rmpage` operation. Agents should read the matching skill, invoke the CLI
101
+ with `--json`, inspect all reported events and complete every required next
102
+ step before running the project checks.
103
+
104
+ Page operations use explicit route areas. Pass `--area public` or `--area user`
105
+ to direct `addpage` and `rmpage` commands and to `addcomponent --page`. The
106
+ interactive page flows expose the same area-aware catalog. Areas select a route
107
+ layout without changing the public URL; see the linked command skills for the
108
+ complete contract.
109
+
90
110
  ## Template Features
91
111
 
92
112
  - Next.js 16 App Router