@haus-tech/haus-workflow 0.18.1 → 0.19.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 (61) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/cli.js +320 -288
  4. package/library/catalog/manifest.json +1 -1
  5. package/library/global/commands/haus-clone.md +32 -0
  6. package/library/global/skills/haus-workflow/SKILL.md +18 -9
  7. package/package.json +4 -8
  8. package/tests/README.md +0 -54
  9. package/tests/fixtures/catalog/agents/code-reviewer.md +0 -15
  10. package/tests/fixtures/catalog/agents/docs-researcher.md +0 -15
  11. package/tests/fixtures/catalog/agents/planner.md +0 -15
  12. package/tests/fixtures/catalog/agents/security-reviewer.md +0 -15
  13. package/tests/fixtures/catalog/agents/test-reviewer.md +0 -15
  14. package/tests/fixtures/catalog/manifest.json +0 -1065
  15. package/tests/fixtures/catalog/policy-gates-manifest.json +0 -120
  16. package/tests/fixtures/catalog/skills/auth-oidc-azure-bankid-patterns/SKILL.md +0 -14
  17. package/tests/fixtures/catalog/skills/bullmq-patterns/SKILL.md +0 -14
  18. package/tests/fixtures/catalog/skills/database-patterns/SKILL.md +0 -14
  19. package/tests/fixtures/catalog/skills/dotnet-patterns/SKILL.md +0 -14
  20. package/tests/fixtures/catalog/skills/dotnet-service-patterns/SKILL.md +0 -14
  21. package/tests/fixtures/catalog/skills/eslint-setup/SKILL.md +0 -14
  22. package/tests/fixtures/catalog/skills/expo-react-native-patterns/SKILL.md +0 -14
  23. package/tests/fixtures/catalog/skills/global-engineering-rules/SKILL.md +0 -14
  24. package/tests/fixtures/catalog/skills/i18next-patterns/SKILL.md +0 -14
  25. package/tests/fixtures/catalog/skills/jest-patterns/SKILL.md +0 -14
  26. package/tests/fixtures/catalog/skills/laravel-nova-patterns/SKILL.md +0 -14
  27. package/tests/fixtures/catalog/skills/laravel-patterns/SKILL.md +0 -14
  28. package/tests/fixtures/catalog/skills/nestjs-graphql-patterns/SKILL.md +0 -14
  29. package/tests/fixtures/catalog/skills/nextauth-patterns/SKILL.md +0 -14
  30. package/tests/fixtures/catalog/skills/nextjs-patterns/SKILL.md +0 -14
  31. package/tests/fixtures/catalog/skills/nx21-monorepo-patterns/SKILL.md +0 -14
  32. package/tests/fixtures/catalog/skills/package-manager-yarn4-pnpm89/SKILL.md +0 -14
  33. package/tests/fixtures/catalog/skills/phpunit-patterns/SKILL.md +0 -14
  34. package/tests/fixtures/catalog/skills/playwright-patterns/SKILL.md +0 -14
  35. package/tests/fixtures/catalog/skills/prettier-setup/SKILL.md +0 -14
  36. package/tests/fixtures/catalog/skills/prisma-patterns/SKILL.md +0 -14
  37. package/tests/fixtures/catalog/skills/production-readiness-review/SKILL.md +0 -14
  38. package/tests/fixtures/catalog/skills/qliro-patterns/SKILL.md +0 -14
  39. package/tests/fixtures/catalog/skills/radix-shadcn-patterns/SKILL.md +0 -14
  40. package/tests/fixtures/catalog/skills/react-router-v7-patterns/SKILL.md +0 -14
  41. package/tests/fixtures/catalog/skills/react19-patterns/SKILL.md +0 -14
  42. package/tests/fixtures/catalog/skills/sanity-patterns/SKILL.md +0 -14
  43. package/tests/fixtures/catalog/skills/security-review/SKILL.md +0 -14
  44. package/tests/fixtures/catalog/skills/sentry-patterns/SKILL.md +0 -14
  45. package/tests/fixtures/catalog/skills/storybook-patterns/SKILL.md +0 -14
  46. package/tests/fixtures/catalog/skills/strapi-patterns/SKILL.md +0 -14
  47. package/tests/fixtures/catalog/skills/stripe-patterns/SKILL.md +0 -14
  48. package/tests/fixtures/catalog/skills/supabase-patterns/SKILL.md +0 -14
  49. package/tests/fixtures/catalog/skills/tailwind-scss-patterns/SKILL.md +0 -14
  50. package/tests/fixtures/catalog/skills/tanstack-query-router-patterns/SKILL.md +0 -14
  51. package/tests/fixtures/catalog/skills/testing-library-patterns/SKILL.md +0 -14
  52. package/tests/fixtures/catalog/skills/turbo-monorepo-patterns/SKILL.md +0 -14
  53. package/tests/fixtures/catalog/skills/typescript5-patterns/SKILL.md +0 -14
  54. package/tests/fixtures/catalog/skills/vendure-app-patterns/SKILL.md +0 -14
  55. package/tests/fixtures/catalog/skills/vendure-plugin-patterns/SKILL.md +0 -14
  56. package/tests/fixtures/catalog/skills/vite8-patterns/SKILL.md +0 -14
  57. package/tests/fixtures/catalog/skills/vitest-patterns/SKILL.md +0 -14
  58. package/tests/fixtures/catalog/skills/vue-patterns/SKILL.md +0 -14
  59. package/tests/fixtures/catalog/skills/wordpress-acf-elementor-jetengine-patterns/SKILL.md +0 -14
  60. package/tests/fixtures/catalog/skills/wordpress-bedrock-patterns/SKILL.md +0 -14
  61. package/tests/fixtures/catalog/skills/wordpress-patterns/SKILL.md +0 -14
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.6.1",
2
+ "version": "2.6.2",
3
3
  "items": [
4
4
  {
5
5
  "id": "haus.nextjs-patterns",
@@ -0,0 +1,32 @@
1
+ Clone repositories for this project. Per-repo setup (install, Docker, `.env`) is a separate step that isn't wired yet — this command only gets repos onto disk.
2
+
3
+ Cloning a single repo is always `haus clone <url> [dir]`. This command picks _which_ repos to clone and runs that primitive for each. There are two modes, chosen by whether a name was given.
4
+
5
+ ## Mode A — a project name was given (`project:clone <name>`)
6
+
7
+ Find one repo by name on GitHub and clone it. Does **not** require a workspace or `repos.manifest.json`.
8
+
9
+ 1. Make sure GitHub CLI is ready: run `gh auth status`. If not authenticated, tell the user to run `gh auth login` and stop.
10
+ 2. Scope the search to repos the user owns or belongs to: get their login with `gh api user -q .login` and their orgs with `gh api user/orgs -q '.[].login'`.
11
+ 3. Search by name, passing one `--owner` per login/org from step 2:
12
+ `gh search repos "<name>" --match name --limit 10 --json fullName,description,url,isPrivate,pushedAt --owner <login> [--owner <org> …]`
13
+ If that returns nothing, retry **without** `--owner` (a broader, all-of-GitHub search) and tell the user you widened it.
14
+ 4. Decide from the results:
15
+ - **0 matches** — tell the user nothing matched `<name>`; offer to try a different name or broaden. Stop.
16
+ - **1 match** — show `fullName` + description and confirm "Clone this one?" before proceeding.
17
+ - **2+ matches** — use `AskUserQuestion` to let the user pick which repo (list each `fullName` with its description; private repos noted). Include a final option like "None of these — search again / broaden" so they can refine.
18
+ 5. Clone the chosen repo with `haus clone <url> [dir]`, using the `url` from the search result. Default target is a folder named after the repo under the current directory; confirm where it will land before running. Quote the exact command first.
19
+ 6. Report the result (cloned / skipped if already present / failed). Remind the user that installing dependencies and configuring the repo is still a manual step for now.
20
+
21
+ ## Mode B — no name was given (`project:clone`)
22
+
23
+ Clone a whole **workspace** from its manifest. Workspace-only (a `repos.manifest.json` at the repo root); for a lone repo without a manifest, use Mode A with a name instead.
24
+
25
+ 1. Confirm `repos.manifest.json` exists at the workspace root. If not, tell the user this mode is for multi-repo workspaces (or they can pass a `<name>` to clone a single repo) and stop.
26
+ 2. Read `repos.manifest.json`. Each entry has an `id`, a `folder`, and a git URL (`repo`). If entries have no `repo` URL, ask the user to add them (or supply the URLs) — `haus clone` needs a URL per repo.
27
+ 3. Read `repos.local.json` if present — its `pathOverrides` map (`folder` → absolute path) marks repos the user already has locally.
28
+ 4. Ask the user, via `AskUserQuestion`, how to obtain the repos:
29
+ - **Clean clone** — clone every manifest repo fresh into its `folder` under the workspace.
30
+ - **Reuse local** — skip any repo already in `repos.local.json` `pathOverrides`; clone only the rest.
31
+ 5. For each repo to clone, run (quoting it first): `haus clone <repo-url> <folder>` from the workspace root. Offer `--dry-run` first if the user wants a preview. If one repo fails, report it and continue to the next.
32
+ 6. After the loop, report which repos were cloned, skipped (already present or reused local), and failed. Remind the user that installing dependencies and configuring each repo (`.env`, services) is still a manual step for now.
@@ -21,15 +21,16 @@ The unprefixed verbs (`update`, `catalog`, `install`, `uninstall`) act on **this
21
21
  haus install** (`~/.claude`, npm) — they manage the haus tool itself, like `npm install -g`.
22
22
  The short legacy aliases still work but the names below are canonical.
23
23
 
24
- | Task name (legacy aliases) | Command | Scope | What it does |
25
- | ----------------------------------------------------------------- | ----------------------- | ------- | ------------------------------------------------------------------------------------------- |
26
- | `project:init` (`setup`, `init`) | _Setup procedure below_ | project | First-time setup of an **existing** repo: adds AI skills, commands, workflow + project docs |
27
- | `project:refresh` (`apply`, `refresh`, `claude-md`, `regenerate`) | `haus apply --write` | project | Re-run setup / refresh `.claude/` context + regenerate root `CLAUDE.md` import block |
28
- | `project:doctor` (`doctor`, `check`) | `haus doctor` | project | Check for install drift |
29
- | `update` (`upgrade`) | `haus update` | global | Update npm package + catalog + `~/.claude/` (also refreshes this project) |
30
- | `catalog` | `haus update` | global | Fetch latest catalog (same command as update) |
31
- | `install` (`global`) | `haus install` | global | Seed `~/.claude/` with haus-owned files |
32
- | `uninstall` | `haus uninstall` | global | Remove all haus global files from `~/.claude/` |
24
+ | Task name (legacy aliases) | Command | Scope | What it does |
25
+ | ----------------------------------------------------------------- | ----------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------- |
26
+ | `project:init` (`setup`, `init`) | _Setup procedure below_ | project | First-time setup of an **existing** repo: adds AI skills, commands, workflow + project docs |
27
+ | `project:clone [name]` (`clone`) | _Clone procedure below_ | project | No name: clone a **workspace**'s repos from `repos.manifest.json`. With a `name`: find & clone one repo by name from GitHub |
28
+ | `project:refresh` (`apply`, `refresh`, `claude-md`, `regenerate`) | `haus apply --write` | project | Re-run setup / refresh `.claude/` context + regenerate root `CLAUDE.md` import block |
29
+ | `project:doctor` (`doctor`, `check`) | `haus doctor` | project | Check for install drift |
30
+ | `update` (`upgrade`) | `haus update` | global | Update npm package + catalog + `~/.claude/` (also refreshes this project) |
31
+ | `catalog` | `haus update` | global | Fetch latest catalog (same command as update) |
32
+ | `install` (`global`) | `haus install` | global | Seed `~/.claude/` with haus-owned files |
33
+ | `uninstall` | `haus uninstall` | global | Remove all haus global files from `~/.claude/` |
33
34
 
34
35
  ## Step 1 — Determine the task
35
36
 
@@ -48,6 +49,8 @@ Options:
48
49
  (haus update — checks npm for new version, fetches catalog, refreshes ~/.claude/)
49
50
  4. [global] catalog — fetch catalog updates only
50
51
  (haus update — same command; pulls latest workflow templates and lockfile)
52
+ 5. [project] project:clone [name] — clone repos
53
+ (no name: clone a workspace from repos.manifest.json; with a name: find & clone one repo by name from GitHub)
51
54
  ```
52
55
 
53
56
  Map the user's selection to the command from the alias table, then continue to Step 2.
@@ -58,6 +61,8 @@ Run the mapped command via Bash. Quote the exact command you are running before
58
61
 
59
62
  **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.
60
63
 
64
+ **Exception — `project:clone` (`clone`):** this asks the user a question before running, so it is a short procedure too. Skip to **Clone (`project:clone`)** under Step 3 and follow it.
65
+
61
66
  ## Step 3 — Post-run steps
62
67
 
63
68
  After the command completes, follow the relevant post-run steps below.
@@ -67,6 +72,10 @@ After the command completes, follow the relevant post-run steps below.
67
72
  1. Open and follow `~/.claude/commands/haus-setup.md` — the installed `haus-setup` command (in some projects also `.claude/commands/haus-setup.md`). Run every step in order. It detects the stack, asks the guided questions, runs `haus apply --write` (scaffolding, skills, commands, rules, docs skill), writes the **project docs** (`CLAUDE.md` body + `docs/`) and `.haus-workflow/deep-context.json`, runs `haus recommend`, applies the newly-matched helpers, and confirms.
68
73
  2. Then fill `.haus-workflow/workflow-config.md` — replace every placeholder (`TODO`, `n/a`, empty): test/lint/typecheck/build commands (check `package.json`), docs paths, validation library, pre-commit tool, highest-stakes logic (ask if unclear). Leave none.
69
74
 
75
+ ### Clone (`project:clone`)
76
+
77
+ 1. Open and follow `~/.claude/commands/haus-clone.md` — the installed `haus-clone` command. With a `name` argument it finds and clones one matching repo from GitHub; with no argument it clones a workspace's repos from `repos.manifest.json`. Per-repo setup (install, Docker, env) is a separate step that isn't wired yet, so just get the repos in place for now.
78
+
70
79
  ### After `haus apply --write`
71
80
 
72
81
  Verify that the root `CLAUDE.md` imports all three haus files:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haus-tech/haus-workflow",
3
- "version": "0.18.1",
3
+ "version": "0.19.0",
4
4
  "description": "Haus AI workflow CLI for Claude Code.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,7 +16,6 @@
16
16
  "scripts/postinstall.mjs",
17
17
  "library/global",
18
18
  "library/catalog",
19
- "tests/fixtures/catalog",
20
19
  "README.md",
21
20
  "CHANGELOG.md"
22
21
  ],
@@ -26,16 +25,15 @@
26
25
  "test": "node --import tsx --test tests/**/*.test.js",
27
26
  "test:coverage": "c8 yarn test",
28
27
  "coverage:check": "c8 --check-coverage yarn test",
29
- "lint": "eslint src scripts",
28
+ "lint": "eslint src",
30
29
  "format:check": "prettier --check .",
31
30
  "format": "prettier --write .",
32
31
  "typecheck": "tsc --noEmit",
33
- "typecheck:scripts": "tsc --noEmit --project tsconfig.scripts.json",
34
32
  "pack:local": "yarn pack",
35
33
  "release": "GITHUB_TOKEN=$(gh auth token) release-it",
36
34
  "release:dry": "GITHUB_TOKEN=$(gh auth token) release-it --dry-run",
37
35
  "prepack": "yarn build",
38
- "verify": "yarn typecheck && yarn typecheck:scripts && yarn lint && yarn build && yarn test",
36
+ "verify": "yarn typecheck && yarn lint && yarn build && yarn test",
39
37
  "verify:full": "yarn verify && yarn coverage:check",
40
38
  "postinstall": "node ./scripts/postinstall.mjs || true",
41
39
  "prepare": "lefthook install || true",
@@ -49,10 +47,8 @@
49
47
  "fast-glob": "3.3.3",
50
48
  "fs-extra": "11.3.5",
51
49
  "ignore": "6.0.2",
52
- "picomatch": "4.0.4",
53
50
  "semver": "7.8.0",
54
- "yaml": "2.8.4",
55
- "zod": "3.25.76"
51
+ "yaml": "2.8.4"
56
52
  },
57
53
  "devDependencies": {
58
54
  "@release-it/conventional-changelog": "11.0.0",
package/tests/README.md DELETED
@@ -1,54 +0,0 @@
1
- # Tests
2
-
3
- Node built-in test runner (`node --test`). No framework. All test files are `.js` (compiled output not required — tests import from `dist/` via `fixture-runner.js`).
4
-
5
- ```bash
6
- yarn test
7
- ```
8
-
9
- ## Structure
10
-
11
- | Path | Contents |
12
- | ----------------- | ----------------------------------- |
13
- | `tests/*.test.js` | Unit and integration tests |
14
- | `tests/helpers/` | Shared test utilities |
15
- | `tests/fixtures/` | Static fixture repos used by tests |
16
-
17
- ## helpers/fixture-runner.js
18
-
19
- Utilities for running the compiled CLI against fixture repos in a temp directory:
20
-
21
- - `cloneFixtureToTemp(fixtureName)` — copies `tests/fixtures/repos/<name>` to a temp dir, returns the path
22
- - `runHaus(cwd, command)` — runs `node dist/cli.js <command>` in `cwd`, returns stdout
23
- - `readHausJson(cwd, fileName)` — reads `.haus-workflow/<fileName>` as parsed JSON
24
-
25
- Tests that use `fixture-runner.js` require a built `dist/` — run `yarn build && yarn test`, or use `yarn verify` which builds before running tests.
26
-
27
- ## fixtures/
28
-
29
- ### fixtures/repos/
30
-
31
- Full fixture repos scanned by integration tests and golden tests. Each subdirectory is a minimal repo skeleton:
32
-
33
- | Fixture | Stack |
34
- | -------------------------------- | ------------------------------------- |
35
- | `laravel-app` | Laravel (PHP, Composer, PHPUnit) |
36
- | `laravel-with-react-frontend` | Laravel + React (pnpm) |
37
- | `nest-graphql-api` | NestJS + GraphQL (Yarn) |
38
- | `nextjs-app` | Next.js (pnpm) |
39
- | `nx-workspace` | Nx monorepo (Yarn) |
40
- | `orphan-graphql-config` | GraphQL config without backend (pnpm) |
41
- | `turbo-monorepo` | Turborepo (Yarn) |
42
- | `vendure-monorepo` | Vendure e-commerce (Yarn) |
43
- | `vendure-with-nextjs-storefront` | Vendure + Next.js storefront (Yarn) |
44
- | `wordpress-bedrock-site` | WordPress Bedrock (Composer) |
45
- | `wordpress-with-node-tooling` | WordPress + Node tooling (pnpm) |
46
-
47
- ### Other fixture dirs
48
-
49
- - `fixtures/dotnet-service/` — unsupported stack (C#/.NET), used to verify unsupported-stack handling
50
- - `fixtures/unsupported-go/` — unsupported stack (Go)
51
- - `fixtures/unsupported-python/` — unsupported stack (Python)
52
- - `fixtures/vendure-plugin/` — minimal Vendure plugin package
53
- - `fixtures/laravel-app/`, `fixtures/next-react-app/`, `fixtures/wordpress-bedrock/` — legacy shallow fixtures; prefer `fixtures/repos/` equivalents for new tests
54
-
@@ -1,15 +0,0 @@
1
- ---
2
- description: Fixture stub agent for CLI tests.
3
- ---
4
-
5
- ## Use when
6
-
7
- Use when working on the relevant task.
8
-
9
- ## Do not use when
10
-
11
- Do not use for unrelated tasks.
12
-
13
- ## Verification
14
-
15
- Check that the output matches expectations.
@@ -1,15 +0,0 @@
1
- ---
2
- description: Fixture stub agent for CLI tests.
3
- ---
4
-
5
- ## Use when
6
-
7
- Use when working on the relevant task.
8
-
9
- ## Do not use when
10
-
11
- Do not use for unrelated tasks.
12
-
13
- ## Verification
14
-
15
- Check that the output matches expectations.
@@ -1,15 +0,0 @@
1
- ---
2
- description: Fixture stub agent for CLI tests.
3
- ---
4
-
5
- ## Use when
6
-
7
- Use when working on the relevant task.
8
-
9
- ## Do not use when
10
-
11
- Do not use for unrelated tasks.
12
-
13
- ## Verification
14
-
15
- Check that the output matches expectations.
@@ -1,15 +0,0 @@
1
- ---
2
- description: Fixture stub agent for CLI tests.
3
- ---
4
-
5
- ## Use when
6
-
7
- Use when working on the relevant task.
8
-
9
- ## Do not use when
10
-
11
- Do not use for unrelated tasks.
12
-
13
- ## Verification
14
-
15
- Check that the output matches expectations.
@@ -1,15 +0,0 @@
1
- ---
2
- description: Fixture stub agent for CLI tests.
3
- ---
4
-
5
- ## Use when
6
-
7
- Use when working on the relevant task.
8
-
9
- ## Do not use when
10
-
11
- Do not use for unrelated tasks.
12
-
13
- ## Verification
14
-
15
- Check that the output matches expectations.