@haus-tech/haus-workflow 2.0.0 → 3.0.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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "6.0.0",
2
+ "version": "6.0.1",
3
3
  "manifestFormat": 2,
4
4
  "globalPlugins": [
5
5
  {
@@ -1270,8 +1270,8 @@
1270
1270
  "path": "configs/eslint/eslint.config.mjs",
1271
1271
  "title": "Haus ESLint config",
1272
1272
  "purpose": "ESLint 9.x flat config for Haus Tech TypeScript/React projects.",
1273
- "whenToUse": "Recommended when `eslint` is missing from the repo. Run `haus scaffold haus.eslint-config` to copy the config into the project root.",
1274
- "whenNotToUse": "Do not scaffold if the project already has a custom ESLint config that extends beyond the Haus baseline.",
1273
+ "whenToUse": "Recommended when `eslint` is missing from the repo. Run `haus configs haus.eslint-config` to copy the config into the project root.",
1274
+ "whenNotToUse": "Skip it if the project already has a custom ESLint config that extends beyond the Haus baseline.",
1275
1275
  "tags": ["eslint", "tooling", "quality"],
1276
1276
  "repoRoles": [],
1277
1277
  "requiresAny": [
@@ -1582,8 +1582,8 @@
1582
1582
  "path": "configs/prettier",
1583
1583
  "title": "Haus Prettier config",
1584
1584
  "purpose": "Prettier config and .prettierignore for Haus Tech projects.",
1585
- "whenToUse": "Recommended when `prettier` is missing from the repo. Run `haus scaffold haus.prettier-config` to copy the config into the project root.",
1586
- "whenNotToUse": "Do not scaffold if the project already has a custom Prettier config.",
1585
+ "whenToUse": "Recommended when `prettier` is missing from the repo. Run `haus configs haus.prettier-config` to copy the config into the project root.",
1586
+ "whenNotToUse": "Skip it if the project already has a custom Prettier config.",
1587
1587
  "tags": ["prettier", "tooling", "quality"],
1588
1588
  "repoRoles": [],
1589
1589
  "requiresAny": [
@@ -29,6 +29,7 @@ repo's files. The short legacy aliases still work but the names below are canoni
29
29
  | `project:reinit` (`reinit`, `re-init`) | _Reinit procedure below_ | project | **Full re-setup.** Removes all haus-managed project files (backed up first, user content preserved), then re-runs `project:init` from scratch |
30
30
  | `project:clone [name]` (`clone`) | _Clone procedure below_ | project | With a `name`: find & clone one repo by name from GitHub. No name: asks single-repo-vs-workspace first, then either mode — workspace mode clones from `repos.manifest.json` |
31
31
  | `project:cloneandsetup [name]` (`cloneandsetup`) | _Clone & setup procedure below_ | project | Run `project:clone`, then set up each repo for local dev — deps, databases, cross-repo links, and env — via each repo's `.haus-workflow/localdev.yml` (+ the workspace's order/links/env) |
32
+ | `project:new [stack] [name]` (`new`, `create`) | _New-project procedure below_ | project | Create a **brand-new** project from an allowed stack (Next.js, Vite+React, NestJS, Expo): scaffold, haus configs, git + GitHub repo, then full init |
32
33
  | `project:add-skills` (`add-skills`, `opt-in`) | _Add-skills procedure below_ | project | Add optional skills, agents, or config (ESLint/Prettier) to an already-set-up project without re-running full setup |
33
34
  | `project:refresh` (`apply`, `refresh`, `claude-md`, `regenerate`) | _Refresh procedure below_ | project | **Full non-destructive sync.** Updates the haus package + catalog first, then re-runs `project:init`'s pipeline in place — nothing is removed up front; new catalog items get added, changed ones updated, and anything removed upstream gets pruned by `apply`'s existing orphan-pruning |
34
35
  | `project:doctor` (`doctor`, `check`) | `haus doctor` | project | Check for install drift |
@@ -43,7 +44,7 @@ repo's files. The short legacy aliases still work but the names below are canoni
43
44
  **If a task argument was passed:** look it up in the alias table above. If no match, tell the user and list valid options. If matched, skip to Step 2.
44
45
 
45
46
  **If no task was passed:** the menu has more options than one `AskUserQuestion` question can
46
- hold (max 4 options per question). Page through all 12 tasks in batches: each page shows the
47
+ hold (max 4 options per question). Page through all 13 tasks in batches: each page shows the
47
48
  next 3 tasks plus a 4th "More options" choice, except the last page, which shows whatever
48
49
  tasks remain (≤4) with no continuation choice — nothing is dropped, and this pattern
49
50
  generalizes automatically if a task is ever added to or removed from the alias table above
@@ -56,39 +57,41 @@ Question 1: "What would you like to do?"
56
57
  Options:
57
58
  1. [project] project:init — add haus to an existing project for the first time
58
59
  (AI skills + commands + workflow into a repo you already have, then a deep read to write the CLAUDE.md docs body + docs/)
59
- 2. [project] project:refresh — full non-destructive sync with the latest haus
60
+ 2. [project] project:new [stack] [name] — create a brand-new project from an allowed stack
61
+ (Next.js, Vite+React, NestJS, Expo — scaffold, haus configs, git + GitHub repo, then full init)
62
+ 3. [project] project:refresh — full non-destructive sync with the latest haus
60
63
  (updates the haus package + catalog, then re-runs setup in place — nothing removed first)
61
- 3. [project] project:clone [name] — clone repos
62
- (picked from here with no name yet — clone.md will ask whether it's a single repo or a whole workspace next)
63
- 4. [—] More options — see: project:cloneandsetup, project:add-skills, project:reinit, and 6 more
64
+ 4. [—] More options — see: project:clone, project:cloneandsetup, project:add-skills, and 7 more
64
65
 
65
66
  Question 2: "What would you like to do?" (only shown if "More options" was picked)
66
67
  Options:
67
- 1. [project] project:cloneandsetup [name] — clone repos, then set them up for local dev
68
+ 1. [project] project:clone [name] — clone repos
69
+ (picked from here with no name yet — clone.md will ask whether it's a single repo or a whole workspace next)
70
+ 2. [project] project:cloneandsetup [name] — clone repos, then set them up for local dev
68
71
  (project:clone — asking single-repo-vs-workspace since no name is known yet — then per-repo deps + databases + cross-repo links + env from localdev.yml)
69
- 2. [project] project:add-skills — add optional skills, agents, or config to this project
72
+ 3. [project] project:add-skills — add optional skills, agents, or config to this project
70
73
  (offers opt-in helpers matching your stack that aren't installed yet — no full re-setup)
71
- 3. [project] project:reinit — full re-setup from scratch
72
- (removes all haus-managed project files, backed up first, then re-runs project:init)
73
- 4. [—] More options — see: update, project:doctor, project:fix, and 3 more
74
+ 4. [—] More options — see: project:reinit, update, project:doctor, and 4 more
74
75
 
75
76
  Question 3: "What would you like to do?" (only shown if "More options" was picked again)
76
77
  Options:
77
- 1. [global] update — update haus package + catalog + global files
78
+ 1. [project] project:reinit — full re-setup from scratch
79
+ (removes all haus-managed project files, backed up first, then re-runs project:init)
80
+ 2. [global] update — update haus package + catalog + global files
78
81
  (haus update — checks npm for new version, fetches catalog, refreshes ~/.claude/)
79
- 2. [project] project:doctor — check for install drift
82
+ 3. [project] project:doctor — check for install drift
80
83
  (haus doctor — a one-line plain-language verdict, healthy or a list of what needs attention)
81
- 3. [project] project:fix — diagnose and fix install drift
82
- (runs doctor, applies the suggested fixes, confirms green)
83
- 4. [—] More options — see: install, uninstall, help
84
+ 4. [—] More options — see: project:fix, install, uninstall, help
84
85
 
85
86
  Question 4: "What would you like to do?" (only shown if "More options" was picked a third time — last page, no further continuation)
86
87
  Options:
87
- 1. [global] install — seed ~/.claude/ with haus-owned files
88
+ 1. [project] project:fix — diagnose and fix install drift
89
+ (runs doctor, applies the suggested fixes, confirms green)
90
+ 2. [global] install — seed ~/.claude/ with haus-owned files
88
91
  (haus install)
89
- 2. [global] uninstall — remove all haus global files from ~/.claude/
92
+ 3. [global] uninstall — remove all haus global files from ~/.claude/
90
93
  (haus uninstall)
91
- 3. [—] help — explain what haus-workflow is and list all available tasks
94
+ 4. [—] help — explain what haus-workflow is and list all available tasks
92
95
  (touches no files — points to docs/cli.md and docs/runbook.md for depth)
93
96
  ```
94
97
 
@@ -98,7 +101,7 @@ Map the user's selection to the command from the alias table, then continue to S
98
101
 
99
102
  Run the mapped command via Bash. Quote the exact command you are running before executing it.
100
103
 
101
- **Exception — `project:init` (`setup` / `init`):** this maps to a multi-step procedure, not a single command. Do not run a bare `haus init`. Skip to **Setup (`project:init`)** under Step 3 and follow it.
104
+ **Exception — `project:init` (`setup` / `init`):** this maps to a multi-step procedure that drives `haus init --json --dry-run` plus follow-up commands, not a single command. Skip to **Setup (`project:init`)** under Step 3 and follow it.
102
105
 
103
106
  **Exception — `project:reinit` (`reinit` / `re-init`):** removes files before re-running setup. Skip to **Reinit (`project:reinit`)** under Step 3 and follow it.
104
107
 
@@ -106,6 +109,8 @@ Run the mapped command via Bash. Quote the exact command you are running before
106
109
 
107
110
  **Exception — `project:cloneandsetup` (`cloneandsetup`):** clone followed by a per-repo setup pass, with confirmations. Skip to **Clone & setup (`project:cloneandsetup`)** under Step 3 and follow it.
108
111
 
112
+ **Exception — `project:new` (`new` / `create`):** collects the stack/name/org/visibility via `AskUserQuestion` and drives `haus new` non-interactively — not a single command. Skip to **New project (`project:new`)** under Step 3 and follow it.
113
+
109
114
  **Exception — `project:add-skills` (`add-skills` / `opt-in`):** a short scan → recommend → choose → apply procedure. Skip to **Add optional skills (`project:add-skills`)** under Step 3 and follow it.
110
115
 
111
116
  **Exception — `project:refresh` (`apply` / `refresh` / `claude-md` / `regenerate`):** updates the haus package first, then re-runs the setup pipeline — not a single command. Skip to **Refresh (`project:refresh`)** under Step 3 and follow it.
@@ -164,6 +169,10 @@ upstream gets pruned automatically by `apply`'s existing orphan-pruning.
164
169
 
165
170
  1. Open and follow `references/cloneandsetup.md` in this skill's directory — it runs the full `project:clone` flow (including clone.md's Step 0 when no name is already known), then sets up each cloned repo locally: selects the node version (`nvm install` from `.nvmrc`), enables corepack, installs JS/PHP dependencies, and seeds `.env`, confirming before each phase. It does not start servers.
166
171
 
172
+ ### New project (`project:new`)
173
+
174
+ 1. Open and follow `references/new.md` in this skill's directory. It lists allowed stacks via `haus new --list --json`, collects the stack/name/org/visibility with `AskUserQuestion`, previews with `--dry-run`, confirms, then runs `haus new <stack> <name> --json --yes [flags]` for real and narrates the JSON result — including relaying any failure `detail` (resume commands) verbatim and surfacing `installHint`. Never run bare interactive `haus new`.
175
+
167
176
  ### Add optional skills (`project:add-skills`)
168
177
 
169
178
  For a project that's already set up but where the user wants more helpers later —
@@ -184,8 +193,8 @@ choices.
184
193
  with one option per group / config item. Then:
185
194
  - Skills/agents → `haus recommend --include <id> <id> …`, then
186
195
  `haus apply --write`.
187
- - Config → `haus scaffold <id>` (add `--force` only if the user chose to
188
- replace an existing file; scaffold preserves files by default).
196
+ - Config → `haus configs <id>` (add `--force` only if the user chose to
197
+ replace an existing file; configs preserves files by default).
189
198
  5. Confirm with the names added and their combined token estimate, e.g.
190
199
  "Added 2 optional helpers: Code review workflow, TDD workflow (~3k tokens)."
191
200
 
@@ -6,7 +6,7 @@ commands; they read plain language and approve.
6
6
 
7
7
  Do this in order:
8
8
 
9
- 1. **Detect.** Run `haus setup-project --json`. Read the JSON yourself —
9
+ 1. **Detect.** Run `haus init --json --dry-run`. Read the JSON yourself —
10
10
  do not show it. Translate what was detected into one or two plain sentences,
11
11
  e.g. "This looks like a Next.js website using Yarn. I found unit tests but no
12
12
  end-to-end tests." If the detection status is `unknown` or `partial`, say so
@@ -47,9 +47,9 @@ Do this in order:
47
47
  `recommendation.json`, so repeated calls would drop the earlier includes.
48
48
  - **Project config** (entries in `recommended[]` with `install: false`, e.g.
49
49
  Haus ESLint / Prettier baselines): offer each as a plain choice ("Add the
50
- Haus ESLint baseline"). On confirm, run `haus scaffold <id>`. `haus scaffold`
50
+ Haus ESLint baseline"). On confirm, run `haus configs <id>`. `haus configs`
51
51
  **preserves existing config files by default** and tells you when a file
52
- already exists — only re-run with `haus scaffold <id> --force` if the user
52
+ already exists — only re-run with `haus configs <id> --force` if the user
53
53
  explicitly chooses to **replace** their current config.
54
54
 
55
55
  If neither list has anything, skip this step silently — don't ask an empty
@@ -0,0 +1,24 @@
1
+ # project:new — create a new project from an allowed stack
2
+
3
+ Drives `haus new` non-interactively. NEVER run bare `haus new` without flags —
4
+ its interactive prompts don't work through the agent; collect answers with
5
+ AskUserQuestion and pass everything as flags.
6
+
7
+ 1. **List stacks.** Run `haus new --list --json`. Present the stacks via
8
+ AskUserQuestion (one option per stack, id + title).
9
+ 2. **Collect inputs.** Ask for: project name (free text; lowercase letters, digits,
10
+ `. _ -`), GitHub org (default: WeAreHausTech; "personal" = omit --org),
11
+ visibility (private default / public), and whether to create the GitHub
12
+ repo at all (default yes; no → add `--no-github`).
13
+ 3. **Preview.** Run
14
+ `haus new <stack> <name> --json --yes --dry-run [--org <org>] [--public] [--no-github]`
15
+ and show the user the planned steps in plain language. Confirm before executing.
16
+ 4. **Execute.** Re-run the same command without `--dry-run`. Parse the JSON:
17
+ - `ok: true` → summarize: project path, repo URL, init result, and the
18
+ `installHint` (dependencies are NOT installed automatically).
19
+ - `ok: false` → report the failed step's `detail` verbatim — it contains the
20
+ exact resume commands (e.g. `gh repo create … && git push -u origin main`).
21
+ Do NOT retry destructively; the project directory is never auto-deleted.
22
+ 5. **Hand off.** Tell the user to `cd <name>` and run the install command from
23
+ `installHint` — the project is fully initialized (no separate `project:init`
24
+ needed).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haus-tech/haus-workflow",
3
- "version": "2.0.0",
3
+ "version": "3.0.0",
4
4
  "description": "Haus AI workflow CLI for Claude Code.",
5
5
  "type": "module",
6
6
  "bin": {