Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ dist/
# Generated plugin skills (copied from shared/skills/ at build time)
plugins/*/skills/

# Generated HUD scripts (copied from dist/hud/ at build time)
scripts/hud/

# Generated shared agents (copied from shared/agents/ at build time)
# Note: plugin-specific agents (catch-up.md, devlog.md) are committed in their plugins
plugins/*/agents/git.md
Expand Down
31 changes: 23 additions & 8 deletions docs/reference/file-organization.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ devflow/
│ └── reference/ # Extracted reference docs
├── scripts/
│ ├── build-plugins.ts
│ ├── statusline.sh
│ ├── build-hud.js # Copies dist/hud/ → scripts/hud/
│ ├── hud.sh # Thin wrapper: exec node hud/index.js
│ ├── hud/ # GENERATED — compiled HUD module (gitignored)
│ └── hooks/ # Working Memory + ambient hooks
│ ├── stop-update-memory # Stop hook: writes WORKING-MEMORY.md
│ ├── session-start-memory # SessionStart hook: injects memory + git state
Expand All @@ -51,7 +53,14 @@ devflow/
│ ├── init.ts
│ ├── list.ts
│ ├── memory.ts
│ ├── hud.ts
│ └── uninstall.ts
├── hud/ # HUD module (TypeScript source)
│ ├── index.ts # Entry point: stdin → gather → render → stdout
│ ├── types.ts # StdinData, HudConfig, ComponentId, etc.
│ ├── config.ts # PRESETS, loadConfig, saveConfig
│ ├── render.ts # Smart multi-line layout assembly
│ └── components/ # 14 individual component renderers
└── cli.ts
```

Expand Down Expand Up @@ -127,7 +136,7 @@ Skills and agents are **not duplicated** in git. Instead:
`devflow init --override-settings` replaces `~/.claude/settings.json`.

Included settings:
- `statusLine` - Smart statusline with context percentage
- `statusLine` - Configurable HUD with presets (replaces legacy statusline.sh)
- `hooks` - Working Memory hooks (Stop, SessionStart, PreCompact)
- `env.ENABLE_TOOL_SEARCH` - Deferred MCP tool loading (~85% token savings)
- `env.ENABLE_LSP_TOOL` - Language Server Protocol support
Expand Down Expand Up @@ -160,11 +169,17 @@ Knowledge files in `.memory/knowledge/` capture decisions and pitfalls that agen

Each file has a `<!-- TL;DR: ... -->` comment on line 1. SessionStart injects TL;DR headers only (~30-50 tokens). Agents read full files when relevant to their work. Cap: 50 entries per file.

## Statusline Script
## HUD (Heads-Up Display)

The statusline (`scripts/statusline.sh`) displays:
- Directory name and model
- Git branch with dirty indicator (`*`)
- Context usage percentage (green <50%, yellow 50-80%, red >80%)
The HUD (`scripts/hud.sh` → `scripts/hud/index.js`) is a configurable TypeScript status line with 14 components and 4 presets:

Data source: `context_window.current_usage` from Claude Code's JSON stdin.
| Preset | Components | Layout |
|--------|-----------|--------|
| Minimal | directory, git branch, model, context % | Single line |
| Classic | + ahead/behind, diff stats, version badge | Single line |
| Standard (default) | + session duration, usage quota | 2 lines |
| Full | + tool/agent activity, todos, speed, config counts | 3-4 lines |

Configuration: `~/.devflow/hud.json` (preset + component toggles). Manage via `devflow hud --configure`.

Data source: `context_window.current_usage` from Claude Code's JSON stdin. Git data gathered with 1s per-command timeout. Overall 2s timeout with graceful degradation.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@
"plugins/",
"shared/",
"scripts/hooks/",
"scripts/hud.sh",
"scripts/hud/",
"src/templates/",
"README.md",
"LICENSE",
"CHANGELOG.md"
],
"scripts": {
"build": "npm run build:cli && npm run build:plugins",
"build": "npm run build:cli && npm run build:plugins && npm run build:hud",
"build:cli": "tsc",
"build:plugins": "npx tsx scripts/build-plugins.ts",
"build:hud": "node scripts/build-hud.js",
"dev": "tsc --watch",
"cli": "node dist/cli.js",
"prepublishOnly": "npm run build",
Expand Down
36 changes: 36 additions & 0 deletions scripts/build-hud.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env node

/**
* Copy compiled HUD scripts from dist/hud/ to scripts/hud/
* for distribution alongside the shell wrapper.
*/

import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const src = path.join(__dirname, '..', 'dist', 'hud');
const dest = path.join(__dirname, 'hud');

// Clean destination
if (fs.existsSync(dest)) fs.rmSync(dest, { recursive: true });

function copyDir(s, d) {
fs.mkdirSync(d, { recursive: true });
for (const entry of fs.readdirSync(s, { withFileTypes: true })) {
const sp = path.join(s, entry.name);
const dp = path.join(d, entry.name);
if (entry.isDirectory()) copyDir(sp, dp);
else fs.copyFileSync(sp, dp);
}
}

if (fs.existsSync(src)) {
copyDir(src, dest);
console.log(`\u2713 HUD scripts copied to ${dest}`);
} else {
console.warn('\u26A0 dist/hud not found \u2014 run tsc first');
}
5 changes: 5 additions & 0 deletions scripts/hud.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# DevFlow HUD — configurable TypeScript status line
# Receives JSON via stdin from Claude Code, outputs ANSI-formatted HUD
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
exec node "${SCRIPT_DIR}/hud/index.js"
240 changes: 0 additions & 240 deletions scripts/statusline.sh

This file was deleted.

4 changes: 3 additions & 1 deletion src/cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { listCommand } from './commands/list.js';
import { ambientCommand } from './commands/ambient.js';
import { memoryCommand } from './commands/memory.js';
import { skillsCommand } from './commands/skills.js';
import { hudCommand } from './commands/hud.js';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
Expand All @@ -26,7 +27,7 @@ program
.description('Agentic Development Toolkit for Claude Code\n\nEnhance your AI-assisted development with intelligent commands and workflows.')
.version(packageJson.version, '-v, --version', 'Display version number')
.helpOption('-h, --help', 'Display help information')
.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');
.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');

// Register commands
program.addCommand(initCommand);
Expand All @@ -35,6 +36,7 @@ program.addCommand(listCommand);
program.addCommand(ambientCommand);
program.addCommand(memoryCommand);
program.addCommand(skillsCommand);
program.addCommand(hudCommand);

// Handle no command
program.action(() => {
Expand Down
Loading
Loading