Skip to content

chore: promote dev to main - #607

Merged
namastex888 merged 79 commits into
mainfrom
dev
Mar 16, 2026
Merged

namastex888 merged 79 commits into
mainfrom
dev

Conversation

@namastex888

Copy link
Copy Markdown
Contributor

Rolling Promotion: dev → main

5 files, +110/-5 lines.

Changes since last release

PR What
#603 fix(agent-dir): resolve agents from main repo when inside a worktree
#604 fix: session hook respects updateChannel, release skip-ci fix
#605 fix: auto-publish @next on dev merge, fix rolling PR history sync

IMPORTANT: Merge with "Create a merge commit" — NEVER squash.

github-actions Bot and others added 30 commits March 14, 2026 19:52
…arn+brain

Group 1 — Orchestration Rules Rewrite:
- Rewrite ORCHESTRATION_PROMPT in smart-install.js and install.sh with current
  CLI commands (spawn, kill, stop, ls, team create/hire/fire/disband, send,
  broadcast, chat, done, status, reset)
- Add skill auto-invocation chain, team lifecycle, and rules sections
- Remove stale genie agent spawn, genie team ensure, genie agent dashboard refs
- Both files have identical orchestration content

Group 2 — Kill Onboarding + Inline References:
- Delete skills/onboarding/ directory entirely
- Inline prompt optimizer content into skills/refine/SKILL.md
- Inline design template into skills/brainstorm/SKILL.md
- Inline wish template into skills/wish/SKILL.md
- Remove all references/ file paths from SKILL.md files

Group 5 — Learn Rewrite + Brain Update:
- Rewrite skills/learn/SKILL.md: primary trigger is user correction, diagnoses
  which behavioral surface needs change (CLAUDE.md, AGENTS.md, SOUL.md, rules/,
  memory/, hooks, configs). Remove BOOTSTRAP.md ref. Connect to Claude native memory.
- Update skills/brain/SKILL.md: add brain vs memory distinction (brain=context
  graph, memory=behavioral learnings). Add auto-install: detect notesmd-cli,
  offer install from https://github.com/Yakitrak/notesmd-cli
Group 3 — Core Chain Skills:
- brainstorm: remove genie brainstorm crystallize, auto-invoke /review at
  WRS=100, suggest /council when Decisions stuck after 2+ exchanges
- wish: fuzzy gate check auto-triggers /brainstorm, step 7 declares depends-on,
  handoff auto-invokes /review instead of suggesting /work
- work: clarify as implementor skill via genie work dispatch, add local /review
  per group, genie send signaling, leader uses genie done (not worker),
  remove "no state management" confusion
- review: add SHIP next-steps per context (plan→wish/work, execution→PR,
  PR→merge), auto-invoke /fix on FIX-FIRST, /trace for unclear root cause

Group 4 — Support Skills:
- council: add auto-invocation triggers (review arch decisions, brainstorm
  stuck decisions), document genie team hire council, add 2min timeout for
  full spawn, clarify lightweight=simulate vs full spawn=real agents
- trace: add genie send for reporting findings, clarify spawned agent IS
  the tracer, /review can invoke /trace
- report: document agent-browser as genie dependency, add wish criteria
  linking during QA, add QA failure auto-invocation chain
- docs: add doc types (README, CLAUDE.md, API, architecture, JSDoc),
  CLAUDE.md as first-class surface, post-work suggestion
- refine: verified inlined content, no remaining references/ paths

Group 6 — Dream Lifecycle:
- Phase 1: use genie work dispatch per group (state tracking for free),
  genie status/done/reset for monitoring
