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.
Files changed (182) hide show
  1. package/README.md +269 -0
  2. package/bin/omx.js +25 -0
  3. package/dist/agents/definitions.d.ts +22 -0
  4. package/dist/agents/definitions.d.ts.map +1 -0
  5. package/dist/agents/definitions.js +235 -0
  6. package/dist/agents/definitions.js.map +1 -0
  7. package/dist/cli/doctor.d.ts +11 -0
  8. package/dist/cli/doctor.d.ts.map +1 -0
  9. package/dist/cli/doctor.js +157 -0
  10. package/dist/cli/doctor.js.map +1 -0
  11. package/dist/cli/index.d.ts +6 -0
  12. package/dist/cli/index.d.ts.map +1 -0
  13. package/dist/cli/index.js +266 -0
  14. package/dist/cli/index.js.map +1 -0
  15. package/dist/cli/setup.d.ts +12 -0
  16. package/dist/cli/setup.d.ts.map +1 -0
  17. package/dist/cli/setup.js +175 -0
  18. package/dist/cli/setup.js.map +1 -0
  19. package/dist/cli/version.d.ts +2 -0
  20. package/dist/cli/version.d.ts.map +1 -0
  21. package/dist/cli/version.js +17 -0
  22. package/dist/cli/version.js.map +1 -0
  23. package/dist/config/generator.d.ts +14 -0
  24. package/dist/config/generator.d.ts.map +1 -0
  25. package/dist/config/generator.js +106 -0
  26. package/dist/config/generator.js.map +1 -0
  27. package/dist/hooks/__tests__/agents-overlay.test.d.ts +8 -0
  28. package/dist/hooks/__tests__/agents-overlay.test.d.ts.map +1 -0
  29. package/dist/hooks/__tests__/agents-overlay.test.js +148 -0
  30. package/dist/hooks/__tests__/agents-overlay.test.js.map +1 -0
  31. package/dist/hooks/agents-overlay.d.ts +34 -0
  32. package/dist/hooks/agents-overlay.d.ts.map +1 -0
  33. package/dist/hooks/agents-overlay.js +265 -0
  34. package/dist/hooks/agents-overlay.js.map +1 -0
  35. package/dist/hooks/emulator.d.ts +44 -0
  36. package/dist/hooks/emulator.d.ts.map +1 -0
  37. package/dist/hooks/emulator.js +108 -0
  38. package/dist/hooks/emulator.js.map +1 -0
  39. package/dist/hooks/keyword-detector.d.ts +27 -0
  40. package/dist/hooks/keyword-detector.d.ts.map +1 -0
  41. package/dist/hooks/keyword-detector.js +63 -0
  42. package/dist/hooks/keyword-detector.js.map +1 -0
  43. package/dist/hooks/session.d.ts +38 -0
  44. package/dist/hooks/session.d.ts.map +1 -0
  45. package/dist/hooks/session.js +135 -0
  46. package/dist/hooks/session.js.map +1 -0
  47. package/dist/hud/colors.d.ts +26 -0
  48. package/dist/hud/colors.d.ts.map +1 -0
  49. package/dist/hud/colors.js +71 -0
  50. package/dist/hud/colors.js.map +1 -0
  51. package/dist/hud/index.d.ts +12 -0
  52. package/dist/hud/index.d.ts.map +1 -0
  53. package/dist/hud/index.js +107 -0
  54. package/dist/hud/index.js.map +1 -0
  55. package/dist/hud/render.d.ts +9 -0
  56. package/dist/hud/render.d.ts.map +1 -0
  57. package/dist/hud/render.js +192 -0
  58. package/dist/hud/render.js.map +1 -0
  59. package/dist/hud/state.d.ts +21 -0
  60. package/dist/hud/state.d.ts.map +1 -0
  61. package/dist/hud/state.js +101 -0
  62. package/dist/hud/state.js.map +1 -0
  63. package/dist/hud/types.d.ts +87 -0
  64. package/dist/hud/types.d.ts.map +1 -0
  65. package/dist/hud/types.js +8 -0
  66. package/dist/hud/types.js.map +1 -0
  67. package/dist/index.d.ts +18 -0
  68. package/dist/index.d.ts.map +1 -0
  69. package/dist/index.js +18 -0
  70. package/dist/index.js.map +1 -0
  71. package/dist/mcp/code-intel-server.d.ts +7 -0
  72. package/dist/mcp/code-intel-server.d.ts.map +1 -0
  73. package/dist/mcp/code-intel-server.js +567 -0
  74. package/dist/mcp/code-intel-server.js.map +1 -0
  75. package/dist/mcp/memory-server.d.ts +7 -0
  76. package/dist/mcp/memory-server.d.ts.map +1 -0
  77. package/dist/mcp/memory-server.js +359 -0
  78. package/dist/mcp/memory-server.js.map +1 -0
  79. package/dist/mcp/state-server.d.ts +7 -0
  80. package/dist/mcp/state-server.d.ts.map +1 -0
  81. package/dist/mcp/state-server.js +181 -0
  82. package/dist/mcp/state-server.js.map +1 -0
  83. package/dist/mcp/trace-server.d.ts +7 -0
  84. package/dist/mcp/trace-server.d.ts.map +1 -0
  85. package/dist/mcp/trace-server.js +205 -0
  86. package/dist/mcp/trace-server.js.map +1 -0
  87. package/dist/modes/base.d.ts +50 -0
  88. package/dist/modes/base.d.ts.map +1 -0
  89. package/dist/modes/base.js +140 -0
  90. package/dist/modes/base.js.map +1 -0
  91. package/dist/notifications/notifier.d.ts +30 -0
  92. package/dist/notifications/notifier.d.ts.map +1 -0
  93. package/dist/notifications/notifier.js +124 -0
  94. package/dist/notifications/notifier.js.map +1 -0
  95. package/dist/team/orchestrator.d.ts +54 -0
  96. package/dist/team/orchestrator.d.ts.map +1 -0
  97. package/dist/team/orchestrator.js +106 -0
  98. package/dist/team/orchestrator.js.map +1 -0
  99. package/dist/utils/package.d.ts +9 -0
  100. package/dist/utils/package.d.ts.map +1 -0
  101. package/dist/utils/package.js +31 -0
  102. package/dist/utils/package.js.map +1 -0
  103. package/dist/utils/paths.d.ts +27 -0
  104. package/dist/utils/paths.d.ts.map +1 -0
  105. package/dist/utils/paths.js +60 -0
  106. package/dist/utils/paths.js.map +1 -0
  107. package/dist/verification/verifier.d.ts +32 -0
  108. package/dist/verification/verifier.d.ts.map +1 -0
  109. package/dist/verification/verifier.js +81 -0
  110. package/dist/verification/verifier.js.map +1 -0
  111. package/package.json +54 -0
  112. package/prompts/analyst.md +110 -0
  113. package/prompts/api-reviewer.md +98 -0
  114. package/prompts/architect.md +109 -0
  115. package/prompts/build-fixer.md +89 -0
  116. package/prompts/code-reviewer.md +105 -0
  117. package/prompts/critic.md +87 -0
  118. package/prompts/debugger.md +93 -0
  119. package/prompts/deep-executor.md +112 -0
  120. package/prompts/dependency-expert.md +99 -0
  121. package/prompts/designer.md +103 -0
  122. package/prompts/executor.md +99 -0
  123. package/prompts/explore.md +112 -0
  124. package/prompts/git-master.md +92 -0
  125. package/prompts/information-architect.md +267 -0
  126. package/prompts/performance-reviewer.md +94 -0
  127. package/prompts/planner.md +116 -0
  128. package/prompts/product-analyst.md +299 -0
  129. package/prompts/product-manager.md +255 -0
  130. package/prompts/qa-tester.md +98 -0
  131. package/prompts/quality-reviewer.md +105 -0
  132. package/prompts/quality-strategist.md +227 -0
  133. package/prompts/researcher.md +96 -0
  134. package/prompts/scientist.md +92 -0
  135. package/prompts/security-reviewer.md +125 -0
  136. package/prompts/style-reviewer.md +87 -0
  137. package/prompts/test-engineer.md +103 -0
  138. package/prompts/ux-researcher.md +282 -0
  139. package/prompts/verifier.md +95 -0
  140. package/prompts/vision.md +75 -0
  141. package/prompts/writer.md +86 -0
  142. package/scripts/notify-hook.js +237 -0
  143. package/skills/analyze/SKILL.md +93 -0
  144. package/skills/autopilot/SKILL.md +175 -0
  145. package/skills/build-fix/SKILL.md +123 -0
  146. package/skills/cancel/SKILL.md +387 -0
  147. package/skills/code-review/SKILL.md +208 -0
  148. package/skills/configure-discord/SKILL.md +256 -0
  149. package/skills/configure-telegram/SKILL.md +232 -0
  150. package/skills/deepinit/SKILL.md +320 -0
  151. package/skills/deepsearch/SKILL.md +38 -0
  152. package/skills/doctor/SKILL.md +193 -0
  153. package/skills/ecomode/SKILL.md +114 -0
  154. package/skills/frontend-ui-ux/SKILL.md +34 -0
  155. package/skills/git-master/SKILL.md +29 -0
  156. package/skills/help/SKILL.md +192 -0
  157. package/skills/hud/SKILL.md +97 -0
  158. package/skills/learn-about-omx/SKILL.md +37 -0
  159. package/skills/learner/SKILL.md +135 -0
  160. package/skills/note/SKILL.md +62 -0
  161. package/skills/omx-setup/SKILL.md +1147 -0
  162. package/skills/pipeline/SKILL.md +407 -0
  163. package/skills/plan/SKILL.md +223 -0
  164. package/skills/project-session-manager/SKILL.md +560 -0
  165. package/skills/psm/SKILL.md +20 -0
  166. package/skills/ralph/SKILL.md +197 -0
  167. package/skills/ralph-init/SKILL.md +38 -0
  168. package/skills/ralplan/SKILL.md +34 -0
  169. package/skills/release/SKILL.md +83 -0
  170. package/skills/research/SKILL.md +510 -0
  171. package/skills/review/SKILL.md +30 -0
  172. package/skills/security-review/SKILL.md +284 -0
  173. package/skills/skill/SKILL.md +837 -0
  174. package/skills/swarm/SKILL.md +25 -0
  175. package/skills/tdd/SKILL.md +106 -0
  176. package/skills/team/SKILL.md +860 -0
  177. package/skills/trace/SKILL.md +33 -0
  178. package/skills/ultrapilot/SKILL.md +632 -0
  179. package/skills/ultraqa/SKILL.md +130 -0
  180. package/skills/ultrawork/SKILL.md +143 -0
  181. package/skills/writer-memory/SKILL.md +443 -0
  182. 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.