@zero2webmaster/starter-kit 0.1.0

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 (87) hide show
  1. package/LICENSE +38 -0
  2. package/README.md +89 -0
  3. package/dist/brand.d.ts +72 -0
  4. package/dist/brand.d.ts.map +1 -0
  5. package/dist/brand.js +198 -0
  6. package/dist/brand.js.map +1 -0
  7. package/dist/brief.d.ts +14 -0
  8. package/dist/brief.d.ts.map +1 -0
  9. package/dist/brief.js +47 -0
  10. package/dist/brief.js.map +1 -0
  11. package/dist/cli.d.ts +3 -0
  12. package/dist/cli.d.ts.map +1 -0
  13. package/dist/cli.js +82 -0
  14. package/dist/cli.js.map +1 -0
  15. package/dist/confirm.d.ts +45 -0
  16. package/dist/confirm.d.ts.map +1 -0
  17. package/dist/confirm.js +382 -0
  18. package/dist/confirm.js.map +1 -0
  19. package/dist/index.d.ts +32 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +12 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/parse-brief.d.ts +32 -0
  24. package/dist/parse-brief.d.ts.map +1 -0
  25. package/dist/parse-brief.js +298 -0
  26. package/dist/parse-brief.js.map +1 -0
  27. package/dist/scaffolders/cf-pages.d.ts +9 -0
  28. package/dist/scaffolders/cf-pages.d.ts.map +1 -0
  29. package/dist/scaffolders/cf-pages.js +259 -0
  30. package/dist/scaffolders/cf-pages.js.map +1 -0
  31. package/dist/scaffolders/cf-worker.d.ts +4 -0
  32. package/dist/scaffolders/cf-worker.d.ts.map +1 -0
  33. package/dist/scaffolders/cf-worker.js +112 -0
  34. package/dist/scaffolders/cf-worker.js.map +1 -0
  35. package/dist/scaffolders/common.d.ts +39 -0
  36. package/dist/scaffolders/common.d.ts.map +1 -0
  37. package/dist/scaffolders/common.js +441 -0
  38. package/dist/scaffolders/common.js.map +1 -0
  39. package/dist/scaffolders/index.d.ts +18 -0
  40. package/dist/scaffolders/index.d.ts.map +1 -0
  41. package/dist/scaffolders/index.js +40 -0
  42. package/dist/scaffolders/index.js.map +1 -0
  43. package/dist/scaffolders/library.d.ts +4 -0
  44. package/dist/scaffolders/library.d.ts.map +1 -0
  45. package/dist/scaffolders/library.js +122 -0
  46. package/dist/scaffolders/library.js.map +1 -0
  47. package/dist/scaffolders/nextjs.d.ts +10 -0
  48. package/dist/scaffolders/nextjs.d.ts.map +1 -0
  49. package/dist/scaffolders/nextjs.js +395 -0
  50. package/dist/scaffolders/nextjs.js.map +1 -0
  51. package/dist/scaffolders/protocol-repo.d.ts +4 -0
  52. package/dist/scaffolders/protocol-repo.d.ts.map +1 -0
  53. package/dist/scaffolders/protocol-repo.js +162 -0
  54. package/dist/scaffolders/protocol-repo.js.map +1 -0
  55. package/dist/scaffolders/python-service.d.ts +4 -0
  56. package/dist/scaffolders/python-service.d.ts.map +1 -0
  57. package/dist/scaffolders/python-service.js +144 -0
  58. package/dist/scaffolders/python-service.js.map +1 -0
  59. package/dist/scaffolders/wp-plugin.d.ts +4 -0
  60. package/dist/scaffolders/wp-plugin.d.ts.map +1 -0
  61. package/dist/scaffolders/wp-plugin.js +268 -0
  62. package/dist/scaffolders/wp-plugin.js.map +1 -0
  63. package/dist/standards.d.ts +65 -0
  64. package/dist/standards.d.ts.map +1 -0
  65. package/dist/standards.js +335 -0
  66. package/dist/standards.js.map +1 -0
  67. package/dist/substitute.d.ts +37 -0
  68. package/dist/substitute.d.ts.map +1 -0
  69. package/dist/substitute.js +98 -0
  70. package/dist/substitute.js.map +1 -0
  71. package/dist/summary.d.ts +20 -0
  72. package/dist/summary.d.ts.map +1 -0
  73. package/dist/summary.js +191 -0
  74. package/dist/summary.js.map +1 -0
  75. package/dist/templates.d.ts +30 -0
  76. package/dist/templates.d.ts.map +1 -0
  77. package/dist/templates.js +123 -0
  78. package/dist/templates.js.map +1 -0
  79. package/dist/wizard.d.ts +12 -0
  80. package/dist/wizard.d.ts.map +1 -0
  81. package/dist/wizard.js +158 -0
  82. package/dist/wizard.js.map +1 -0
  83. package/dist/writer.d.ts +62 -0
  84. package/dist/writer.d.ts.map +1 -0
  85. package/dist/writer.js +367 -0
  86. package/dist/writer.js.map +1 -0
  87. package/package.json +72 -0
