-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Add comprehensive tmux integration for persistent dev environments #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
stevengonsalvez
wants to merge
11
commits into
main
Choose a base branch
from
feat/tmux
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f28cfac
feat: replace background jobs with tmux for persistence
stevengonsalvez 53d4afd
feat: add generic tmux-based dev environment commands
stevengonsalvez c41f05f
feat: add tmux session monitoring infrastructure
stevengonsalvez e31d5fe
feat: add async agent spawning with git worktree isolation
stevengonsalvez 01152c5
feat: add frontend-design skill from official Claude Code plugins
stevengonsalvez 3c9a470
refactor: simplify spawn-agent to actually spawn Claude in tmux
stevengonsalvez eb91db9
fix: resolve bash array checking with set -u mode
stevengonsalvez e6c8c74
feat: add production-ready utilities to webapp-testing skill
stevengonsalvez f6d2634
feat: add git worktree isolation support to spawn-agent
stevengonsalvez 9be3c14
feat: add robust initialization and error handling to spawn-agent
stevengonsalvez 2dea0fd
feat: add multi-agent orchestration system
stevengonsalvez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # /attach-agent-worktree - Attach to Agent Session | ||
|
|
||
| Changes to agent worktree directory and attaches to its tmux session. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| /attach-agent-worktree {timestamp} | ||
| ``` | ||
|
|
||
| ## Implementation | ||
|
|
||
| ```bash | ||
| #!/bin/bash | ||
|
|
||
| AGENT_ID="$1" | ||
|
|
||
| if [ -z "$AGENT_ID" ]; then | ||
| echo "❌ Agent ID required" | ||
| echo "Usage: /attach-agent-worktree {timestamp}" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Find worktree directory | ||
| WORKTREE_DIR=$(find worktrees -type d -name "agent-${AGENT_ID}*" 2>/dev/null | head -1) | ||
|
|
||
| if [ -z "$WORKTREE_DIR" ] || [ ! -d "$WORKTREE_DIR" ]; then | ||
| echo "❌ Worktree not found for agent: $AGENT_ID" | ||
| exit 1 | ||
| fi | ||
|
|
||
| SESSION="agent-${AGENT_ID}" | ||
|
|
||
| # Check if tmux session exists | ||
| if ! tmux has-session -t "$SESSION" 2>/dev/null; then | ||
| echo "❌ Tmux session not found: $SESSION" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "📂 Worktree: $WORKTREE_DIR" | ||
| echo "🔗 Attaching to session: $SESSION" | ||
| echo "" | ||
|
|
||
| # Attach to session | ||
| tmux attach -t "$SESSION" | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # /cleanup-agent-worktree - Remove Agent Worktree | ||
|
|
||
| Removes a specific agent worktree and its branch. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| /cleanup-agent-worktree {timestamp} | ||
| /cleanup-agent-worktree {timestamp} --force | ||
| ``` | ||
|
|
||
| ## Implementation | ||
|
|
||
| ```bash | ||
| #!/bin/bash | ||
|
|
||
| AGENT_ID="$1" | ||
| FORCE="$2" | ||
|
|
||
| if [ -z "$AGENT_ID" ]; then | ||
| echo "❌ Agent ID required" | ||
| echo "Usage: /cleanup-agent-worktree {timestamp} [--force]" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Source utilities | ||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| source "$SCRIPT_DIR/../utils/git-worktree-utils.sh" | ||
|
|
||
| # Cleanup worktree | ||
| if [ "$FORCE" = "--force" ]; then | ||
| cleanup_agent_worktree "$AGENT_ID" true | ||
| else | ||
| cleanup_agent_worktree "$AGENT_ID" false | ||
| fi | ||
| ``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example command for starting a server with log capture is missing redirection of
stderr. This means that any error messages from the server won't be captured in the log file, making debugging more difficult. This also applies to other similar examples in this file (lines 274, 280, and 303).To ensure all output is logged,
stderrshould be redirected tostdoutbefore piping totee.