- Phase 2: leader creates PR, reads bot comments critically, /fix valid
  issues, CI green required (poll, don't sleep)
- Phase 3: merge to dev, spawn tester, QA loop until all criteria proven,
  each fix = new PR to dev
- Phase 4: DREAM-REPORT.md with per-wish QA status
- Remove Status: SHIPPED and sleep 5 references
- Add full team lifecycle: create→execute→review→merge→QA→disband
- Change genie agent history/read/answer to genie history/read/answer
  (top-level commands, not under agent namespace) in both install.sh
  and smart-install.js
- Fix escaped backticks in wish SKILL.md template (remove backslashes)
- Add --repo <path> to genie team create in both orchestration prompts
  (--repo is required)
fix(skills): refresh all skills + orchestration rules rewrite
- Add "leader" built-in role with full orchestration system prompt
- Add --wish <slug> flag to "genie team create" for auto-spawning leaders
- Add team status tracking (in_progress/done/blocked) with setTeamStatus()
- Add "genie team done" and "genie team blocked" CLI commands
- Add autoMergeDev config option to GenieConfigSchema
- Update "genie team ls" to show team status column
- Add file lock to setTeamStatus to prevent concurrent read-modify-write races
- Replace require("node:path").resolve with ESM import in team.ts
- Validate wish file exists before createTeam to avoid orphaned teams
- Add --team flag to all genie team commands in leader prompt since GENIE_TEAM won't be set
Co-Authored-By: Paperclip <noreply@paperclip.ing>
feat: task leader role — autonomous wish lifecycle orchestration
…rompts

Inline --append-system-prompt and --system-prompt flags broke when passed
through tmux send-keys with multi-line prompts containing code blocks.
All system prompts are now written to temp files at /tmp/genie-prompts/
and passed via --append-system-prompt-file or --system-prompt-file.

When both systemPrompt and systemPromptFile are set, they are merged into
a single temp file. Extra --append-system-prompt-file args are also merged.

Closes #568
fix: eliminate inline system prompts — all prompts via temp files (#568)
- Add initialPrompt field to SpawnParams/SpawnOptions, appended as
  Claude Code positional [prompt] arg in buildClaudeCommand()
- spawnLeaderWithWish() now passes a kickoff prompt so the leader
  begins working immediately — no manual genie send needed
- Audit and update orchestration rules in smart-install.js and
  install.sh: add team done/blocked, dir commands, update --next/
  --stable, task leader workflow, autoMergeDev config
- Both install scripts now have identical orchestration content
feat: auto-kickoff leader on wish spawn + orchestration rules audit
Group 1 — Orchestration Rules:
- Create plugins/genie/rules/genie-orchestration.md (~15 lines)
- Remove hardcoded ORCHESTRATION_PROMPT from smart-install.js
- Update install.sh to copy from package file with fallback
- Both installers log where the rule was created
- Add removal of ~/.claude/rules/genie-orchestration.md to uninstall

Group 2 — Agent Consolidation:
- Rename implementor → engineer
- Merge spec-reviewer + quality-reviewer → reviewer (SHIP/FIX-FIRST)
- Merge tests → qa (writes tests + validates on dev)
- Delete old agent files
- Update builtin-agents.ts, skills, and all references

Group 4 — Session Fixes:
- getAgentsSystemPrompt() → getAgentsFilePath() (returns path not content)
- team-lead-command.ts: accept systemPromptFile, delete PROMPTS_DIR copy
- --agent-name uses basename(cwd) instead of hardcoded "team-lead"
- launchTmuxSpawn: use send-keys for first agent in team window
…gistry

Group 3 of fix-orchestration-rules wish:

- Convert every agent .md into folder/<name>/AGENTS.md with symlinks
- Create team-lead/ with AGENTS.md + SOUL.md + HEARTBEAT.md
- Create pm/ with AGENTS.md + SOUL.md + HEARTBEAT.md
- Add SOUL.md for all council members with real-person philosophy
- Add @SOUL.md import to council AGENTS.md files
- Rewrite builtin-agents.ts: scan plugins/genie/agents/*/ for discovery,
  parse CC frontmatter, no inline systemPrompt strings
- Add resolveBuiltinAgentPath(name) for file-based resolution
- Update agents.ts: use agentPath as systemPromptFile, no inline prompts
- Update tests for new folder structure and naming (council-- double dash)
session.ts hardcoded 'team-lead' as the agent name in ensureNativeTeamForLeader,
findLastSessionId calls, and console.log messages. Since team-lead-command.ts
derives agent name from basename(cwd), session.ts must match to avoid session
resume mismatches and incorrect native team registration.

Also simplify install.sh orchestration rules lookup to use the already-resolved
PKG_DIR instead of scanning hardcoded candidate paths.
feat: orchestration rules overhaul + agent folder structure + session fixes
import.meta.dir returns CWD in compiled bundles, not the module's
directory. Use the actual script path (process.argv[1]) resolved via
realpathSync to find the package root and discover agent folders.
fix: builtin agent folder scanner — resolve package root via process.argv[1] (#576)
namastex888 and others added 24 commits March 16, 2026 01:13
fix: set GENIE_TEAM env var on agent spawn
fix: kickoff message — genie work spawns automatically
Agent directory now defaults to project scope (<repo>/.genie/agents.json)
with fallback to global (~/.genie/agent-directory.json) then built-ins.

- add/rm/edit default to project scope, accept { global: true } option
- resolve() checks project → global → built-in roles → built-in council
- ls() returns entries from all scopes with scope label
- dir CLI commands accept --global flag
- dir ls shows SCOPE column

Closes #578
feat: project-scoped agent directory — multiple engineers across projects
fix(update): delete bun lockfile before install
#593)

* fix(reset): clean up all team dirs on --reset, not just current window

When `genie --reset` was called, handleReset() killed the entire tmux
session but only deleted one native team directory (the current
windowName). Any other windows in the session left their team configs
behind in ~/.claude/teams/.

Fix: collect all window names via listWindows() before killing the
session, then delete each window's team directory.

Closes #545

* fix: use session ID instead of name in tmux calls to prevent injection

Gemini review flagged potential command injection when sessionName is
passed to tmux.listWindows/killSession. If a session name contains
single quotes it could break shell quoting in executeTmux.

Fix: use existing.id (system-assigned identifier) instead of
sessionName for the tmux calls. Session name still used for the log
message (cosmetic only).

---------

Co-authored-by: Felipe Rosa <felipe@namastex.ai>
…chTmuxSpawn (#595)

Extract helper functions to bring both functions under the biome
complexity limit of 15:

- buildClaudeCommand (27→~12): extract appendSystemPromptFlags()
- launchTmuxSpawn (22→~8): extract createTmuxPane() and applySpawnLayout()

Closes #594

Co-authored-by: Test User <test@test.com>
…596)

- Fix JSON formatting in package.json, openclaw.plugin.json, plugin.json
- Fix noAssignInExpressions in dispatch.ts (refactor while loop)
- Reduce complexity in performUninstall (21→≤15): extract tryRemoveStep()
- Reduce complexity in autoSpawn (25→≤15): extract buildSearchNames(), buildSpawnArgs()
- Reduce complexity in executeBlockingChain (18→≤15): extract runHandler()
- Reduce complexity in syncPlugin (16→≤15): extract updatePluginRegistry()
- Reduce complexity in chat action (17→≤15): extract resolveTeamName()

Biome now reports zero errors and zero warnings.

Co-authored-by: Test User <test@test.com>
Delete scale.test.ts and file-lock-concurrency.test.ts — these are
environment-dependent stress tests that cause CI failures due to
shared /tmp state and concurrent file lock race conditions. They
belong in a separate CI job, not the main test suite.

Co-authored-by: Test User <test@test.com>
* feat(worktree): move default worktree path to ~/.genie/worktrees/<project>/

Worktrees currently default to <repo>/.worktrees/ which causes accidental
git commits and bloated npm publishes. Change the default to
~/.genie/worktrees/<project-name>/ when no explicit worktreeBase is set.

- Make worktreeBase optional in config schema (undefined = new default)
- Update getWorktreeBase() to derive project name from basename(repoPath)
- Update setup wizard to show new default path

* feat(worktree): add auto-prune, fix gitignore, remove dead code

- Add pruneStaleWorktrees() to clean up team configs for non-existent
  worktree paths and run git worktree prune
- Call pruneStaleWorktrees() from disbandTeam() after cleanup
- Update .gitignore: add .worktrees/, remove dead .genie/worktrees/
- Untrack committed .worktrees/ directory from git
- Delete dead worktree-manager.ts and its test (unused legacy code)

---------

Co-authored-by: Test User <test@test.com>
Remove files that should never have been tracked:
- .worktrees/ — Claude Code worktree metadata
- .genie/agents.json — local agent directory
- .genie/teams/ — local team configs
- .genie/brainstorms/ — local brainstorm drafts
- .genie/wishes/ — local wish plans

These are local runtime state, not part of the published package.
Files remain on disk (git rm --cached), only removed from tracking.

Co-authored-by: Test User <test@test.com>
…603)

Worktrees don't have .genie/agents.json (it's gitignored), so agent
resolution fails for project-scoped agents. Fix: detect worktree via
git rev-parse --git-common-dir and fall back to the main repo's
agents.json when the worktree's doesn't contain the requested agent.

Closes #600

Co-authored-by: Test User <test@test.com>
- smart-install.js: read updateChannel from ~/.genie/config.json,
  skip CLI reinstall when channel is 'next'
- release.yml: use startsWith instead of contains for [skip ci]
- remove hardcoded worktreeBase from createDefaultConfig()

Co-authored-by: Test User <test@test.com>
- ci.yml: add publish-next job that runs on dev push after quality gate
  passes — publishes to npm @next automatically
- rolling-pr.yml: update PR body to warn against squash merge — squash
  breaks dev/main history sync causing duplicate diffs on every PR

Co-authored-by: Test User <test@test.com>
# Conflicts:
#	src/lib/agent-directory.ts
@coderabbitai

coderabbitai Bot commented Mar 16, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@namastex888 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 33 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d7849cfb-8b9f-41bf-8488-e1d7dd3a3eb7

📥 Commits

Reviewing files that changed from the base of the PR and between c863735 and 9ad5718.

⛔ Files ignored due to path filters (1)
  • plugins/genie/scripts/smart-install.js is excluded by !plugins/genie/scripts/**
📒 Files selected for processing (4)
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
  • .github/workflows/rolling-pr.yml
  • src/lib/agent-directory.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request performs a rolling promotion of the dev branch into main, incorporating several key fixes and enhancements. The changes primarily focus on improving agent resolution within Git worktrees, refining update channel handling for session hooks, and streamlining the automated publishing process for development builds. The overall goal is to stabilize the main branch with recent development fixes.

Highlights

  • Agent Directory Fix: Resolved agents from the main repository when operating inside a Git worktree, ensuring consistent agent discovery.
  • Session Hook Update: Ensured the session hook respects the updateChannel configuration, along with a fix for skip-ci releases.
  • Automated Publishing: Implemented auto-publishing of @next versions on dev branch merges and fixed rolling PR history synchronization.
Changelog
  • plugins/genie/scripts/smart-install.js
    • Introduced getUpdateChannel to read update preferences from config.json.
    • Updated genieCliNeedsInstall to respect the updateChannel, preventing automatic overwrites for next channel users.
    • Removed worktreeBase from the default terminal configuration, simplifying settings.
  • src/lib/agent-directory.ts
    • Implemented getMainRepoRoot to correctly identify the main repository's root when working in a Git worktree.
    • Enhanced agent resolution (resolve) to search for agents in the main repository's .genie/agents.json if the current directory is a worktree.
    • Extended agent listing (ls) to aggregate and display agents from both the current worktree and the main repository, avoiding duplicates.
Ignored Files
  • Ignored by pattern: .github/workflows/** (3)
    • .github/workflows/ci.yml
    • .github/workflows/release.yml
    • .github/workflows/rolling-pr.yml
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a rolling promotion of several fixes from the dev branch to main. The changes correctly implement support for git worktrees when resolving agents and prevent automatic updates for users on the 'next' channel. The code is well-structured. I have a couple of suggestions to improve code consistency and error handling.

Comment on lines +243 to +245
} catch {
// Ignore
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Swallowing errors silently can make debugging difficult. If config.json exists but is malformed, this will fail silently and default to 'latest', which might be unexpected for the user. Consider logging the error for debugging purposes, even if you intend to fall back to the default value.

Suggested change
} catch {
// Ignore
}
} catch (e) {
// It's safer to log this error for debugging, in case the config is malformed.
console.error(`[smart-install] Warning: Could not read update channel from config: ${e.message}`);
}

}).trim();
// --git-common-dir returns the shared .git dir (absolute or relative).
// For worktrees it points to the main repo's .git, for the main repo it's just ".git".
const { resolve: resolvePath } = require('node:path');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with existing imports in this file and for better performance, it's preferable to use a static import for resolve instead of a dynamic require(). You can add resolve to the node:path import at the top of the file (line 16) and remove this line.

At the top of the file, you can change:

import { dirname, join } from 'node:path';

To:

import { dirname, join, resolve as resolvePath } from 'node:path';

This will make resolvePath available throughout the file without needing a dynamic require.

@namastex888
namastex888 merged commit 46dfb78 into main Mar 16, 2026
10 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d944427961

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci.yml
echo "NPM_TOKEN not set — skipping @next publish"
exit 0
fi
bun publish --tag next --access public

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove duplicate @next publish from dev CI path

This new bun publish --tag next runs on every push to dev, but .github/workflows/version.yml already publishes @next in its Publish dev release to npm step after it pushes the version-bump commit to dev; that means the same version can be published twice for the same promotion flow, and npm version immutability causes one of those runs to fail. In practice this will make either the CI workflow or the Version workflow red during normal release automation.

Useful? React with 👍 / 👎.

Comment thread .github/workflows/ci.yml
Comment on lines +73 to +74
needs: [quality-gate]
if: github.event_name == 'push' && github.ref == 'refs/heads/dev'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Gate @next publish on secrets scan success

publish-next currently depends only on quality-gate, so it can still execute when secrets-scan fails in the same workflow. That allows publishing a package from a commit explicitly flagged by the security scan; add secrets-scan to needs (or otherwise require its success) so publishing is blocked when secret detection fails.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants