@undeemed/get-shit-done-codex 1.6.5

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 (79) hide show
  1. package/AGENTS.md +183 -0
  2. package/LICENSE +21 -0
  3. package/README.md +179 -0
  4. package/bin/install.js +214 -0
  5. package/commands/gsd/add-phase.md +207 -0
  6. package/commands/gsd/add-todo.md +182 -0
  7. package/commands/gsd/audit-milestone.md +258 -0
  8. package/commands/gsd/check-todos.md +217 -0
  9. package/commands/gsd/complete-milestone.md +136 -0
  10. package/commands/gsd/debug.md +149 -0
  11. package/commands/gsd/discuss-phase.md +80 -0
  12. package/commands/gsd/execute-phase.md +304 -0
  13. package/commands/gsd/help.md +383 -0
  14. package/commands/gsd/insert-phase.md +227 -0
  15. package/commands/gsd/list-phase-assumptions.md +50 -0
  16. package/commands/gsd/map-codebase.md +71 -0
  17. package/commands/gsd/new-milestone.md +717 -0
  18. package/commands/gsd/new-project.md +896 -0
  19. package/commands/gsd/pause-work.md +123 -0
  20. package/commands/gsd/plan-milestone-gaps.md +284 -0
  21. package/commands/gsd/plan-phase.md +475 -0
  22. package/commands/gsd/progress.md +356 -0
  23. package/commands/gsd/remove-phase.md +338 -0
  24. package/commands/gsd/research-phase.md +180 -0
  25. package/commands/gsd/resume-work.md +40 -0
  26. package/commands/gsd/update.md +172 -0
  27. package/commands/gsd/verify-work.md +219 -0
  28. package/commands/gsd/whats-new.md +124 -0
  29. package/get-shit-done/references/checkpoints.md +788 -0
  30. package/get-shit-done/references/continuation-format.md +249 -0
  31. package/get-shit-done/references/git-integration.md +254 -0
  32. package/get-shit-done/references/questioning.md +141 -0
  33. package/get-shit-done/references/tdd.md +263 -0
  34. package/get-shit-done/references/ui-brand.md +160 -0
  35. package/get-shit-done/references/verification-patterns.md +595 -0
  36. package/get-shit-done/templates/DEBUG.md +159 -0
  37. package/get-shit-done/templates/UAT.md +247 -0
  38. package/get-shit-done/templates/codebase/architecture.md +255 -0
  39. package/get-shit-done/templates/codebase/concerns.md +310 -0
  40. package/get-shit-done/templates/codebase/conventions.md +307 -0
  41. package/get-shit-done/templates/codebase/integrations.md +280 -0
  42. package/get-shit-done/templates/codebase/stack.md +186 -0
  43. package/get-shit-done/templates/codebase/structure.md +285 -0
  44. package/get-shit-done/templates/codebase/testing.md +480 -0
  45. package/get-shit-done/templates/config.json +26 -0
  46. package/get-shit-done/templates/context.md +291 -0
  47. package/get-shit-done/templates/continue-here.md +78 -0
  48. package/get-shit-done/templates/debug-subagent-prompt.md +91 -0
  49. package/get-shit-done/templates/discovery.md +146 -0
  50. package/get-shit-done/templates/milestone-archive.md +123 -0
  51. package/get-shit-done/templates/milestone.md +115 -0
  52. package/get-shit-done/templates/phase-prompt.md +576 -0
  53. package/get-shit-done/templates/planner-subagent-prompt.md +117 -0
  54. package/get-shit-done/templates/project.md +184 -0
  55. package/get-shit-done/templates/requirements.md +231 -0
  56. package/get-shit-done/templates/research-project/ARCHITECTURE.md +204 -0
  57. package/get-shit-done/templates/research-project/FEATURES.md +147 -0
  58. package/get-shit-done/templates/research-project/PITFALLS.md +200 -0
  59. package/get-shit-done/templates/research-project/STACK.md +120 -0
  60. package/get-shit-done/templates/research-project/SUMMARY.md +170 -0
  61. package/get-shit-done/templates/research.md +529 -0
  62. package/get-shit-done/templates/roadmap.md +202 -0
  63. package/get-shit-done/templates/state.md +206 -0
  64. package/get-shit-done/templates/summary.md +269 -0
  65. package/get-shit-done/templates/user-setup.md +323 -0
  66. package/get-shit-done/templates/verification-report.md +322 -0
  67. package/get-shit-done/workflows/complete-milestone.md +750 -0
  68. package/get-shit-done/workflows/diagnose-issues.md +233 -0
  69. package/get-shit-done/workflows/discovery-phase.md +293 -0
  70. package/get-shit-done/workflows/discuss-phase.md +422 -0
  71. package/get-shit-done/workflows/execute-phase.md +552 -0
  72. package/get-shit-done/workflows/execute-plan.md +1831 -0
  73. package/get-shit-done/workflows/list-phase-assumptions.md +178 -0
  74. package/get-shit-done/workflows/map-codebase.md +289 -0
  75. package/get-shit-done/workflows/resume-project.md +311 -0
  76. package/get-shit-done/workflows/transition.md +564 -0
  77. package/get-shit-done/workflows/verify-phase.md +629 -0
  78. package/get-shit-done/workflows/verify-work.md +563 -0
  79. package/package.json +39 -0
