@orderful/droid 0.19.0 → 0.21.0

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.
@@ -0,0 +1,33 @@
1
+ name: codex
2
+ description: "Shared organizational knowledge - PRDs, tech designs, patterns, and explored topics. Use when loading project context, searching codex, capturing decisions, or adding explored topics."
3
+ version: 0.1.0
4
+ status: beta
5
+
6
+ includes:
7
+ skills:
8
+ - name: droid-codex
9
+ required: true
10
+ commands:
11
+ - codex
12
+ agents:
13
+ - codex-document-processor
14
+
15
+ dependencies: []
16
+
17
+ # Prerequisites checked on install
18
+ prerequisites:
19
+ - name: gh
20
+ description: GitHub CLI for PR workflows
21
+ check: "gh --version"
22
+ install_hint: "brew install gh && gh auth login"
23
+
24
+ config_schema:
25
+ codex_repo:
26
+ type: string
27
+ description: Path to local orderful-codex repository (required)
28
+ required: true
29
+ default: "~/src/github.com/orderful-codex"
30
+ freshness_days:
31
+ type: number
32
+ description: Days before showing staleness warning
33
+ default: 30
@@ -0,0 +1,137 @@
1
+ ---
2
+ name: codex-document-processor
3
+ description: "Process documents (PDF, markdown) into codex-ready markdown with proper frontmatter. Use when importing files to the codex - handles extraction, formatting, and writing to the correct location."
4
+ tools:
5
+ - Read
6
+ - Write
7
+ - Glob
8
+ color: yellow
9
+ ---
10
+
11
+ You are a document processor for the Orderful codex. Your job is to transform source documents (PDFs, markdown files) into properly structured codex entries.
12
+
13
+ ## Input
14
+
15
+ You will receive:
16
+ 1. **File path** - The source document to process
17
+ 2. **Document type** - One of: `prd`, `tech-design`, `topic`, `pattern`
18
+ 3. **Project/entry name** - Where this should be stored in the codex
19
+ 4. **Codex repo path** - The local path to orderful-codex repository
20
+
21
+ ## Validation (Do This First)
22
+
23
+ Before processing, validate all inputs:
24
+
25
+ 1. **Document type** - Must be one of: `prd`, `tech-design`, `topic`, `pattern`. Reject anything else.
26
+ 2. **File path** - Must exist and be readable. Use Read tool to verify.
27
+ 3. **Project/entry name** - Must be safe for filesystem paths:
28
+ - Only allow: alphanumeric, dashes, underscores
29
+ - **Reject** if contains: `..`, `/`, `\`, or any shell metacharacters (`$`, backtick, `|`, `;`, `&`, `>`, `<`)
30
+ - If invalid, return error immediately (do not attempt to sanitize)
31
+ 4. **Codex repo path** - Must exist and contain expected structure
32
+
33
+ If any validation fails, return an error (see Error Handling below).
34
+
35
+ ## Process
36
+
37
+ ### 1. Read Source Document
38
+
39
+ Read the file at the provided path. For PDFs, extract all text content. For markdown, read as-is.
40
+
41
+ ### 2. Extract Key Information
42
+
43
+ From the content, identify:
44
+ - **Title** - The document/feature name
45
+ - **Main content** - The substantive information
46
+ - **Codebase paths** (if tech-design) - Any code paths mentioned
47
+ - **Source** - Default to `confluence` for PRDs/tech-designs, `exploration` for topics
48
+ - **Status** - Default based on type:
49
+ - PRD/tech-design: `draft` (new imports start as drafts)
50
+ - Topic/pattern: `active` (explorations are immediately usable)
51
+
52
+ ### 3. Read and Apply Frontmatter Template
53
+
54
+ **Read the template from the codex repo** - don't hardcode frontmatter structure:
55
+
56
+ | Type | Template Path |
57
+ |------|---------------|
58
+ | `prd` | `{codex_repo}/templates/PRD.md` |
59
+ | `tech-design` | `{codex_repo}/templates/TECH-DESIGN.md` |
60
+ | `topic` | `{codex_repo}/templates/TOPIC.md` |
61
+ | `pattern` | `{codex_repo}/templates/PATTERN.md` (if exists, else use TOPIC.md) |
62
+
63
+ 1. Read the appropriate template file
64
+ 2. Extract its frontmatter structure
65
+ 3. Fill in the values:
66
+ - `title` → extracted title
67
+ - `created` / `explored` → today's date (YYYY-MM-DD)
68
+ - `updated` → today's date (YYYY-MM-DD)
69
+ - `status` → `draft` for PRD/tech-design, `active` for topic/pattern
70
+ - `codebase_paths` → extracted paths, or omit if none found
71
+ - Keep other fields from template as-is
72
+
73
+ This ensures frontmatter stays in sync with the codex repo's templates.
74
+
75
+ ### 4. Structure Content
76
+
77
+ Transform the source content into the codex format:
78
+ - Preserve the original information and structure where sensible
79
+ - Use markdown headings, lists, and tables appropriately
80
+ - Remove any PDF artifacts or formatting noise
81
+ - Keep the content substantive - don't pad with empty template sections
82
+
83
+ ### 5. Write Output
84
+
85
+ Write the processed markdown to the correct location:
86
+
87
+ | Type | Output Path |
88
+ |------|-------------|
89
+ | `prd` | `{codex_repo}/projects/{name}/PRD.md` |
90
+ | `tech-design` | `{codex_repo}/projects/{name}/TECH-DESIGN.md` |
91
+ | `topic` | `{codex_repo}/topics/{name}.md` |
92
+ | `pattern` | `{codex_repo}/patterns/{name}.md` |
93
+
94
+ Create the directory if it doesn't exist.
95
+
96
+ **If file already exists:** Return an error. Do not overwrite without explicit confirmation from the main conversation. The error response should indicate the file exists so the user can decide whether to proceed.
97
+
98
+ ### 6. Return Result
99
+
100
+ Return a brief JSON summary:
101
+
102
+ ```json
103
+ {
104
+ "status": "success",
105
+ "file_path": "/path/to/written/file.md",
106
+ "title": "Extracted document title",
107
+ "type": "prd",
108
+ "summary": "One sentence describing what was processed"
109
+ }
110
+ ```
111
+
112
+ ## Important Notes
113
+
114
+ - **Preserve substance over form** - The goal is to capture the document's information, not perfectly replicate its layout
115
+ - **Don't invent content** - Only include information that exists in the source document
116
+ - **Handle missing sections gracefully** - If the source doesn't have a section (e.g., no "Testing Strategy"), omit it rather than leaving empty placeholders
117
+ - **Omit empty frontmatter fields** - If `codebase_paths` can't be determined, omit the field entirely rather than using placeholders
118
+ - **Canadian spelling** - Use behaviour, colour, etc.
119
+
120
+ ## Error Handling
121
+
122
+ If anything fails, return an error response instead of the success format:
123
+
124
+ ```json
125
+ {
126
+ "status": "error",
127
+ "error_type": "validation_failed" | "file_not_found" | "extraction_failed" | "file_exists" | "write_failed",
128
+ "message": "Human-readable description of what went wrong"
129
+ }
130
+ ```
131
+
132
+ **Error types:**
133
+ - `validation_failed` - Invalid document type, unsafe name, or missing codex repo
134
+ - `file_not_found` - Source file doesn't exist or isn't readable
135
+ - `extraction_failed` - Couldn't extract meaningful content from the document
136
+ - `file_exists` - Target file already exists (user must confirm overwrite)
137
+ - `write_failed` - Couldn't write to target location (permissions, disk space, etc.)
@@ -0,0 +1,70 @@
1
+ ---
2
+ description: Shared organizational knowledge - PRDs, tech designs, patterns, and explored topics
3
+ argument-hint: "[projects | patterns | topics | {name} | search {query} | new {name} | decision {text} | add topic {name}]"
4
+ allowed-tools: Read, Write, Edit, Glob, Grep, Bash(gh:*), Bash(git:*), Bash(ls:*), Bash(mkdir:*)
5
+ ---
6
+
7
+ # /codex
8
+
9
+ Entry point for shared organizational knowledge. See the **codex skill** for full behaviour.
10
+
11
+ > Context is AI's multiplier. This is Orderful's.
12
+
13
+ ## Arguments
14
+
15
+ $ARGUMENTS
16
+
17
+ ## Prerequisites
18
+
19
+ Before first use, verify:
20
+
21
+ 1. **Repo cloned** at configured `codex_repo` path
22
+ 2. **gh CLI** installed and authenticated
23
+
24
+ ## Usage
25
+
26
+ ```bash
27
+ /codex # Show categories (projects, patterns, topics)
28
+ /codex projects # List projects
29
+ /codex patterns # List patterns
30
+ /codex topics # List topics
31
+ /codex {name} # Load entry (searches all categories)
32
+ /codex search {query} # Search across everything
33
+ /codex new {name} # Scaffold new project from templates
34
+ /codex decision {text} # Append to active project's DECISIONS.md
35
+ /codex snapshot {file} {name} # Import PDF/markdown to project
36
+ /codex add topic {name} # Add explored topic with freshness metadata
37
+ ```
38
+
39
+ ## Configuration
40
+
41
+ **ALWAYS read `~/.droid/skills/codex/overrides.yaml` first.**
42
+
43
+ - `codex_repo` - Path to local orderful-codex repository (required)
44
+ - `freshness_days` - Days before showing staleness warning (default: 30)
45
+
46
+ ## Behaviour
47
+
48
+ Refer to the codex skill for:
49
+ - **Loading**: How to search, handle matches, check freshness, auto-generate CONTEXT.md
50
+ - **Decisions**: How to append to active project's DECISIONS.md
51
+ - **Topics**: How to capture explored codebase areas with freshness metadata
52
+ - **Creating**: How to scaffold new projects from templates
53
+
54
+ The skill's `references/` folder contains detailed procedures for each workflow.
55
+
56
+ ## Examples
57
+
58
+ ```bash
59
+ # Load project context
60
+ /codex transaction-templates
61
+
62
+ # Search for webhook-related content
63
+ /codex search webhook
64
+
65
+ # Capture a decision during implementation
66
+ /codex decision "Using UUIDv7 for IDs because it's sortable and includes timestamp"
67
+
68
+ # Save today's exploration as a topic
69
+ /codex add topic organization-hierarchy
70
+ ```
@@ -0,0 +1,314 @@
1
+ ---
2
+ name: droid-codex
3
+ description: "Shared organizational knowledge - PRDs, tech designs, patterns, and explored topics. Use when loading project context ('load transaction-templates'), searching codex ('search webhook'), capturing decisions ('codex decision'), or adding explored topics ('add topic'). User prompts like 'check the codex', 'what's in the codex about X', 'load the PRD for Y'."
4
+ globs:
5
+ - "**/PRD.md"
6
+ - "**/TECH-DESIGN.md"
7
+ - "**/CONTEXT.md"
8
+ - "**/DECISIONS.md"
9
+ alwaysApply: false
10
+ allowed-tools: Read, Write, Edit, Glob, Grep, Bash(gh:*), Bash(git:*), Bash(ls:*), Bash(mkdir:*)
11
+ ---
12
+
13
+ # Codex Skill
14
+
15
+ > Context is AI's multiplier. This is Orderful's.
16
+
17
+ Shared organizational knowledge for humans and droids alike. Product requirements documents, tech designs, patterns, and explored topics - structured for AI-assisted development.
18
+
19
+ ## Prerequisites
20
+
21
+ Before using codex, verify:
22
+
23
+ 1. **Repo cloned:** Check if `codex_repo` path exists
24
+ 2. **gh CLI:** Required for PR workflows (CONTEXT.md auto-generation)
25
+
26
+ ```bash
27
+ # Check repo exists
28
+ ls -la {codex_repo}
29
+
30
+ # Check gh CLI
31
+ gh --version
32
+ ```
33
+
34
+ If prerequisites fail, guide user to fix:
35
+ - Repo missing: `git clone git@github.com:orderful/orderful-codex.git {path}`
36
+ - gh missing: `brew install gh && gh auth login`
37
+
38
+ ## Sync Before Reading
39
+
40
+ **Before any read operation** (loading, searching, listing), pull latest:
41
+
42
+ ```bash
43
+ git -C {codex_repo} pull --rebase --quiet
44
+ ```
45
+
46
+ This ensures shared knowledge is always current. The pull is quiet to avoid noise, but if it fails (conflicts, network), warn the user.
47
+
48
+ ## Security
49
+
50
+ ### Input Validation
51
+
52
+ **Always validate user-provided names before using in paths:**
53
+
54
+ ```bash
55
+ # REJECT names containing path traversal attempts
56
+ if [[ "{name}" == *".."* ]] || [[ "{name}" == *"/"* ]]; then
57
+ echo "Invalid name: must not contain '..' or '/'"
58
+ exit 1
59
+ fi
60
+
61
+ # REJECT names with shell metacharacters
62
+ if [[ "{name}" =~ [\$\`\|\;\&\>\<] ]]; then
63
+ echo "Invalid name: contains unsafe characters"
64
+ exit 1
65
+ fi
66
+ ```
67
+
68
+ ### Safe Git Commits
69
+
70
+ **Use heredoc for commit messages to prevent injection:**
71
+
72
+ ```bash
73
+ # GOOD - safe from injection
74
+ git commit -F - <<EOF
75
+ decision({active}): {summary}
76
+ EOF
77
+
78
+ # BAD - vulnerable to injection
79
+ git commit -m "decision({active}): {summary}"
80
+ ```
81
+
82
+ ### Access Control
83
+
84
+ **Check repo access before attempting write operations:**
85
+
86
+ ```bash
87
+ # Verify push access before making changes
88
+ if ! git -C {codex_repo} push --dry-run 2>/dev/null; then
89
+ echo "Error: No push access to codex repo. Check your permissions."
90
+ exit 1
91
+ fi
92
+ ```
93
+
94
+ ## Configuration
95
+
96
+ **ALWAYS read `~/.droid/skills/codex/overrides.yaml` first.**
97
+
98
+ | Setting | Default | Description |
99
+ |---------|---------|-------------|
100
+ | `codex_repo` | `~/src/github.com/orderful-codex` | Path to local codex repo |
101
+ | `freshness_days` | `30` | Days before staleness warning |
102
+
103
+ ## Categories
104
+
105
+ The codex has three categories:
106
+
107
+ | Category | Path | Purpose |
108
+ |----------|------|---------|
109
+ | `projects` | `{codex_repo}/projects/` | Feature/project context (PRD, tech design, decisions) |
110
+ | `patterns` | `{codex_repo}/patterns/` | Cross-cutting technical patterns |
111
+ | `topics` | `{codex_repo}/topics/` | Explored codebase areas with freshness tracking |
112
+
113
+ ## Commands
114
+
115
+ | Command | Action |
116
+ |---------|--------|
117
+ | `/codex` | Show categories overview |
118
+ | `/codex projects` | List all projects |
119
+ | `/codex patterns` | List all patterns |
120
+ | `/codex topics` | List all topics |
121
+ | `/codex {name}` | Load entry (searches all categories) |
122
+ | `/codex search {query}` | Search across everything |
123
+ | `/codex new {name}` | Scaffold new project from templates |
124
+ | `/codex decision {text}` | Append to active project's DECISIONS.md |
125
+ | `/codex snapshot {type} {file} {name}` | Import PDF/markdown to codex (uses agent) |
126
+ | `/codex add topic {name}` | Add explored topic with freshness metadata |
127
+
128
+ ## Loading an Entry
129
+
130
+ **Trigger:** `/codex {name}` or user asks to load/check codex for something
131
+
132
+ **Procedure:**
133
+
134
+ 1. Search for `{name}` across all categories (fuzzy match on folder/file names)
135
+ 2. If multiple matches → show list, let user pick
136
+ 3. If single match → load it
137
+ 4. For projects with multiple files → show file list, let user pick which to load
138
+ 5. Check freshness (see below)
139
+ 6. Output loaded content
140
+
141
+ **If no CONTEXT.md exists for a project:**
142
+ - Synthesise unified context from PRD.md + TECH-DESIGN.md + DECISIONS.md
143
+ - Create branch, commit CONTEXT.md, open PR
144
+ - Inform user: "I've created a CONTEXT.md summarising this project - PR #{number}"
145
+
146
+ Full procedure: `references/loading.md`
147
+
148
+ ## Freshness Checking
149
+
150
+ All codex files have frontmatter:
151
+
152
+ ```yaml
153
+ ---
154
+ title: Feature Name
155
+ type: prd | tech-design | context | decisions | pattern | topic
156
+ status: draft | active | complete | archived
157
+ created: 2026-01-07
158
+ updated: 2026-01-07
159
+ confidence: high | medium | low
160
+ source: confluence | exploration | implementation
161
+ codebase_paths:
162
+ - apps/platform-api/src/...
163
+ ---
164
+ ```
165
+
166
+ **Status values:**
167
+ - `draft` - Initial capture, not ready for consumption
168
+ - `active` - Current, being used for implementation
169
+ - `complete` - Project shipped, kept for reference
170
+ - `archived` - No longer relevant, kept for history
171
+
172
+ Note: Topics use `draft | active | archived` (no "complete"). Patterns use `active | archived` (no draft phase).
173
+
174
+ **When loading any file:**
175
+
176
+ 1. Parse frontmatter for `updated` date
177
+ 2. Calculate days since update
178
+ 3. If > `freshness_days` (default 30):
179
+ - Warn: "This doc was last updated {date} ({n} days ago). Want me to verify it's still accurate?"
180
+ 4. If `codebase_paths` present:
181
+ - Check if those paths have commits since `updated` date
182
+ - If yes: "Files in {paths} have changed since this doc was updated. Want me to review?"
183
+ 5. If `confidence: low`:
184
+ - Note: "This was a quick exploration and may be incomplete"
185
+
186
+ ## Active Project Tracking
187
+
188
+ Scoped operations (`decision`, `snapshot`) require an active project:
189
+
190
+ - When user loads a project via `/codex {project-name}`, set it as active
191
+ - Store active project name in session context
192
+ - If scoped operation called with no active project → show project list, let user pick
193
+
194
+ ## Adding Decisions
195
+
196
+ **Trigger:** `/codex decision {text}` or user wants to capture a decision
197
+
198
+ **Procedure:**
199
+
200
+ 1. Verify active project exists (if not, prompt to select)
201
+ 2. Read `{codex_repo}/projects/{active}/DECISIONS.md`
202
+ 3. Append new decision with today's date:
203
+ ```markdown
204
+ ## {YYYY-MM-DD}: {Decision summary from text}
205
+
206
+ **Context:** {Extract from conversation}
207
+
208
+ **Decision:** {The decision}
209
+
210
+ **Rationale:** {Why this choice}
211
+ ```
212
+ 4. Update `updated` date in frontmatter
213
+ 5. Create branch, commit, and open PR via `gh pr create`
214
+
215
+ Full procedure: `references/decisions.md`
216
+
217
+ ## Adding Topics
218
+
219
+ **Trigger:** `/codex add topic {name}` or user wants to save exploration
220
+
221
+ **Procedure:**
222
+
223
+ 1. Create `{codex_repo}/topics/{name}.md`
224
+ 2. Use template from `{codex_repo}/templates/TOPIC.md`
225
+ 3. Fill in frontmatter:
226
+ - `explored`: today's date
227
+ - `confidence`: ask user or infer from exploration depth
228
+ - `codebase_paths`: paths that were explored
229
+ 4. Fill in content from current exploration/conversation
230
+ 5. Create branch, commit, and open PR via `gh pr create`
231
+
232
+ Full procedure: `references/topics.md`
233
+
234
+ ## Importing Documents
235
+
236
+ **Trigger:** `/codex snapshot {type} {file} {name}` or user wants to add a file to the codex
237
+
238
+ **IMPORTANT:** Always use the `codex-document-processor` agent to process documents. This keeps the main conversation context lean by offloading heavy document processing.
239
+
240
+ **Procedure:**
241
+
242
+ 1. Determine the document type (required): `prd`, `tech-design`, `topic`, or `pattern`
243
+ 2. Spawn the `codex-document-processor` agent with:
244
+ - File path to the source document
245
+ - Document type
246
+ - Project/entry name
247
+ - Codex repo path from config
248
+ 3. Agent processes the document:
249
+ - Reads and extracts content
250
+ - Applies appropriate frontmatter template
251
+ - Writes to correct location in codex repo
252
+ - Returns file path and summary
253
+ 4. **Back in main conversation:** Handle git workflow
254
+ - Create branch: `codex/snapshot-{name}`
255
+ - Commit the new file
256
+ - Push and create PR via `gh pr create`
257
+ 5. Share PR link with user
258
+
259
+ **Example invocations:**
260
+
261
+ ```bash
262
+ # Explicit snapshot command
263
+ /codex snapshot prd ~/Downloads/transaction-templates-prd.pdf transaction-templates
264
+
265
+ # Natural language (still uses the agent)
266
+ "Add this PRD to the transaction-templates project" + attach file
267
+ "Import this tech design to generic-scenario-testing"
268
+ ```
269
+
270
+ The agent handles: PDF reading, content extraction, frontmatter generation, file writing.
271
+ The main conversation handles: git branch, commit, PR creation, user interaction.
272
+
273
+ ## Creating New Projects
274
+
275
+ **Trigger:** `/codex new {name}` or user wants to start new project entry
276
+
277
+ **Procedure:**
278
+
279
+ 1. Create `{codex_repo}/projects/{name}/`
280
+ 2. Copy templates from `{codex_repo}/templates/`:
281
+ - PRD.md
282
+ - TECH-DESIGN.md
283
+ - DECISIONS.md
284
+ 3. Fill in frontmatter with today's date
285
+ 4. Create branch, commit, and open PR via `gh pr create`
286
+
287
+ Full procedure: `references/creating.md`
288
+
289
+ ## Integration with /project
290
+
291
+ The codex holds **shared** organizational knowledge. The `/project` skill holds **personal** working memory.
292
+
293
+ ```
294
+ /codex transaction-templates → load shared context
295
+ /project create --from codex:{name} → seed personal PROJECT.md
296
+ /codex publish → promote learnings back (future)
297
+ ```
298
+
299
+ When user runs `/project create --from codex:{name}`:
300
+ 1. Load the codex entry
301
+ 2. Extract key context for personal PROJECT.md
302
+ 3. Create project in user's projects_dir
303
+
304
+ ## Git Workflow
305
+
306
+ **All codex changes must go through PRs** (main branch is protected):
307
+
308
+ 1. Create branch: `codex/{action}-{name}` (e.g., `codex/decision-uuid-format`)
309
+ 2. Make changes
310
+ 3. Commit with descriptive message
311
+ 4. Push and create PR via `gh pr create`
312
+ 5. Share PR link with user
313
+
314
+ Safe changes (new files, decision appends) are auto-merged by GitHub Action. Modifications to existing content require review.
@@ -0,0 +1,150 @@
1
+ # Creating New Projects
2
+
3
+ Detailed procedure for scaffolding new project entries in the codex.
4
+
5
+ ## When to Use
6
+
7
+ - Starting work on a new feature/project
8
+ - `/codex new {name}` command
9
+ - User asks to create a codex entry for something new
10
+
11
+ ## Procedure
12
+
13
+ ### 1. Determine Project Name
14
+
15
+ From user input:
16
+ - Use kebab-case: `transaction-templates`, `audit-logging`
17
+ - Should match how the team refers to the feature
18
+
19
+ ### 2. Check for Existing Entry
20
+
21
+ ```bash
22
+ ls {codex_repo}/projects/ | grep -i {name}
23
+ ```
24
+
25
+ If exists:
26
+ ```
27
+ A project named '{name}' already exists. Did you mean to load it?
28
+ → /codex {name}
29
+ ```
30
+
31
+ ### 3. Create Project Directory
32
+
33
+ ```bash
34
+ mkdir -p {codex_repo}/projects/{name}
35
+ ```
36
+
37
+ ### 4. Copy Templates
38
+
39
+ ```bash
40
+ cp {codex_repo}/templates/PRD.md {codex_repo}/projects/{name}/
41
+ cp {codex_repo}/templates/TECH-DESIGN.md {codex_repo}/projects/{name}/
42
+ cp {codex_repo}/templates/DECISIONS.md {codex_repo}/projects/{name}/
43
+ ```
44
+
45
+ ### 5. Update Frontmatter
46
+
47
+ In each file, update:
48
+ - `title`: Project name (Title Case)
49
+ - `created`: Today's date
50
+ - `updated`: Today's date
51
+
52
+ ### 6. Optionally Pre-Fill Content
53
+
54
+ If user provides context, fill in what we know:
55
+ - PRD.md: Problem statement, goals if discussed
56
+ - TECH-DESIGN.md: Any architectural decisions mentioned
57
+ - DECISIONS.md: Leave as template (decisions come during impl)
58
+
59
+ ### 7. Create Branch and PR
60
+
61
+ ```bash
62
+ cd {codex_repo}
63
+ git checkout -b codex/new-{name}
64
+ git add projects/{name}/
65
+ git commit -F - <<EOF
66
+ feat(codex): scaffold {name} project
67
+ EOF
68
+ git push -u origin codex/new-{name}
69
+ gh pr create --title "New project: {name}" --body "Scaffold for {name} project"
70
+ ```
71
+
72
+ ### 8. Confirm to User
73
+
74
+ ```
75
+ ✅ Created codex project: {name}
76
+
77
+ 📁 {codex_repo}/projects/{name}/
78
+ ├── PRD.md (template - fill in requirements)
79
+ ├── TECH-DESIGN.md (template - fill in technical design)
80
+ └── DECISIONS.md (ready for decisions during implementation)
81
+
82
+ PR: {pr_url}
83
+ (Auto-merges for new projects)
84
+
85
+ Next steps:
86
+ 1. Fill in PRD.md with product requirements
87
+ 2. Fill in TECH-DESIGN.md with technical approach
88
+ 3. Use `/codex decision` to capture decisions as you implement
89
+ ```
90
+
91
+ ## Example
92
+
93
+ **User:** `/codex new audit-logging`
94
+
95
+ **Result:**
96
+
97
+ ```
98
+ ✅ Created codex project: audit-logging
99
+
100
+ 📁 ~/src/github.com/orderful-codex/projects/audit-logging/
101
+ ├── PRD.md (template - fill in requirements)
102
+ ├── TECH-DESIGN.md (template - fill in technical design)
103
+ └── DECISIONS.md (ready for decisions during implementation)
104
+
105
+ Next steps:
106
+ 1. Fill in PRD.md with product requirements
107
+ 2. Fill in TECH-DESIGN.md with technical approach
108
+ 3. Use `/codex decision` to capture decisions as you implement
109
+
110
+ Want me to help fill in any of these based on what we've discussed?
111
+ ```
112
+
113
+ ## With Pre-Existing Context
114
+
115
+ If the user has already discussed the feature:
116
+
117
+ **User:** "We're building audit logging to track all API changes for compliance. It'll use an event sourcing pattern."
118
+
119
+ **User:** `/codex new audit-logging`
120
+
121
+ **Result:** (PRD.md pre-filled with discussed context)
122
+
123
+ ```markdown
124
+ ---
125
+ title: Audit Logging
126
+ type: prd
127
+ created: 2026-01-07
128
+ updated: 2026-01-07
129
+ confidence: medium
130
+ source: implementation
131
+ ---
132
+
133
+ # Audit Logging - PRD
134
+
135
+ ## Problem Statement
136
+
137
+ Need to track all API changes for compliance requirements.
138
+
139
+ ## Goals
140
+
141
+ - Track all API changes
142
+ - Support compliance auditing
143
+ - {More goals to be defined}
144
+
145
+ ## Non-Goals
146
+
147
+ - {To be defined}
148
+
149
+ ...
150
+ ```