oh-my-codex 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +269 -0
- package/bin/omx.js +25 -0
- package/dist/agents/definitions.d.ts +22 -0
- package/dist/agents/definitions.d.ts.map +1 -0
- package/dist/agents/definitions.js +235 -0
- package/dist/agents/definitions.js.map +1 -0
- package/dist/cli/doctor.d.ts +11 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +157 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/index.d.ts +6 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +266 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/setup.d.ts +12 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +175 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/cli/version.d.ts +2 -0
- package/dist/cli/version.d.ts.map +1 -0
- package/dist/cli/version.js +17 -0
- package/dist/cli/version.js.map +1 -0
- package/dist/config/generator.d.ts +14 -0
- package/dist/config/generator.d.ts.map +1 -0
- package/dist/config/generator.js +106 -0
- package/dist/config/generator.js.map +1 -0
- package/dist/hooks/__tests__/agents-overlay.test.d.ts +8 -0
- package/dist/hooks/__tests__/agents-overlay.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/agents-overlay.test.js +148 -0
- package/dist/hooks/__tests__/agents-overlay.test.js.map +1 -0
- package/dist/hooks/agents-overlay.d.ts +34 -0
- package/dist/hooks/agents-overlay.d.ts.map +1 -0
- package/dist/hooks/agents-overlay.js +265 -0
- package/dist/hooks/agents-overlay.js.map +1 -0
- package/dist/hooks/emulator.d.ts +44 -0
- package/dist/hooks/emulator.d.ts.map +1 -0
- package/dist/hooks/emulator.js +108 -0
- package/dist/hooks/emulator.js.map +1 -0
- package/dist/hooks/keyword-detector.d.ts +27 -0
- package/dist/hooks/keyword-detector.d.ts.map +1 -0
- package/dist/hooks/keyword-detector.js +63 -0
- package/dist/hooks/keyword-detector.js.map +1 -0
- package/dist/hooks/session.d.ts +38 -0
- package/dist/hooks/session.d.ts.map +1 -0
- package/dist/hooks/session.js +135 -0
- package/dist/hooks/session.js.map +1 -0
- package/dist/hud/colors.d.ts +26 -0
- package/dist/hud/colors.d.ts.map +1 -0
- package/dist/hud/colors.js +71 -0
- package/dist/hud/colors.js.map +1 -0
- package/dist/hud/index.d.ts +12 -0
- package/dist/hud/index.d.ts.map +1 -0
- package/dist/hud/index.js +107 -0
- package/dist/hud/index.js.map +1 -0
- package/dist/hud/render.d.ts +9 -0
- package/dist/hud/render.d.ts.map +1 -0
- package/dist/hud/render.js +192 -0
- package/dist/hud/render.js.map +1 -0
- package/dist/hud/state.d.ts +21 -0
- package/dist/hud/state.d.ts.map +1 -0
- package/dist/hud/state.js +101 -0
- package/dist/hud/state.js.map +1 -0
- package/dist/hud/types.d.ts +87 -0
- package/dist/hud/types.d.ts.map +1 -0
- package/dist/hud/types.js +8 -0
- package/dist/hud/types.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/code-intel-server.d.ts +7 -0
- package/dist/mcp/code-intel-server.d.ts.map +1 -0
- package/dist/mcp/code-intel-server.js +567 -0
- package/dist/mcp/code-intel-server.js.map +1 -0
- package/dist/mcp/memory-server.d.ts +7 -0
- package/dist/mcp/memory-server.d.ts.map +1 -0
- package/dist/mcp/memory-server.js +359 -0
- package/dist/mcp/memory-server.js.map +1 -0
- package/dist/mcp/state-server.d.ts +7 -0
- package/dist/mcp/state-server.d.ts.map +1 -0
- package/dist/mcp/state-server.js +181 -0
- package/dist/mcp/state-server.js.map +1 -0
- package/dist/mcp/trace-server.d.ts +7 -0
- package/dist/mcp/trace-server.d.ts.map +1 -0
- package/dist/mcp/trace-server.js +205 -0
- package/dist/mcp/trace-server.js.map +1 -0
- package/dist/modes/base.d.ts +50 -0
- package/dist/modes/base.d.ts.map +1 -0
- package/dist/modes/base.js +140 -0
- package/dist/modes/base.js.map +1 -0
- package/dist/notifications/notifier.d.ts +30 -0
- package/dist/notifications/notifier.d.ts.map +1 -0
- package/dist/notifications/notifier.js +124 -0
- package/dist/notifications/notifier.js.map +1 -0
- package/dist/team/orchestrator.d.ts +54 -0
- package/dist/team/orchestrator.d.ts.map +1 -0
- package/dist/team/orchestrator.js +106 -0
- package/dist/team/orchestrator.js.map +1 -0
- package/dist/utils/package.d.ts +9 -0
- package/dist/utils/package.d.ts.map +1 -0
- package/dist/utils/package.js +31 -0
- package/dist/utils/package.js.map +1 -0
- package/dist/utils/paths.d.ts +27 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +60 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/verification/verifier.d.ts +32 -0
- package/dist/verification/verifier.d.ts.map +1 -0
- package/dist/verification/verifier.js +81 -0
- package/dist/verification/verifier.js.map +1 -0
- package/package.json +54 -0
- package/prompts/analyst.md +110 -0
- package/prompts/api-reviewer.md +98 -0
- package/prompts/architect.md +109 -0
- package/prompts/build-fixer.md +89 -0
- package/prompts/code-reviewer.md +105 -0
- package/prompts/critic.md +87 -0
- package/prompts/debugger.md +93 -0
- package/prompts/deep-executor.md +112 -0
- package/prompts/dependency-expert.md +99 -0
- package/prompts/designer.md +103 -0
- package/prompts/executor.md +99 -0
- package/prompts/explore.md +112 -0
- package/prompts/git-master.md +92 -0
- package/prompts/information-architect.md +267 -0
- package/prompts/performance-reviewer.md +94 -0
- package/prompts/planner.md +116 -0
- package/prompts/product-analyst.md +299 -0
- package/prompts/product-manager.md +255 -0
- package/prompts/qa-tester.md +98 -0
- package/prompts/quality-reviewer.md +105 -0
- package/prompts/quality-strategist.md +227 -0
- package/prompts/researcher.md +96 -0
- package/prompts/scientist.md +92 -0
- package/prompts/security-reviewer.md +125 -0
- package/prompts/style-reviewer.md +87 -0
- package/prompts/test-engineer.md +103 -0
- package/prompts/ux-researcher.md +282 -0
- package/prompts/verifier.md +95 -0
- package/prompts/vision.md +75 -0
- package/prompts/writer.md +86 -0
- package/scripts/notify-hook.js +237 -0
- package/skills/analyze/SKILL.md +93 -0
- package/skills/autopilot/SKILL.md +175 -0
- package/skills/build-fix/SKILL.md +123 -0
- package/skills/cancel/SKILL.md +387 -0
- package/skills/code-review/SKILL.md +208 -0
- package/skills/configure-discord/SKILL.md +256 -0
- package/skills/configure-telegram/SKILL.md +232 -0
- package/skills/deepinit/SKILL.md +320 -0
- package/skills/deepsearch/SKILL.md +38 -0
- package/skills/doctor/SKILL.md +193 -0
- package/skills/ecomode/SKILL.md +114 -0
- package/skills/frontend-ui-ux/SKILL.md +34 -0
- package/skills/git-master/SKILL.md +29 -0
- package/skills/help/SKILL.md +192 -0
- package/skills/hud/SKILL.md +97 -0
- package/skills/learn-about-omx/SKILL.md +37 -0
- package/skills/learner/SKILL.md +135 -0
- package/skills/note/SKILL.md +62 -0
- package/skills/omx-setup/SKILL.md +1147 -0
- package/skills/pipeline/SKILL.md +407 -0
- package/skills/plan/SKILL.md +223 -0
- package/skills/project-session-manager/SKILL.md +560 -0
- package/skills/psm/SKILL.md +20 -0
- package/skills/ralph/SKILL.md +197 -0
- package/skills/ralph-init/SKILL.md +38 -0
- package/skills/ralplan/SKILL.md +34 -0
- package/skills/release/SKILL.md +83 -0
- package/skills/research/SKILL.md +510 -0
- package/skills/review/SKILL.md +30 -0
- package/skills/security-review/SKILL.md +284 -0
- package/skills/skill/SKILL.md +837 -0
- package/skills/swarm/SKILL.md +25 -0
- package/skills/tdd/SKILL.md +106 -0
- package/skills/team/SKILL.md +860 -0
- package/skills/trace/SKILL.md +33 -0
- package/skills/ultrapilot/SKILL.md +632 -0
- package/skills/ultraqa/SKILL.md +130 -0
- package/skills/ultrawork/SKILL.md +143 -0
- package/skills/writer-memory/SKILL.md +443 -0
- package/templates/AGENTS.md +326 -0
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: project-session-manager
|
|
3
|
+
description: Manage isolated dev environments with git worktrees and tmux sessions
|
|
4
|
+
aliases: [psm]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Project Session Manager (PSM) Skill
|
|
8
|
+
|
|
9
|
+
> **Quick Start:** For simple worktree creation without tmux sessions, use `omc teleport`:
|
|
10
|
+
> ```bash
|
|
11
|
+
> omc teleport #123 # Create worktree for issue/PR
|
|
12
|
+
> omc teleport my-feature # Create worktree for feature
|
|
13
|
+
> omc teleport list # List worktrees
|
|
14
|
+
> ```
|
|
15
|
+
> See [Teleport Command](#teleport-command) below for details.
|
|
16
|
+
|
|
17
|
+
Automate isolated development environments using git worktrees and tmux sessions with Codex CLI. Enables parallel work across multiple tasks, projects, and repositories.
|
|
18
|
+
|
|
19
|
+
## Commands
|
|
20
|
+
|
|
21
|
+
| Command | Description | Example |
|
|
22
|
+
|---------|-------------|---------|
|
|
23
|
+
| `review <ref>` | PR review session | `/psm review omc#123` |
|
|
24
|
+
| `fix <ref>` | Issue fix session | `/psm fix omc#42` |
|
|
25
|
+
| `feature <proj> <name>` | Feature development | `/psm feature omc add-webhooks` |
|
|
26
|
+
| `list [project]` | List active sessions | `/psm list` |
|
|
27
|
+
| `attach <session>` | Attach to session | `/psm attach omc:pr-123` |
|
|
28
|
+
| `kill <session>` | Kill session | `/psm kill omc:pr-123` |
|
|
29
|
+
| `cleanup` | Clean merged/closed | `/psm cleanup` |
|
|
30
|
+
| `status` | Current session info | `/psm status` |
|
|
31
|
+
|
|
32
|
+
## Project References
|
|
33
|
+
|
|
34
|
+
Supported formats:
|
|
35
|
+
- **Alias**: `omc#123` (requires `~/.psm/projects.json`)
|
|
36
|
+
- **Full**: `owner/repo#123`
|
|
37
|
+
- **URL**: `https://github.com/owner/repo/pull/123`
|
|
38
|
+
- **Current**: `#123` (uses current directory's repo)
|
|
39
|
+
|
|
40
|
+
## Configuration
|
|
41
|
+
|
|
42
|
+
### Project Aliases (`~/.psm/projects.json`)
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"aliases": {
|
|
47
|
+
"omc": {
|
|
48
|
+
"repo": "Yeachan-Heo/oh-my-codex",
|
|
49
|
+
"local": "~/Workspace/oh-my-codex",
|
|
50
|
+
"default_base": "main"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"defaults": {
|
|
54
|
+
"worktree_root": "~/.psm/worktrees",
|
|
55
|
+
"cleanup_after_days": 14
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Providers
|
|
61
|
+
|
|
62
|
+
PSM supports multiple issue tracking providers:
|
|
63
|
+
|
|
64
|
+
| Provider | CLI Required | Reference Formats | Commands |
|
|
65
|
+
|----------|--------------|-------------------|----------|
|
|
66
|
+
| GitHub (default) | `gh` | `owner/repo#123`, `alias#123`, GitHub URLs | review, fix, feature |
|
|
67
|
+
| Jira | `jira` | `PROJ-123` (if PROJ configured), `alias#123` | fix, feature |
|
|
68
|
+
|
|
69
|
+
### Jira Configuration
|
|
70
|
+
|
|
71
|
+
To use Jira, add an alias with `jira_project` and `provider: "jira"`:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"aliases": {
|
|
76
|
+
"mywork": {
|
|
77
|
+
"jira_project": "MYPROJ",
|
|
78
|
+
"repo": "mycompany/my-project",
|
|
79
|
+
"local": "~/Workspace/my-project",
|
|
80
|
+
"default_base": "develop",
|
|
81
|
+
"provider": "jira"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Important:** The `repo` field is still required for cloning the git repository. Jira tracks issues, but you work in a git repo.
|
|
88
|
+
|
|
89
|
+
For non-GitHub repos, use `clone_url` instead:
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"aliases": {
|
|
93
|
+
"private": {
|
|
94
|
+
"jira_project": "PRIV",
|
|
95
|
+
"clone_url": "git@gitlab.internal:team/repo.git",
|
|
96
|
+
"local": "~/Workspace/repo",
|
|
97
|
+
"provider": "jira"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Jira Reference Detection
|
|
104
|
+
|
|
105
|
+
PSM only recognizes `PROJ-123` format as Jira when `PROJ` is explicitly configured as a `jira_project` in your aliases. This prevents false positives from branch names like `FIX-123`.
|
|
106
|
+
|
|
107
|
+
### Jira Examples
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Fix a Jira issue (MYPROJ must be configured)
|
|
111
|
+
psm fix MYPROJ-123
|
|
112
|
+
|
|
113
|
+
# Fix using alias (recommended)
|
|
114
|
+
psm fix mywork#123
|
|
115
|
+
|
|
116
|
+
# Feature development (works same as GitHub)
|
|
117
|
+
psm feature mywork add-webhooks
|
|
118
|
+
|
|
119
|
+
# Note: 'psm review' is not supported for Jira (no PR concept)
|
|
120
|
+
# Use 'psm fix' for Jira issues
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Jira CLI Setup
|
|
124
|
+
|
|
125
|
+
Install the Jira CLI:
|
|
126
|
+
```bash
|
|
127
|
+
# macOS
|
|
128
|
+
brew install ankitpokhrel/jira-cli/jira-cli
|
|
129
|
+
|
|
130
|
+
# Linux
|
|
131
|
+
# See: https://github.com/ankitpokhrel/jira-cli#installation
|
|
132
|
+
|
|
133
|
+
# Configure (interactive)
|
|
134
|
+
jira init
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
The Jira CLI handles authentication separately from PSM.
|
|
138
|
+
|
|
139
|
+
## Directory Structure
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
~/.psm/
|
|
143
|
+
├── projects.json # Project aliases
|
|
144
|
+
├── sessions.json # Active session registry
|
|
145
|
+
└── worktrees/ # Worktree storage
|
|
146
|
+
└── <project>/
|
|
147
|
+
└── <type>-<id>/
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Session Naming
|
|
151
|
+
|
|
152
|
+
| Type | Tmux Session | Worktree Dir |
|
|
153
|
+
|------|--------------|--------------|
|
|
154
|
+
| PR Review | `psm:omc:pr-123` | `~/.psm/worktrees/omc/pr-123` |
|
|
155
|
+
| Issue Fix | `psm:omc:issue-42` | `~/.psm/worktrees/omc/issue-42` |
|
|
156
|
+
| Feature | `psm:omc:feat-auth` | `~/.psm/worktrees/omc/feat-auth` |
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Implementation Protocol
|
|
161
|
+
|
|
162
|
+
When the user invokes a PSM command, follow this protocol:
|
|
163
|
+
|
|
164
|
+
### Parse Arguments
|
|
165
|
+
|
|
166
|
+
Parse `{{ARGUMENTS}}` to determine:
|
|
167
|
+
1. **Subcommand**: review, fix, feature, list, attach, kill, cleanup, status
|
|
168
|
+
2. **Reference**: project#number, URL, or session ID
|
|
169
|
+
3. **Options**: --branch, --base, --no-claude, --no-tmux, etc.
|
|
170
|
+
|
|
171
|
+
### Subcommand: `review <ref>`
|
|
172
|
+
|
|
173
|
+
**Purpose**: Create PR review session
|
|
174
|
+
|
|
175
|
+
**Steps**:
|
|
176
|
+
|
|
177
|
+
1. **Resolve reference**:
|
|
178
|
+
```bash
|
|
179
|
+
# Read project aliases
|
|
180
|
+
cat ~/.psm/projects.json 2>/dev/null || echo '{"aliases":{}}'
|
|
181
|
+
|
|
182
|
+
# Parse ref format: alias#num, owner/repo#num, or URL
|
|
183
|
+
# Extract: project_alias, repo (owner/repo), pr_number, local_path
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
2. **Fetch PR info**:
|
|
187
|
+
```bash
|
|
188
|
+
gh pr view <pr_number> --repo <repo> --json number,title,author,headRefName,baseRefName,body,files,url
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
3. **Ensure local repo exists**:
|
|
192
|
+
```bash
|
|
193
|
+
# If local path doesn't exist, clone
|
|
194
|
+
if [[ ! -d "$local_path" ]]; then
|
|
195
|
+
git clone "https://github.com/$repo.git" "$local_path"
|
|
196
|
+
fi
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
4. **Create worktree**:
|
|
200
|
+
```bash
|
|
201
|
+
worktree_path="$HOME/.psm/worktrees/$project_alias/pr-$pr_number"
|
|
202
|
+
|
|
203
|
+
# Fetch PR branch
|
|
204
|
+
cd "$local_path"
|
|
205
|
+
git fetch origin "pull/$pr_number/head:pr-$pr_number-review"
|
|
206
|
+
|
|
207
|
+
# Create worktree
|
|
208
|
+
git worktree add "$worktree_path" "pr-$pr_number-review"
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
5. **Create session metadata**:
|
|
212
|
+
```bash
|
|
213
|
+
cat > "$worktree_path/.psm-session.json" << EOF
|
|
214
|
+
{
|
|
215
|
+
"id": "$project_alias:pr-$pr_number",
|
|
216
|
+
"type": "review",
|
|
217
|
+
"project": "$project_alias",
|
|
218
|
+
"ref": "pr-$pr_number",
|
|
219
|
+
"branch": "<head_branch>",
|
|
220
|
+
"base": "<base_branch>",
|
|
221
|
+
"created_at": "$(date -Iseconds)",
|
|
222
|
+
"tmux_session": "psm:$project_alias:pr-$pr_number",
|
|
223
|
+
"worktree_path": "$worktree_path",
|
|
224
|
+
"source_repo": "$local_path",
|
|
225
|
+
"github": {
|
|
226
|
+
"pr_number": $pr_number,
|
|
227
|
+
"pr_title": "<title>",
|
|
228
|
+
"pr_author": "<author>",
|
|
229
|
+
"pr_url": "<url>"
|
|
230
|
+
},
|
|
231
|
+
"state": "active"
|
|
232
|
+
}
|
|
233
|
+
EOF
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
6. **Update sessions registry**:
|
|
237
|
+
```bash
|
|
238
|
+
# Add to ~/.psm/sessions.json
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
7. **Create tmux session**:
|
|
242
|
+
```bash
|
|
243
|
+
tmux new-session -d -s "psm:$project_alias:pr-$pr_number" -c "$worktree_path"
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
8. **Launch Codex CLI** (unless --no-claude):
|
|
247
|
+
```bash
|
|
248
|
+
tmux send-keys -t "psm:$project_alias:pr-$pr_number" "claude" Enter
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
9. **Output session info**:
|
|
252
|
+
```
|
|
253
|
+
Session ready!
|
|
254
|
+
|
|
255
|
+
ID: omc:pr-123
|
|
256
|
+
Worktree: ~/.psm/worktrees/omc/pr-123
|
|
257
|
+
Tmux: psm:omc:pr-123
|
|
258
|
+
|
|
259
|
+
To attach: tmux attach -t psm:omc:pr-123
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Subcommand: `fix <ref>`
|
|
263
|
+
|
|
264
|
+
**Purpose**: Create issue fix session
|
|
265
|
+
|
|
266
|
+
**Steps**:
|
|
267
|
+
|
|
268
|
+
1. **Resolve reference** (same as review)
|
|
269
|
+
|
|
270
|
+
2. **Fetch issue info**:
|
|
271
|
+
```bash
|
|
272
|
+
gh issue view <issue_number> --repo <repo> --json number,title,body,labels,url
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
3. **Create feature branch**:
|
|
276
|
+
```bash
|
|
277
|
+
cd "$local_path"
|
|
278
|
+
git fetch origin main
|
|
279
|
+
branch_name="fix/$issue_number-$(echo "$title" | tr ' ' '-' | tr '[:upper:]' '[:lower:]' | head -c 30)"
|
|
280
|
+
git checkout -b "$branch_name" origin/main
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
4. **Create worktree**:
|
|
284
|
+
```bash
|
|
285
|
+
worktree_path="$HOME/.psm/worktrees/$project_alias/issue-$issue_number"
|
|
286
|
+
git worktree add "$worktree_path" "$branch_name"
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
5. **Create session metadata** (similar to review, type="fix")
|
|
290
|
+
|
|
291
|
+
6. **Update registry, create tmux, launch claude** (same as review)
|
|
292
|
+
|
|
293
|
+
### Subcommand: `feature <project> <name>`
|
|
294
|
+
|
|
295
|
+
**Purpose**: Start feature development
|
|
296
|
+
|
|
297
|
+
**Steps**:
|
|
298
|
+
|
|
299
|
+
1. **Resolve project** (from alias or path)
|
|
300
|
+
|
|
301
|
+
2. **Create feature branch**:
|
|
302
|
+
```bash
|
|
303
|
+
cd "$local_path"
|
|
304
|
+
git fetch origin main
|
|
305
|
+
branch_name="feature/$feature_name"
|
|
306
|
+
git checkout -b "$branch_name" origin/main
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
3. **Create worktree**:
|
|
310
|
+
```bash
|
|
311
|
+
worktree_path="$HOME/.psm/worktrees/$project_alias/feat-$feature_name"
|
|
312
|
+
git worktree add "$worktree_path" "$branch_name"
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
4. **Create session, tmux, launch claude** (same pattern)
|
|
316
|
+
|
|
317
|
+
### Subcommand: `list [project]`
|
|
318
|
+
|
|
319
|
+
**Purpose**: List active sessions
|
|
320
|
+
|
|
321
|
+
**Steps**:
|
|
322
|
+
|
|
323
|
+
1. **Read sessions registry**:
|
|
324
|
+
```bash
|
|
325
|
+
cat ~/.psm/sessions.json 2>/dev/null || echo '{"sessions":{}}'
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
2. **Check tmux sessions**:
|
|
329
|
+
```bash
|
|
330
|
+
tmux list-sessions -F "#{session_name}" 2>/dev/null | grep "^psm:"
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
3. **Check worktrees**:
|
|
334
|
+
```bash
|
|
335
|
+
ls -la ~/.psm/worktrees/*/ 2>/dev/null
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
4. **Format output**:
|
|
339
|
+
```
|
|
340
|
+
Active PSM Sessions:
|
|
341
|
+
|
|
342
|
+
ID | Type | Status | Worktree
|
|
343
|
+
-------------------|---------|----------|---------------------------
|
|
344
|
+
omc:pr-123 | review | active | ~/.psm/worktrees/omc/pr-123
|
|
345
|
+
omc:issue-42 | fix | detached | ~/.psm/worktrees/omc/issue-42
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### Subcommand: `attach <session>`
|
|
349
|
+
|
|
350
|
+
**Purpose**: Attach to existing session
|
|
351
|
+
|
|
352
|
+
**Steps**:
|
|
353
|
+
|
|
354
|
+
1. **Parse session ID**: `project:type-number`
|
|
355
|
+
|
|
356
|
+
2. **Verify session exists**:
|
|
357
|
+
```bash
|
|
358
|
+
tmux has-session -t "psm:$session_id" 2>/dev/null
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
3. **Attach**:
|
|
362
|
+
```bash
|
|
363
|
+
tmux attach -t "psm:$session_id"
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### Subcommand: `kill <session>`
|
|
367
|
+
|
|
368
|
+
**Purpose**: Kill session and cleanup
|
|
369
|
+
|
|
370
|
+
**Steps**:
|
|
371
|
+
|
|
372
|
+
1. **Kill tmux session**:
|
|
373
|
+
```bash
|
|
374
|
+
tmux kill-session -t "psm:$session_id" 2>/dev/null
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
2. **Remove worktree**:
|
|
378
|
+
```bash
|
|
379
|
+
worktree_path=$(jq -r ".sessions[\"$session_id\"].worktree" ~/.psm/sessions.json)
|
|
380
|
+
source_repo=$(jq -r ".sessions[\"$session_id\"].source_repo" ~/.psm/sessions.json)
|
|
381
|
+
|
|
382
|
+
cd "$source_repo"
|
|
383
|
+
git worktree remove "$worktree_path" --force
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
3. **Update registry**:
|
|
387
|
+
```bash
|
|
388
|
+
# Remove from sessions.json
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
### Subcommand: `cleanup`
|
|
392
|
+
|
|
393
|
+
**Purpose**: Clean up merged PRs and closed issues
|
|
394
|
+
|
|
395
|
+
**Steps**:
|
|
396
|
+
|
|
397
|
+
1. **Read all sessions**
|
|
398
|
+
|
|
399
|
+
2. **For each PR session, check if merged**:
|
|
400
|
+
```bash
|
|
401
|
+
gh pr view <pr_number> --repo <repo> --json merged,state
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
3. **For each issue session, check if closed**:
|
|
405
|
+
```bash
|
|
406
|
+
gh issue view <issue_number> --repo <repo> --json closed,state
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
4. **Clean up merged/closed sessions**:
|
|
410
|
+
- Kill tmux session
|
|
411
|
+
- Remove worktree
|
|
412
|
+
- Update registry
|
|
413
|
+
|
|
414
|
+
5. **Report**:
|
|
415
|
+
```
|
|
416
|
+
Cleanup complete:
|
|
417
|
+
Removed: omc:pr-123 (merged)
|
|
418
|
+
Removed: omc:issue-42 (closed)
|
|
419
|
+
Kept: omc:feat-auth (active)
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
### Subcommand: `status`
|
|
423
|
+
|
|
424
|
+
**Purpose**: Show current session info
|
|
425
|
+
|
|
426
|
+
**Steps**:
|
|
427
|
+
|
|
428
|
+
1. **Detect current session** from tmux or cwd:
|
|
429
|
+
```bash
|
|
430
|
+
tmux display-message -p "#{session_name}" 2>/dev/null
|
|
431
|
+
# or check if cwd is inside a worktree
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
2. **Read session metadata**:
|
|
435
|
+
```bash
|
|
436
|
+
cat .psm-session.json 2>/dev/null
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
3. **Show status**:
|
|
440
|
+
```
|
|
441
|
+
Current Session: omc:pr-123
|
|
442
|
+
Type: review
|
|
443
|
+
PR: #123 - Add webhook support
|
|
444
|
+
Branch: feature/webhooks
|
|
445
|
+
Created: 2 hours ago
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
---
|
|
449
|
+
|
|
450
|
+
## Error Handling
|
|
451
|
+
|
|
452
|
+
| Error | Resolution |
|
|
453
|
+
|-------|------------|
|
|
454
|
+
| Worktree exists | Offer: attach, recreate, or abort |
|
|
455
|
+
| PR not found | Verify URL/number, check permissions |
|
|
456
|
+
| No tmux | Warn and skip session creation |
|
|
457
|
+
| No gh CLI | Error with install instructions |
|
|
458
|
+
|
|
459
|
+
## Teleport Command
|
|
460
|
+
|
|
461
|
+
The `omc teleport` command provides a lightweight alternative to full PSM sessions. It creates git worktrees without tmux session management — ideal for quick, isolated development.
|
|
462
|
+
|
|
463
|
+
### Usage
|
|
464
|
+
|
|
465
|
+
```bash
|
|
466
|
+
# Create worktree for an issue or PR
|
|
467
|
+
omc teleport #123
|
|
468
|
+
omc teleport owner/repo#123
|
|
469
|
+
omc teleport https://github.com/owner/repo/issues/42
|
|
470
|
+
|
|
471
|
+
# Create worktree for a feature
|
|
472
|
+
omc teleport my-feature
|
|
473
|
+
|
|
474
|
+
# List existing worktrees
|
|
475
|
+
omc teleport list
|
|
476
|
+
|
|
477
|
+
# Remove a worktree
|
|
478
|
+
omc teleport remove issue/my-repo-123
|
|
479
|
+
omc teleport remove --force feat/my-repo-my-feature
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
### Options
|
|
483
|
+
|
|
484
|
+
| Flag | Description | Default |
|
|
485
|
+
|------|-------------|---------|
|
|
486
|
+
| `--worktree` | Create worktree (default, kept for compatibility) | `true` |
|
|
487
|
+
| `--path <path>` | Custom worktree root directory | `~/Workspace/omc-worktrees/` |
|
|
488
|
+
| `--base <branch>` | Base branch to create from | `main` |
|
|
489
|
+
| `--json` | Output as JSON | `false` |
|
|
490
|
+
|
|
491
|
+
### Worktree Layout
|
|
492
|
+
|
|
493
|
+
```
|
|
494
|
+
~/Workspace/omc-worktrees/
|
|
495
|
+
├── issue/
|
|
496
|
+
│ └── my-repo-123/ # Issue worktrees
|
|
497
|
+
├── pr/
|
|
498
|
+
│ └── my-repo-456/ # PR review worktrees
|
|
499
|
+
└── feat/
|
|
500
|
+
└── my-repo-my-feature/ # Feature worktrees
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
### PSM vs Teleport
|
|
504
|
+
|
|
505
|
+
| Feature | PSM | Teleport |
|
|
506
|
+
|---------|-----|----------|
|
|
507
|
+
| Git worktree | Yes | Yes |
|
|
508
|
+
| Tmux session | Yes | No |
|
|
509
|
+
| Codex CLI launch | Yes | No |
|
|
510
|
+
| Session registry | Yes | No |
|
|
511
|
+
| Auto-cleanup | Yes | No |
|
|
512
|
+
| Project aliases | Yes | No (uses current repo) |
|
|
513
|
+
|
|
514
|
+
Use **PSM** for full managed sessions. Use **teleport** for quick worktree creation.
|
|
515
|
+
|
|
516
|
+
---
|
|
517
|
+
|
|
518
|
+
## Requirements
|
|
519
|
+
|
|
520
|
+
Required:
|
|
521
|
+
- `git` - Version control (with worktree support v2.5+)
|
|
522
|
+
- `jq` - JSON parsing
|
|
523
|
+
- `tmux` - Session management (optional, but recommended)
|
|
524
|
+
|
|
525
|
+
Optional (per provider):
|
|
526
|
+
- `gh` - GitHub CLI (for GitHub workflows)
|
|
527
|
+
- `jira` - Jira CLI (for Jira workflows)
|
|
528
|
+
|
|
529
|
+
## Initialization
|
|
530
|
+
|
|
531
|
+
On first run, create default config:
|
|
532
|
+
|
|
533
|
+
```bash
|
|
534
|
+
mkdir -p ~/.psm/worktrees ~/.psm/logs
|
|
535
|
+
|
|
536
|
+
# Create default projects.json if not exists
|
|
537
|
+
if [[ ! -f ~/.psm/projects.json ]]; then
|
|
538
|
+
cat > ~/.psm/projects.json << 'EOF'
|
|
539
|
+
{
|
|
540
|
+
"aliases": {
|
|
541
|
+
"omc": {
|
|
542
|
+
"repo": "Yeachan-Heo/oh-my-codex",
|
|
543
|
+
"local": "~/Workspace/oh-my-codex",
|
|
544
|
+
"default_base": "main"
|
|
545
|
+
}
|
|
546
|
+
},
|
|
547
|
+
"defaults": {
|
|
548
|
+
"worktree_root": "~/.psm/worktrees",
|
|
549
|
+
"cleanup_after_days": 14,
|
|
550
|
+
"auto_cleanup_merged": true
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
EOF
|
|
554
|
+
fi
|
|
555
|
+
|
|
556
|
+
# Create sessions.json if not exists
|
|
557
|
+
if [[ ! -f ~/.psm/sessions.json ]]; then
|
|
558
|
+
echo '{"version":1,"sessions":{},"stats":{"total_created":0,"total_cleaned":0}}' > ~/.psm/sessions.json
|
|
559
|
+
fi
|
|
560
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: psm
|
|
3
|
+
description: Project Session Manager - isolated dev environments with git worktrees and tmux
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# PSM (Project Session Manager Alias)
|
|
7
|
+
|
|
8
|
+
PSM is a shorthand alias for `/project-session-manager`.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
/psm <arguments>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Behavior
|
|
17
|
+
|
|
18
|
+
This skill is identical to `/project-session-manager`. Invoke the Project Session Manager skill with the same arguments.
|
|
19
|
+
|
|
20
|
+
Follow the Project Session Manager skill's full documentation for worktree management, tmux session handling, and template usage.
|