Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
9586b96
chore(version): bump to 3.260310.5 [skip ci]
github-actions[bot] Mar 10, 2026
ed67840
fix(session): sanitize dots in window names for tmux targeting
filipexyz Mar 12, 2026
e12b4e3
test(session): add regression tests for dot sanitization in window names
filipexyz Mar 12, 2026
1214ca1
fix(test): use ESM import instead of require() in session tests
filipexyz Mar 12, 2026
03f2022
fix(test): add complete export stubs to mock.module in idle-timeout t…
filipexyz Mar 12, 2026
21ef329
fix(test): replace mock.module with dependency injection in idle-timeout
filipexyz Mar 12, 2026
bf013b3
fix(session): sanitize window name before collision lookup
filipexyz Mar 12, 2026
4c6c521
fix(spawn): sanitize dots in team names before tmux targeting
filipexyz Mar 12, 2026
2ab1cd0
fix(spawn): return sanitizeWindowName consistently in ensureTeamLead
filipexyz Mar 12, 2026
8591c1a
feat(dir): add agent directory module replacing profiles and blueprints
automagik-genie Mar 13, 2026
d743df3
chore(knip): ignore deprecated files pending cleanup in later groups
automagik-genie Mar 13, 2026
e9e1d4d
fix(genie): restore dev-compatible genie.ts with only dir changes
automagik-genie Mar 13, 2026
855cb29
fix(knip): reduce ignore list to only Group 1 dead files
automagik-genie Mar 13, 2026
08e751a
feat(state): add wish state machine and remove beads integration
Mar 13, 2026
0c6b4e0
feat(spawn): directory-based agent spawn with system-prompt-file flags
Mar 13, 2026
fdbee95
feat(team): rewrite team manager with worktree lifecycle and hire/fire
Mar 13, 2026
ffb486c
chore: clean up dead code from _open removal
Mar 13, 2026
1c82b00
chore: remove cascading dead exports from tmux.ts
Mar 13, 2026
868d4d4
fix(tests): isolate flaky tests from env contamination
Mar 13, 2026
1b8aaff
chore: initial commit
Mar 13, 2026
21a8b4d
feat(dispatch): add context-injecting dispatch commands
Mar 13, 2026
a3e4630
feat(messaging): redesign messaging with directory-first resolution a…
Mar 13, 2026
f981071
feat(cli): promote commands to top-level, remove agent/task namespace…
Mar 13, 2026
76e823e
feat(council): add inline system prompt injection and dual-mode counc…
Mar 13, 2026
9def6bf
feat(skills): update all skill prompts to use genie spawn dispatch an…
Mar 13, 2026
26d8624
chore: remove dead code and fix lint/format errors from parallel rede…
Mar 14, 2026
9bf6634
chore: remove accidentally committed claude worktree artifacts
Mar 14, 2026
abfccb8
fix(skills): update stale command references in onboarding and dream
Mar 14, 2026
d371bc4
fix(state): auto-init state file and guard against completing blocked…
Mar 14, 2026
d97c63f
fix(spawn): set GENIE_AGENT_NAME for all spawns, verify crypto in ses…
Mar 14, 2026
62afe49
fix(cli): rename dispatch-work to work, remove old task-based work co…
Mar 14, 2026
57de7c6
fix(team): kill running agents on fire and disband
Mar 14, 2026
8140fde
fix(docs): update stale command references in docs and README
Mar 14, 2026
9398c08
fix: resolve lint errors, dead code, and stale test assertion
Mar 14, 2026
8db6c8e
Merge pull request #536 from automagik-dev/feat/agent-directory
namastex888 Mar 14, 2026
b51306e
fix(hooks): update auto-spawn to use top-level genie spawn command
Mar 14, 2026
f182a10
Merge pull request #538 from automagik-dev/fix/auto-spawn-hook
namastex888 Mar 14, 2026
239a179
chore: resolve merge conflict in session.ts (keep dev version)
Mar 14, 2026
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
310 changes: 310 additions & 0 deletions .genie/brainstorms/agent-directory/DESIGN.md

