devflow-kit 1.7.0 → 1.8.1

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 (197) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +31 -1
  3. package/dist/cli.js +3 -1
  4. package/dist/commands/hud.d.ts +22 -0
  5. package/dist/commands/hud.js +180 -0
  6. package/dist/commands/init.d.ts +2 -12
  7. package/dist/commands/init.js +362 -181
  8. package/dist/commands/list.js +1 -0
  9. package/dist/commands/uninstall.js +9 -16
  10. package/dist/hud/cache.d.ts +14 -0
  11. package/dist/hud/cache.js +54 -0
  12. package/dist/hud/colors.d.ts +23 -0
  13. package/dist/hud/colors.js +62 -0
  14. package/dist/hud/components/config-counts.d.ts +8 -0
  15. package/dist/hud/components/config-counts.js +91 -0
  16. package/dist/hud/components/context-usage.d.ts +8 -0
  17. package/dist/hud/components/context-usage.js +49 -0
  18. package/dist/hud/components/diff-stats.d.ts +3 -0
  19. package/dist/hud/components/diff-stats.js +36 -0
  20. package/dist/hud/components/directory.d.ts +3 -0
  21. package/dist/hud/components/directory.js +10 -0
  22. package/dist/hud/components/git-ahead-behind.d.ts +3 -0
  23. package/dist/hud/components/git-ahead-behind.js +16 -0
  24. package/dist/hud/components/git-branch.d.ts +3 -0
  25. package/dist/hud/components/git-branch.js +14 -0
  26. package/dist/hud/components/model.d.ts +3 -0
  27. package/dist/hud/components/model.js +21 -0
  28. package/dist/hud/components/release-info.d.ts +3 -0
  29. package/dist/hud/components/release-info.js +9 -0
  30. package/dist/hud/components/session-cost.d.ts +3 -0
  31. package/dist/hud/components/session-cost.js +9 -0
  32. package/dist/hud/components/session-duration.d.ts +3 -0
  33. package/dist/hud/components/session-duration.js +18 -0
  34. package/dist/hud/components/todo-progress.d.ts +3 -0
  35. package/dist/hud/components/todo-progress.js +11 -0
  36. package/dist/hud/components/usage-quota.d.ts +3 -0
  37. package/dist/hud/components/usage-quota.js +45 -0
  38. package/dist/hud/components/version-badge.d.ts +3 -0
  39. package/dist/hud/components/version-badge.js +80 -0
  40. package/dist/hud/components/worktree-count.d.ts +3 -0
  41. package/dist/hud/components/worktree-count.js +8 -0
  42. package/dist/hud/config.d.ts +10 -0
  43. package/dist/hud/config.js +55 -0
  44. package/dist/hud/credentials.d.ts +17 -0
  45. package/dist/hud/credentials.js +99 -0
  46. package/dist/hud/git.d.ts +7 -0
  47. package/dist/hud/git.js +153 -0
  48. package/dist/hud/index.d.ts +2 -0
  49. package/dist/hud/index.js +81 -0
  50. package/dist/hud/render.d.ts +7 -0
  51. package/dist/hud/render.js +111 -0
  52. package/dist/hud/stdin.d.ts +6 -0
  53. package/dist/hud/stdin.js +25 -0
  54. package/dist/hud/transcript.d.ts +7 -0
  55. package/dist/hud/transcript.js +130 -0
  56. package/dist/hud/types.d.ts +116 -0
  57. package/dist/hud/types.js +2 -0
  58. package/dist/hud/usage-api.d.ts +7 -0
  59. package/dist/hud/usage-api.js +84 -0
  60. package/dist/utils/manifest.d.ts +1 -0
  61. package/dist/utils/post-install.d.ts +8 -1
  62. package/dist/utils/post-install.js +41 -0
  63. package/package.json +5 -2
  64. package/plugins/devflow-accessibility/.claude-plugin/plugin.json +1 -1
  65. package/plugins/devflow-ambient/.claude-plugin/plugin.json +1 -1
  66. package/plugins/devflow-ambient/agents/scrutinizer.md +6 -4
  67. package/plugins/devflow-ambient/agents/shepherd.md +26 -12
  68. package/plugins/devflow-ambient/agents/simplifier.md +24 -15
  69. package/plugins/devflow-audit-claude/.claude-plugin/plugin.json +1 -1
  70. package/plugins/devflow-code-review/.claude-plugin/plugin.json +1 -1
  71. package/plugins/devflow-core-skills/.claude-plugin/plugin.json +1 -1
  72. package/plugins/devflow-debug/.claude-plugin/plugin.json +1 -1
  73. package/plugins/devflow-frontend-design/.claude-plugin/plugin.json +1 -1
  74. package/plugins/devflow-go/.claude-plugin/plugin.json +1 -1
  75. package/plugins/devflow-implement/.claude-plugin/plugin.json +1 -1
  76. package/plugins/devflow-implement/agents/scrutinizer.md +6 -4
  77. package/plugins/devflow-implement/agents/shepherd.md +26 -12
  78. package/plugins/devflow-implement/agents/simplifier.md +24 -15
  79. package/plugins/devflow-implement/skills/self-review/references/stub-detection.md +135 -0
  80. package/plugins/devflow-java/.claude-plugin/plugin.json +1 -1
  81. package/plugins/devflow-python/.claude-plugin/plugin.json +1 -1
  82. package/plugins/devflow-react/.claude-plugin/plugin.json +1 -1
  83. package/plugins/devflow-resolve/.claude-plugin/plugin.json +1 -1
  84. package/plugins/devflow-resolve/agents/simplifier.md +24 -15
  85. package/plugins/devflow-rust/.claude-plugin/plugin.json +1 -1
  86. package/plugins/devflow-self-review/.claude-plugin/plugin.json +1 -1
  87. package/plugins/devflow-self-review/agents/scrutinizer.md +6 -4
  88. package/plugins/devflow-self-review/agents/simplifier.md +24 -15
  89. package/plugins/devflow-self-review/skills/self-review/references/stub-detection.md +135 -0
  90. package/plugins/devflow-specify/.claude-plugin/plugin.json +1 -1
  91. package/plugins/devflow-typescript/.claude-plugin/plugin.json +1 -1
  92. package/scripts/hud/cache.d.ts +14 -0
  93. package/scripts/hud/cache.d.ts.map +1 -0
  94. package/scripts/hud/cache.js +54 -0
  95. package/scripts/hud/cache.js.map +1 -0
  96. package/scripts/hud/colors.d.ts +23 -0
  97. package/scripts/hud/colors.d.ts.map +1 -0
  98. package/scripts/hud/colors.js +62 -0
  99. package/scripts/hud/colors.js.map +1 -0
  100. package/scripts/hud/components/config-counts.d.ts +8 -0
  101. package/scripts/hud/components/config-counts.d.ts.map +1 -0
  102. package/scripts/hud/components/config-counts.js +91 -0
  103. package/scripts/hud/components/config-counts.js.map +1 -0
  104. package/scripts/hud/components/context-usage.d.ts +8 -0
  105. package/scripts/hud/components/context-usage.d.ts.map +1 -0
  106. package/scripts/hud/components/context-usage.js +49 -0
  107. package/scripts/hud/components/context-usage.js.map +1 -0
  108. package/scripts/hud/components/diff-stats.d.ts +3 -0
  109. package/scripts/hud/components/diff-stats.d.ts.map +1 -0
  110. package/scripts/hud/components/diff-stats.js +36 -0
  111. package/scripts/hud/components/diff-stats.js.map +1 -0
  112. package/scripts/hud/components/directory.d.ts +3 -0
  113. package/scripts/hud/components/directory.d.ts.map +1 -0
  114. package/scripts/hud/components/directory.js +10 -0
  115. package/scripts/hud/components/directory.js.map +1 -0
  116. package/scripts/hud/components/git-ahead-behind.d.ts +3 -0
  117. package/scripts/hud/components/git-ahead-behind.d.ts.map +1 -0
  118. package/scripts/hud/components/git-ahead-behind.js +16 -0
  119. package/scripts/hud/components/git-ahead-behind.js.map +1 -0
  120. package/scripts/hud/components/git-branch.d.ts +3 -0
  121. package/scripts/hud/components/git-branch.d.ts.map +1 -0
  122. package/scripts/hud/components/git-branch.js +14 -0
  123. package/scripts/hud/components/git-branch.js.map +1 -0
  124. package/scripts/hud/components/model.d.ts +3 -0
  125. package/scripts/hud/components/model.d.ts.map +1 -0
  126. package/scripts/hud/components/model.js +21 -0
  127. package/scripts/hud/components/model.js.map +1 -0
  128. package/scripts/hud/components/release-info.d.ts +3 -0
  129. package/scripts/hud/components/release-info.d.ts.map +1 -0
  130. package/scripts/hud/components/release-info.js +9 -0
  131. package/scripts/hud/components/release-info.js.map +1 -0
  132. package/scripts/hud/components/session-cost.d.ts +3 -0
  133. package/scripts/hud/components/session-cost.d.ts.map +1 -0
  134. package/scripts/hud/components/session-cost.js +9 -0
  135. package/scripts/hud/components/session-cost.js.map +1 -0
  136. package/scripts/hud/components/session-duration.d.ts +3 -0
  137. package/scripts/hud/components/session-duration.d.ts.map +1 -0
  138. package/scripts/hud/components/session-duration.js +18 -0
  139. package/scripts/hud/components/session-duration.js.map +1 -0
  140. package/scripts/hud/components/todo-progress.d.ts +3 -0
  141. package/scripts/hud/components/todo-progress.d.ts.map +1 -0
  142. package/scripts/hud/components/todo-progress.js +11 -0
  143. package/scripts/hud/components/todo-progress.js.map +1 -0
  144. package/scripts/hud/components/usage-quota.d.ts +3 -0
  145. package/scripts/hud/components/usage-quota.d.ts.map +1 -0
  146. package/scripts/hud/components/usage-quota.js +45 -0
  147. package/scripts/hud/components/usage-quota.js.map +1 -0
  148. package/scripts/hud/components/version-badge.d.ts +3 -0
  149. package/scripts/hud/components/version-badge.d.ts.map +1 -0
  150. package/scripts/hud/components/version-badge.js +80 -0
  151. package/scripts/hud/components/version-badge.js.map +1 -0
  152. package/scripts/hud/components/worktree-count.d.ts +3 -0
  153. package/scripts/hud/components/worktree-count.d.ts.map +1 -0
  154. package/scripts/hud/components/worktree-count.js +8 -0
  155. package/scripts/hud/components/worktree-count.js.map +1 -0
  156. package/scripts/hud/config.d.ts +10 -0
  157. package/scripts/hud/config.d.ts.map +1 -0
  158. package/scripts/hud/config.js +55 -0
  159. package/scripts/hud/config.js.map +1 -0
  160. package/scripts/hud/credentials.d.ts +17 -0
  161. package/scripts/hud/credentials.d.ts.map +1 -0
  162. package/scripts/hud/credentials.js +99 -0
  163. package/scripts/hud/credentials.js.map +1 -0
  164. package/scripts/hud/git.d.ts +7 -0
  165. package/scripts/hud/git.d.ts.map +1 -0
  166. package/scripts/hud/git.js +153 -0
  167. package/scripts/hud/git.js.map +1 -0
  168. package/scripts/hud/index.d.ts +2 -0
  169. package/scripts/hud/index.d.ts.map +1 -0
  170. package/scripts/hud/index.js +81 -0
  171. package/scripts/hud/index.js.map +1 -0
  172. package/scripts/hud/render.d.ts +7 -0
  173. package/scripts/hud/render.d.ts.map +1 -0
  174. package/scripts/hud/render.js +111 -0
  175. package/scripts/hud/render.js.map +1 -0
  176. package/scripts/hud/stdin.d.ts +6 -0
  177. package/scripts/hud/stdin.d.ts.map +1 -0
  178. package/scripts/hud/stdin.js +25 -0
  179. package/scripts/hud/stdin.js.map +1 -0
  180. package/scripts/hud/transcript.d.ts +7 -0
  181. package/scripts/hud/transcript.d.ts.map +1 -0
  182. package/scripts/hud/transcript.js +130 -0
  183. package/scripts/hud/transcript.js.map +1 -0
  184. package/scripts/hud/types.d.ts +116 -0
  185. package/scripts/hud/types.d.ts.map +1 -0
  186. package/scripts/hud/types.js +2 -0
  187. package/scripts/hud/types.js.map +1 -0
  188. package/scripts/hud/usage-api.d.ts +7 -0
  189. package/scripts/hud/usage-api.d.ts.map +1 -0
  190. package/scripts/hud/usage-api.js +84 -0
  191. package/scripts/hud/usage-api.js.map +1 -0
  192. package/scripts/hud.sh +5 -0
  193. package/shared/agents/scrutinizer.md +6 -4
  194. package/shared/agents/shepherd.md +26 -12
  195. package/shared/agents/simplifier.md +24 -15
  196. package/shared/skills/self-review/references/stub-detection.md +135 -0
  197. package/src/templates/settings.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,54 @@ All notable changes to DevFlow will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.8.1] - 2026-03-22