package/LICENSE ADDED
@@ -0,0 +1,38 @@
1
+ Z2W Starter Kit — Proprietary License
2
+
3
+ Copyright (c) 2026 Dr. Kerry Kriger / Zero2Webmaster.
4
+ All rights reserved.
5
+
6
+ This software ("z2w-starter-kit") is proprietary. It is published to the
7
+ npm registry for distribution convenience under the package name
8
+ @zero2webmaster/starter-kit, but publication does not constitute an open-
9
+ source license.
10
+
11
+ A paid subscription is required for production use, redistribution, and
12
+ any commercial deployment. Free evaluation use for the purpose of
13
+ assessing whether to purchase a subscription is permitted.
14
+
15
+ Without an active paid subscription, you may NOT:
16
+ 1. Use this software in any commercial product, service, or workflow.
17
+ 2. Redistribute, sublicense, sell, or otherwise transfer the software,
18
+ in source or compiled form, in whole or in part.
19
+ 3. Remove or modify any license, copyright, or attribution notices.
20
+ 4. Reverse-engineer the runtime license-validation mechanism or
21
+ attempt to bypass subscription checks.
22
+
23
+ You MAY, without a subscription:
24
+ 1. Read the source for evaluation purposes.
25
+ 2. Run the CLI on a single workstation for evaluation purposes only.
26
+ 3. Report issues at the project's GitHub repository.
27
+
28
+ Subscriptions: https://zero2webmaster.com (subscription terms apply).
29
+
30
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
31
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
32
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
33
+ IN NO EVENT SHALL THE AUTHOR OR COPYRIGHT HOLDER BE LIABLE FOR ANY
34
+ CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
35
+ TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE
36
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37
+
38
+ For licensing inquiries: kerry@zero2webmaster.com
package/README.md ADDED
@@ -0,0 +1,89 @@
1
+ # z2w-starter-kit
2
+
3
+ **Version:** 0.1.0 | **Framework:** 2.13.0
4
+
5
+ > Node CLI to scaffold new Z2W projects from canonical Templates + AGENTS.md.
6
+
7
+ **Brand:** Zero2Webmaster
8
+
9
+ ---
10
+
11
+ ## Overview
12
+
13
+ `z2w-starter-kit` is a command-line scaffolder for [Zero2Webmaster](https://zero2webmaster.com) projects. It reads canonical content from the master Templates folder (`AGENTS_WP_v3.1.0.md`, `AGENTS_v2.13.0.md`, `Resources/*`), parses a pasted project brief OR walks an 8-question fallback wizard, applies brand presets, layers the current Z2W standards block (portable-stack, Fathom analytics, Uptime Kuma, Neon-careful, Agent Coordination, SEO baseline, email-service, text-size), substitutes placeholders, and writes a complete project skeleton atomically into the target path.
14
+
15
+ It is the Node/npm sibling of the `instantiate-z2w-project` Claude Code skill — the same orchestration logic, packaged so any developer can run it without Claude Code installed. When standards drift, both must be updated together.
16
+
17
+ ```bash
18
+ npx @zero2webmaster/starter-kit init
19
+ ```
20
+
21
+ ## Quick start
22
+
23
+ ```bash
24
+ # Run without installing
25
+ npx @zero2webmaster/starter-kit init
26
+
27
+ # Or install globally
28
+ npm install -g @zero2webmaster/starter-kit
29
+ z2w-starter-kit init
30
+
31
+ # Or run from a local clone during development
32
+ git clone https://github.com/zero2webmaster/z2w-starter-kit
33
+ cd z2w-starter-kit
34
+ npm install
35
+ npm run build
36
+ node dist/cli.js init
37
+ ```
38
+
39
+ The CLI's primary surface is **brief-first**: paste a project-instantiation brief, the CLI parses it deterministically, shows a numbered confirmation screen with per-line edit, then scaffolds. Type `skip` at the brief prompt or pass `--wizard` to fall back to the 8-question sequential wizard.
40
+
41
+ Project types supported: `wp-plugin`, `cf-worker`, `cf-pages`, `nextjs`, `python-service`, `library`, `protocol-repo`.
42
+
43
+ Brand presets: `save-the-frogs`, `bansuri-bliss`, `zero2webmaster`, `custom`.
44
+
45
+ ## CLI flags
46
+
47
+ | Flag | Purpose |
48
+ |---|---|
49
+ | `--wizard` | Skip brief-first mode; go straight to the 8-question fallback wizard |
50
+ | `--input <source>` | Non-interactive mode. `--input <path>` reads `ScaffoldInputs` JSON from a file; `--input -` reads from stdin. Bypasses brief / confirm / wizard entirely. For CI use |
51
+ | `--dry-run` | Print the file list + contents that would be written, without touching disk |
52
+ | `--target-path <path>` | Override the target path from inputs |
53
+ | `--templates-path <path>` | Point at a Templates folder other than `~/Desktop/Zero2Webmaster/AI/Templates/` |
54
+ | `--promote-standards` | Run the interactive (a) inline / (b) promote-into-Templates dialog per applicable standard. Promoted standards are captured in `STANDARDS_PROMOTIONS.md` alongside the scaffold (the Templates-folder write itself is a v0.2.x concern) |
55
+ | `--allow-non-empty` | Write into a non-empty target directory. Off by default — the CLI refuses to scaffold over existing content unless explicitly opted in |
56
+ | `--no-color` | Suppress ANSI color in the final summary output. Honored regardless of terminal capability, per POSIX `NO_COLOR` convention |
57
+
58
+ ## Architecture
59
+
60
+ This is a pure CLI tool. No web UI, no database, no scheduled jobs, no deployment target. Side-effectful commands (`git init`, `gh repo create`, `npm install`, `composer install`, symlink setup) are surfaced as next-actions in the final summary block — the CLI does NOT run them on the user's behalf in v0.1.x.
61
+
62
+ - **Layer 1 (Directive):** SOPs in `directives/` (system architecture, scaffolder contracts, brand presets)
63
+ - **Layer 2 (Orchestration):** Node CLI (`src/cli.ts`) parses args, parses the brief or runs the wizard, decides what to write
64
+ - **Layer 3 (Execution):** Filesystem operations via `fs-extra` (atomic per-file writes via `.tmp` + rename); git/`gh` shell-outs run by the user post-scaffold, not by this CLI
65
+
66
+ For non-WP web apps (`nextjs`, `cf-pages` with `hasWebUi`), the CLI emits the full 7-item SEO baseline at instantiation: SSR/SSG via the framework's Metadata API, per-page metadata, one `<h1>` + semantic HTML, sitemap + robots with preview-noindex gating, OG image placeholder, Organization JSON-LD, Fathom Analytics wiring via the canonical env var (`NEXT_PUBLIC_FATHOM_SITE_ID` for Next.js, `PUBLIC_FATHOM_SITE_ID` for Vite/SvelteKit/Astro, inline `<script>` for cf-pages static), and a `SEO-CHECKLIST.md` pre-launch audit.
67
+
68
+ ## Relationship to the Claude Code skill
69
+
70
+ The Claude Code skill at `~/.claude/skills/instantiate-z2w-project/SKILL.md` and this CLI share a contract: same inputs, same outputs, same brand presets, same standards block. The skill is the in-Claude-Code path; this CLI is the standalone path. The Templates folder remains the canonical source for AGENTS file bodies and the `Resources/` boilerplate — both the skill and this CLI read Templates files fresh on every run; neither embeds copies.
71
+
72
+ ## Status
73
+
74
+ - v0.1.0 ships as a fully-free local-Templates-only CLI.
75
+ - The runtime license-validation Worker and the hosted Templates mirror (per the project brief) are separate v0.2.x+ tracks. Subscribers will not encounter paid feature gates at v0.1.0.
76
+
77
+ ## License
78
+
79
+ Proprietary — © 2026 Dr. Kerry Kriger, Zero2Webmaster. All rights reserved.
80
+
81
+ A paid subscription is required for production use, redistribution, and any commercial deployment. Free evaluation use for the purpose of assessing whether to purchase a subscription is permitted. See [LICENSE](LICENSE) for full terms.
82
+
83
+ Subscriptions: https://zero2webmaster.com.
84
+ For licensing inquiries: kerry@zero2webmaster.com.
85
+
86
+ ---
87
+
88
+ *Scaffolded 2026-05-28 via the [[instantiate-z2w-project]] Claude Code skill v1; reconciled against the consolidated skill v1.1.0 (brief-first + Agent Coordination block) on 2026-05-29.*
89
+ *Version: 0.1.0 | Last Updated: 2026-05-30*
@@ -0,0 +1,72 @@
1
+ import type { BrandPreset, CustomBrandInputs } from "./index.js";
2
+ export interface BrandColorExtra {
3
+ /** Human label (e.g. "Complementary", "STF Deep Green"). */
4
+ label: string;
5
+ /** Six-digit hex with leading `#` — see {@link isHexColor}. */
6
+ hex: string;
7
+ /** Optional one-line description. */
8
+ description?: string;
9
+ }
10
+ export interface BrandPresetSpec {
11
+ preset: BrandPreset;
12
+ brandName: string;
13
+ brandNameRule: string;
14
+ primaryColor: string;
15
+ accentColor: string;
16
+ typographyRule: string;
17
+ domains: readonly string[];
18
+ /**
19
+ * Default GitHub org for `gh repo create`. `null` for `custom` (caller must
20
+ * supply explicitly). Internal Z2W brands map to `zero2webmaster`; STF maps
21
+ * to `savethefrogs`; Bansuri Bliss maps to `bansuribliss`.
22
+ */
23
+ githubOrg: string | null;
24
+ author: string;
25
+ authorUrl: string;
26
+ /** Additional brand colors beyond primary + accent (purple, gold, ...). */
27
+ extras: readonly BrandColorExtra[];
28
+ /** Related Claude skill to cross-link in CLAUDE.md when relevant. */
29
+ relatedSkill?: string;
30
+ /** Free-form notes appended at the bottom of the brand block. */
31
+ notes?: readonly string[];
32
+ /**
33
+ * True when one or more required brand values is unresolved (e.g. the
34
+ * bansuri-bliss stub). The brand-block generator emits TODO markers and a
35
+ * pointer back to the skill so the gap is impossible to miss.
36
+ */
37
+ isStub: boolean;
38
+ }
39
+ export declare const DEFAULT_AUTHOR = "Dr. Kerry Kriger";
40
+ export declare const DEFAULT_AUTHOR_URL = "https://zero2webmaster.com/kerry-kriger";
41
+ export declare const DEFAULT_TYPOGRAPHY_RULE = "Large, easy-to-read type per Z2W standing organization instruction (body 18px+, line-height >= 1.5).";
42
+ /** True iff `s` is a `#RGB` or `#RRGGBB` hex color literal. */
43
+ export declare function isHexColor(s: string): boolean;
44
+ export declare const SAVE_THE_FROGS_PRESET: BrandPresetSpec;
45
+ export declare const BANSURI_BLISS_PRESET: BrandPresetSpec;
46
+ export declare const ZERO2WEBMASTER_PRESET: BrandPresetSpec;
47
+ export declare const BRAND_PRESETS: Readonly<Record<Exclude<BrandPreset, "custom">, BrandPresetSpec>>;
48
+ /**
49
+ * Build a one-off BrandPresetSpec from user-supplied custom-brand inputs.
50
+ *
51
+ * Per [[instantiate-z2w-project]] SKILL.md, `custom` is never persisted back
52
+ * into the skill — one-offs aren't presets. The typography rule defaults to
53
+ * the Z2W standing org rule, and GitHub org defaults to `null` (caller must
54
+ * set it explicitly via the GitHub org input).
55
+ */
56
+ export declare function buildCustomBrandSpec(inputs: CustomBrandInputs, githubOrg?: string | null): BrandPresetSpec;
57
+ /**
58
+ * Resolve the brand spec for a given preset. For `custom`, `customInputs` is
59
+ * required and `githubOrg` may be passed through to fill the spec's
60
+ * githubOrg field.
61
+ */
62
+ export declare function getBrandSpec(preset: BrandPreset, customInputs?: CustomBrandInputs, githubOrg?: string): BrandPresetSpec;
63
+ /**
64
+ * Render a brand spec as a self-contained markdown block suitable for
65
+ * prepending to a scaffolded project's CLAUDE.md (per the skill's Step 5).
66
+ *
67
+ * Stub presets (e.g. bansuri-bliss) emit visible `_TODO_` markers for the
68
+ * unresolved values plus the spec's notes — so the gap is impossible to miss
69
+ * when the scaffolded project is opened.
70
+ */
71
+ export declare function renderBrandBlock(spec: BrandPresetSpec): string;
72
+ //# sourceMappingURL=brand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brand.d.ts","sourceRoot":"","sources":["../src/brand.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEjE,MAAM,WAAW,eAAe;IAC9B,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,GAAG,EAAE,MAAM,CAAC;IACZ,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B;;;;OAIG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC;IACnC,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iEAAiE;IACjE,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,cAAc,qBAAqB,CAAC;AACjD,eAAO,MAAM,kBAAkB,4CAA4C,CAAC;AAC5E,eAAO,MAAM,uBAAuB,yGACoE,CAAC;AAIzG,+DAA+D;AAC/D,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAE7C;AAED,eAAO,MAAM,qBAAqB,EAAE,eA+BnC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eAiBlC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,eA6BnC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAClC,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,eAAe,CAAC,CAKxD,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,iBAAiB,EACzB,SAAS,GAAE,MAAM,GAAG,IAAW,GAC9B,eAAe,CAejB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,WAAW,EACnB,YAAY,CAAC,EAAE,iBAAiB,EAChC,SAAS,CAAC,EAAE,MAAM,GACjB,eAAe,CAUjB;AAOD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CA6D9D"}
package/dist/brand.js ADDED
@@ -0,0 +1,198 @@
1
+ // z2w-starter-kit brand presets.
2
+ //
3
+ // Mirrors the [[instantiate-z2w-project]] skill's "Brand presets" section.
4
+ // Each preset captures the brand name, the capitalization rule that
5
+ // disambiguates correct from incorrect spellings, the brand colors, the
6
+ // typography rule, and the GitHub org used for `gh repo create` defaults.
7
+ //
8
+ // The bansuri-bliss preset is intentionally a stub — colors and typography
9
+ // remain TODO until Kerry supplies them on first scaffold. The v0.2.x flow
10
+ // will persist resolved values back into the skill SKILL.md (see
11
+ // docs/HANDOFF.md). For v0.1.x the brand-block generator surfaces the gap
12
+ // as visible markers and points the maintainer at the skill.
13
+ export const DEFAULT_AUTHOR = "Dr. Kerry Kriger";
14
+ export const DEFAULT_AUTHOR_URL = "https://zero2webmaster.com/kerry-kriger";
15
+ export const DEFAULT_TYPOGRAPHY_RULE = "Large, easy-to-read type per Z2W standing organization instruction (body 18px+, line-height >= 1.5).";
16
+ const HEX_COLOR_RE = /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
17
+ /** True iff `s` is a `#RGB` or `#RRGGBB` hex color literal. */
18
+ export function isHexColor(s) {
19
+ return HEX_COLOR_RE.test(s);
20
+ }
21
+ export const SAVE_THE_FROGS_PRESET = {
22
+ preset: "save-the-frogs",
23
+ brandName: "SAVE THE FROGS!",
24
+ brandNameRule: "always all caps with trailing exclamation mark; never 'Save The Frogs' or 'Save the Frogs!' when referring to the organization",
25
+ primaryColor: "#72af43",
26
+ accentColor: "#f5821f",
27
+ typographyRule: "Large, easy-to-read type per Z2W standing organization instruction (body 18px+, line-height >= 1.5).",
28
+ domains: [
29
+ "savethefrogs.com",
30
+ "worldsalamanderday.org",
31
+ "worldfrogday.org",
32
+ "amphibianweek.org",
33
+ ],
34
+ githubOrg: "savethefrogs",
35
+ author: DEFAULT_AUTHOR,
36
+ authorUrl: DEFAULT_AUTHOR_URL,
37
+ extras: [
38
+ { label: "Primary dark (hover)", hex: "#5a8d35" },
39
+ { label: "Primary deep (accents on cream)", hex: "#3d6b2a" },
40
+ { label: "Accent dark (orange hover)", hex: "#d66a10" },
41
+ { label: "Neutral ink (body text)", hex: "#1a1a1a" },
42
+ { label: "Neutral paper (warm off-white)", hex: "#fdfcf7" },
43
+ { label: "Neutral cream (warm cream sections)", hex: "#f5f1e3" },
44
+ ],
45
+ relatedSkill: "[[stf-graphics-skill]]",
46
+ notes: [
47
+ "Event names: 'Save The Frogs Day' (April 28), 'World Salamander Day' (March 28), 'World Frog Day' (March 20). Title case, NO exclamation mark — that ornament is reserved for the organization name itself.",
48
+ ],
49
+ isStub: false,
50
+ };
51
+ export const BANSURI_BLISS_PRESET = {
52
+ preset: "bansuri-bliss",
53
+ brandName: "Bansuri Bliss",
54
+ brandNameRule: "title case; never 'Bonseri Bliss' or 'Bansuri Bliss Academy'",
55
+ primaryColor: "",
56
+ accentColor: "",
57
+ typographyRule: "",
58
+ domains: ["bansuribliss.com"],
59
+ githubOrg: "bansuribliss",
60
+ author: DEFAULT_AUTHOR,
61
+ authorUrl: DEFAULT_AUTHOR_URL,
62
+ extras: [],
63
+ notes: [
64
+ "STUB PRESET — colors and typography unresolved. Ask Kerry on first scaffold and persist the values back into the [[instantiate-z2w-project]] skill SKILL.md (see the brand preset block). The v0.2.x persistence-back-to-skill flow will automate this; until then, edit the skill by hand.",
65
+ ],
66
+ isStub: true,
67
+ };
68
+ export const ZERO2WEBMASTER_PRESET = {
69
+ preset: "zero2webmaster",
70
+ brandName: "Zero2Webmaster",
71
+ brandNameRule: "exact spelling; never 'Zero To Webmaster', 'Zero 2 Webmaster', or '0-2 Webmaster'",
72
+ primaryColor: "#82C92B",
73
+ accentColor: "#FFD700",
74
+ typographyRule: "Large, easy-to-read type per Z2W standing organization instruction (body 18px+, line-height >= 1.5).",
75
+ domains: ["zero2webmaster.com"],
76
+ githubOrg: "zero2webmaster",
77
+ author: DEFAULT_AUTHOR,
78
+ authorUrl: DEFAULT_AUTHOR_URL,
79
+ extras: [
80
+ {
81
+ label: "Complementary purple",
82
+ hex: "#722BC9",
83
+ description: "Use sparingly for accents / highlights.",
84
+ },
85
+ {
86
+ label: "Analogous gold",
87
+ hex: "#C9C12B",
88
+ description: "Pairs with primary green; use sparingly.",
89
+ },
90
+ ],
91
+ notes: [
92
+ "Applies to Z2W internal tools, Z2W-branded WP plugins, Z2W cross-project infrastructure, and the Z2W product line. All ship under the zero2webmaster GitHub org, NEVER under kerrykriger personal.",
93
+ ],
94
+ isStub: false,
95
+ };
96
+ export const BRAND_PRESETS = {
97
+ "save-the-frogs": SAVE_THE_FROGS_PRESET,
98
+ "bansuri-bliss": BANSURI_BLISS_PRESET,
99
+ zero2webmaster: ZERO2WEBMASTER_PRESET,
100
+ };
101
+ /**
102
+ * Build a one-off BrandPresetSpec from user-supplied custom-brand inputs.
103
+ *
104
+ * Per [[instantiate-z2w-project]] SKILL.md, `custom` is never persisted back
105
+ * into the skill — one-offs aren't presets. The typography rule defaults to
106
+ * the Z2W standing org rule, and GitHub org defaults to `null` (caller must
107
+ * set it explicitly via the GitHub org input).
108
+ */
109
+ export function buildCustomBrandSpec(inputs, githubOrg = null) {
110
+ return {
111
+ preset: "custom",
112
+ brandName: inputs.brandName,
113
+ brandNameRule: inputs.brandNameRule,
114
+ primaryColor: inputs.primaryColor,
115
+ accentColor: inputs.accentColor,
116
+ typographyRule: DEFAULT_TYPOGRAPHY_RULE,
117
+ domains: [],
118
+ githubOrg,
119
+ author: DEFAULT_AUTHOR,
120
+ authorUrl: DEFAULT_AUTHOR_URL,
121
+ extras: [],
122
+ isStub: false,
123
+ };
124
+ }
125
+ /**
126
+ * Resolve the brand spec for a given preset. For `custom`, `customInputs` is
127
+ * required and `githubOrg` may be passed through to fill the spec's
128
+ * githubOrg field.
129
+ */
130
+ export function getBrandSpec(preset, customInputs, githubOrg) {
131
+ if (preset === "custom") {
132
+ if (!customInputs) {
133
+ throw new Error("getBrandSpec: brand='custom' requires customInputs (brandName, brandNameRule, primaryColor, accentColor).");
134
+ }
135
+ return buildCustomBrandSpec(customInputs, githubOrg ?? null);
136
+ }
137
+ return BRAND_PRESETS[preset];
138
+ }
139
+ function valueOrTodo(value) {
140
+ const trimmed = value.trim();
141
+ return trimmed.length > 0 ? trimmed : "_TODO — fill in_";
142
+ }
143
+ /**
144
+ * Render a brand spec as a self-contained markdown block suitable for
145
+ * prepending to a scaffolded project's CLAUDE.md (per the skill's Step 5).
146
+ *
147
+ * Stub presets (e.g. bansuri-bliss) emit visible `_TODO_` markers for the
148
+ * unresolved values plus the spec's notes — so the gap is impossible to miss
149
+ * when the scaffolded project is opened.
150
+ */
151
+ export function renderBrandBlock(spec) {
152
+ const lines = [];
153
+ lines.push(`## Brand: ${spec.brandName}`);
154
+ lines.push("");
155
+ lines.push(`- **Brand name:** \`${spec.brandName}\` — ${spec.brandNameRule}`);
156
+ lines.push(`- **Author:** ${spec.author} (${spec.authorUrl})`);
157
+ if (spec.githubOrg) {
158
+ lines.push(`- **GitHub org default:** \`${spec.githubOrg}\``);
159
+ }
160
+ lines.push("");
161
+ lines.push("**Color palette:**");
162
+ lines.push("");
163
+ lines.push("| Role | Hex | Notes |");
164
+ lines.push("|---|---|---|");
165
+ lines.push(`| Primary | \`${valueOrTodo(spec.primaryColor)}\` | Headings, primary brand color |`);
166
+ lines.push(`| Accent | \`${valueOrTodo(spec.accentColor)}\` | Links, CTAs |`);
167
+ for (const extra of spec.extras) {
168
+ const note = extra.description ?? "";
169
+ lines.push(`| ${extra.label} | \`${valueOrTodo(extra.hex)}\` | ${note} |`);
170
+ }
171
+ lines.push("");
172
+ lines.push(`**Typography:** ${valueOrTodo(spec.typographyRule)}`);
173
+ lines.push("");
174
+ if (spec.domains.length > 0) {
175
+ lines.push("**Domains:**");
176
+ lines.push("");
177
+ for (const domain of spec.domains) {
178
+ lines.push(`- ${domain}`);
179
+ }
180
+ lines.push("");
181
+ }
182
+ if (spec.relatedSkill) {
183
+ lines.push(`**Related skill:** ${spec.relatedSkill}`);
184
+ lines.push("");
185
+ }
186
+ if (spec.notes && spec.notes.length > 0) {
187
+ for (const note of spec.notes) {
188
+ lines.push(`> ${note}`);
189
+ }
190
+ lines.push("");
191
+ }
192
+ if (spec.isStub) {
193
+ lines.push("> **Stub preset:** one or more required values above are unresolved. On first scaffold, gather the missing values from Kerry and persist them back into the [[instantiate-z2w-project]] skill SKILL.md so the next scaffold uses real values. The v0.2.x persistence-back-to-skill flow will automate this.");
194
+ lines.push("");
195
+ }
196
+ return lines.join("\n").replace(/\n{3,}/g, "\n\n").trimEnd() + "\n";
197
+ }
198
+ //# sourceMappingURL=brand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brand.js","sourceRoot":"","sources":["../src/brand.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,EAAE;AACF,2EAA2E;AAC3E,oEAAoE;AACpE,wEAAwE;AACxE,0EAA0E;AAC1E,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,iEAAiE;AACjE,0EAA0E;AAC1E,6DAA6D;AA2C7D,MAAM,CAAC,MAAM,cAAc,GAAG,kBAAkB,CAAC;AACjD,MAAM,CAAC,MAAM,kBAAkB,GAAG,yCAAyC,CAAC;AAC5E,MAAM,CAAC,MAAM,uBAAuB,GAClC,sGAAsG,CAAC;AAEzG,MAAM,YAAY,GAAG,sCAAsC,CAAC;AAE5D,+DAA+D;AAC/D,MAAM,UAAU,UAAU,CAAC,CAAS;IAClC,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAoB;IACpD,MAAM,EAAE,gBAAgB;IACxB,SAAS,EAAE,iBAAiB;IAC5B,aAAa,EACX,gIAAgI;IAClI,YAAY,EAAE,SAAS;IACvB,WAAW,EAAE,SAAS;IACtB,cAAc,EACZ,sGAAsG;IACxG,OAAO,EAAE;QACP,kBAAkB;QAClB,wBAAwB;QACxB,kBAAkB;QAClB,mBAAmB;KACpB;IACD,SAAS,EAAE,cAAc;IACzB,MAAM,EAAE,cAAc;IACtB,SAAS,EAAE,kBAAkB;IAC7B,MAAM,EAAE;QACN,EAAE,KAAK,EAAE,sBAAsB,EAAE,GAAG,EAAE,SAAS,EAAE;QACjD,EAAE,KAAK,EAAE,iCAAiC,EAAE,GAAG,EAAE,SAAS,EAAE;QAC5D,EAAE,KAAK,EA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,IAAI,CAAC;AACtE,CAAC"}
@@ -0,0 +1,14 @@
1
+ export interface BriefResult {
2
+ brief: string | null;
3
+ skipped: boolean;
4
+ }
5
+ export interface GatherBriefOptions {
6
+ input?: NodeJS.ReadableStream;
7
+ output?: NodeJS.WritableStream;
8
+ /** Test seam: when supplied, lines are read from here instead of `input`. */
9
+ lines?: AsyncIterable<string>;
10
+ }
11
+ export declare const BRIEF_PROMPT = "Paste your project instantiation prompt. End with a line containing only `---` to signal done. Type `skip` to fall through to wizard mode.";
12
+ export declare const BRIEF_SENTINEL = "---";
13
+ export declare function gatherBrief(opts?: GatherBriefOptions): Promise<BriefResult>;
14
+ //# sourceMappingURL=brief.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brief.d.ts","sourceRoot":"","sources":["../src/brief.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IAC/B,6EAA6E;IAC7E,KAAK,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC/B;AAED,eAAO,MAAM,YAAY,+IACqH,CAAC;AAE/I,eAAO,MAAM,cAAc,QAAQ,CAAC;AAWpC,wBAAsB,WAAW,CAC/B,IAAI,GAAE,kBAAuB,GAC5B,OAAO,CAAC,WAAW,CAAC,CA+BtB"}
package/dist/brief.js ADDED
@@ -0,0 +1,47 @@
1
+ // z2w-starter-kit brief gatherer.
2
+ //
3
+ // Reads a pasted project-instantiation brief from stdin until a line
4
+ // containing only `---` (the sentinel) or end-of-stream. A first line of
5
+ // `skip` (case-insensitive) short-circuits to wizard-fallback mode.
6
+ //
7
+ // Implemented over a node:readline interface rather than @inquirer/prompts
8
+ // because briefs are multi-line pastes — inquirer's `input` is single-line and
9
+ // `editor` opens $EDITOR, neither of which fits "paste from the clipboard."
10
+ // The seam takes an optional async-iterable line source so tests can drive it
11
+ // without spawning a real TTY.
12
+ import { createInterface } from "node:readline";
13
+ export const BRIEF_PROMPT = "Paste your project instantiation prompt. End with a line containing only `---` to signal done. Type `skip` to fall through to wizard mode.";
14
+ export const BRIEF_SENTINEL = "---";
15
+ async function* linesFromStream(input) {
16
+ const rl = createInterface({ input, crlfDelay: Infinity });
17
+ for await (const line of rl) {
18
+ yield line;
19
+ }
20
+ }
21
+ export async function gatherBrief(opts = {}) {
22
+ const output = opts.output ?? process.stdout;
23
+ output.write(`\n${BRIEF_PROMPT}\n\n`);
24
+ const source = opts.lines ?? linesFromStream(opts.input ?? process.stdin);
25
+ const buffer = [];
26
+ let firstNonEmptySeen = false;
27
+ for await (const line of source) {
28
+ const trimmed = line.trim();
29
+ if (!firstNonEmptySeen) {
30
+ if (trimmed.length === 0)
31
+ continue;
32
+ if (trimmed.toLowerCase() === "skip") {
33
+ return { brief: null, skipped: true };
34
+ }
35
+ firstNonEmptySeen = true;
36
+ }
37
+ if (trimmed === BRIEF_SENTINEL)
38
+ break;
39
+ buffer.push(line);
40
+ }
41
+ const body = buffer.join("\n").trim();
42
+ return {
43
+ brief: body.length > 0 ? body : null,
44
+ skipped: false,
45
+ };
46
+ }
47
+ //# sourceMappingURL=brief.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brief.js","sourceRoot":"","sources":["../src/brief.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,EAAE;AACF,qEAAqE;AACrE,yEAAyE;AACzE,oEAAoE;AACpE,EAAE;AACF,2EAA2E;AAC3E,+EAA+E;AAC/E,4EAA4E;AAC5E,8EAA8E;AAC9E,+BAA+B;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAchD,MAAM,CAAC,MAAM,YAAY,GACvB,4IAA4I,CAAC;AAE/I,MAAM,CAAC,MAAM,cAAc,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AAC;IACtC,OAAO;QACL,KAAK,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;QACpC,OAAO,EAAE,KAAK;KACf,CAAC;AACJ,CAAC"}
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,82 @@
1
+ #!/usr/bin/env node
2
+ // z2w-starter-kit CLI entry point.
3
+ //
4
+ // Brief-first input flow + Step 6 writer. The CLI defaults to the brief-paste
5
+ // confirmation loop; `--wizard` runs the 8-question fallback; `--input <src>`
6
+ // bypasses both and reads a JSON `ScaffoldInputs` from stdin (`-`) or a file
7
+ // path for non-interactive CI / testing use. `--dry-run` prints the file list
8
+ // + contents to stdout without touching disk. `--promote-standards` runs the
9
+ // interactive (a) inline / (b) promote-into-Templates dialog before write.
10
+ import { Command } from "commander";
11
+ import { input as inquirerInput } from "@inquirer/prompts";
12
+ import { gatherBrief } from "./brief.js";
13
+ import { confirmInputs } from "./confirm.js";
14
+ import { parseBrief } from "./parse-brief.js";
15
+ import { runWizard } from "./wizard.js";
16
+ import { version } from "./index.js";
17
+ import { renderSummary } from "./summary.js";
18
+ import { loadScaffoldInputs, writeScaffold, WriterError } from "./writer.js";
19
+ const inquirerPrompter = (message, defaultValue) => inquirerInput({ message, default: defaultValue });
20
+ async function gatherInputs(flags) {
21
+ if (flags.input) {
22
+ return loadScaffoldInputs(flags.input);
23
+ }
24
+ if (flags.wizard) {
25
+ return runWizard({ prompter: inquirerPrompter });
26
+ }
27
+ const { brief, skipped } = await gatherBrief();
28
+ if (skipped || brief === null) {
29
+ return runWizard({ prompter: inquirerPrompter });
30
+ }
31
+ const parsed = parseBrief(brief);
32
+ return confirmInputs(parsed, { prompter: inquirerPrompter });
33
+ }
34
+ async function runInit(flags) {
35
+ const inputs = await gatherInputs(flags);
36
+ const targetPath = flags.targetPath ?? inputs.targetPath;
37
+ const result = await writeScaffold(inputs, targetPath, {
38
+ dryRun: flags.dryRun === true,
39
+ refuseNonEmpty: flags.refuseNonEmpty !== false,
40
+ templatesPath: flags.templatesPath,
41
+ promoteStandards: flags.promoteStandards === true,
42
+ prompter: flags.promoteStandards ? inquirerPrompter : undefined,
43
+ });
44
+ renderSummary(inputs, result, { noColor: flags.noColor === true });
45
+ }
46
+ const program = new Command();
47
+ program
48
+ .name("z2w-starter-kit")
49
+ .description("Scaffold a new Zero2Webmaster project.")
50
+ .version(version, "-v, --version");
51
+ program
52
+ .command("init")
53
+ .description("Scaffold a new project (brief-first; --wizard for fallback; --input for non-interactive)")
54
+ .option("--wizard", "skip the brief prompt and run the 8-question wizard")
55
+ .option("--dry-run", "print the file list + contents without writing to disk")
56
+ .option("--input <source>", "load ScaffoldInputs JSON from a file path, or '-' for stdin (bypasses brief/wizard)")
57
+ .option("--target-path <path>", "absolute path to scaffold into (defaults to inputs.targetPath)")
58
+ .option("--templates-path <path>", "absolute path to the Templates folder (default: ~/Desktop/Zero2Webmaster/AI/Templates)")
59
+ .option("--promote-standards", "run the (a) inline / (b) promote-into-Templates dialog per applicable standard")
60
+ .option("--allow-non-empty", "allow writes into a non-empty target directory (default: refuse)")
61
+ .option("--no-color", "disable colored output (default: auto-detect TTY)")
62
+ .action(async (opts) => {
63
+ try {
64
+ await runInit({
65
+ wizard: opts["wizard"] === true,
66
+ dryRun: opts["dryRun"] === true,
67
+ input: typeof opts["input"] === "string" ? opts["input"] : undefined,
68
+ targetPath: typeof opts["targetPath"] === "string" ? opts["targetPath"] : undefined,
69
+ templatesPath: typeof opts["templatesPath"] === "string" ? opts["templatesPath"] : undefined,
70
+ promoteStandards: opts["promoteStandards"] === true,
71
+ refuseNonEmpty: opts["allowNonEmpty"] !== true,
72
+ noColor: opts["color"] === false,
73
+ });
74
+ }
75
+ catch (err) {
76
+ const message = err instanceof WriterError ? err.message : err.message;
77
+ process.stderr.write(`\nerror: ${message}\n`);
78
+ process.exit(1);
79
+ }
80
+ });
81
+ program.parseAsync(process.argv);
82
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,mCAAmC;AACnC,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,6EAA6E;AAC7E,2EAA2E;AAE3E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,aAAa,EAAiB,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAuB,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE7E,MAAM,gBAAgB,GAAa,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,CAC3D,aAAa,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;AAapD,KAAK,UAAU,YAAY,CAAC,KAAgB;IAC1C,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAChB,OAAO,kBAAkB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjB,OAAO,SAAS,CAAC,EAAE,QAAQ,EAAE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GAAG,EAAE,CAAC;QACb,MAAM,OAAO,GACX,GAAG,YAAY,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAE,GAAa,CAAC,OAAO,CAAC;QACpE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,OAAO,IAAI,CAAC,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,45 @@
1
+ import type { ParsedBrief } from "./parse-brief.js";
2
+ import type { BrandPreset, CustomBrandInputs, DbStrategy, ProjectType, ScaffoldInputs } from "./index.js";
3
+ export type Prompter = (message: string, defaultValue?: string) => Promise<string>;
4
+ export interface ConfirmOptions {
5
+ prompter: Prompter;
6
+ output?: NodeJS.WritableStream;
7
+ /** Skips on-disk checks for the target path; tests set this to true. */
8
+ skipFsChecks?: boolean;
9
+ }
10
+ export declare const PROJECT_TYPES: readonly ProjectType[];
11
+ export declare const BRANDS: readonly BrandPreset[];
12
+ export declare const DB_STRATEGIES: readonly DbStrategy[];
13
+ export declare const UNSET_PLACEHOLDER = "[unset \u2014 please type]";
14
+ type ParseResult<T> = {
15
+ ok: true;
16
+ value: T;
17
+ } | {
18
+ ok: false;
19
+ error: string;
20
+ };
21
+ interface Draft {
22
+ slug: string | null;
23
+ description: string | null;
24
+ projectType: ProjectType | null;
25
+ brand: BrandPreset | null;
26
+ githubOrg: string | null;
27
+ targetPath: string | null;
28
+ dbStrategy: DbStrategy | null;
29
+ hasWebUi: boolean | null;
30
+ hasCron: boolean | null;
31
+ participateInBulletin: boolean | null;
32
+ customBrand: CustomBrandInputs | null;
33
+ }
34
+ export declare function renderDraft(draft: Draft): string;
35
+ export declare function parseSlug(raw: string): ParseResult<string>;
36
+ /**
37
+ * Display the parsed brief as a numbered checklist and loop until the user
38
+ * accepts a complete-and-valid state.
39
+ *
40
+ * The user types a field number to edit; an empty line accepts. The loop
41
+ * refuses to accept while any field is still `[unset — please type]`.
42
+ */
43
+ export declare function confirmInputs(parsed: ParsedBrief, opts: ConfirmOptions): Promise<ScaffoldInputs>;
44
+ export {};
45
+ //# sourceMappingURL=confirm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirm.d.ts","sourceRoot":"","sources":["../src/confirm.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAOpD,OAAO,KAAK,EACV,WAAW,EACX,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAEnF,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IAC/B,wEAAwE;IACxE,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAQ/C,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,SAAS,WAAW,EAKxC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,SAAS,UAAU,EAO9C,CAAC;AAEF,eAAO,MAAM,iBAAiB,+BAA0B,CAAC;AAEzD,KAAK,WAAW,CAAC,CAAC,IAAI;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5E,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE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