Large diffs are not rendered by default.

628 changes: 628 additions & 0 deletions .genie/brainstorms/agent-directory/DRAFT.md

Large diffs are not rendered by default.

153 changes: 153 additions & 0 deletions .genie/wishes/fix-onboarding-prod-bugs/WISH.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# Wish: Fix Onboarding Production Bugs (tmux defaults + silent prompt failure)

| Field | Value |
|-------|-------|
| **Status** | SUPERSEDED by `unify-install-kill-fragmentation` |
| **Slug** | `fix-onboarding-prod-bugs` |
| **Date** | 2026-03-09 |

## Summary

Two bugs discovered during clean-machine onboarding testing. Bug 1 (low): `genie install` never writes base tmux settings, so users on distros with `mouse on` system defaults can't scroll. Bug 2 (critical): `TEAM_LEAD_PROMPT.md` is loaded via filesystem path that resolves correctly in dev (`src/lib/`) but breaks in the production flat bundle (`dist/genie.js`), causing Claude to launch without any orchestration instructions — silently.

## Scope

### IN

- Inline `TEAM_LEAD_PROMPT.md` content as a TypeScript constant (eliminate filesystem dependency)
- Add explicit CRITICAL-level warning when orchestration prompt is empty/null
- Fix misleading `tui.ts` warning that only mentions `AGENTS.md`
- Add sensible tmux base defaults to `generateTmuxConfig()` in shortcuts.ts
- Keep `TEAM_LEAD_PROMPT.md` file for documentation/reference (add header noting it's inlined)

### OUT

- No changes to the build pipeline or bundler configuration
- No changes to `AGENTS.md` loading logic (that works correctly via `process.cwd()`)
- No tmux mouse-mode detection or auto-configuration beyond static defaults
- No changes to `install.ts` prerequisite installation flow
- No new CLI flags or user-facing options

## Decisions

| Decision | Rationale |
|----------|-----------|
| Inline prompt as TS constant (Option 1) | Eliminates entire class of "file not found at runtime" bugs. No bundler config needed. Content already ships with the package — just needs to be compiled in. |
| Keep `TEAM_LEAD_PROMPT.md` file | Serves as human-readable documentation; easier to review/edit prompt content before copying into the constant. |
| `set -g mouse off` as default | Users on clean machines expect terminal-native scroll. Power users who want mouse can override in their own config. Matches tmux's own default (pre-distro overrides). |
| Add CRITICAL warning, not throw | Throwing would block `genie command` entirely. Warning lets it proceed degraded while making the failure visible. |

## Success Criteria

- [ ] `genie command` on a clean install injects `TEAM_LEAD_PROMPT.md` content into the system prompt
- [ ] Running from `dist/genie.js` (production bundle) produces identical orchestration prompt as running from `src/genie.ts` (dev)
- [ ] If orchestration prompt is somehow empty, a CRITICAL warning is logged to stderr
- [ ] `generateTmuxConfig()` output includes `set -g mouse off` and `set -g base-index 0`
- [ ] `tui.ts` warning distinguishes between missing `AGENTS.md` (optional) and missing orchestration prompt (critical)
- [ ] `bun run check` passes (typecheck + lint + dead-code + tests)
- [ ] No runtime `fs.readFileSync` or `fs.existsSync` calls for `TEAM_LEAD_PROMPT.md`

## Execution Groups

### Group 1: Inline orchestration prompt (CRITICAL fix)

**Goal:** Eliminate filesystem dependency for TEAM_LEAD_PROMPT.md. Make the orchestration prompt a compile-time constant.

**Deliverables:**
1. Create a new constant `TEAM_LEAD_PROMPT` in `src/lib/team-lead-command.ts` containing the full content of `TEAM_LEAD_PROMPT.md`
2. Replace `getTeamLeadPrompt()` filesystem-based function with a simple getter returning the constant
3. Remove unused `fs` imports (`readFileSync`, `existsSync` for prompt loading — keep others if used elsewhere)
4. Remove unused `path` imports (`dirname`, `join` for prompt path — keep if used elsewhere)
5. Remove unused `url` import (`fileURLToPath` — keep if used elsewhere)

**Acceptance criteria:**
- `getTeamLeadPrompt()` returns the prompt content without any filesystem access
- No `import.meta.url` usage remains for prompt resolution
- The returned string matches `TEAM_LEAD_PROMPT.md` content exactly

**Validation:**
```bash
# Verify no filesystem loading for the prompt
grep -n 'import.meta.url' src/lib/team-lead-command.ts && echo "FAIL: import.meta.url still present" || echo "PASS"
grep -n 'TEAM_LEAD_PROMPT' src/lib/team-lead-command.ts | head -5
bun run typecheck
```

### Group 2: Add failure warnings + fix misleading tui.ts message

**Goal:** Make prompt loading failures loud and distinguishable.

**Deliverables:**
1. In `persistSystemPrompt()` (`team-lead-command.ts`), add a `console.error('CRITICAL: ...')` if `getTeamLeadPrompt()` returns empty/null
2. In `tui.ts`, update the warning at lines 198-201:
- If `AGENTS.md` is missing, log it as informational (not a problem)
- After `buildClaudeCommand` is called, if no `--system-prompt` flag was emitted, log a CRITICAL warning mentioning both AGENTS.md and orchestration prompt

**Acceptance criteria:**
- Warning text clearly distinguishes optional `AGENTS.md` from mandatory orchestration prompt
- CRITICAL warning fires when orchestration prompt is null/empty
- Warning does NOT fire during normal operation (prompt is inlined, so it should always be present)

**Validation:**
```bash
grep -n 'CRITICAL' src/lib/team-lead-command.ts src/genie-commands/tui.ts
bun run typecheck
```

### Group 3: tmux base defaults

**Goal:** Ensure clean-machine tmux installs get sensible defaults.

**Deliverables:**
1. Prepend base settings to `generateTmuxConfig()` output in `src/term-commands/shortcuts.ts`:
```
# Base settings (generated by genie-cli)
set -g mouse off
set -g base-index 0
setw -g pane-base-index 0
```

**Acceptance criteria:**
- `generateTmuxConfig()` output starts with base settings before keyboard shortcuts
- Existing keyboard shortcuts remain unchanged
- The "generated by genie-cli" marker is present (used for install/uninstall detection)

**Validation:**
```bash
grep -n 'mouse off' src/term-commands/shortcuts.ts && echo "PASS" || echo "FAIL"
grep -n 'base-index' src/term-commands/shortcuts.ts && echo "PASS" || echo "FAIL"
bun run typecheck
```

### Group 4: Update TEAM_LEAD_PROMPT.md + final validation

**Goal:** Mark the file as documentation-only and run full quality gates.

**Deliverables:**
1. Add a header comment to `TEAM_LEAD_PROMPT.md`:
```
<!-- NOTE: This file is kept for documentation. The actual prompt is inlined
as a constant in src/lib/team-lead-command.ts. Edits here must be
copied to that constant. -->
```
2. Run full quality gates

**Acceptance criteria:**
- `bun run check` exits 0
- `bun run build` succeeds
- Built `dist/genie.js` contains the inlined prompt string

**Validation:**
```bash
bun run check
bun run build
grep -c 'MANDATORY Agent Orchestration' dist/genie.js # should be >= 1
```

## Assumptions / Risks

| Risk | Mitigation |
|------|------------|
| Inlined prompt constant becomes stale vs. TEAM_LEAD_PROMPT.md edits | Header comment in .md file warns to sync changes; could add a CI check later |
| `set -g mouse off` may surprise users who expect mouse | Matches tmux's own compiled default; users can override in their own config block below genie's |
| Large string constant in source may trigger linter warnings | Use template literal; biome doesn't flag long template strings |
Loading
Loading