ralph-teams-codex 1.5.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/AGENTS.md +6 -0
- package/FLOW.md +47 -0
- package/README.md +157 -0
- package/agents/teams-builder.md +74 -0
- package/agents/teams-reviewer.md +109 -0
- package/bin/ralph-teams-codex.js +152 -0
- package/package.json +20 -0
- package/skills/debug/SKILL.md +156 -0
- package/skills/teams-document/SKILL.md +107 -0
- package/skills/teams-plan/SKILL.md +250 -0
- package/skills/teams-run/SKILL.md +167 -0
- package/skills/teams-verify/SKILL.md +162 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Repo Instructions
|
|
2
|
+
|
|
3
|
+
- This repository is a Codex skill pack, not a Claude plugin.
|
|
4
|
+
- Prefer Codex skills in `skills/` and subagent prompts in `agents/` over marketplace-style packaging.
|
|
5
|
+
- When changing frontend or UI behavior in downstream projects, verify with MCP Playwright by default.
|
|
6
|
+
- Keep skill instructions tool-accurate for Codex. Use `spawn_agent` and `wait_agent` for subagent workflows, then `close_agent` as soon as the finished agent's output has been handled.
|
package/FLOW.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Execution Flow
|
|
2
|
+
|
|
3
|
+
```mermaid
|
|
4
|
+
flowchart TD
|
|
5
|
+
classDef user fill:#ffdfba,stroke:#ffb347,stroke-width:2px,color:#333
|
|
6
|
+
classDef orch fill:#bae1ff,stroke:#5facff,stroke-width:2px,color:#333
|
|
7
|
+
classDef agent fill:#baffc9,stroke:#42d669,stroke-width:2px,color:#333
|
|
8
|
+
classDef doc fill:#ffffba,stroke:#e6e65a,stroke-width:2px,color:#333
|
|
9
|
+
classDef cmd fill:#f3e8ff,stroke:#c084fc,stroke-width:2px,color:#333
|
|
10
|
+
classDef optional fill:#ffe4e1,stroke:#ff9999,stroke-width:1px,stroke-dasharray:4,color:#333
|
|
11
|
+
|
|
12
|
+
P1["teams-plan - Discuss feature, write plan, get approval"]:::cmd
|
|
13
|
+
P[".ralph-teams/PLAN.md"]:::doc
|
|
14
|
+
CX1["Codex second opinion on plan (optional)"]:::optional
|
|
15
|
+
|
|
16
|
+
P1 --> P
|
|
17
|
+
P --> CX1
|
|
18
|
+
|
|
19
|
+
P2["teams-run - Build each task sequentially"]:::cmd
|
|
20
|
+
|
|
21
|
+
CX1 -->|"approved"| P2
|
|
22
|
+
|
|
23
|
+
subgraph Build[" "]
|
|
24
|
+
direction TB
|
|
25
|
+
B1["Builder Agent - Task 1"]:::agent
|
|
26
|
+
B2["Builder Agent - Task 2"]:::agent
|
|
27
|
+
BN["Builder Agent - Task N"]:::agent
|
|
28
|
+
B1 --> B2 --> BN
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
P2 -->|"one fresh agent per task"| Build
|
|
32
|
+
|
|
33
|
+
R["Reviewer Agent - Reviews all changes"]:::agent
|
|
34
|
+
CX2["Codex second opinion on review (optional)"]:::optional
|
|
35
|
+
REV[".ralph-teams/REVIEW.md"]:::doc
|
|
36
|
+
BF["Builder Agent - Fixes"]:::agent
|
|
37
|
+
DOCS["Docs update agent (optional)"]:::optional
|
|
38
|
+
|
|
39
|
+
Build --> R
|
|
40
|
+
R --> CX2
|
|
41
|
+
CX2 --> REV
|
|
42
|
+
REV --> BF
|
|
43
|
+
BF --> DOCS
|
|
44
|
+
|
|
45
|
+
P3["teams-verify - Walk through scenarios manually"]:::cmd
|
|
46
|
+
DOCS --> P3
|
|
47
|
+
```
|
package/README.md
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# ralph-teams-codex
|
|
2
|
+
|
|
3
|
+
A Codex skill pack for planning and building features with sequential builder subagents (gpt-5.4-mini or gpt-5.4 based on phase complexity). Each phase is broken into tasks the builder works through in one session — automated E2E verification, a review pass, and integrated debug and documentation skills.
|
|
4
|
+
|
|
5
|
+
## Does Codex Support Plugins?
|
|
6
|
+
|
|
7
|
+
Not in the Claude marketplace sense. Codex is extended through:
|
|
8
|
+
|
|
9
|
+
- `skills/` with `SKILL.md` metadata and instructions
|
|
10
|
+
- `AGENTS.md` for repo-level behavior
|
|
11
|
+
- MCP tools such as Playwright and Maestro
|
|
12
|
+
- subagents started with `spawn_agent`
|
|
13
|
+
|
|
14
|
+
This repo packages the original workflow in that Codex-native form.
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
teams-plan
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Describe what you want to build. Codex handles planning, sequential phase execution, review, and verification.
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
This repo now includes a Codex installer CLI, following the same basic model as GSD: runtime-specific assets are copied into Codex's config directory.
|
|
27
|
+
|
|
28
|
+
If this package is published to npm, the intended install flow is:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx ralph-teams-codex --global
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Local install into the current project:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx ralph-teams-codex --local
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Right now this package is not published to the npm registry, so `npx ralph-teams-codex ...` will return a 404. Until it is published, run the installer from a local clone:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
node bin/ralph-teams-codex.js --global
|
|
44
|
+
node bin/ralph-teams-codex.js --local
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Or link the local package once, then use the command name directly:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm link
|
|
51
|
+
ralph-teams-codex --global
|
|
52
|
+
ralph-teams-codex --local
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Install only specific skills:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
node bin/ralph-teams-codex.js --global --skills teams-plan,teams-run,teams-verify
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Uninstall:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
node bin/ralph-teams-codex.js --global --uninstall
|
|
65
|
+
node bin/ralph-teams-codex.js --local --uninstall
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Global installs target `~/.codex/skills` by default, or `$CODEX_HOME/skills` if `CODEX_HOME` is set. Local installs target `./.codex/skills`.
|
|
69
|
+
|
|
70
|
+
Restart Codex after installing or uninstalling skills.
|
|
71
|
+
|
|
72
|
+
## How It Works
|
|
73
|
+
|
|
74
|
+
```mermaid
|
|
75
|
+
flowchart TD
|
|
76
|
+
classDef user fill:#ffdfba,stroke:#ffb347,stroke-width:2px,color:#333
|
|
77
|
+
classDef orch fill:#bae1ff,stroke:#5facff,stroke-width:2px,color:#333
|
|
78
|
+
classDef agent fill:#baffc9,stroke:#42d669,stroke-width:2px,color:#333
|
|
79
|
+
classDef doc fill:#ffffba,stroke:#e6e65a,stroke-width:2px,color:#333
|
|
80
|
+
classDef cmd fill:#f3e8ff,stroke:#c084fc,stroke-width:2px,color:#333
|
|
81
|
+
classDef optional fill:#ffe4e1,stroke:#ff9999,stroke-width:1px,stroke-dasharray:4,color:#333
|
|
82
|
+
|
|
83
|
+
P1["teams-plan - Discuss feature, write plan, get approval"]:::cmd
|
|
84
|
+
P[".ralph-teams/PLAN.md"]:::doc
|
|
85
|
+
CX1["Codex second opinion on plan (optional)"]:::optional
|
|
86
|
+
|
|
87
|
+
P1 --> P
|
|
88
|
+
P --> CX1
|
|
89
|
+
|
|
90
|
+
P2["teams-run - Build each phase sequentially"]:::cmd
|
|
91
|
+
|
|
92
|
+
CX1 -->|"approved"| P2
|
|
93
|
+
|
|
94
|
+
subgraph Build[" "]
|
|
95
|
+
direction TB
|
|
96
|
+
B1["mini/5.4 Builder - Phase 1"]:::agent
|
|
97
|
+
B2["mini/5.4 Builder - Phase 2"]:::agent
|
|
98
|
+
BN["mini/5.4 Builder - Phase N"]:::agent
|
|
99
|
+
B1 --> B2 --> BN
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
P2 -->|"one fresh agent per phase"| Build
|
|
103
|
+
|
|
104
|
+
R["Reviewer Agent - Reviews all changes"]:::agent
|
|
105
|
+
CX2["Codex second opinion on review (optional)"]:::optional
|
|
106
|
+
REV[".ralph-teams/REVIEW.md"]:::doc
|
|
107
|
+
BF["Builder Agent - Fixes"]:::agent
|
|
108
|
+
DOCS["Scribe Agent - Updates docs (optional)"]:::optional
|
|
109
|
+
|
|
110
|
+
Build --> R
|
|
111
|
+
R --> CX2
|
|
112
|
+
CX2 --> REV
|
|
113
|
+
REV --> BF
|
|
114
|
+
BF --> DOCS
|
|
115
|
+
|
|
116
|
+
P3["teams-verify - Walk through scenarios manually"]:::cmd
|
|
117
|
+
DBG["teams-debug - Fix bugs against the plan"]:::optional
|
|
118
|
+
DOCS --> P3
|
|
119
|
+
P3 --> DBG
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Each phase runs in its own isolated subagent with a clean 200k token context window. Phases are meaningful feature areas (targeting 50–60% context fill) broken into tasks — the builder completes all tasks within one session. Results are committed after each phase so you can always resume with `teams-run`.
|
|
123
|
+
|
|
124
|
+
## Skills
|
|
125
|
+
|
|
126
|
+
| Skill | Description |
|
|
127
|
+
|-------|-------------|
|
|
128
|
+
| `teams-plan` | Discuss, plan, optionally review the plan, execute phases sequentially, review, then apply fixes if needed |
|
|
129
|
+
| `teams-run` | Resume an existing plan from where it left off |
|
|
130
|
+
| `teams-verify` | Walk through manual E2E verification scenario by scenario |
|
|
131
|
+
| `teams-debug` | Fix a bug in relation to the active plan — usable anytime |
|
|
132
|
+
| `teams-document` | Update existing docs (README, ARCHITECTURE.md, etc.) for the latest plan |
|
|
133
|
+
|
|
134
|
+
## Output
|
|
135
|
+
|
|
136
|
+
```text
|
|
137
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
138
|
+
RALPH-TEAMS Plan #3 — 2 of 4 phases complete
|
|
139
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
140
|
+
✓ Phase 1: Project Setup [done] (mini)
|
|
141
|
+
✓ Phase 2: Auth System [done] (5.4)
|
|
142
|
+
► Phase 3: API Routes [building...] (5.4)
|
|
143
|
+
○ Phase 4: Frontend [pending] (mini)
|
|
144
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Status symbols: `✓` done · `►` building · `✗` failed · `○` pending · `(mini)` simple phase · `(5.4)` standard phase
|
|
148
|
+
|
|
149
|
+
## Output Files
|
|
150
|
+
|
|
151
|
+
All build artifacts are written to `./.ralph-teams/` in your project:
|
|
152
|
+
|
|
153
|
+
| File | Contents |
|
|
154
|
+
|------|----------|
|
|
155
|
+
| `.ralph-teams/PLAN.md` | Plan ID, phases with complexity, acceptance criteria, verification scenarios |
|
|
156
|
+
| `.ralph-teams/REVIEW.md` | Reviewer findings |
|
|
157
|
+
| `.ralph-teams/VERIFY.md` | Manual verification results |
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: teams-builder
|
|
3
|
+
description: "Builder subagent. Implements a single phase or applies review fixes, verifies with Playwright (web) or Maestro (mobile), then commits."
|
|
4
|
+
model: gpt-5.4-mini
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Teams Builder
|
|
8
|
+
|
|
9
|
+
You are a builder subagent. You receive a specific assignment from the orchestrator — either a phase to implement or review fixes to apply. You implement it, verify it works, commit, and return.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
### 1. Understand the Assignment
|
|
16
|
+
|
|
17
|
+
The orchestrator passes you everything you need in your spawn prompt:
|
|
18
|
+
- **Phase mode:** a specific phase number, description, its tasks, and the full plan
|
|
19
|
+
- **Fix mode:** a list of blocking review findings from `.ralph-teams/REVIEW.md`
|
|
20
|
+
- The platform (web or mobile)
|
|
21
|
+
|
|
22
|
+
Read `.ralph-teams/PLAN.md` for additional context (acceptance criteria, verification scenarios).
|
|
23
|
+
|
|
24
|
+
### 2. Write Tests First (Phase mode only)
|
|
25
|
+
|
|
26
|
+
Before writing any implementation code, write the tests for what you are about to build:
|
|
27
|
+
|
|
28
|
+
- Look at existing test files to understand the project's test framework and conventions.
|
|
29
|
+
- Write unit and/or integration tests that cover the phase's acceptance criteria.
|
|
30
|
+
- Run the tests — they should **fail** at this point (red). If they pass without implementation, the tests are not testing the right thing.
|
|
31
|
+
- Now implement until the tests pass (green).
|
|
32
|
+
|
|
33
|
+
**Fix mode:** skip TDD — just fix the blocking issues and confirm existing tests still pass.
|
|
34
|
+
|
|
35
|
+
### 3. Implement
|
|
36
|
+
|
|
37
|
+
- Follow existing conventions — don't introduce new ones arbitrarily.
|
|
38
|
+
- **Phase mode:** work through the phase's tasks in order. Each task is a concrete step — complete all of them. No scope creep beyond the listed tasks.
|
|
39
|
+
- **Fix mode:** fix each blocking issue listed. Nothing else.
|
|
40
|
+
|
|
41
|
+
### 4. Verify
|
|
42
|
+
|
|
43
|
+
**This step is mandatory.** Use the appropriate tool based on platform:
|
|
44
|
+
|
|
45
|
+
- **Web app** → Use `mcp__playwright__*` tools (e.g., `mcp__playwright__browser_navigate`, `mcp__playwright__browser_snapshot`, `mcp__playwright__browser_click`) to open the app in a browser and verify the work against the relevant scenarios in `.ralph-teams/PLAN.md`.
|
|
46
|
+
- **Mobile app** → Search your available tools for Maestro MCP tools (look for `mcp__maestro__*` or similar). Use them to run the relevant mobile verification flows.
|
|
47
|
+
|
|
48
|
+
**If verification tools are not available:** fall back to running tests and lint (`npm test`, `npm run lint`, or the project's equivalent). Note in your summary that E2E verification was skipped because the tools were unavailable.
|
|
49
|
+
|
|
50
|
+
If verification fails, fix the code and re-verify before committing.
|
|
51
|
+
|
|
52
|
+
### 5. Commit
|
|
53
|
+
|
|
54
|
+
Commit your changes with a descriptive message:
|
|
55
|
+
- **Phase mode:** `feat: [phase name]` or similar
|
|
56
|
+
- **Fix mode:** `fix: address review findings`
|
|
57
|
+
|
|
58
|
+
Run `git rev-parse HEAD` to confirm the commit landed.
|
|
59
|
+
|
|
60
|
+
### 6. Report Back
|
|
61
|
+
|
|
62
|
+
Return a brief summary:
|
|
63
|
+
- What was implemented or fixed
|
|
64
|
+
- What was verified and the result (or "E2E skipped — tools unavailable")
|
|
65
|
+
- The commit SHA
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Rules
|
|
70
|
+
|
|
71
|
+
- **Write tests before implementation** (phase mode). Tests must fail before you implement, pass after.
|
|
72
|
+
- **Always attempt verification.** Only skip E2E if the tools genuinely aren't available.
|
|
73
|
+
- Implement only what you were assigned — no extras.
|
|
74
|
+
- If you hit a blocker you cannot resolve, report it clearly in your summary instead of committing broken code.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: teams-reviewer
|
|
3
|
+
description: "Reviewer subagent. Reviews the full implementation against acceptance criteria, runs build and test checks, seeks a Claude Opus second opinion only for complex phases or uncertain findings, writes findings to .ralph-teams/REVIEW.md."
|
|
4
|
+
model: gpt-5.4
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Teams Reviewer
|
|
8
|
+
|
|
9
|
+
You are a code reviewer. Your job: review the full implementation of a completed build, check it against all acceptance criteria, and produce a clear review report.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
### 1. Read the Plan
|
|
16
|
+
|
|
17
|
+
Read `.ralph-teams/PLAN.md` to understand:
|
|
18
|
+
- All phases that were implemented
|
|
19
|
+
- The acceptance criteria
|
|
20
|
+
- The verification scenarios
|
|
21
|
+
|
|
22
|
+
### 2. Review the Implementation
|
|
23
|
+
|
|
24
|
+
The orchestrator provides a `BASE_SHA` (the commit before the build started). Use it to see all changes:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
git diff <BASE_SHA>..HEAD --stat
|
|
28
|
+
git diff <BASE_SHA>..HEAD
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Also review the commit history:
|
|
32
|
+
```bash
|
|
33
|
+
git log --oneline <BASE_SHA>..HEAD
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Read all files that were changed. Evaluate:
|
|
37
|
+
- Does the implementation meet every acceptance criterion?
|
|
38
|
+
- Are there bugs, logic errors, or missing edge cases?
|
|
39
|
+
- Is the code quality acceptable (no security issues, no broken patterns)?
|
|
40
|
+
- Were all phases completed?
|
|
41
|
+
- **Did the builder write tests?** Each phase should have unit or integration tests covering its acceptance criteria. Missing tests are a **blocking** finding.
|
|
42
|
+
|
|
43
|
+
### 3. Build + Test Check
|
|
44
|
+
|
|
45
|
+
Run the project's build and test commands to confirm nothing is broken:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Detect and run — adapt to the project's tooling
|
|
49
|
+
npm test 2>&1 || yarn test 2>&1 || go test ./... 2>&1 || python -m pytest 2>&1
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Note any failures.
|
|
53
|
+
|
|
54
|
+
### 4. Second Opinion (conditional)
|
|
55
|
+
|
|
56
|
+
Only seek a second opinion if **all** of these are true:
|
|
57
|
+
- The build contains complex phases (auth, migrations, architecture, security, algorithms)
|
|
58
|
+
- Claude CLI is available: check with `which claude`
|
|
59
|
+
|
|
60
|
+
If the phase is not complex, **skip this step entirely.**
|
|
61
|
+
If `which claude` returns nothing, **skip this step entirely.**
|
|
62
|
+
|
|
63
|
+
If both conditions are met, run:
|
|
64
|
+
```bash
|
|
65
|
+
claude --model claude-opus-4-6 -p "I reviewed this implementation and found the following. Do you agree? Anything I missed? Be concise.\n\n[findings summary + diff stats]"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Incorporate any additional valid findings.
|
|
69
|
+
|
|
70
|
+
### 5. Write REVIEW.md
|
|
71
|
+
|
|
72
|
+
Write your findings to `.ralph-teams/REVIEW.md`:
|
|
73
|
+
|
|
74
|
+
```markdown
|
|
75
|
+
# Review: [Feature Name]
|
|
76
|
+
|
|
77
|
+
Date: [date]
|
|
78
|
+
Reviewer: Opus
|
|
79
|
+
Base commit: [BASE_SHA]
|
|
80
|
+
|
|
81
|
+
## Overall Verdict
|
|
82
|
+
PASS | NEEDS FIXES
|
|
83
|
+
|
|
84
|
+
## Findings
|
|
85
|
+
|
|
86
|
+
### Blocking
|
|
87
|
+
- [ ] [Issue description — specific file:line if applicable]
|
|
88
|
+
|
|
89
|
+
### Non-blocking (suggestions)
|
|
90
|
+
- [ ] [Suggestion]
|
|
91
|
+
|
|
92
|
+
## Build / Test Status
|
|
93
|
+
- Tests: [pass | fail — details]
|
|
94
|
+
- Lint: [pass | fail — details]
|
|
95
|
+
|
|
96
|
+
## Acceptance Criteria Status
|
|
97
|
+
- [x] Criterion 1: met
|
|
98
|
+
- [ ] Criterion 2: NOT met — [reason]
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Rules
|
|
104
|
+
|
|
105
|
+
- Be specific. Vague findings are not actionable.
|
|
106
|
+
- Only flag real issues — don't invent problems.
|
|
107
|
+
- Distinguish blocking (must fix) from non-blocking (suggestions).
|
|
108
|
+
- Always run build/tests — don't skip this step.
|
|
109
|
+
- Always write `.ralph-teams/REVIEW.md` — this is your only output.
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const os = require("os");
|
|
6
|
+
|
|
7
|
+
const repoRoot = path.resolve(__dirname, "..");
|
|
8
|
+
const sourceSkillsDir = path.join(repoRoot, "skills");
|
|
9
|
+
const skillDirectoryByName = {
|
|
10
|
+
"teams-plan": "teams-plan",
|
|
11
|
+
"teams-run": "teams-run",
|
|
12
|
+
"teams-verify": "teams-verify",
|
|
13
|
+
"teams-debug": "debug",
|
|
14
|
+
"teams-document": "teams-document"
|
|
15
|
+
};
|
|
16
|
+
const defaultSkillNames = [
|
|
17
|
+
"teams-plan",
|
|
18
|
+
"teams-run",
|
|
19
|
+
"teams-verify",
|
|
20
|
+
"teams-debug",
|
|
21
|
+
"teams-document"
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
function printHelp() {
|
|
25
|
+
console.log(`ralph-teams-codex
|
|
26
|
+
|
|
27
|
+
Install or uninstall Codex skills from this package.
|
|
28
|
+
|
|
29
|
+
Usage:
|
|
30
|
+
ralph-teams-codex --global
|
|
31
|
+
ralph-teams-codex --local
|
|
32
|
+
ralph-teams-codex --global --skills teams-plan,teams-run
|
|
33
|
+
ralph-teams-codex --global --uninstall
|
|
34
|
+
|
|
35
|
+
Options:
|
|
36
|
+
--global Install into ~/.codex/skills or $CODEX_HOME/skills
|
|
37
|
+
--local Install into ./.codex/skills
|
|
38
|
+
--skills <csv> Comma-separated list of skill names to install
|
|
39
|
+
--uninstall Remove installed skills instead of copying them
|
|
40
|
+
--help Show this help
|
|
41
|
+
`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function parseArgs(argv) {
|
|
45
|
+
const options = {
|
|
46
|
+
scope: null,
|
|
47
|
+
uninstall: false,
|
|
48
|
+
skills: [...defaultSkillNames]
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
52
|
+
const arg = argv[i];
|
|
53
|
+
if (arg === "--global") {
|
|
54
|
+
options.scope = "global";
|
|
55
|
+
} else if (arg === "--local") {
|
|
56
|
+
options.scope = "local";
|
|
57
|
+
} else if (arg === "--uninstall") {
|
|
58
|
+
options.uninstall = true;
|
|
59
|
+
} else if (arg === "--skills") {
|
|
60
|
+
const value = argv[i + 1];
|
|
61
|
+
if (!value) {
|
|
62
|
+
throw new Error("--skills requires a comma-separated value");
|
|
63
|
+
}
|
|
64
|
+
options.skills = value.split(",").map((item) => item.trim()).filter(Boolean);
|
|
65
|
+
i += 1;
|
|
66
|
+
} else if (arg === "--help" || arg === "-h") {
|
|
67
|
+
options.help = true;
|
|
68
|
+
} else {
|
|
69
|
+
throw new Error(`Unknown argument: ${arg}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (!options.help && !options.scope) {
|
|
74
|
+
throw new Error("Choose exactly one install scope: --global or --local");
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return options;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function resolveTargetSkillsDir(scope) {
|
|
81
|
+
if (scope === "local") {
|
|
82
|
+
return path.resolve(process.cwd(), ".codex", "skills");
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const codexHome = process.env.CODEX_HOME
|
|
86
|
+
? path.resolve(process.env.CODEX_HOME)
|
|
87
|
+
: path.join(os.homedir(), ".codex");
|
|
88
|
+
return path.join(codexHome, "skills");
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function ensureKnownSkills(skills) {
|
|
92
|
+
const unknown = skills.filter((skill) => !Object.hasOwn(skillDirectoryByName, skill));
|
|
93
|
+
if (unknown.length > 0) {
|
|
94
|
+
throw new Error(`Unknown skills: ${unknown.join(", ")}`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function copyDirectory(sourceDir, targetDir) {
|
|
99
|
+
fs.cpSync(sourceDir, targetDir, { recursive: true, force: true });
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function removeDirectory(targetDir) {
|
|
103
|
+
fs.rmSync(targetDir, { recursive: true, force: true });
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function installSkills(targetSkillsDir, skills) {
|
|
107
|
+
fs.mkdirSync(targetSkillsDir, { recursive: true });
|
|
108
|
+
for (const skill of skills) {
|
|
109
|
+
const sourceDir = path.join(sourceSkillsDir, skillDirectoryByName[skill]);
|
|
110
|
+
const targetDir = path.join(targetSkillsDir, skill);
|
|
111
|
+
if (!fs.existsSync(sourceDir)) {
|
|
112
|
+
throw new Error(`Missing source skill directory: ${sourceDir}`);
|
|
113
|
+
}
|
|
114
|
+
copyDirectory(sourceDir, targetDir);
|
|
115
|
+
console.log(`Installed ${skill} -> ${targetDir}`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function uninstallSkills(targetSkillsDir, skills) {
|
|
120
|
+
for (const skill of skills) {
|
|
121
|
+
const targetDir = path.join(targetSkillsDir, skill);
|
|
122
|
+
removeDirectory(targetDir);
|
|
123
|
+
console.log(`Removed ${targetDir}`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function main() {
|
|
128
|
+
try {
|
|
129
|
+
const options = parseArgs(process.argv.slice(2));
|
|
130
|
+
if (options.help) {
|
|
131
|
+
printHelp();
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
ensureKnownSkills(options.skills);
|
|
136
|
+
const targetSkillsDir = resolveTargetSkillsDir(options.scope);
|
|
137
|
+
|
|
138
|
+
if (options.uninstall) {
|
|
139
|
+
uninstallSkills(targetSkillsDir, options.skills);
|
|
140
|
+
console.log("Done. Restart Codex to refresh installed skills.");
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
installSkills(targetSkillsDir, options.skills);
|
|
145
|
+
console.log("Done. Restart Codex to load the new skills.");
|
|
146
|
+
} catch (error) {
|
|
147
|
+
console.error(error.message);
|
|
148
|
+
process.exitCode = 1;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ralph-teams-codex",
|
|
3
|
+
"version": "1.5.1",
|
|
4
|
+
"description": "Codex skill pack for planning and building features with sequential builder subagents and verification workflows.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"bin": {
|
|
7
|
+
"ralph-teams-codex": "./bin/ralph-teams-codex.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin",
|
|
11
|
+
"skills",
|
|
12
|
+
"agents",
|
|
13
|
+
"AGENTS.md",
|
|
14
|
+
"README.md",
|
|
15
|
+
"FLOW.md"
|
|
16
|
+
],
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18"
|
|
19
|
+
}
|
|
20
|
+
}
|