package/AGENTS.md ADDED
@@ -0,0 +1,183 @@
1
+ # Get Shit Done (GSD) - Agent Instructions
2
+
3
+ A meta-prompting, context engineering and spec-driven development system for Codex CLI.
4
+
5
+ ## Overview
6
+
7
+ This system helps you build software projects by:
8
+
9
+ 1. **Deep context gathering** - Understanding what you want to build through structured questioning
10
+ 2. **Roadmap creation** - Breaking work into phases and plans
11
+ 3. **Autonomous execution** - Running atomic tasks with fresh context each time
12
+ 4. **State tracking** - Maintaining project state across sessions
13
+
14
+ ## Core Principles
15
+
16
+ ### Solo Developer Model
17
+
18
+ - You are planning for ONE person (the user) and ONE implementer (the AI)
19
+ - No teams, stakeholders, ceremonies, or coordination overhead
20
+ - User is the visionary/product owner
21
+ - AI is the builder
22
+ - Estimate effort in AI execution time, not human dev time
23
+
24
+ ### Plans Are Prompts
25
+
26
+ - PLAN.md IS the prompt that executes work
27
+ - Contains: Objective, Context, Tasks, Success Criteria
28
+ - When planning a phase, you are writing the prompt that will execute it
29
+
30
+ ### Scope Control
31
+
32
+ **Quality degradation curve:**
33
+
34
+ - 0-30% context: Peak quality
35
+ - 30-50% context: Good quality
36
+ - 50-70% context: Degrading quality
37
+ - 70%+ context: Poor quality
38
+
39
+ **Solution:** Aggressive atomicity - 2-3 tasks per plan maximum
40
+
41
+ ### Deviation Rules
42
+
43
+ During execution:
44
+
45
+ 1. **Auto-fix bugs** - Fix immediately, document
46
+ 2. **Auto-add critical** - Security/correctness gaps, add immediately
47
+ 3. **Auto-fix blockers** - Can't proceed, fix immediately
48
+ 4. **Ask about architectural** - Major changes, stop and ask
49
+ 5. **Log enhancements** - Nice-to-haves, log to ISSUES.md, continue
50
+
51
+ ### Atomic Git Commits
52
+
53
+ Each task gets its own commit immediately after completion:
54
+
55
+ - Format: `{type}({phase}-{plan}): {task-description}`
56
+ - Types: feat, fix, test, refactor, perf, chore, docs
57
+ - One final metadata commit per plan
58
+
59
+ ## Directory Structure
60
+
61
+ ```
62
+ .planning/
63
+ ├── PROJECT.md # Project vision and requirements
64
+ ├── ROADMAP.md # Phases from start to finish
65
+ ├── STATE.md # Living memory across sessions
66
+ ├── ISSUES.md # Deferred enhancements
67
+ ├── config.json # Workflow mode and settings
68
+ ├── codebase/ # (brownfield) Codebase analysis
69
+ │ ├── STACK.md
70
+ │ ├── ARCHITECTURE.md
71
+ │ ├── STRUCTURE.md
72
+ │ ├── CONVENTIONS.md
73
+ │ ├── TESTING.md
74
+ │ ├── INTEGRATIONS.md
75
+ │ └── CONCERNS.md
76
+ └── phases/
77
+ └── XX-name/
78
+ ├── XX-NN-PLAN.md
79
+ └── XX-NN-SUMMARY.md
80
+ ```
81
+
82
+ ## Commands
83
+
84
+ The following commands are available. Invoke them with `/gsd:command-name`:
85
+
86
+ | Command | Description |
87
+ | --------------------------------- | ------------------------------------------- |
88
+ | `/gsd:new-project` | Initialize project through deep questioning |
89
+ | `/gsd:create-roadmap` | Create roadmap and state tracking |
90
+ | `/gsd:map-codebase` | Map existing codebase (brownfield projects) |
91
+ | `/gsd:plan-phase [N]` | Generate task plans for phase N |
92
+ | `/gsd:execute-plan [path]` | Execute a PLAN.md file |
93
+ | `/gsd:progress` | Show current position and what's next |
94
+ | `/gsd:verify-work [N]` | User acceptance testing |
95
+ | `/gsd:plan-fix [plan]` | Plan fixes for UAT issues |
96
+ | `/gsd:complete-milestone` | Archive milestone, prep next version |
97
+ | `/gsd:discuss-milestone` | Gather context for next milestone |
98
+ | `/gsd:new-milestone [name]` | Create new milestone with phases |
99
+ | `/gsd:add-phase` | Append phase to roadmap |
100
+ | `/gsd:insert-phase [N]` | Insert urgent work |
101
+ | `/gsd:remove-phase [N]` | Remove future phase |
102
+ | `/gsd:discuss-phase [N]` | Gather context before planning |
103
+ | `/gsd:research-phase [N]` | Deep ecosystem research |
104
+ | `/gsd:list-phase-assumptions [N]` | Review assumptions before planning |
105
+ | `/gsd:pause-work` | Create handoff when stopping mid-phase |
106
+ | `/gsd:resume-work` | Restore from last session |
107
+ | `/gsd:consider-issues` | Review deferred issues |
108
+ | `/gsd:help` | Show all commands |
109
+
110
+ ## Workflow
111
+
112
+ ### New Projects (Greenfield)
113
+
114
+ ```bash
115
+ /gsd:new-project # Deep questioning → PROJECT.md
116
+ /gsd:create-roadmap # Create ROADMAP.md and STATE.md
117
+ /gsd:plan-phase 1 # Create atomic task plans
118
+ /gsd:execute-plan # Subagent executes autonomously
119
+ ```
120
+
121
+ ### Existing Projects (Brownfield)
122
+
123
+ ```bash
124
+ /gsd:map-codebase # Analyze existing code → codebase/
125
+ /gsd:new-project # Questioning with codebase context
126
+ /gsd:create-roadmap # Continue as normal
127
+ ```
128
+
129
+ ## File References
130
+
131
+ When executing commands, reference these files for detailed instructions:
132
+
133
+ - **Workflows:** `get-shit-done/workflows/*.md`
134
+ - **Templates:** `get-shit-done/templates/*.md`
135
+ - **References:** `get-shit-done/references/*.md`
136
+ - **Commands:** `commands/gsd/*.md`
137
+
138
+ ## Anti-Patterns
139
+
140
+ NEVER include:
141
+
142
+ - Team structures, RACI matrices
143
+ - Stakeholder management
144
+ - Sprint ceremonies
145
+ - Human dev time estimates
146
+ - Change management processes
147
+ - Documentation for documentation's sake
148
+
149
+ If it sounds like corporate PM theater, delete it.
150
+
151
+ ## Context Engineering
152
+
153
+ Always load relevant context files:
154
+
155
+ - `.planning/PROJECT.md` - Project vision
156
+ - `.planning/STATE.md` - Current position and decisions
157
+ - `.planning/ROADMAP.md` - Phase structure
158
+ - `.planning/config.json` - Mode settings
159
+
160
+ For brownfield projects, also load:
161
+
162
+ - `.planning/codebase/ARCHITECTURE.md`
163
+ - `.planning/codebase/CONVENTIONS.md`
164
+ - `.planning/codebase/STACK.md`
165
+
166
+ ## Test-Driven Development
167
+
168
+ Use TDD when beneficial:
169
+
170
+ - Business logic with defined inputs/outputs
171
+ - API endpoints and handlers
172
+ - Data transformations and parsing
173
+ - Validation rules
174
+ - State machines and workflows
175
+
176
+ Skip TDD for:
177
+
178
+ - UI layout and styling
179
+ - Exploratory prototyping
180
+ - One-off scripts and migrations
181
+ - Configuration changes
182
+
183
+ See `get-shit-done/references/tdd.md` for detailed TDD workflow.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Lex Christopherson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,179 @@
1
+ # Get Shit Done (Codex CLI)
2
+
3
+ A meta-prompting, context engineering and spec-driven development system for [OpenAI Codex CLI](https://github.com/openai/codex).
4
+
5
+ Fork of [get-shit-done](https://github.com/taches/get-shit-done) by TÂCHES, adapted for Codex CLI by [undeemed](https://github.com/undeemed).
6
+
7
+ [![npm version](https://img.shields.io/npm/v/%40undeemed%2Fget-shit-done-codex?style=flat-square)](https://www.npmjs.com/package/@undeemed/get-shit-done-codex)
8
+ [![License](https://img.shields.io/badge/license-MIT-green?style=flat-square)](LICENSE)
9
+
10
+ ## What This Does
11
+
12
+ GSD solves context rot — the quality degradation that happens as AI fills its context window. It structures your project through specs and plans so Codex CLI has what it needs to build reliably.
13
+
14
+ **The problem:** AI assistants lose quality as conversations grow. Context gets polluted, requirements get forgotten, work becomes inconsistent.
15
+
16
+ **The solution:** Hierarchical planning with fresh context windows. Each task runs in isolation with exactly the context it needs—no degradation from accumulated garbage.
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ npx @undeemed/get-shit-done-codex
22
+ ```
23
+
24
+ You'll be prompted to install globally (`~/.codex/`) or locally (`./`).
25
+
26
+ For non-interactive installs:
27
+
28
+ ```bash
29
+ npx @undeemed/get-shit-done-codex --global # Install to ~/.codex/
30
+ npx @undeemed/get-shit-done-codex --local # Install to current directory
31
+ ```
32
+
33
+ After installation, run `codex` to start Codex CLI, then use `/prompts:gsd-help` to see all commands.
34
+
35
+ ## Quick Start
36
+
37
+ ```bash
38
+ # 1. Initialize project (questions → research → requirements → roadmap)
39
+ /prompts:gsd-new-project
40
+
41
+ # 2. Plan the first phase
42
+ /prompts:gsd-plan-phase 1
43
+
44
+ # 3. Execute the phase
45
+ /prompts:gsd-execute-phase 1
46
+
47
+ # 4. Verify it works
48
+ /prompts:gsd-verify-work 1
49
+ ```
50
+
51
+ ## How It Works
52
+
53
+ ### 1. Initialize Project
54
+
55
+ ```
56
+ /prompts:gsd-new-project
57
+ ```
58
+
59
+ One command takes you from idea to ready-for-planning:
60
+ - Deep questioning to understand what you're building
61
+ - Optional domain research (spawns 4 parallel researcher agents)
62
+ - Requirements definition with v1/v2/out-of-scope scoping
63
+ - Roadmap creation with phase breakdown
64
+
65
+ **Creates:** `PROJECT.md`, `REQUIREMENTS.md`, `ROADMAP.md`, `STATE.md`, `.planning/research/`
66
+
67
+ ### 2. Plan Phase
68
+
69
+ ```
70
+ /prompts:gsd-plan-phase 1
71
+ ```
72
+
73
+ The system researches how to implement the phase, creates 2-3 atomic task plans, and verifies them against requirements.
74
+
75
+ **Creates:** `{phase}-RESEARCH.md`, `{phase}-{N}-PLAN.md`
76
+
77
+ ### 3. Execute Phase
78
+
79
+ ```
80
+ /prompts:gsd-execute-phase 1
81
+ ```
82
+
83
+ Runs all plans in parallel waves. Each plan executes in a fresh 200k context window. Every task gets its own atomic commit.
84
+
85
+ **Creates:** `{phase}-{N}-SUMMARY.md`, `{phase}-VERIFICATION.md`
86
+
87
+ ### 4. Verify Work
88
+
89
+ ```
90
+ /prompts:gsd-verify-work 1
91
+ ```
92
+
93
+ Manual user acceptance testing. The system walks you through testable deliverables and creates fix plans if issues are found.
94
+
95
+ ## Commands
96
+
97
+ | Command | Description |
98
+ |-------------------------------------|-------------------------------------------------------------------|
99
+ | `/prompts:gsd-new-project` | Initialize project: questions → research → requirements → roadmap |
100
+ | `/prompts:gsd-plan-phase [N]` | Research + plan + verify for a phase |
101
+ | `/prompts:gsd-execute-phase <N>` | Execute all plans in parallel waves |
102
+ | `/prompts:gsd-verify-work [N]` | Manual user acceptance testing |
103
+ | `/prompts:gsd-complete-milestone` | Archive milestone, tag release |
104
+ | `/prompts:gsd-new-milestone [name]` | Start next version |
105
+ | `/prompts:gsd-progress` | Show current status and what's next |
106
+ | `/prompts:gsd-help` | Show all commands |
107
+
108
+ See `/prompts:gsd-help` for the complete command reference.
109
+
110
+ ## Why It Works
111
+
112
+ ### Context Engineering
113
+
114
+ GSD maintains structured context files that stay within quality limits:
115
+
116
+ - `PROJECT.md` — Project vision, always loaded
117
+ - `REQUIREMENTS.md` — Scoped v1/v2 requirements with phase traceability
118
+ - `ROADMAP.md` — Where you're going, what's done
119
+ - `STATE.md` — Decisions, blockers, position — memory across sessions
120
+ - `PLAN.md` — Atomic task with XML structure, verification steps
121
+ - `SUMMARY.md` — What happened, committed to history
122
+
123
+ ### Multi-Agent Orchestration
124
+
125
+ Every stage uses a thin orchestrator that spawns specialized agents:
126
+
127
+ - **Research** — 4 parallel researchers investigate stack, features, architecture, pitfalls
128
+ - **Planning** — Planner creates plans, checker verifies, loops until pass
129
+ - **Execution** — Executors implement in parallel, each with fresh 200k context
130
+ - **Verification** — Verifier checks codebase against goals, debuggers diagnose failures
131
+
132
+ The orchestrator stays at 30-40% context. The work happens in fresh subagent contexts.
133
+
134
+ ### Atomic Git Commits
135
+
136
+ Each task gets its own commit immediately after completion:
137
+
138
+ ```bash
139
+ feat(01-01): implement user authentication
140
+ feat(01-01): add password hashing
141
+ docs(01-01): complete auth-setup plan
142
+ ```
143
+
144
+ Git bisect finds exact failing task. Each task independently revertable.
145
+
146
+ ## Troubleshooting
147
+
148
+ **Commands not found?**
149
+ - Restart Codex CLI to reload prompts
150
+ - Check `~/.codex/prompts/gsd-*.md` (global) or `./prompts/gsd-*.md` (local)
151
+
152
+ **Update to latest:**
153
+ ```bash
154
+ npx get-shit-done-codex@latest
155
+ ```
156
+
157
+ ## More Documentation
158
+
159
+ For deeper guides, detailed workflows, and comprehensive documentation, see the [original get-shit-done README](https://github.com/taches/get-shit-done/blob/main/README.md).
160
+
161
+ The original repository contains:
162
+ - Detailed workflow explanations
163
+ - Advanced usage patterns
164
+ - Complete command reference
165
+ - Best practices and examples
166
+ - Architecture and design principles
167
+
168
+ **Note:** The original README is written for Claude Code. When following it, remember that this fork uses:
169
+ - `/prompts:gsd-*` command format (instead of `/gsd:*`)
170
+ - Codex CLI (instead of Claude Code)
171
+ - `~/.codex/` directory (instead of `~/.claude/`)
172
+
173
+ ## Credits
174
+
175
+ Original project by [TÂCHES](https://github.com/taches). This fork adapts it for Codex CLI.
176
+
177
+ ## License
178
+
179
+ MIT
package/bin/install.js ADDED
@@ -0,0 +1,214 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const os = require('os');
6
+ const readline = require('readline');
7
+
8
+ // Colors
9
+ const cyan = '\x1b[36m';
10
+ const green = '\x1b[32m';
11
+ const yellow = '\x1b[33m';
12
+ const dim = '\x1b[2m';
13
+ const reset = '\x1b[0m';
14
+
15
+ // Get version from package.json
16
+ const pkg = require('../package.json');
17
+
18
+ const banner = `
19
+ ${cyan} ██████╗ ███████╗██████╗ ██████╗
20
+ ██╔════╝ ██╔════╝██╔══██╗██╔════╝
21
+ ██║ ███╗███████╗██║ ██║██║
22
+ ██║ ██║╚════██║██║ ██║██║
23
+ ╚██████╔╝███████║██████╔╝╚██████╗
24
+ ╚═════╝ ╚══════╝╚═════╝ ╚═════╝${reset}
25
+
26
+ Get Shit Done ${dim}v${pkg.version}${reset}
27
+ A meta-prompting, context engineering and spec-driven
28
+ development system for OpenAI Codex CLI by TÂCHES.
29
+ `;
30
+
31
+ // Parse args
32
+ const args = process.argv.slice(2);
33
+ const hasGlobal = args.includes('--global') || args.includes('-g');
34
+ const hasLocal = args.includes('--local') || args.includes('-l');
35
+ const hasHelp = args.includes('--help') || args.includes('-h');
36
+
37
+ console.log(banner);
38
+
39
+ // Show help if requested
40
+ if (hasHelp) {
41
+ console.log(` ${yellow}Usage:${reset} npx get-shit-done-codex [options]
42
+
43
+ ${yellow}Options:${reset}
44
+ ${cyan}-g, --global${reset} Install globally (to ~/.codex/)
45
+ ${cyan}-l, --local${reset} Install locally (to current directory)
46
+ ${cyan}-h, --help${reset} Show this help message
47
+
48
+ ${yellow}Examples:${reset}
49
+ ${dim}# Install globally to ~/.codex directory${reset}
50
+ npx get-shit-done-codex --global
51
+
52
+ ${dim}# Install to current project only${reset}
53
+ npx get-shit-done-codex --local
54
+
55
+ ${yellow}Notes:${reset}
56
+ For codex-cli, this installer:
57
+ - Creates/updates AGENTS.md in the target directory
58
+ - Copies the get-shit-done skill and commands
59
+ - Global install goes to ~/.codex/ (inherited by all projects)
60
+ - Local install puts files in current directory
61
+ `);
62
+ process.exit(0);
63
+ }
64
+
65
+ /**
66
+ * Apply content replacements for Codex CLI compatibility
67
+ */
68
+ function applyReplacements(content, pathPrefix) {
69
+ // Path replacements
70
+ content = content.replace(/~\/\.claude\//g, pathPrefix);
71
+ content = content.replace(/\.claude\//g, pathPrefix.replace('~/', ''));
72
+
73
+ // Claude → Codex naming
74
+ content = content.replace(/Claude Code/g, 'Codex CLI');
75
+ content = content.replace(/Claude/g, 'Codex');
76
+
77
+ // Command format: /gsd:name → /prompts:gsd-name (Codex CLI custom prompts format)
78
+ content = content.replace(/\/gsd:/g, '/prompts:gsd-');
79
+
80
+ return content;
81
+ }
82
+
83
+ /**
84
+ * Recursively copy directory, replacing paths in .md files
85
+ */
86
+ function copyWithPathReplacement(srcDir, destDir, pathPrefix) {
87
+ fs.mkdirSync(destDir, { recursive: true });
88
+
89
+ const entries = fs.readdirSync(srcDir, { withFileTypes: true });
90
+
91
+ for (const entry of entries) {
92
+ const srcPath = path.join(srcDir, entry.name);
93
+ const destPath = path.join(destDir, entry.name);
94
+
95
+ if (entry.isDirectory()) {
96
+ copyWithPathReplacement(srcPath, destPath, pathPrefix);
97
+ } else if (entry.name.endsWith('.md')) {
98
+ let content = fs.readFileSync(srcPath, 'utf8');
99
+ content = applyReplacements(content, pathPrefix);
100
+ fs.writeFileSync(destPath, content);
101
+ } else {
102
+ fs.copyFileSync(srcPath, destPath);
103
+ }
104
+ }
105
+ }
106
+
107
+ /**
108
+ * Install to the specified directory
109
+ */
110
+ function install(isGlobal) {
111
+ const src = path.join(__dirname, '..');
112
+ const codexDir = isGlobal
113
+ ? path.join(os.homedir(), '.codex')
114
+ : process.cwd();
115
+
116
+ const locationLabel = isGlobal
117
+ ? '~/.codex'
118
+ : '.';
119
+
120
+ // Path prefix for file references
121
+ const pathPrefix = isGlobal
122
+ ? '~/.codex/'
123
+ : './';
124
+
125
+ console.log(` Installing to ${cyan}${locationLabel}${reset}\n`);
126
+
127
+ // Create target directory if needed
128
+ fs.mkdirSync(codexDir, { recursive: true });
129
+
130
+ // Copy AGENTS.md
131
+ const agentsSrc = path.join(src, 'AGENTS.md');
132
+ const agentsDest = path.join(codexDir, 'AGENTS.md');
133
+ let agentsContent = fs.readFileSync(agentsSrc, 'utf8');
134
+ agentsContent = applyReplacements(agentsContent, pathPrefix);
135
+ fs.writeFileSync(agentsDest, agentsContent);
136
+ console.log(` ${green}✓${reset} Installed AGENTS.md`);
137
+
138
+ // Create prompts directory (Codex CLI uses prompts/ for custom slash commands)
139
+ const promptsDir = path.join(codexDir, 'prompts');
140
+ fs.mkdirSync(promptsDir, { recursive: true });
141
+
142
+ // Copy commands/gsd as prompts (flatten the structure for Codex CLI)
143
+ // Codex CLI expects prompts/command-name.md format
144
+ const gsdSrc = path.join(src, 'commands', 'gsd');
145
+ const entries = fs.readdirSync(gsdSrc);
146
+ for (const entry of entries) {
147
+ if (entry.endsWith('.md')) {
148
+ const srcPath = path.join(gsdSrc, entry);
149
+ // Convert to gsd-command format (e.g., help.md -> gsd-help.md)
150
+ const destName = 'gsd-' + entry;
151
+ const destPath = path.join(promptsDir, destName);
152
+ let content = fs.readFileSync(srcPath, 'utf8');
153
+ content = applyReplacements(content, pathPrefix);
154
+ fs.writeFileSync(destPath, content);
155
+ }
156
+ }
157
+ console.log(` ${green}✓${reset} Installed prompts/gsd-*.md (${entries.filter(e => e.endsWith('.md')).length} commands)`);
158
+
159
+ // Copy get-shit-done skill with path replacement
160
+ const skillSrc = path.join(src, 'get-shit-done');
161
+ const skillDest = path.join(codexDir, 'get-shit-done');
162
+ copyWithPathReplacement(skillSrc, skillDest, pathPrefix);
163
+ console.log(` ${green}✓${reset} Installed get-shit-done`);
164
+
165
+ console.log(`
166
+ ${green}Done!${reset}
167
+
168
+ ${yellow}For Codex CLI:${reset}
169
+ - AGENTS.md is at ${cyan}${codexDir}/AGENTS.md${reset}
170
+ - Slash commands are in ${cyan}${codexDir}/prompts/${reset}
171
+
172
+ ${yellow}Getting Started:${reset}
173
+ 1. Run ${cyan}codex${reset} to start the Codex CLI
174
+ 2. Type ${cyan}/${reset} to see available commands
175
+ 3. Start with ${cyan}/prompts:gsd-new-project${reset} to initialize a project
176
+
177
+ ${dim}Commands use /prompts:gsd-name format (e.g., /prompts:gsd-help)${reset}
178
+ `);
179
+ }
180
+
181
+ /**
182
+ * Prompt for install location
183
+ */
184
+ function promptLocation() {
185
+ const rl = readline.createInterface({
186
+ input: process.stdin,
187
+ output: process.stdout
188
+ });
189
+
190
+ console.log(` ${yellow}Where would you like to install?${reset}
191
+
192
+ ${cyan}1${reset}) Global ${dim}(~/.codex)${reset} - available in all projects
193
+ ${cyan}2${reset}) Local ${dim}(.)${reset} - this project only
194
+ `);
195
+
196
+ rl.question(` Choice ${dim}[1]${reset}: `, (answer) => {
197
+ rl.close();
198
+ const choice = answer.trim() || '1';
199
+ const isGlobal = choice !== '2';
200
+ install(isGlobal);
201
+ });
202
+ }
203
+
204
+ // Main
205
+ if (hasGlobal && hasLocal) {
206
+ console.error(` ${yellow}Cannot specify both --global and --local${reset}`);
207
+ process.exit(1);
208
+ } else if (hasGlobal) {
209
+ install(true);
210
+ } else if (hasLocal) {
211
+ install(false);
212
+ } else {
213
+ promptLocation();
214
+ }