Commit 6c90166
feat(www,arkenv): agent prompt docs URL + install skill on --agent (#1793)
## Summary
- Homepage `getAgentPrompt` now embeds the **current deployment’s docs
origin** (via new `getDocsUrl`) and tells agents to install the skill +
prefer `@arkenv/core` / `@arkenv/standard`.
- `arkenv init --agent` installs the agent skill when missing (same as
`--yes`); skips when already present.
- Patch changeset for the CLI behavior change.
## Docs URL resolution (`getDocsUrl`)
Preference order (trimmed; trailing slashes stripped):
1. `NEXT_PUBLIC_SITE_URL` — used as-is (no trailing slash)
2. else `VERCEL_PROJECT_PRODUCTION_URL` → `https://${that}` (keeps
scheme if already present)
3. else `VERCEL_URL` → `https://${that}` (preview deploys)
4. else fallback `https://arkenv.js.org`
Setting `NEXT_PUBLIC_SITE_URL` or the Vercel **production** URL makes
the homepage prompt auto-flip when the site moves off a preview host
(e.g. `arkenv-v1.vercel.app` → `arkenv.js.org`) without hardcoding the
preview forever.
## Prompt sample (fallback docs URL)
```
Set up ArkEnv with `npx arkenv@alpha init --agent`. Use docs only at https://arkenv.js.org. If the ArkEnv skill is missing, install it with `npx skills add yamcodes/arkenv`. Prefer `@arkenv/core` / `@arkenv/standard` over legacy `import from "arkenv"`. Install any missing dependencies, wire the env schema into the app entry, start the app, and tell me when validation works from editor to runtime.
```
## Test plan
- [x] `vitest run lib/config/release.test.ts` (www)
- [x] `vitest run components/page/install-panel.test.tsx` (www)
- [x] `vitest run src/cli/commands/init.test.ts` (arkenv)
- [ ] Spot-check Copy prompt on a Vercel preview: expect `Use docs only
at https://<VERCEL_URL>` (or production URL when set)
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>1 parent 19c5ac3 commit 6c90166
3 files changed
Lines changed: 188 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
11 | 22 | | |
12 | 23 | | |
13 | 24 | | |
| |||
45 | 56 | | |
46 | 57 | | |
47 | 58 | | |
48 | | - | |
49 | | - | |
| 59 | + | |
| 60 | + | |
50 | 61 | | |
51 | | - | |
52 | | - | |
| 62 | + | |
| 63 | + | |
53 | 64 | | |
54 | 65 | | |
55 | 66 | | |
| |||
58 | 69 | | |
59 | 70 | | |
60 | 71 | | |
61 | | - | |
62 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
63 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
64 | 137 | | |
65 | 138 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
13 | 61 | | |
14 | 62 | | |
15 | 63 | | |
| |||
53 | 101 | | |
54 | 102 | | |
55 | 103 | | |
56 | | - | |
| 104 | + | |
| 105 | + | |
57 | 106 | | |
58 | | - | |
| 107 | + | |
| 108 | + | |
59 | 109 | | |
60 | 110 | | |
61 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
62 | 115 | | |
63 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
64 | 125 | | |
65 | 126 | | |
66 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
651 | 694 | | |
652 | 695 | | |
653 | 696 | | |
| |||
0 commit comments