@haus-tech/haus-workflow 0.16.1 → 0.16.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.16.3](https://github.com/WeAreHausTech/haus-workflow/compare/v0.16.2...v0.16.3) (2026-06-09)
4
+
5
+ ### Bug Fixes
6
+
7
+ - **install:** keep skill frontmatter valid by stamping marker as a field ([#79](https://github.com/WeAreHausTech/haus-workflow/issues/79)) ([76ddbf1](https://github.com/WeAreHausTech/haus-workflow/commit/76ddbf1248b8844538363dcfd3744cd975d96f52))
8
+
9
+ ## [0.16.2](https://github.com/WeAreHausTech/haus-workflow/compare/v0.16.1...v0.16.2) (2026-06-09)
10
+
3
11
  ## [0.16.1](https://github.com/WeAreHausTech/haus-workflow/compare/v0.16.0...v0.16.1) (2026-06-09)
4
12
 
5
13
  ## [0.16.0](https://github.com/WeAreHausTech/haus-workflow/compare/v0.15.0...v0.16.0) (2026-06-05)
package/README.md CHANGED
@@ -29,13 +29,17 @@ and configures the repo for you.
29
29
 
30
30
  Once installed, Claude Code gains a `/haus-workflow` slash command.
31
31
 
32
+ The `project:*` tasks act on the current repo. The unprefixed verbs (`update`,
33
+ `catalog`, `install`, `uninstall`) manage the haus tool itself on your machine
34
+ (`~/.claude` + npm), like `npm install -g`. The short legacy names still work.
35
+
32
36
  ```
33
- /haus-workflow # interactive menu — pick setup, update, refresh, etc.
34
- /haus-workflow setup # full first-time setupscaffolding, skills, commands + docs (runs the /haus-setup flow)
35
- /haus-workflow apply # refresh .claude/ and regenerate CLAUDE.md imports
36
- /haus-workflow update # update npm package + catalog + ~/.claude/
37
- /haus-workflow catalog # fetch only latest catalog
38
- /haus-workflow doctor # health check for drift
37
+ /haus-workflow # interactive menu — pick a task
38
+ /haus-workflow project:init # [project] add haus to an EXISTING repo AI skills, commands, workflow + docs
39
+ /haus-workflow project:refresh # [project] refresh .claude/ and regenerate CLAUDE.md imports
40
+ /haus-workflow project:doctor # [project] health check for drift
41
+ /haus-workflow update # [global] update npm package + catalog + ~/.claude/
42
+ /haus-workflow catalog # [global] fetch only the latest catalog
39
43
  ```
40
44
 
41
45
  Without an argument, the skill presents a menu so you can pick the task. With an argument, it runs immediately.
package/dist/cli.js CHANGED
@@ -3323,6 +3323,8 @@ import fs15 from "fs-extra";
3323
3323
  // src/install/header.ts
3324
3324
  var MD_PREFIX = "<!-- HAUS-MANAGED";
3325
3325
  var MD_SUFFIX = " -->";
3326
+ var FM_FENCE = "---";
3327
+ var FM_KEY = "haus_managed";
3326
3328
  function parseAttrs(raw) {
3327
3329
  const idMatch = /\bid=(\S+)/.exec(raw);
3328
3330
  const vMatch = /\bv=(\S+)/.exec(raw);
@@ -3330,20 +3332,67 @@ function parseAttrs(raw) {
3330
3332
  if (!idMatch || !vMatch || !srcMatch) return void 0;
3331
3333
  return { stableId: idMatch[1], schemaVersion: vMatch[1], source: srcMatch[1] };
3332
3334
  }
3335
+ function isFence(line2) {
3336
+ return (line2 ?? "").replace(/\r$/, "") === FM_FENCE;
3337
+ }
3338
+ function hasFrontmatter(content2) {
3339
+ return isFence(content2.split("\n", 1)[0]);
3340
+ }
3341
+ function frontmatterMarkerValue(content2) {
3342
+ const lines = content2.split("\n");
3343
+ if (!isFence(lines[0])) return void 0;
3344
+ for (let i = 1; i < lines.length; i++) {
3345
+ if (isFence(lines[i])) return void 0;
3346
+ const m = /^haus_managed:\s*"?(.*?)"?\s*$/.exec(lines[i]);
3347
+ if (m) return m[1];
3348
+ }
3349
+ return void 0;
3350
+ }
3333
3351
  function parseMarkdownHeader(content2) {
3334
3352
  const firstLine = content2.split("\n")[0] ?? "";
3335
- if (!firstLine.startsWith(MD_PREFIX)) return void 0;
3336
- return parseAttrs(firstLine);
3353
+ if (firstLine.startsWith(MD_PREFIX)) return parseAttrs(firstLine);
3354
+ const fmValue = frontmatterMarkerValue(content2);
3355
+ if (fmValue !== void 0) return parseAttrs(fmValue);
3356
+ return void 0;
3337
3357
  }
3338
3358
  function buildMarkdownHeader(h) {
3339
3359
  return `${MD_PREFIX} id=${h.stableId} v=${h.schemaVersion} source=${h.source}${MD_SUFFIX}`;
3340
3360
  }
3361
+ function buildMarkerValue(h) {
3362
+ return `id=${h.stableId} v=${h.schemaVersion} source=${h.source}`;
3363
+ }
3364
+ function stampFrontmatter(content2, h) {
3365
+ const lines = content2.split("\n");
3366
+ let close = -1;
3367
+ for (let i = 1; i < lines.length; i++) {
3368
+ if (isFence(lines[i])) {
3369
+ close = i;
3370
+ break;
3371
+ }
3372
+ }
3373
+ if (close === -1) return content2;
3374
+ const fields2 = [];
3375
+ for (let i = 1; i < close; i++) {
3376
+ if (/^haus_managed:/.test(lines[i])) continue;
3377
+ fields2.push(lines[i]);
3378
+ }
3379
+ const rebuilt = [
3380
+ FM_FENCE,
3381
+ ...fields2,
3382
+ `${FM_KEY}: "${buildMarkerValue(h)}"`,
3383
+ ...lines.slice(close)
3384
+ // closing fence + body
3385
+ ];
3386
+ return rebuilt.join("\n");
3387
+ }
3341
3388
  function stampMarkdown(content2, h) {
3389
+ if (hasFrontmatter(content2)) return stampFrontmatter(content2, h);
3342
3390
  const header = buildMarkdownHeader(h);
3343
- const existing = parseMarkdownHeader(content2);
3344
- if (existing) {
3345
- const rest = content2.slice(content2.indexOf("\n") + 1);
3346
- return `${header}
3391
+ const firstLine = content2.split("\n")[0] ?? "";
3392
+ if (firstLine.startsWith(MD_PREFIX)) {
3393
+ const nl = content2.indexOf("\n");
3394
+ const rest = nl === -1 ? "" : content2.slice(nl + 1);
3395
+ return rest === "" ? header : `${header}
3347
3396
  ${rest}`;
3348
3397
  }
3349
3398
  return `${header}
@@ -1,8 +1,6 @@
1
- ## <!-- HAUS-MANAGED id=skill.haus-workflow v=2 source=@haus-tech/haus-workflow@0.1.0 -->
2
-
1
+ ---
3
2
  name: haus-workflow
4
3
  description: Haus all-in-one workflow skill. Handles project setup, update, catalog refresh, and CLAUDE.md regeneration. Invoke with a task name or without to get a menu.
5
-
6
4
  ---
7
5
 
8
6
  # haus-workflow
@@ -17,16 +15,21 @@ All-in-one entry point for the Haus AI workflow.
17
15
 
18
16
  ## Task aliases → commands
19
17
 
20
- | Alias(es) | Command | What it does |
21
- | ------------------------------------ | ----------------------- | ------------------------------------------------------------------- |
22
- | `init`, `setup` | _Setup procedure below_ | Full first-time setup: scaffolding, skills, commands + project docs |
23
- | `apply`, `refresh`, `update-project` | `haus apply --write` | Re-run setup / refresh `.claude/` context |
24
- | `update`, `upgrade` | `haus update` | Update npm package + catalog + `~/.claude/` |
25
- | `catalog` | `haus update` | Fetch latest catalog (same command as update) |
26
- | `doctor`, `check` | `haus doctor` | Check for install drift |
27
- | `install`, `global` | `haus install` | Seed `~/.claude/` with haus-owned files |
28
- | `uninstall` | `haus uninstall` | Remove all haus global files from `~/.claude/` |
29
- | `claude-md`, `regenerate` | `haus apply --write` | Regenerate root `CLAUDE.md` import block |
18
+ Task names use an asymmetric scope convention. The **project:** namespace marks tasks that
19
+ act on **this repo** (`./.claude`, `./.haus-workflow`) — type `project:` to see them all.
20
+ The unprefixed verbs (`update`, `catalog`, `install`, `uninstall`) act on **this machine's
21
+ haus install** (`~/.claude`, npm) they manage the haus tool itself, like `npm install -g`.
22
+ The short legacy aliases still work but the names below are canonical.
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/` |
30
33
 
31
34
  ## Step 1 — Determine the task
32
35
 
@@ -37,16 +40,14 @@ All-in-one entry point for the Haus AI workflow.
37
40
  ```
38
41
  Question: "What would you like to do?"
39
42
  Options:
40
- 1. Set up this project for the first time
41
- (full setup scaffolding + skills + commands, then a deep read to write the CLAUDE.md docs body + docs/)
42
- 2. Refresh project setup
43
+ 1. [project] project:init add haus to an existing project for the first time
44
+ (AI skills + commands + workflow into a repo you already have, then a deep read to write the CLAUDE.md docs body + docs/)
45
+ 2. [project] project:refresh — refresh this project's setup
43
46
  (haus apply --write — re-runs setup, regenerates CLAUDE.md imports)
44
- 3. Update haus package + catalog + global files
47
+ 3. [global] update — update haus package + catalog + global files
45
48
  (haus update — checks npm for new version, fetches catalog, refreshes ~/.claude/)
46
- 4. Fetch catalog updates only
49
+ 4. [global] catalog — fetch catalog updates only
47
50
  (haus update — same command; pulls latest workflow templates and lockfile)
48
- 5. Regenerate CLAUDE.md import block
49
- (haus apply --write — rewrites the @-import block at the root CLAUDE.md)
50
51
  ```
51
52
 
52
53
  Map the user's selection to the command from the alias table, then continue to Step 2.
@@ -55,13 +56,13 @@ Map the user's selection to the command from the alias table, then continue to S
55
56
 
56
57
  Run the mapped command via Bash. Quote the exact command you are running before executing it.
57
58
 
58
- **Exception — `setup` / `init`:** this maps to a multi-step procedure, not a single command. Do not run a bare `haus init`. Skip to **Setup (`setup` / `init`)** under Step 3 and follow it.
59
+ **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.
59
60
 
60
61
  ## Step 3 — Post-run steps
61
62
 
62
63
  After the command completes, follow the relevant post-run steps below.
63
64
 
64
- ### Setup (`setup` / `init`)
65
+ ### Setup (`project:init`)
65
66
 
66
67
  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.
67
68
  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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haus-tech/haus-workflow",
3
- "version": "0.16.1",
3
+ "version": "0.16.3",
4
4
  "description": "Haus AI workflow CLI for Claude Code.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -18,9 +18,7 @@
18
18
  "library/catalog",
19
19
  "tests/fixtures/catalog",
20
20
  "README.md",
21
- "CHANGELOG.md",
22
- "LICENSE",
23
- "NOTICE"
21
+ "CHANGELOG.md"
24
22
  ],
25
23
  "scripts": {
26
24
  "build": "tsup src/cli.ts --format esm --dts --clean --out-dir dist --external @inquirer/checkbox",
@@ -34,8 +32,6 @@
34
32
  "typecheck": "tsc --noEmit",
35
33
  "typecheck:scripts": "tsc --noEmit --project tsconfig.scripts.json",
36
34
  "pack:local": "yarn pack",
37
- "publish:dry": "npm pack --dry-run",
38
- "publish:public": "yarn npm publish --access public",
39
35
  "release": "GITHUB_TOKEN=$(gh auth token) release-it",
40
36
  "release:dry": "GITHUB_TOKEN=$(gh auth token) release-it --dry-run",
41
37
  "prepack": "yarn build",