@orderful/droid 0.35.3 → 0.36.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.
Files changed (40) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/CHANGELOG.md +32 -0
  3. package/README.md +80 -18
  4. package/dist/tools/codex/.claude-plugin/plugin.json +2 -2
  5. package/dist/tools/codex/TOOL.yaml +2 -2
  6. package/dist/tools/codex/commands/codex.md +1 -1
  7. package/dist/tools/codex/skills/codex/SKILL.md +120 -329
  8. package/dist/tools/codex/skills/codex/references/reading-workflows.md +56 -0
  9. package/dist/tools/codex/skills/codex/references/review/prd.md +49 -0
  10. package/dist/tools/codex/skills/codex/references/review/workflow.md +40 -230
  11. package/dist/tools/codex/skills/codex/scripts/git-finish-write.d.ts +1 -0
  12. package/dist/tools/codex/skills/codex/scripts/git-finish-write.d.ts.map +1 -1
  13. package/dist/tools/codex/skills/codex/scripts/git-finish-write.ts +19 -4
  14. package/dist/tools/plan/.claude-plugin/plugin.json +1 -1
  15. package/dist/tools/plan/TOOL.yaml +1 -1
  16. package/dist/tools/plan/skills/plan/SKILL.md +1 -0
  17. package/dist/tools/tech-design/skills/tech-design/SKILL.md +14 -10
  18. package/dist/tools/tech-design/skills/tech-design/references/publish.md +3 -2
  19. package/package.json +1 -1
  20. package/src/tools/codex/.claude-plugin/plugin.json +2 -2
  21. package/src/tools/codex/TOOL.yaml +2 -2
  22. package/src/tools/codex/commands/codex.md +1 -1
  23. package/src/tools/codex/skills/codex/SKILL.md +120 -329
  24. package/src/tools/codex/skills/codex/references/reading-workflows.md +56 -0
  25. package/src/tools/codex/skills/codex/references/review/prd.md +49 -0
  26. package/src/tools/codex/skills/codex/references/review/workflow.md +40 -230
  27. package/src/tools/codex/skills/codex/scripts/git-finish-write.ts +19 -4
  28. package/src/tools/plan/.claude-plugin/plugin.json +1 -1
  29. package/src/tools/plan/TOOL.yaml +1 -1
  30. package/src/tools/plan/skills/plan/SKILL.md +1 -0
  31. package/src/tools/tech-design/skills/tech-design/SKILL.md +14 -10
  32. package/src/tools/tech-design/skills/tech-design/references/publish.md +3 -2
  33. package/dist/tools/codex/skills/codex/references/creating.md +0 -112
  34. package/dist/tools/codex/skills/codex/references/decisions.md +0 -124
  35. package/dist/tools/codex/skills/codex/references/loading.md +0 -292
  36. package/dist/tools/codex/skills/codex/references/topics.md +0 -215
  37. package/src/tools/codex/skills/codex/references/creating.md +0 -112
  38. package/src/tools/codex/skills/codex/references/decisions.md +0 -124
  39. package/src/tools/codex/skills/codex/references/loading.md +0 -292
  40. package/src/tools/codex/skills/codex/references/topics.md +0 -215
