Skip to content

Commit 8143fce

Browse files
centdixclaude
andauthored
refactor: cut lifecycle runtime over to webmux (#79)
* feat: add full lifecycle backend foundations * refactor: cut over config and runtime identity foundations * feat: add runtime reconciliation and snapshot endpoint * Harden lifecycle rollback and merge recovery * Add runtime event ingestion and notification cutover * Cut terminal transport over to runtime sessions * Cut lifecycle routes and frontend reads to snapshot * agents.md for codex * Refactor runtime control onto per-worktree agentctl * Keep configured panes open on startup errors * config * Probe configured service ports in runtime snapshot * Restore worktree status transitions via agent hooks * Check python3 during init setup * Store PR sync state in worktree webmux storage * Remove legacy backend layout and compatibility paths * Simplify agent startup and make yolo profile-driven * Expose configured profiles directly in the frontend * feat: add configurable lifecycle hooks * fix: restore linear links and safe worktree handling * feat: add provider-backed auto naming * config * feat: add worktree window close action * rm * feat: scaffold .webmux.yaml with claude or codex Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: resolve absolute worktree roots Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * testing * add example --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 10f188a commit 8143fce

80 files changed

Lines changed: 11788 additions & 2280 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/commit/SKILL.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
name: commit
3+
user_invocable: true
4+
description: Create a git commit with conventional commit format. MUST use anytime you want to commit changes.
5+
---
6+
7+
# Git Commit Skill
8+
9+
Create a focused, single-line commit following conventional commit conventions.
10+
11+
## Instructions
12+
13+
1. **Analyze changes**: Run `git status` and `git diff` to understand what was modified
14+
2. **Stage only modified files**: Add files individually by name. NEVER use `git add -A` or `git add .`
15+
3. **Write commit message**: Follow the conventional commit format as a single line
16+
17+
## Conventional Commit Format
18+
19+
```
20+
<type>: <description>
21+
```
22+
23+
### Types
24+
- `feat`: New feature or capability
25+
- `fix`: Bug fix
26+
- `refactor`: Code change that neither fixes a bug nor adds a feature
27+
- `docs`: Documentation only changes
28+
- `style`: Formatting, missing semicolons, etc (no code change)
29+
- `test`: Adding or correcting tests
30+
- `chore`: Maintenance tasks, dependency updates, etc
31+
- `perf`: Performance improvement
32+
33+
### Rules
34+
- Message MUST be a single line (no multi-line messages)
35+
- Description should be lowercase, imperative mood ("add" not "added")
36+
- No period at the end
37+
- Keep under 72 characters total
38+
39+
### Examples
40+
```
41+
feat: add token usage tracking for AI providers
42+
fix: resolve null pointer in job executor
43+
refactor: extract common validation logic
44+
docs: update API endpoint documentation
45+
chore: upgrade sqlx to 0.7
46+
```
47+
48+
## Execution Steps
49+
50+
1. Run `git status` to see all changes
51+
2. Run `git diff` to understand the changes in detail
52+
3. Run `git log --oneline -5` to see recent commit style
53+
4. Stage ONLY the modified/relevant files: `git add <file1> <file2> ...`
54+
5. Create the commit with conventional format:
55+
```bash
56+
git commit -m "<type>: <description>
57+
58+
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>"
59+
```
60+
6. Run `git status` to verify the commit succeeded

.agents/skills/pr/SKILL.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
name: pr
3+
user_invocable: true
4+
description: Open a draft pull request on GitHub. MUST use when you want to create/open a PR.
5+
---
6+
7+
# Pull Request Skill
8+
9+
Create a draft pull request with a clear title and explicit description of changes.
10+
11+
## Instructions
12+
13+
1. **Analyze branch changes**: Understand all commits since diverging from main
14+
2. **Push to remote**: Ensure all commits are pushed
15+
3. **Create draft PR**: Always open as draft for review before merging
16+
17+
## PR Title Format
18+
19+
Follow conventional commit format for the PR title:
20+
```
21+
<type>: <description>
22+
```
23+
24+
### Types
25+
- `feat`: New feature or capability
26+
- `fix`: Bug fix
27+
- `refactor`: Code restructuring
28+
- `docs`: Documentation changes
29+
- `chore`: Maintenance tasks
30+
- `perf`: Performance improvements
31+
32+
### Title Rules
33+
- Keep under 70 characters
34+
- Use lowercase, imperative mood
35+
- No period at the end
36+
37+
## PR Body Format
38+
39+
The body MUST be explicit about what changed. Structure:
40+
41+
```markdown
42+
## Summary
43+
<Clear description of what this PR does and why>
44+
45+
## Changes
46+
- <Specific change 1>
47+
- <Specific change 2>
48+
- <Specific change 3>
49+
50+
## Test plan
51+
- [ ] <How to verify change 1>
52+
- [ ] <How to verify change 2>
53+
54+
---
55+
Generated with [Claude Code](https://claude.com/claude-code)
56+
```
57+
58+
## Execution Steps
59+
60+
1. Run `git status` to check for uncommitted changes
61+
2. Run `git log main..HEAD --oneline` to see all commits in this branch
62+
3. Run `git diff main...HEAD` to see the full diff against main
63+
4. Check if remote branch exists and is up to date:
64+
```bash
65+
git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null || echo "no upstream"
66+
```
67+
5. Push to remote if needed: `git push -u origin HEAD`
68+
6. Create draft PR using gh CLI:
69+
```bash
70+
gh pr create --draft --title "<type>: <description>" --body "$(cat <<'EOF'
71+
## Summary
72+
<description>
73+
74+
## Changes
75+
- <change 1>
76+
- <change 2>
77+
78+
## Test plan
79+
- [ ] <test 1>
80+
- [ ] <test 2>
81+
82+
---
83+
Generated with [Claude Code](https://claude.com/claude-code)
84+
EOF
85+
)"
86+
```
87+
7. Return the PR URL to the user

.webmux.example.yaml

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# Example `.webmux.yaml` for the current refactored config shape.
2+
# Copy the parts you need into `.webmux.yaml`.
3+
4+
# Project name shown in the dashboard and browser tab.
5+
name: Example Project
6+
7+
workspace:
8+
# Base branch used when creating a new worktree.
9+
mainBranch: main
10+
11+
# Relative or absolute path where managed worktrees are created.
12+
worktreeRoot: __worktrees
13+
14+
# Default agent if the UI caller does not choose one.
15+
# Allowed values: claude, codex
16+
defaultAgent: claude
17+
18+
# Auto-generated service ports that are injected into pane processes,
19+
# lifecycle hooks, and runtime env files.
20+
services:
21+
# Human-readable label shown in the UI.
22+
- name: Backend
23+
24+
# Env var that receives the allocated port number.
25+
portEnv: BACKEND_PORT
26+
27+
# Starting port for the first worktree.
28+
portStart: 5111
29+
30+
# Increment applied per worktree slot.
31+
portStep: 10
32+
33+
# Optional URL template used by the UI when showing service links.
34+
# `${PORT_ENV_NAME}` placeholders are expanded from allocated ports.
35+
urlTemplate: http://127.0.0.1:${BACKEND_PORT}
36+
37+
- name: Frontend
38+
portEnv: FRONTEND_PORT
39+
portStart: 5112
40+
portStep: 10
41+
urlTemplate: http://127.0.0.1:${FRONTEND_PORT}
42+
43+
# Extra env vars materialized into the worktree runtime env.
44+
# Values can be strings or booleans.
45+
startupEnvs:
46+
NODE_ENV: development
47+
FEATURE_FLAG: true
48+
49+
profiles:
50+
# Any profile name is allowed. The UI shows these names as choices.
51+
default:
52+
# Allowed values: host, docker
53+
runtime: host
54+
55+
# Enables permissive agent flags:
56+
# Claude => --dangerously-skip-permissions
57+
# Codex => --yolo
58+
yolo: false
59+
60+
# Host env vars forwarded to the agent process.
61+
envPassthrough:
62+
- GITHUB_TOKEN
63+
- OPENAI_API_KEY
64+
65+
# Optional system prompt for the agent pane.
66+
# `${VAR}` placeholders are expanded from the computed runtime env.
67+
systemPrompt: >
68+
You are working inside a webmux-managed worktree.
69+
Backend: ${BACKEND_PORT}
70+
Frontend: ${FRONTEND_PORT}
71+
72+
panes:
73+
# `agent` panes start the configured coding agent.
74+
- id: agent
75+
kind: agent
76+
77+
# Gives focus to this pane when the session opens.
78+
focus: true
79+
80+
# Optional pane placement relative to the previous pane.
81+
# Allowed values: right, bottom
82+
split: right
83+
84+
# Optional pane size percentage for the split.
85+
sizePct: 65
86+
87+
# Optional working directory for this pane.
88+
# Allowed values: repo, worktree
89+
cwd: worktree
90+
91+
# `shell` panes start an interactive shell.
92+
- id: shell
93+
kind: shell
94+
split: bottom
95+
sizePct: 35
96+
cwd: worktree
97+
98+
# `command` panes run a startup command.
99+
- id: frontend
100+
kind: command
101+
split: right
102+
sizePct: 40
103+
cwd: worktree
104+
command: bun run frontend:dev
105+
106+
sandbox:
107+
runtime: docker
108+
yolo: true
109+
110+
# Required when `runtime: docker`.
111+
image: example-sandbox-image
112+
113+
envPassthrough:
114+
- AWS_ACCESS_KEY_ID
115+
- AWS_SECRET_ACCESS_KEY
116+
- AWS_SESSION_TOKEN
117+
118+
systemPrompt: >
119+
You are running inside a sandbox container.
120+
Use the runtime env file before starting services.
121+
122+
# Optional Docker mounts.
123+
mounts:
124+
# Host path to mount into the container.
125+
- hostPath: ~/.codex
126+
127+
# Optional container path. Defaults to `hostPath` if omitted.
128+
guestPath: /root/.codex
129+
130+
# Optional write access. Omit or set false for read-only.
131+
writable: true
132+
133+
panes:
134+
- id: agent
135+
kind: agent
136+
focus: true
137+
- id: backend
138+
kind: command
139+
split: right
140+
cwd: worktree
141+
command: bun run backend:dev
142+
143+
integrations:
144+
github:
145+
# Linked repos used for PR monitoring in the UI.
146+
linkedRepos:
147+
# GitHub repo slug.
148+
- repo: your-org/shared-lib
149+
150+
# Short display label in the UI.
151+
alias: shared
152+
153+
linear:
154+
# Enables or disables Linear issue fetching in the dashboard.
155+
enabled: true
156+
157+
lifecycleHooks:
158+
# Shell command run after a managed worktree is created and its session exists.
159+
# Runs with the worktree as cwd and receives startupEnvs, allocated ports,
160+
# and WEBMUX_* metadata in its environment.
161+
postCreate: scripts/post-create.sh
162+
163+
# Shell command run before a managed worktree is removed.
164+
preRemove: scripts/pre-remove.sh
165+
166+
auto_name:
167+
# Model used when the branch field is left empty and a prompt is provided.
168+
# Supported provider families currently include:
169+
# - claude-*
170+
# - gemini-*
171+
# - gpt-*, chatgpt-*, o*
172+
model: claude-3-5-haiku-latest
173+
174+
# Optional system prompt for branch-name generation.
175+
system_prompt: >
176+
Generate a concise git branch name from the task description.
177+
Return only the branch name in lowercase kebab-case.

0 commit comments

Comments
 (0)