create-next-pro-cli 0.1.30 → 0.1.31
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 +8 -0
- package/dist/bin.bun.js +19 -0
- package/dist/bin.node.js +21 -0
- package/dist/bin.node.js.map +1 -1
- package/package.json +1 -1
- package/templates/Projects/default/.agents/skills/create-next-pro-addapi/SKILL.md +61 -0
- package/templates/Projects/default/.agents/skills/create-next-pro-addcomponent/SKILL.md +67 -0
- package/templates/Projects/default/.agents/skills/create-next-pro-addlanguage/SKILL.md +68 -0
- package/templates/Projects/default/.agents/skills/create-next-pro-addlib/SKILL.md +65 -0
- package/templates/Projects/default/.agents/skills/create-next-pro-addpage/SKILL.md +84 -0
- package/templates/Projects/default/.agents/skills/create-next-pro-addtext/SKILL.md +63 -0
- package/templates/Projects/default/.agents/skills/create-next-pro-create-project/SKILL.md +76 -0
- package/templates/Projects/default/.agents/skills/create-next-pro-rmpage/SKILL.md +66 -0
- package/templates/Projects/default/AGENTS.md +83 -0
- package/templates/Projects/default/README.md +23 -9
- package/templates/Projects/default/tests/consumer/validate-template.ts +2 -0
- package/templates/Projects/default/tests/unit/template-baseline.test.ts +9 -0
package/package.json
CHANGED
|
@@ -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.
|
|
13
|
+
|
|
14
|
+
## Command
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
create-next-pro addcomponent <Component> [--page <Page|Parent.Child>] [--json]
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`-P` is the short form of `--page`. The option requires a page name.
|
|
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`, the command 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`.
|
|
35
|
+
|
|
36
|
+
## Workflow
|
|
37
|
+
|
|
38
|
+
1. Decide whether the component is global or owned by one page.
|
|
39
|
+
2. Verify the page scope 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 --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,84 @@
|
|
|
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
|
+
- Inspect the requested route and UI scope before generating files.
|
|
13
|
+
|
|
14
|
+
## Command
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
create-next-pro addpage <Page|Parent.Child> [options] [--json]
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
With no file options, the command selects `layout`, `page`, and `loading`.
|
|
21
|
+
|
|
22
|
+
| Long option | Short option | Generated route file |
|
|
23
|
+
| ---------------- | ------------ | -------------------- |
|
|
24
|
+
| `--layout` | `-L` | `layout.tsx` |
|
|
25
|
+
| `--page` | `-P` | `page.tsx` |
|
|
26
|
+
| `--loading` | `-l` | `loading.tsx` |
|
|
27
|
+
| `--not-found` | `-n` | `not-found.tsx` |
|
|
28
|
+
| `--error` | `-e` | `error.tsx` |
|
|
29
|
+
| `--global-error` | `-g` | `global-error.tsx` |
|
|
30
|
+
| `--route` | `-r` | `route.ts` |
|
|
31
|
+
| `--template` | `-t` | `template.tsx` |
|
|
32
|
+
| `--default` | `-d` | `default.tsx` |
|
|
33
|
+
|
|
34
|
+
Short options can be combined, for example `-PLl`. Unknown options fail with `INVALID_ARGUMENT`.
|
|
35
|
+
|
|
36
|
+
## Effects
|
|
37
|
+
|
|
38
|
+
For `Account.Security`, expect resources under:
|
|
39
|
+
|
|
40
|
+
- `src/app/[locale]/Account/Security/`
|
|
41
|
+
- `src/ui/Account/Security/page-ui.tsx`
|
|
42
|
+
- `messages/<locale>/Account.json` at the `Security` namespace
|
|
43
|
+
- `messages/<locale>.ts` when the message file needs registration
|
|
44
|
+
|
|
45
|
+
The command creates only missing code files and preserves existing ones as `unchanged`. It prepares all required templates and locale updates before writing.
|
|
46
|
+
|
|
47
|
+
## Workflow
|
|
48
|
+
|
|
49
|
+
1. Select the logical page name and only the required route file options.
|
|
50
|
+
2. Run the command with `--json`.
|
|
51
|
+
3. Inspect route, UI, translation, and aggregator events separately.
|
|
52
|
+
4. Review every generated UI and route file.
|
|
53
|
+
5. Replace or translate placeholder messages in every locale.
|
|
54
|
+
6. Run the project checks.
|
|
55
|
+
|
|
56
|
+
## Examples
|
|
57
|
+
|
|
58
|
+
Create the default page resources:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
create-next-pro addpage Profile
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Create only `page.tsx`, `layout.tsx`, and the page UI for a nested page:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
create-next-pro addpage Account.Security -PL --json
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Create an error and not-found boundary:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
create-next-pro addpage Checkout --error --not-found --json
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Validate
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
bun run check
|
|
80
|
+
# or: npm run check
|
|
81
|
+
# or: pnpm run check
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
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,66 @@
|
|
|
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
|
+
- Review uncommitted work and references to the route before deletion.
|
|
13
|
+
- Use a simple logical name or `Parent.Child`, never a filesystem path.
|
|
14
|
+
|
|
15
|
+
## Command
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
create-next-pro rmpage [Page|Parent.Child] [--json]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Without a name, human mode displays an autocomplete tree and asks for confirmation. JSON mode requires the explicit page name and never prompts.
|
|
22
|
+
|
|
23
|
+
## Effects
|
|
24
|
+
|
|
25
|
+
The command can remove:
|
|
26
|
+
|
|
27
|
+
- the page's App Router directory;
|
|
28
|
+
- the matching `src/ui` page directory;
|
|
29
|
+
- a top-level locale JSON file and its aggregator registration; or
|
|
30
|
+
- only the nested message key for `Parent.Child`.
|
|
31
|
+
|
|
32
|
+
The page catalog excludes technical directories and routes without `page.tsx`. Resolution and deletion remain confined to the project. Shared parents and unrelated files are preserved.
|
|
33
|
+
|
|
34
|
+
## Workflow
|
|
35
|
+
|
|
36
|
+
1. Discover the target with human autocomplete or confirm its logical name from the project structure.
|
|
37
|
+
2. Inspect references, navigation entries, tests, and uncommitted changes that may depend on the page.
|
|
38
|
+
3. Prefer an explicit name with `--json` for agentic deletion.
|
|
39
|
+
4. Require a successful result and inspect every `deleted`, `updated`, and `unchanged` event.
|
|
40
|
+
5. Confirm deleted paths are absent and preserved parents still exist.
|
|
41
|
+
6. Remove or update references only after reviewing the CLI result.
|
|
42
|
+
7. Run the project checks.
|
|
43
|
+
|
|
44
|
+
## Examples
|
|
45
|
+
|
|
46
|
+
Select and confirm a page interactively:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
create-next-pro rmpage
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Remove a nested page non-interactively:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
create-next-pro rmpage Account.Security --json
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Validate
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
bun run check
|
|
62
|
+
# or: npm run check
|
|
63
|
+
# or: pnpm run check
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Treat `TARGET_NOT_FOUND` as a request or state mismatch. Do not substitute a filesystem deletion command, and do not infer deletion from exit code alone.
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
- Preserve existing source files. The add commands report existing resources as `unchanged` instead of overwriting them.
|
|
55
|
+
- Use `rmpage` only for a page returned by the CLI page catalog, and inspect deletion events before making follow-up edits.
|
|
56
|
+
|
|
57
|
+
## CLI operations
|
|
58
|
+
|
|
59
|
+
| Operation | Purpose | Skill |
|
|
60
|
+
| ---------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
61
|
+
| 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) |
|
|
62
|
+
| `addpage` | Add a route, page UI, and localized message resources. | [`$create-next-pro-addpage`](.agents/skills/create-next-pro-addpage/SKILL.md) |
|
|
63
|
+
| `addcomponent` | Add a global or page-scoped UI component and messages. | [`$create-next-pro-addcomponent`](.agents/skills/create-next-pro-addcomponent/SKILL.md) |
|
|
64
|
+
| `addlib` | Add a library directory or a library module and export. | [`$create-next-pro-addlib`](.agents/skills/create-next-pro-addlib/SKILL.md) |
|
|
65
|
+
| `addapi` | Add an App Router API route handler. | [`$create-next-pro-addapi`](.agents/skills/create-next-pro-addapi/SKILL.md) |
|
|
66
|
+
| `addlanguage` | Copy and register a new locale that must then be translated. | [`$create-next-pro-addlanguage`](.agents/skills/create-next-pro-addlanguage/SKILL.md) |
|
|
67
|
+
| `addtext` | Set one translation path across all configured locales. | [`$create-next-pro-addtext`](.agents/skills/create-next-pro-addtext/SKILL.md) |
|
|
68
|
+
| `rmpage` | Remove a catalogued page and its associated resources safely. | [`$create-next-pro-rmpage`](.agents/skills/create-next-pro-rmpage/SKILL.md) |
|
|
69
|
+
|
|
70
|
+
## Global options
|
|
71
|
+
|
|
72
|
+
- `--json`: emit one deterministic JSON document without prompts or decorative output.
|
|
73
|
+
- `--force`: replace an existing project destination during project creation only.
|
|
74
|
+
- `--reconfigure`: rerun the interactive CLI configuration assistant.
|
|
75
|
+
- `--help`: display public command help.
|
|
76
|
+
- `--version` or `-v`: display the CLI version.
|
|
77
|
+
|
|
78
|
+
## Finish every mutation
|
|
79
|
+
|
|
80
|
+
1. Inspect the CLI result and all changed paths.
|
|
81
|
+
2. Complete required review or translation steps.
|
|
82
|
+
3. Run `bun run check`, `npm run check`, or `pnpm run check` with the selected package manager.
|
|
83
|
+
4. Report the command, status, affected paths, and any remaining required work.
|