@@ -1,124 +0,0 @@
1
- # Adding Decisions
2
-
3
- Detailed procedure for capturing decisions during implementation.
4
-
5
- ## When to Use
6
-
7
- - User explicitly asks to record a decision
8
- - `/codex decision {text}` command
9
- - During implementation when a significant choice is made
10
-
11
- ## Prerequisites
12
-
13
- - **Active project** must be set (from previous `/codex search {project}` load)
14
- - If no active project, prompt user to select one first
15
-
16
- ## Procedure
17
-
18
- ### 1. Verify Active Project
19
-
20
- ```
21
- If no active project:
22
- "No project is currently active. Which project should I add this decision to?"
23
- → List projects, let user pick
24
- → Set as active
25
- ```
26
-
27
- ### 2. Parse Decision Text
28
-
29
- From the user's input, extract:
30
- - **Summary:** Brief title for the decision
31
- - **Context:** What situation prompted this?
32
- - **Decision:** What was decided?
33
- - **Rationale:** Why this choice?
34
-
35
- If any parts are unclear, ask:
36
- ```
37
- I'll add this decision. Can you clarify:
38
- - What prompted this decision?
39
- - Were there alternatives you considered?
40
- ```
41
-
42
- ### 3. Start Write Operation
43
-
44
- ```bash
45
- droid config --get tools.codex | droid exec droid-codex git-start-write --config - --branch codex/decision-{short-summary}
46
- ```
47
-
48
- ### 4. Read and Update DECISIONS.md
49
-
50
- ```bash
51
- cat {codex_repo}/projects/{active}/DECISIONS.md
52
- ```
53
-
54
- Append new decision at the end:
55
-
56
- ```markdown
57
- ---
58
-
59
- ## {YYYY-MM-DD}: {Summary}
60
-
61
- **Context:** {What situation prompted this decision?}
62
-
63
- **Decision:** {What was decided?}
64
-
65
- **Rationale:** {Why this choice over alternatives?}
66
-
67
- **Alternatives Considered:**
68
- - {Alternative 1} - {Why rejected}
69
- - {Alternative 2} - {Why rejected}
70
-
71
- **Consequences:**
72
- - {Expected outcomes, trade-offs}
73
- ```
74
-
75
- Update the `updated` field in frontmatter to today's date.
76
-
77
- ### 5. Finish Write Operation
78
-
79
- ```bash
80
- droid config --get tools.codex | droid exec droid-codex git-finish-write --config - \
81
- --message "decision({active}): {summary}" \
82
- --pr-title "Decision: {summary}" \
83
- --pr-body "{full decision text}"
84
- ```
85
-
86
- ### 6. Confirm to User
87
-
88
- ```
89
- ✅ Added decision to {active}/DECISIONS.md:
90
- "{summary}"
91
-
92
- PR: {pr_url}
93
- (Auto-merges for append-only changes)
94
- ```
95
-
96
- ## Example
97
-
98
- **User:** `/codex decision "Using UUIDv7 for all new IDs because it's sortable and includes timestamp"`
99
-
100
- **Active project:** transaction-templates
101
-
102
- **Result appended to DECISIONS.md:**
103
-
104
- ```markdown
105
- ---
106
-
107
- ## 2026-01-07: Using UUIDv7 for ID Generation
108
-
109
- **Context:** Need to choose ID format for new transaction template records.
110
-
111
- **Decision:** Use UUIDv7 for all new IDs.
112
-
113
- **Rationale:** UUIDv7 is sortable (timestamp-based prefix) and includes creation timestamp, making it ideal for ordered data and debugging.
114
-
115
- **Alternatives Considered:**
116
- - UUIDv4 - Random, not sortable, no timestamp
117
- - Auto-increment - Database-specific, exposes record count
118
- - ULID - Similar benefits but less standard
119
-
120
- **Consequences:**
121
- - IDs will be longer than auto-increment (36 chars)
122
- - Natural ordering by creation time
123
- - No database sequence dependencies
124
- ```
@@ -1,292 +0,0 @@
1
- # Loading Codex Entries
2
-
3
- Detailed procedure for loading entries from the codex.
4
-
5
- ## Search and Match
6
-
7
- **IMPORTANT:** Use the index file for fast lookups. This avoids expensive file-by-file searching.
8
-
9
- 1. **Get codex repo path** by running `droid config --get tools.codex` and parsing the JSON output
10
- 2. **Read the index file** at `{codex_repo}/index.yaml`:
11
- ```yaml
12
- # index.yaml structure
13
- projects:
14
- partnership-automation:
15
- title: "Partnership Automation & Sample Transaction Engine"
16
- aliases: ["transaction-templates", "template-transactions"]
17
- patterns:
18
- jsdoc-config-directives:
19
- title: "JSDoc @config Directives"
20
- aliases: ["config-directives", "comment-directives"]
21
- topics:
22
- handlebars-template-security:
23
- title: "Handlebars Template Security"
24
- aliases: []
25
- domains: {}
26
- proposals: {}
27
- ```
28
- 3. **Match `{name}` against the index:**
29
- - Check each entry's key (folder/file name)
30
- - Check each entry's `aliases` array
31
- - Match is case-insensitive and supports partial matching
32
- - Example: "template transactions" matches `partnership-automation` via alias "template-transactions"
33
- 4. **Handle matches:**
34
- - No matches → "No codex entry found for '{name}'. Did you mean one of these?" + suggest entries from index
35
- - Single match → proceed to load from the matched category/path
36
- - Multiple matches → show list with category, let user pick
37
-
38
- **Fallback:** If `index.yaml` doesn't exist, fall back to directory scanning:
39
-
40
- ```bash
41
- ls {codex_repo}/projects/ | grep -i {name}
42
- ls {codex_repo}/domains/ | grep -i {name}
43
- # ... etc
44
- ```
45
-
46
- ## Loading a Project
47
-
48
- Projects are folders with multiple files:
49
-
50
- ```
51
- projects/transaction-templates/
52
- ├── PRD.md
53
- ├── TECH-DESIGN.md
54
- ├── DESIGN.md # Optional
55
- ├── CONTEXT.md # Auto-generated summary (progressive disclosure layer 1)
56
- └── DECISIONS.md
57
- ```
58
-
59
- ### Progressive Disclosure
60
-
61
- CONTEXT.md is the **first layer** - a synthesised summary that's enough for most queries. Only load full documents when deeper detail is needed.
62
-
63
- | Layer | What | When to use |
64
- | ----- | ----------------- | ------------------------------------------------------------ |
65
- | 1 | CONTEXT.md (~2KB) | General questions, getting oriented, "what is this project?" |
66
- | 2 | Specific file | Deep dives - "show me the full technical architecture" |
67
- | 3 | All files | Comprehensive review, major updates, onboarding |
68
-
69
- ### Procedure
70
-
71
- 1. **List files** in project folder
72
- 2. **Check for CONTEXT.md:**
73
-
74
- **If CONTEXT.md exists:**
75
-
76
- ```
77
- 📂 Loading transaction-templates
78
-
79
- CONTEXT.md available (updated 2026-01-05, ~2KB)
80
- → Loading summary for general context...
81
-
82
- [CONTEXT.md content]
83
-
84
- ---
85
- Need more detail? Available files:
86
- - PRD.md - Full requirements and goals
87
- - TECH-DESIGN.md - Architecture and implementation
88
- - DECISIONS.md - Decision log
89
- ```
90
-
91
- Load CONTEXT.md automatically. Only load additional files if user asks.
92
-
93
- **If no CONTEXT.md:**
94
- → Trigger auto-generation (see below)
95
-
96
- 3. **Set project as active** for scoped operations
97
- 4. **Check freshness** (see below)
98
-
99
- ## Loading a Domain or Proposal
100
-
101
- Domains and proposals are single files:
102
-
103
- ```
104
- domains/partnerships.md
105
- proposals/caching-layer.md
106
- ```
107
-
108
- **Procedure:**
109
-
110
- 1. Read the file
111
- 2. Check freshness
112
- 3. Output content
113
-
114
- ## Loading a Pattern or Topic
115
-
116
- Patterns and topics are single files:
117
-
118
- ```
119
- patterns/api-design.md
120
- topics/organization-hierarchy.md
121
- ```
122
-
123
- **Procedure:**
124
-
125
- 1. Read the file
126
- 2. Check freshness
127
- 3. Output content
128
-
129
- ## Auto-Generating CONTEXT.md
130
-
131
- If loading a project and no CONTEXT.md exists, generate it immediately.
132
-
133
- **User sees:**
134
-
135
- ```
136
- 📂 Loading transaction-templates
137
-
138
- No CONTEXT.md found - generating summary from available artifacts...
139
-
140
- Reading PRD.md...
141
- → Extracting problem statement, goals, success metrics
142
- Reading TECH-DESIGN.md...
143
- → Extracting architecture overview, key decisions
144
- Reading DECISIONS.md...
145
- → Extracting decision log summary
146
-
147
- Synthesising unified context...
148
- ```
149
-
150
- **Procedure:**
151
-
152
- Generate CONTEXT.md either synchronously or asynchronously:
153
-
154
- ### Option A: Synchronous (works everywhere)
155
-
156
- 1. **Inform user:** "No CONTEXT.md found - generating summary from available artifacts"
157
- 2. **Read all available files:** PRD.md, TECH-DESIGN.md, DECISIONS.md
158
- 3. **Generate unified summary** (see template below)
159
- 4. **Create PR** (see git workflow below)
160
- 5. **Output the new CONTEXT.md** with "need more detail?" options
161
-
162
- ### Option B: Asynchronous (Claude Code only, optional)
163
-
164
- 1. **Spawn background agent** to synthesize CONTEXT.md (non-blocking):
165
- ```
166
- Use Task tool with subagent_type: "general" and run_in_background: true
167
- Prompt: "Generate CONTEXT.md for {project} from PRD.md, TECH-DESIGN.md, DECISIONS.md. Create branch, commit, open PR."
168
- ```
169
- 2. **Immediately ask user** which file to load (don't wait for synthesis)
170
- 3. **Load selected file** and continue working
171
- 4. **When background agent completes**, inform user: "CONTEXT.md ready - PR #{number}"
172
-
173
- **Choose whichever approach works best.** Synchronous is simpler and works everywhere. Asynchronous avoids blocking but requires background agent support.
174
-
175
- ### CONTEXT.md Template
176
-
177
- Generate a unified summary from the project files:
178
-
179
- ```markdown
180
- ---
181
- title: { Project Name }
182
- type: context
183
- created: { today }
184
- updated: { today }
185
- confidence: high
186
- source: implementation
187
- ---
188
-
189
- # {Project Name} - Context
190
-
191
- ## Overview
192
-
193
- {Synthesised from PRD problem statement + goals}
194
-
195
- ## Technical Approach
196
-
197
- {Synthesised from TECH-DESIGN architecture + key decisions}
198
-
199
- ## Key Decisions
200
-
201
- {Summarised from DECISIONS.md}
202
-
203
- ## Current Status
204
-
205
- {Inferred from most recent updates}
206
-
207
- ---
208
-
209
- _Auto-generated from PRD.md, TECH-DESIGN.md, and DECISIONS.md_
210
- ```
211
-
212
- ### Git Workflow for CONTEXT.md
213
-
214
- After generating the CONTEXT.md content:
215
-
216
- ```bash
217
- cd {codex_repo}
218
- git checkout -b auto/context-{project-name}
219
- # Write CONTEXT.md to projects/{project}/CONTEXT.md
220
- git add projects/{project}/CONTEXT.md
221
- git commit -F - <<EOF
222
- feat: auto-generate CONTEXT.md for {project}
223
- EOF
224
- git push -u origin auto/context-{project-name}
225
- gh pr create --title "Auto-generated CONTEXT.md for {project}" --body "Synthesised from PRD, TECH-DESIGN, and DECISIONS."
226
- ```
227
-
228
- Then inform the user:
229
-
230
- ```
231
- ✅ CONTEXT.md created and PR #{number} opened
232
-
233
- [Show CONTEXT.md content]
234
-
235
- ---
236
- Need more detail? Available files:
237
- - PRD.md - Full requirements and goals
238
- - TECH-DESIGN.md - Architecture and implementation
239
- - DECISIONS.md - Decision log
240
- ```
241
-
242
- ## Freshness Checking
243
-
244
- After loading any file:
245
-
246
- 1. **Parse frontmatter** for `updated` date
247
- 2. **Calculate age:**
248
- ```
249
- days_old = today - updated
250
- ```
251
- 3. **Check against threshold** (`freshness_days` from config, default 30):
252
- - If `days_old > freshness_days`:
253
- ```
254
- ⚠️ This doc was last updated {updated} ({days_old} days ago).
255
- Want me to verify it's still accurate?
256
- ```
257
- 4. **Check codebase changes** (if `codebase_paths` present):
258
-
259
- ```bash
260
- cd {workspace}
261
- git log --oneline --since="{updated}" -- {codebase_paths}
262
- ```
263
-
264
- - If commits found:
265
- ```
266
- ⚠️ Files in {paths} have changed since this doc was updated.
267
- Recent commits: {list}
268
- Want me to review for needed updates?
269
- ```
270
-
271
- 5. **Note confidence** (if `confidence: low`):
272
- ```
273
- ℹ️ This was a quick exploration and may be incomplete.
274
- ```
275
-
276
- ## Output Format
277
-
278
- After loading, output:
279
-
280
- ```
281
- 📚 Loaded: {category}/{name}
282
- Updated: {updated} ({days_old} days ago)
283
- Confidence: {confidence}
284
-
285
- ---
286
-
287
- {file content}
288
-
289
- ---
290
-
291
- {freshness warnings if any}
292
- ```
@@ -1,215 +0,0 @@
1
- # Adding Topics
2
-
3
- Detailed procedure for capturing explored codebase areas as institutional knowledge.
4
-
5
- ## When to Use
6
-
7
- - After a deep exploration of a codebase area
8
- - User asks to save/capture exploration
9
- - `/codex add topic {name}` command
10
- - Converting ad-hoc research into persistent knowledge
11
-
12
- ## The Value
13
-
14
- Topics turn ephemeral exploration into institutional memory:
15
- - Next time someone needs to understand this area, context is ready
16
- - AI can load it instantly instead of re-exploring
17
- - Freshness tracking ensures it stays current
18
-
19
- ## Procedure
20
-
21
- ### 1. Determine Topic Name
22
-
23
- From user input or infer from exploration:
24
- - Use kebab-case: `organization-hierarchy`, `webhook-processing`
25
- - Be specific but concise
26
-
27
- ### 2. Gather Content
28
-
29
- From the current conversation/exploration, extract:
30
- - **Overview:** What is this area of the codebase?
31
- - **Key Concepts:** Important terms, patterns, relationships
32
- - **Architecture:** How components fit together
33
- - **Key Files:** Important files and their purposes
34
- - **Common Patterns:** Recurring patterns in this area
35
- - **Gotchas:** Things to watch out for
36
-
37
- ### 3. Determine Metadata
38
-
39
- Ask user or infer:
40
- - **Confidence:** How thorough was the exploration?
41
- - `high` - Comprehensive, covered most aspects
42
- - `medium` - Good coverage but may have gaps
43
- - `low` - Quick exploration, definitely incomplete
44
- - **Codebase paths:** Which directories/files were explored?
45
-
46
- ### 4. Start Write Operation
47
-
48
- ```bash
49
- droid config --get tools.codex | droid exec droid-codex git-start-write --config - --branch codex/topic-{name}
50
- ```
51
-
52
- ### 5. Read Template
53
-
54
- ```bash
55
- cat {codex_repo}/templates/TOPIC.md
56
- ```
57
-
58
- ### 6. Create Topic File
59
-
60
- ```bash
61
- # Create the file
62
- touch {codex_repo}/topics/{name}.md
63
- ```
64
-
65
- Fill in content:
66
-
67
- ```markdown
68
- ---
69
- title: {Topic Title}
70
- type: topic
71
- created: {today}
72
- updated: {today}
73
- confidence: {high|medium|low}
74
- source: exploration
75
- codebase_paths:
76
- - {path/explored/1}
77
- - {path/explored/2}
78
- ---
79
-
80
- # {Topic Title}
81
-
82
- ## Overview
83
-
84
- {Brief description of this area of the codebase}
85
-
86
- ## Key Concepts
87
-
88
- ### {Concept 1}
89
-
90
- {Explanation}
91
-
92
- ### {Concept 2}
93
-
94
- {Explanation}
95
-
96
- ## Architecture
97
-
98
- {How components fit together}
99
-
100
- ```
101
- {Diagram or structure if helpful}
102
- ```
103
-
104
- ## Key Files
105
-
106
- | File | Purpose |
107
- |------|---------|
108
- | `{path/to/file}` | {What it does} |
109
-
110
- ## Common Patterns
111
-
112
- {Patterns used in this area}
113
-
114
- ## Gotchas
115
-
116
- - {Thing to watch out for}
117
- - {Another gotcha}
118
-
119
- ## Related
120
-
121
- - {Links to related topics, PRDs, or external docs}
122
- ```
123
-
124
- ### 7. Finish Write Operation
125
-
126
- ```bash
127
- droid config --get tools.codex | droid exec droid-codex git-finish-write --config - \
128
- --message "topic: add {name}" \
129
- --pr-title "Topic: {name}" \
130
- --pr-body "New topic from codebase exploration"
131
- ```
132
-
133
- ### 8. Confirm to User
134
-
135
- ```
136
- ✅ Added topic: {name}
137
-
138
- 📚 {codex_repo}/topics/{name}.md
139
- Confidence: {confidence}
140
- Paths covered: {codebase_paths}
141
-
142
- PR: {pr_url}
143
- (Auto-merges for new files)
144
-
145
- Next time someone asks about {topic}, I can load this context instantly.
146
- ```
147
-
148
- ## Example
149
-
150
- **User:** (after exploring organization hierarchy) `/codex add topic organization-hierarchy`
151
-
152
- **Result:**
153
-
154
- ```markdown
155
- ---
156
- title: Organization Hierarchy
157
- type: topic
158
- created: 2026-01-07
159
- updated: 2026-01-07
160
- confidence: high
161
- source: exploration
162
- codebase_paths:
163
- - apps/platform-api/src/modules/organization/
164
- - libs/shared/src/types/organization.ts
165
- ---
166
-
167
- # Organization Hierarchy
168
-
169
- ## Overview
170
-
171
- Orderful's multi-tenant organization structure with parent-child relationships, enabling enterprise customers to manage multiple business units under a single account.
172
-
173
- ## Key Concepts
174
-
175
- ### Organization
176
-
177
- The top-level entity. Has settings, billing, users.
178
-
179
- ### Child Organizations
180
-
181
- Organizations can have children, creating a hierarchy. Children inherit some settings from parents.
182
-
183
- ### Organization Context
184
-
185
- Request-scoped context determining which org's data to access.
186
-
187
- ## Architecture
188
-
189
- ```
190
- Organization (parent)
191
- ├── Organization (child 1)
192
- │ └── Organization (grandchild)
193
- └── Organization (child 2)
194
- ```
195
-
196
- ## Key Files
197
-
198
- | File | Purpose |
199
- |------|---------|
200
- | `organization.entity.ts` | TypeORM entity with parent/child relations |
201
- | `organization.service.ts` | Business logic for org operations |
202
- | `organization-context.middleware.ts` | Sets org context from request |
203
-
204
- ## Common Patterns
205
-
206
- - Always check org context before data access
207
- - Use `organizationId` foreign key on tenant-scoped entities
208
- - Hierarchy queries use recursive CTEs
209
-
210
- ## Gotchas
211
-
212
- - Child orgs don't automatically inherit all parent settings
213
- - Deleting a parent doesn't cascade to children (soft delete)
214
- - API keys are scoped to single org, not hierarchy
215
- ```