9
+
10
+ ### Changed
11
+ - **Init wizard**: individual feature prompts with explanatory notes replace extras multiselect
12
+ - **Init wizard**: scope-aware `.claudeignore` batch install across all discovered projects (user scope)
13
+ - **Init wizard**: project discovery via `~/.claude/history.jsonl` to find all Claude-used git repos
14
+ - **Init wizard**: managed settings sudo confirmation moved to prompt phase (before spinner)
15
+ - **Init wizard**: safe-delete prompt moved to prompt phase for uninterrupted install
16
+
17
+ ### Added
18
+ - `--hud` flag for `devflow init` to explicitly enable HUD
19
+ - `discoverProjectGitRoots()` utility for finding projects from Claude history
20
+
21
+ ### Removed
22
+ - Extras multiselect (`buildExtrasOptions`) — replaced by individual feature prompts
23
+
24
+ ---
25
+
26
+ ## [1.8.0] - 2026-03-22
27
+
28
+ ### Added
29
+ - **Configurable HUD** replacing bash statusline — 14 components, on/off model (#155)
30
+ - **HUD components**: directory, git branch, ahead/behind, diff stats, release info, worktree count, model, context usage, version badge, session duration, session cost, usage quota, todo progress, config counts
31
+ - **`--hud-only` flag** for standalone HUD install
32
+ - **`--no-hud` flag** to skip HUD during init
33
+ - **`devflow hud` command** (--status, --enable, --disable, --detail, --no-detail)
34
+ - **Version upgrade notification**: `✦ Devflow vX.Y.Z · update: npx devflow-kit init` (yellow, always visible even when HUD disabled)
35
+ - **Skill shadowing docs** and HUD options added to README (#156)
36
+ - **Simplifier agent** — 8 structured slop detection categories (#120)
37
+ - **Scrutinizer agent** — stub detection patterns with reference file (#121)
38
+ - **Shepherd agent** — goal-backward verification, artifact depth checking, stub type, re-verification (#124)
39
+
40
+ ### Changed
41
+ - Init flow: HUD preset picker (5 options) → simple yes/no confirm
42
+ - `--disable` keeps statusLine registered (version badge still renders)
43
+ - Manifest `features.hud` field: `string|false` → `boolean`
44
+
45
+ ### Fixed
46
+ - HUD base branch detection matching raw commit hashes from reflog (#156)
47
+ - HUD comparing main vs main (0/0 always) — now compares against origin/main
48
+
49
+ ### Removed
50
+ - HUD preset system (minimal/classic/standard/full)
51
+ - `--configure`, `--preset`, `--hud <preset>` flags
52
+ - `speed`, `tool-activity`, `agent-activity` components
53
+
54
+ ---
55
+
8
56
  ## [1.7.0] - 2026-03-20
9
57
 
10
58
  ### Added
@@ -928,6 +976,8 @@ devflow init
928
976
  ---
929
977
 
930
978
  [Unreleased]: https://github.com/dean0x/devflow/compare/v1.4.0...HEAD
979
+ [1.8.1]: https://github.com/dean0x/devflow/compare/v1.8.0...v1.8.1
980
+ [1.8.0]: https://github.com/dean0x/devflow/compare/v1.7.0...v1.8.0
931
981
  [1.7.0]: https://github.com/dean0x/devflow/compare/v1.6.1...v1.7.0
932
982
  [1.6.1]: https://github.com/dean0x/devflow/compare/v1.6.0...v1.6.1
933
983
  [1.6.0]: https://github.com/dean0x/devflow/compare/v1.5.0...v1.6.0
package/README.md CHANGED
@@ -24,7 +24,7 @@ DevFlow adds structured commands that handle the full lifecycle: specify feature
24
24
  - **Full-lifecycle implementation** — spec, explore, plan, code, validate, refine in one command
25
25
  - **Automatic session memory** — survives restarts, `/clear`, and context compaction
26
26
  - **Parallel debugging** — competing hypotheses investigated simultaneously
27
- - **Version notifications** — statusline shows an update badge when a newer version is available
27
+ - **Version notifications** — HUD shows `✦ Devflow vX.Y.Z · update: npx devflow-kit init` when a newer version is available
28
28
  - **35 quality skills** — 9 auto-activating core, 8 optional language/ecosystem, plus specialized review, agent, and orchestration skills
29
29
 
30
30
  ## Quick Start
@@ -248,8 +248,38 @@ Session context is saved and restored automatically via Working Memory hooks —
248
248
  | `--teams` / `--no-teams` | Enable/disable Agent Teams (experimental, default: off) |
249
249
  | `--ambient` / `--no-ambient` | Enable/disable ambient mode (default: on) |
250
250
  | `--memory` / `--no-memory` | Enable/disable working memory (default: on) |
251
+ | `--hud` / `--no-hud` | Enable/disable HUD status line (default: on) |
252
+ | `--hud-only` | Install only the HUD (no plugins, hooks, or extras) |
251
253
  | `--verbose` | Show detailed output |
252
254
 
255
+ ### HUD Options
256
+
257
+ | Command | Description |
258
+ |---------|-------------|
259
+ | `npx devflow-kit hud --status` | Show current HUD config |
260
+ | `npx devflow-kit hud --enable` | Enable HUD |
261
+ | `npx devflow-kit hud --disable` | Disable HUD (version notifications still appear) |
262
+ | `npx devflow-kit hud --detail` | Show tool/agent descriptions |
263
+ | `npx devflow-kit hud --no-detail` | Hide tool/agent descriptions |
264
+
265
+ ### Skill Shadowing
266
+
267
+ Override any DevFlow skill with your own version. Shadowed skills survive `devflow init` — they won't be overwritten on reinstall or upgrade.
268
+
269
+ ```bash
270
+ # Create a personal override (copies current version as reference)
271
+ npx devflow-kit skills shadow core-patterns
272
+
273
+ # Edit your override
274
+ vim ~/.claude/skills/core-patterns/SKILL.md
275
+
276
+ # List all overrides
277
+ npx devflow-kit skills list-shadowed
278
+
279
+ # Remove override (next init restores DevFlow's version)
280
+ npx devflow-kit skills unshadow core-patterns
281
+ ```
282
+
253
283
  ### Uninstall Options
254
284
 
255
285
  | Option | Description |
package/dist/cli.js CHANGED
@@ -9,6 +9,7 @@ import { listCommand } from './commands/list.js';
9
9
  import { ambientCommand } from './commands/ambient.js';
10
10
  import { memoryCommand } from './commands/memory.js';
11
11
  import { skillsCommand } from './commands/skills.js';
12
+ import { hudCommand } from './commands/hud.js';
12
13
  const __filename = fileURLToPath(import.meta.url);
13
14
  const __dirname = dirname(__filename);
14
15
  // Read version from package.json
@@ -19,7 +20,7 @@ program
19
20
  .description('Agentic Development Toolkit for Claude Code\n\nEnhance your AI-assisted development with intelligent commands and workflows.')
20
21
  .version(packageJson.version, '-v, --version', 'Display version number')
21
22
  .helpOption('-h, --help', 'Display help information')
22
- .addHelpText('after', '\nExamples:\n $ devflow init Install all DevFlow plugins\n $ devflow init --plugin=implement Install specific plugin\n $ devflow init --plugin=implement,review Install multiple plugins\n $ devflow list List available plugins\n $ devflow ambient --enable Enable always-on ambient mode\n $ devflow memory --status Check working memory state\n $ devflow uninstall Remove DevFlow from Claude Code\n $ devflow --version Show version\n $ devflow --help Show help\n\nDocumentation:\n https://github.com/dean0x/devflow#readme');
23
+ .addHelpText('after', '\nExamples:\n $ devflow init Install all DevFlow plugins\n $ devflow init --plugin=implement Install specific plugin\n $ devflow init --plugin=implement,review Install multiple plugins\n $ devflow list List available plugins\n $ devflow ambient --enable Enable always-on ambient mode\n $ devflow memory --status Check working memory state\n $ devflow hud --configure Configure HUD preset\n $ devflow uninstall Remove DevFlow from Claude Code\n $ devflow --version Show version\n $ devflow --help Show help\n\nDocumentation:\n https://github.com/dean0x/devflow#readme');
23
24
  // Register commands
24
25
  program.addCommand(initCommand);
25
26
  program.addCommand(uninstallCommand);
@@ -27,6 +28,7 @@ program.addCommand(listCommand);
27
28
  program.addCommand(ambientCommand);
28
29
  program.addCommand(memoryCommand);
29
30
  program.addCommand(skillsCommand);
31
+ program.addCommand(hudCommand);
30
32
  // Handle no command
31
33
  program.action(() => {
32
34
  program.help();
@@ -0,0 +1,22 @@
1
+ import { Command } from 'commander';
2
+ /**
3
+ * Add the HUD statusLine to settings JSON.
4
+ * Idempotent — returns unchanged JSON if HUD already set.
5
+ * Upgrades legacy statusline.sh to hud.sh automatically.
6
+ */
7
+ export declare function addHudStatusLine(settingsJson: string, devflowDir: string): string;
8
+ /**
9
+ * Remove the HUD statusLine from settings JSON.
10
+ * Idempotent — returns unchanged JSON if statusLine not present or not DevFlow.
11
+ */
12
+ export declare function removeHudStatusLine(settingsJson: string): string;
13
+ /**
14
+ * Check if the statusLine in settings JSON points to the DevFlow HUD.
15
+ */
16
+ export declare function hasHudStatusLine(settingsJson: string): boolean;
17
+ /**
18
+ * Check if an existing statusLine belongs to a non-DevFlow tool.
19
+ */
20
+ export declare function hasNonDevFlowStatusLine(settingsJson: string): boolean;
21
+ export declare const hudCommand: Command;
22
+ //# sourceMappingURL=hud.d.ts.map
@@ -0,0 +1,180 @@
1
+ import { Command } from 'commander';
2
+ import { promises as fs } from 'node:fs';
3
+ import * as path from 'node:path';
4
+ import * as p from '@clack/prompts';
5
+ import color from 'picocolors';
6
+ import { getClaudeDirectory, getDevFlowDirectory } from '../utils/paths.js';
7
+ import { HUD_COMPONENTS, loadConfig, saveConfig, } from '../hud/config.js';
8
+ /**
9
+ * Add the HUD statusLine to settings JSON.
10
+ * Idempotent — returns unchanged JSON if HUD already set.
11
+ * Upgrades legacy statusline.sh to hud.sh automatically.
12
+ */
13
+ export function addHudStatusLine(settingsJson, devflowDir) {
14
+ const settings = JSON.parse(settingsJson);
15
+ const hudCommand = path.join(devflowDir, 'scripts', 'hud.sh');
16
+ // Already pointing to this exact HUD — nothing to do
17
+ if (settings.statusLine?.command === hudCommand) {
18
+ return settingsJson;
19
+ }
20
+ // If there's a non-DevFlow statusLine, don't overwrite (caller should check first)
21
+ if (settings.statusLine && !isDevFlowStatusLine(settings.statusLine)) {
22
+ return settingsJson;
23
+ }
24
+ settings.statusLine = {
25
+ type: 'command',
26
+ command: hudCommand,
27
+ };
28
+ return JSON.stringify(settings, null, 2) + '\n';
29
+ }
30
+ /**
31
+ * Remove the HUD statusLine from settings JSON.
32
+ * Idempotent — returns unchanged JSON if statusLine not present or not DevFlow.
33
+ */
34
+ export function removeHudStatusLine(settingsJson) {
35
+ const settings = JSON.parse(settingsJson);
36
+ if (!settings.statusLine) {
37
+ return settingsJson;
38
+ }
39
+ // Only remove if it's a DevFlow HUD/statusline
40
+ if (!isDevFlowStatusLine(settings.statusLine)) {
41
+ return settingsJson;
42
+ }
43
+ delete settings.statusLine;
44
+ return JSON.stringify(settings, null, 2) + '\n';
45
+ }
46
+ /**
47
+ * Check if the statusLine in settings JSON points to the DevFlow HUD.
48
+ */
49
+ export function hasHudStatusLine(settingsJson) {
50
+ const settings = JSON.parse(settingsJson);
51
+ if (!settings.statusLine)
52
+ return false;
53
+ return isDevFlowStatusLine(settings.statusLine);
54
+ }
55
+ /**
56
+ * Check if an existing statusLine belongs to DevFlow (HUD or legacy statusline).
57
+ * Matches paths containing 'hud.sh', 'statusline.sh', or a '/devflow/' directory segment.
58
+ */
59
+ function isDevFlowStatusLine(statusLine) {
60
+ const cmd = statusLine.command ?? '';
61
+ return (cmd.includes('hud.sh') ||
62
+ cmd.includes('statusline.sh') ||
63
+ cmd.includes('/devflow/') ||
64
+ cmd.includes('\\devflow\\'));
65
+ }
66
+ /**
67
+ * Check if an existing statusLine belongs to a non-DevFlow tool.
68
+ */
69
+ export function hasNonDevFlowStatusLine(settingsJson) {
70
+ const settings = JSON.parse(settingsJson);
71
+ if (!settings.statusLine?.command)
72
+ return false;
73
+ return !isDevFlowStatusLine(settings.statusLine);
74
+ }
75
+ export const hudCommand = new Command('hud')
76
+ .description('Configure the HUD (status line)')
77
+ .option('--status', 'Show current HUD config')
78
+ .option('--detail', 'Show tool/agent descriptions in HUD')
79
+ .option('--no-detail', 'Hide tool/agent descriptions')
80
+ .option('--enable', 'Enable HUD in settings')
81
+ .option('--disable', 'Disable HUD (remove statusLine)')
82
+ .action(async (options) => {
83
+ const hasFlag = options.status ||
84
+ options.enable ||
85
+ options.disable ||
86
+ options.detail !== undefined;
87
+ if (!hasFlag) {
88
+ p.intro(color.bgCyan(color.white(' HUD ')));
89
+ p.note(`${color.cyan('devflow hud --detail')} Show tool/agent descriptions\n` +
90
+ `${color.cyan('devflow hud --no-detail')} Hide tool/agent descriptions\n` +
91
+ `${color.cyan('devflow hud --status')} Show current config\n` +
92
+ `${color.cyan('devflow hud --enable')} Enable HUD in settings\n` +
93
+ `${color.cyan('devflow hud --disable')} Remove HUD from settings`, 'Usage');
94
+ p.note(`${HUD_COMPONENTS.length} components: ${HUD_COMPONENTS.join(', ')}`, 'Components');
95
+ p.outro(color.dim('Toggle with --enable / --disable'));
96
+ return;
97
+ }
98
+ if (options.status) {
99
+ const config = loadConfig();
100
+ p.intro(color.bgCyan(color.white(' HUD Status ')));
101
+ p.note(`${color.dim('Enabled:')} ${config.enabled ? color.green('yes') : color.dim('no')}\n` +
102
+ `${color.dim('Detail:')} ${config.detail ? color.green('on') : color.dim('off')}\n` +
103
+ `${color.dim('Components:')} ${HUD_COMPONENTS.length}`, 'Current config');
104
+ // Check settings.json
105
+ const claudeDir = getClaudeDirectory();
106
+ const settingsPath = path.join(claudeDir, 'settings.json');
107
+ try {
108
+ const content = await fs.readFile(settingsPath, 'utf-8');
109
+ const enabled = hasHudStatusLine(content);
110
+ p.log.info(`Status line: ${enabled ? color.green('enabled') : color.dim('disabled')}`);
111
+ }
112
+ catch {
113
+ p.log.info(`Status line: ${color.dim('no settings.json found')}`);
114
+ }
115
+ return;
116
+ }
117
+ if (options.detail !== undefined) {
118
+ const config = loadConfig();
119
+ config.detail = options.detail;
120
+ saveConfig(config);
121
+ p.log.success(`HUD detail ${config.detail ? 'enabled' : 'disabled'}`);
122
+ return;
123
+ }
124
+ if (options.enable) {
125
+ const claudeDir = getClaudeDirectory();
126
+ const settingsPath = path.join(claudeDir, 'settings.json');
127
+ let settingsContent;
128
+ try {
129
+ settingsContent = await fs.readFile(settingsPath, 'utf-8');
130
+ }
131
+ catch {
132
+ settingsContent = '{}';
133
+ }
134
+ // Ensure statusLine is registered
135
+ if (!hasHudStatusLine(settingsContent)) {
136
+ // Check for non-DevFlow statusLine
137
+ if (hasNonDevFlowStatusLine(settingsContent)) {
138
+ const settings = JSON.parse(settingsContent);
139
+ p.log.warn(`Existing statusLine found: ${color.dim(settings.statusLine?.command ?? 'unknown')}`);
140
+ if (process.stdin.isTTY) {
141
+ const overwrite = await p.confirm({
142
+ message: 'Replace existing statusLine with DevFlow HUD?',
143
+ initialValue: false,
144
+ });
145
+ if (p.isCancel(overwrite) || !overwrite) {
146
+ p.log.info('HUD not enabled — existing statusLine preserved');
147
+ return;
148
+ }
149
+ }
150
+ else {
151
+ p.log.info('Non-interactive mode — skipping (existing statusLine would be overwritten)');
152
+ return;
153
+ }
154
+ }
155
+ const devflowDir = getDevFlowDirectory();
156
+ const updated = addHudStatusLine(settingsContent, devflowDir);
157
+ await fs.writeFile(settingsPath, updated, 'utf-8');
158
+ }
159
+ // Update config
160
+ const config = loadConfig();
161
+ if (config.enabled) {
162
+ p.log.info('HUD already enabled');
163
+ return;
164
+ }
165
+ saveConfig({ ...config, enabled: true });
166
+ p.log.success('HUD enabled');
167
+ p.log.info(color.dim('Restart Claude Code to see the HUD'));
168
+ }
169
+ if (options.disable) {
170
+ const config = loadConfig();
171
+ if (!config.enabled) {
172
+ p.log.info('HUD already disabled');
173
+ return;
174
+ }
175
+ saveConfig({ ...config, enabled: false });
176
+ p.log.success('HUD disabled');
177
+ p.log.info(color.dim('Version upgrade notifications will still appear'));
178
+ }
179
+ });
180
+ //# sourceMappingURL=hud.js.map
@@ -1,8 +1,9 @@
1
1
  import { Command } from 'commander';
2
2
  import { type PluginDefinition } from '../plugins.js';
3
- export { substituteSettingsTemplate, computeGitignoreAppend, applyTeamsConfig, stripTeamsConfig, mergeDenyList } from '../utils/post-install.js';
3
+ export { substituteSettingsTemplate, computeGitignoreAppend, applyTeamsConfig, stripTeamsConfig, mergeDenyList, discoverProjectGitRoots } from '../utils/post-install.js';
4
4
  export { addAmbientHook, removeAmbientHook, hasAmbientHook } from './ambient.js';
5
5
  export { addMemoryHooks, removeMemoryHooks, hasMemoryHooks } from './memory.js';
6
+ export { addHudStatusLine, removeHudStatusLine, hasHudStatusLine } from './hud.js';
6
7
  /**
7
8
  * Parse a comma-separated plugin selection string into normalized plugin names.
8
9
  * Validates against known plugins; returns invalid names as errors.
@@ -11,16 +12,5 @@ export declare function parsePluginSelection(input: string, validPlugins: Plugin
11
12
  selected: string[];
12
13
  invalid: string[];
13
14
  };
14
- export type ExtraId = 'settings' | 'claudeignore' | 'gitignore' | 'docs' | 'safe-delete';
15
- interface ExtraOption {
16
- value: ExtraId;
17
- label: string;
18
- hint: string;
19
- }
20
- /**
21
- * Build the list of configuration extras available for the given scope/git context.
22
- * Pure function — no I/O, no side effects.
23
- */
24
- export declare function buildExtrasOptions(scope: 'user' | 'local', gitRoot: string | null): ExtraOption[];
25
15
  export declare const initCommand: Command;
26
16
  //# sourceMappingURL=init.d.ts.map