@orderful/droid 0.48.0 → 0.51.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 (100) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +2 -1
  3. package/CHANGELOG.md +34 -0
  4. package/bun.lock +137 -3
  5. package/dist/bin/droid.js +355 -90
  6. package/dist/commands/pack.d.ts +5 -0
  7. package/dist/commands/pack.d.ts.map +1 -0
  8. package/dist/index.js +11 -0
  9. package/dist/lib/pack.d.ts +31 -0
  10. package/dist/lib/pack.d.ts.map +1 -0
  11. package/dist/lib/types.d.ts +17 -0
  12. package/dist/lib/types.d.ts.map +1 -1
  13. package/dist/tools/brain/.claude-plugin/plugin.json +1 -1
  14. package/dist/tools/brain/TOOL.yaml +3 -1
  15. package/dist/tools/brain/skills/brain/SKILL.md +4 -0
  16. package/dist/tools/brain/skills/brain/references/workflows.md +21 -7
  17. package/dist/tools/coach/TOOL.yaml +4 -0
  18. package/dist/tools/code-review/.claude-plugin/plugin.json +3 -2
  19. package/dist/tools/code-review/TOOL.yaml +4 -1
  20. package/dist/tools/code-review/agents/codex-context-researcher.md +99 -0
  21. package/dist/tools/code-review/skills/code-review/SKILL.md +20 -1
  22. package/dist/tools/codex/.claude-plugin/plugin.json +1 -1
  23. package/dist/tools/codex/TOOL.yaml +3 -1
  24. package/dist/tools/codex/skills/codex/SKILL.md +5 -1
  25. package/dist/tools/codex/skills/codex/scripts/normalize-frontmatter.d.ts +61 -0
  26. package/dist/tools/codex/skills/codex/scripts/normalize-frontmatter.d.ts.map +1 -0
  27. package/dist/tools/codex/skills/codex/scripts/normalize-frontmatter.ts +402 -0
  28. package/dist/tools/comments/TOOL.yaml +2 -0
  29. package/dist/tools/droid/.claude-plugin/plugin.json +1 -1
  30. package/dist/tools/droid/TOOL.yaml +3 -1
  31. package/dist/tools/droid/skills/droid/SKILL.md +48 -2
  32. package/dist/tools/droid/skills/droid/references/new-tool-workflow.md +234 -0
  33. package/dist/tools/edi-schema/TOOL.yaml +2 -0
  34. package/dist/tools/excalidraw/TOOL.yaml +2 -0
  35. package/dist/tools/meeting/TOOL.yaml +2 -0
  36. package/dist/tools/pii/TOOL.yaml +2 -0
  37. package/dist/tools/plan/.claude-plugin/plugin.json +1 -1
  38. package/dist/tools/plan/TOOL.yaml +5 -1
  39. package/dist/tools/plan/commands/plan.md +3 -2
  40. package/dist/tools/plan/skills/plan/SKILL.md +31 -10
  41. package/dist/tools/plan/skills/plan/references/workflows.md +44 -14
  42. package/dist/tools/project/.claude-plugin/plugin.json +1 -1
  43. package/dist/tools/project/TOOL.yaml +7 -1
  44. package/dist/tools/project/skills/project/SKILL.md +32 -1
  45. package/dist/tools/project/skills/project/references/loading.md +1 -0
  46. package/dist/tools/project/skills/project/references/pulling.md +57 -0
  47. package/dist/tools/project/skills/project/references/pushing.md +79 -0
  48. package/dist/tools/release/TOOL.yaml +2 -0
  49. package/dist/tools/share/TOOL.yaml +2 -0
  50. package/dist/tools/status-update/TOOL.yaml +4 -0
  51. package/dist/tools/tech-design/TOOL.yaml +2 -0
  52. package/dist/tools/wrapup/TOOL.yaml +2 -0
  53. package/package.json +3 -1
  54. package/scripts/build.ts +3 -2
  55. package/src/bin/droid.ts +9 -0
  56. package/src/commands/pack.ts +77 -0
  57. package/src/lib/pack.test.ts +85 -0
  58. package/src/lib/pack.ts +293 -0
  59. package/src/lib/types.ts +19 -0
  60. package/src/tools/brain/.claude-plugin/plugin.json +1 -1
  61. package/src/tools/brain/TOOL.yaml +3 -1
  62. package/src/tools/brain/skills/brain/SKILL.md +4 -0
  63. package/src/tools/brain/skills/brain/references/workflows.md +21 -7
  64. package/src/tools/coach/TOOL.yaml +4 -0
  65. package/src/tools/code-review/.claude-plugin/plugin.json +3 -2
  66. package/src/tools/code-review/TOOL.yaml +4 -1
  67. package/src/tools/code-review/agents/codex-context-researcher.md +99 -0
  68. package/src/tools/code-review/skills/code-review/SKILL.md +20 -1
  69. package/src/tools/codex/.claude-plugin/plugin.json +1 -1
  70. package/src/tools/codex/TOOL.yaml +3 -1
  71. package/src/tools/codex/skills/codex/SKILL.md +5 -1
  72. package/src/tools/codex/skills/codex/scripts/normalize-frontmatter.test.ts +331 -0
  73. package/src/tools/codex/skills/codex/scripts/normalize-frontmatter.ts +402 -0
  74. package/src/tools/comments/TOOL.yaml +2 -0
  75. package/src/tools/droid/.claude-plugin/plugin.json +1 -1
  76. package/src/tools/droid/TOOL.yaml +3 -1
  77. package/src/tools/droid/skills/droid/SKILL.md +48 -2
  78. package/src/tools/droid/skills/droid/references/new-tool-workflow.md +234 -0
  79. package/src/tools/edi-schema/TOOL.yaml +2 -0
  80. package/src/tools/excalidraw/TOOL.yaml +2 -0
  81. package/src/tools/meeting/TOOL.yaml +2 -0
  82. package/src/tools/pii/TOOL.yaml +2 -0
  83. package/src/tools/plan/.claude-plugin/plugin.json +1 -1
  84. package/src/tools/plan/TOOL.yaml +5 -1
  85. package/src/tools/plan/commands/plan.md +3 -2
  86. package/src/tools/plan/skills/plan/SKILL.md +31 -10
  87. package/src/tools/plan/skills/plan/references/workflows.md +44 -14
  88. package/src/tools/project/.claude-plugin/plugin.json +1 -1
  89. package/src/tools/project/TOOL.yaml +7 -1
  90. package/src/tools/project/skills/project/SKILL.md +32 -1
  91. package/src/tools/project/skills/project/references/loading.md +1 -0
  92. package/src/tools/project/skills/project/references/pulling.md +57 -0
  93. package/src/tools/project/skills/project/references/pushing.md +79 -0
  94. package/src/tools/release/TOOL.yaml +2 -0
  95. package/src/tools/share/TOOL.yaml +2 -0
  96. package/src/tools/status-update/TOOL.yaml +4 -0
  97. package/src/tools/tech-design/TOOL.yaml +2 -0
  98. package/src/tools/wrapup/TOOL.yaml +2 -0
  99. package/dist/tools/codex/skills/codex/scripts/git-scripts.test.ts +0 -364
  100. package/dist/tools/pii/skills/pii/scripts/presidio.test.ts +0 -444
@@ -0,0 +1,234 @@
1
+ # New Tool Workflow
2
+
3
+ Detailed workflow for `/droid new {tool-name}`. Handles both from-scratch scaffolding and importing existing skill/agent files.
4
+
5
+ **Philosophy:** Fix what can be fixed automatically. Only ask the human about things that need judgement (security, audience). The PR should contain a clean, droid-standards-compliant tool — not the raw submission with warnings.
6
+
7
+ ## Step 1: Parse Arguments
8
+
9
+ ```
10
+ /droid new {tool-name} → scaffold from scratch
11
+ /droid new {tool-name} --from {path} → import existing file(s)
12
+ ```
13
+
14
+ Tool name must be kebab-case. If not, convert it.
15
+
16
+ ## Step 2: Import (if --from provided)
17
+
18
+ Determine input type by file extension or path type:
19
+
20
+ | Input | Handling |
21
+ |-------|----------|
22
+ | `.skill` or `.zip` | Extract to temp directory, locate SKILL.md and/or agent .md files inside |
23
+ | Directory | Use directly, scan for SKILL.md and agent .md files |
24
+ | Single `.md` file | Determine type: if frontmatter has `name`/`description`/`allowed-tools` → skill. If it has `tools`/`model` → agent. Otherwise → skill. |
25
+
26
+ If no `--from`, scaffold a blank SKILL.md using the template from AGENTS.md:
27
+
28
+ ```yaml
29
+ ---
30
+ name: {tool-name}
31
+ description: "{Tool description}. Use when {scenarios}. User prompts like {examples}."
32
+ globs: []
33
+ alwaysApply: false
34
+ allowed-tools: [Read, Edit, Write, Glob, Grep, Bash]
35
+ ---
36
+ ```
37
+
38
+ ## Step 3: Transform Imported Content
39
+
40
+ Read imported files, check each rule, and **fix in-place**. Track what was changed for the summary.
41
+
42
+ ### Frontmatter Fixes (auto-fix)
43
+
44
+ | Issue | Fix |
45
+ |-------|-----|
46
+ | Multiline description (`>`, `>-`, `\|`) | Rewrite as single-line quoted string |
47
+ | `name` not kebab-case | Convert to kebab-case |
48
+ | Missing `allowed-tools` | Analyse content for tool usage patterns (Bash commands, Read references, MCP tool calls) and generate the list |
49
+ | `allowed-tools` missing tools the content clearly needs | Add them |
50
+ | `globs` missing | Add `globs: []` |
51
+ | `alwaysApply` missing | Add `alwaysApply: false` |
52
+
53
+ ### Description Rewrite (auto-fix)
54
+
55
+ The description must follow this pattern:
56
+ ```
57
+ "{What it does}. Use when {scenarios}. User prompts like {examples}."
58
+ ```
59
+
60
+ If the description doesn't match:
61
+ 1. Read the content to understand what it does
62
+ 2. Rewrite the description to match the pattern
63
+ 3. Keep it as a single-line quoted string (CRITICAL — Claude Code's parser breaks on multiline YAML)
64
+
65
+ ### Structure Recommendations (warn only)
66
+
67
+ | Check | Rule | Action |
68
+ |-------|------|--------|
69
+ | `references/` exists | Files should be referenced from SKILL.md | Warn if orphaned |
70
+ | Skill over 100 lines | Progressive disclosure recommended | Suggest extracting to references/ |
71
+ | `argument-hint` field | Recommended for skills with subcommands | Suggest adding |
72
+
73
+ ## Step 4: Security Scan
74
+
75
+ Flag these patterns with clear severity levels:
76
+
77
+ ### High Severity (block until resolved)
78
+
79
+ | Pattern | Why |
80
+ |---------|-----|
81
+ | Base64-encoded content (`base64`, long alphanumeric strings) | Could hide malicious instructions |
82
+ | System prompt extraction (`system prompt`, `instructions above`, `ignore previous`) | Prompt injection attempt |
83
+ | Encoded/obfuscated content (hex escapes, unicode escapes) | Evasion technique |
84
+
85
+ ### Medium Severity (warn, require acknowledgement)
86
+
87
+ | Pattern | Why |
88
+ |---------|-----|
89
+ | `Bash` in allowed-tools without clear justification | Shell access is powerful |
90
+ | External URLs in instructions (http/https links) | Could exfiltrate data or load remote instructions |
91
+ | File system paths outside expected directories | Potential data access |
92
+ | `dangerouslyDisableSandbox` or similar sandbox bypass | Security boundary violation |
93
+
94
+ ### Low Severity (informational)
95
+
96
+ | Pattern | Why |
97
+ |---------|-----|
98
+ | Large number of allowed-tools (> 5) | May be over-permissioned |
99
+ | No `references/` for skills over 100 lines | Progressive disclosure recommended |
100
+
101
+ ## Step 5: Collect Metadata
102
+
103
+ ### Audience (required — always ask)
104
+
105
+ Audience is a droid-specific concept that won't exist on incoming files. Always ask:
106
+
107
+ ```
108
+ Who is this tool for? (select all that apply)
109
+
110
+ - all — everyone at Orderful
111
+ - engineering — R&D, CLI users
112
+ - product — product managers
113
+ - design — designers
114
+ - integration-developers — integration specialists
115
+ - customer-support — support team
116
+ - network-operations — network ops
117
+ ```
118
+
119
+ ### Tool Description
120
+
121
+ If not obvious from the imported content, ask for a one-line tool description for TOOL.yaml.
122
+
123
+ ## Step 6: Scaffold and PR
124
+
125
+ ### Create tool structure
126
+
127
+ ```
128
+ src/tools/{tool-name}/
129
+ ├── TOOL.yaml
130
+ ├── skills/
131
+ │ └── {skill-name}/
132
+ │ ├── SKILL.md
133
+ │ └── references/ (if present)
134
+ └── agents/
135
+ └── {agent-name}.md (if present)
136
+ ```
137
+
138
+ ### Generate TOOL.yaml
139
+
140
+ ```yaml
141
+ name: {tool-name}
142
+ description: "{tool description}"
143
+ version: 0.1.0
144
+ status: beta
145
+ audience:
146
+ - {selected audiences}
147
+
148
+ includes:
149
+ skills:
150
+ - name: {skill-name}
151
+ required: true
152
+ commands: []
153
+ agents:
154
+ - {agent-name} (if present)
155
+
156
+ dependencies: []
157
+ ```
158
+
159
+ ### Changeset
160
+
161
+ Create `.changeset/{tool-name}-initial.md`:
162
+ ```markdown
163
+ ---
164
+ "@orderful/droid": minor
165
+ ---
166
+
167
+ Add {tool-name} tool
168
+ ```
169
+
170
+ Note: new tools are `minor` version bumps (new capability), not `patch`.
171
+
172
+ ### Branch and PR
173
+
174
+ ```bash
175
+ git checkout -b contrib/{tool-name}
176
+ git add src/tools/{tool-name}/
177
+ git add .changeset/{tool-name}-initial.md
178
+ git commit -m "feat: add {tool-name} tool"
179
+ git push -u origin contrib/{tool-name}
180
+ ```
181
+
182
+ Create PR:
183
+ ```
184
+ gh pr create --reviewer frytyler --title "feat: add {tool-name} tool" --body "$(cat <<'EOF'
185
+ ### Summary :sparkles:
186
+
187
+ Adds the `{tool-name}` tool to droid, created via `/droid new`.
188
+
189
+ ### Changes
190
+
191
+ - New `{tool-name}` tool (v0.1.0, beta)
192
+ - Includes: {list skills and agents}
193
+ - Audience: {audience tags}
194
+
195
+ ### Imported From
196
+
197
+ {If --from was used: "Imported from `{original-path}`, transformed to droid standards."}
198
+ {If from scratch: "Scaffolded from scratch."}
199
+
200
+ ### Transformations Applied
201
+
202
+ {List what was auto-fixed: description rewrite, allowed-tools added, etc.}
203
+
204
+ 🤖 Co-Authored with [Claude Code](https://claude.com/claude-code)
205
+ EOF
206
+ )"
207
+ ```
208
+
209
+ ## Summary Format
210
+
211
+ Present results after transforming, before asking for metadata:
212
+
213
+ ```
214
+ [● ●] New Tool: {tool-name}
215
+
216
+ ## Imported
217
+ [from] {original-path}
218
+ [type] skill + 2 reference docs
219
+
220
+ ## Auto-fixed
221
+ [fixed] Description rewritten to single-line format
222
+ [fixed] Added allowed-tools: [Read, Bash, MCP]
223
+ [fixed] Added alwaysApply: false, globs: []
224
+
225
+ ## Security
226
+ [pass] No high-severity issues
227
+ [warn] Bash in allowed-tools — used for {reason}, looks justified
228
+
229
+ ## Needs your input
230
+ [need] audience — who is this for?
231
+ [need] tool description — one-liner for TOOL.yaml
232
+ ```
233
+
234
+ After collecting metadata, show the final tool structure and proceed to PR.
@@ -2,6 +2,8 @@ name: edi-schema
2
2
  description: "Query EDI schemas without context overhead. Uses a sub-agent to inspect large schema and code-list files, then returns concise results."
3
3
  version: 0.1.0
4
4
  status: beta
5
+ audience:
6
+ - engineering
5
7
 
6
8
  includes:
7
9
  skills:
@@ -2,6 +2,8 @@ name: excalidraw
2
2
  description: "Generate Excalidraw diagrams from conversation context and save them to your Obsidian brain vault. Requires brain tool configured, Obsidian, and the Excalidraw plugin."
3
3
  version: 0.1.0
4
4
  status: experimental
5
+ audience:
6
+ - all
5
7
 
6
8
  includes:
7
9
  skills:
@@ -2,6 +2,8 @@ name: meeting
2
2
  description: "Work with meeting notes, summaries, and transcripts. List recent meetings, search content, generate context-aware summaries, export to codex. Backed by Granola MCP."
3
3
  version: 0.1.2
4
4
  status: beta
5
+ audience:
6
+ - all
5
7
 
6
8
  includes:
7
9
  skills:
@@ -2,6 +2,8 @@ name: pii
2
2
  description: "Detect and redact PII (personally identifiable information) in text files. Powered by Microsoft Presidio with a bundled Python venv — zero external dependencies after first run."
3
3
  version: 0.1.0
4
4
  status: beta
5
+ audience:
6
+ - all
5
7
 
6
8
  includes:
7
9
  skills:
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "droid-plan",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Task-scoped planning with portable, structured plans. Use when planning implementation for a PR, ticket, or small feature. User prompts like 'let's plan this', 'can we start a plan', 'think through the implementation'.",
5
5
  "author": {
6
6
  "name": "Orderful",
@@ -1,7 +1,11 @@
1
1
  name: plan
2
2
  description: "Task-scoped planning with portable, structured plans. Use when planning implementation for a PR, ticket, or small feature. User prompts like 'let's plan this', 'can we start a plan', 'think through the implementation'."
3
- version: 0.1.6
3
+ version: 0.1.8
4
4
  status: alpha
5
+ audience:
6
+ - engineering
7
+ - product
8
+ - design
5
9
 
6
10
  includes:
7
11
  skills:
@@ -19,7 +19,7 @@ argument-hint: "new|search|check|cleanup|ready|implement [topic]"
19
19
  | `/plan check` | Address @droid comments |
20
20
  | `/plan cleanup` | Resolve threads, log decisions |
21
21
  | `/plan ready` | Finalize and validate |
22
- | `/plan implement` | Execute the plan |
22
+ | `/plan implement` | Review plan, then execute |
23
23
 
24
24
  ## Examples
25
25
 
@@ -29,7 +29,8 @@ argument-hint: "new|search|check|cleanup|ready|implement [topic]"
29
29
  /plan check # Address open comments
30
30
  /plan cleanup # Resolve threads, log decisions
31
31
  /plan ready # Mark plan as ready
32
- /plan implement # Execute the plan
32
+ /plan implement # Review plan, then execute
33
+ /plan implement --no-review # Skip review, execute directly
33
34
  ```
34
35
 
35
36
  See the **plan skill** for complete documentation.
@@ -27,6 +27,7 @@ Task-scoped planning for PRs, tickets, and small features. Lighter than `/tech-d
27
27
  Uses config from dependencies:
28
28
  - `droid config --get tools.brain` → `brain_dir`, `inbox_folder`
29
29
  - `droid config --get user_mention` → `user_mention` (global config)
30
+ - `droid config --get tools.project` → `save_related_in_project` (optional, for project-aware routing)
30
31
 
31
32
  **Overrides:** This skill supports user-defined overrides. See `/droid` skill § Skill Overrides.
32
33
 
@@ -45,7 +46,7 @@ Example: `/plan new auth-refactor -- we must stay backward compatible with v1 cl
45
46
  | `/plan check` | Address `@droid` comments, respond to questions |
46
47
  | `/plan cleanup` | Resolve threads, apply changes, log decisions |
47
48
  | `/plan ready` | Finalize: validate and update status |
48
- | `/plan implement` | Execute tasks, optionally convert to XML |
49
+ | `/plan implement` | Review plan, then execute tasks |
49
50
 
50
51
  ## `/plan new {topic}`
51
52
 
@@ -54,7 +55,8 @@ Example: `/plan new auth-refactor -- we must stay backward compatible with v1 cl
54
55
  - Run `droid config --get user_mention` for user's mention tag
55
56
  - If `brain_dir` not configured, ask user where to store plans
56
57
  2. Determine location:
57
- - If `/project` active → offer: `{projects_dir}/{project}/plans/`
58
+ - If `/project` active AND `save_related_in_project` is true (check `droid config --get tools.project`) use `{projects_dir}/{project}/plans/` (no prompt)
59
+ - If `/project` active AND `save_related_in_project` is false (default) → offer choice between project folder and inbox
58
60
  - Otherwise → `{brain_dir}/{inbox_folder}/plans/`
59
61
  3. Offer context loading (`/project`, `/codex` search)
60
62
  4. Ask clarifying questions (goal, scope, constraints)
@@ -90,21 +92,26 @@ See `references/workflows.md` § Cleanup for the full graduation pattern.
90
92
 
91
93
  ## `/plan ready`
92
94
 
93
- 1. Check for unresolved discussions (warn if any)
94
- 2. Validate required sections (Context, at least one Task)
95
- 3. Update status to `ready`
96
- 4. Offer: stay in brain, copy to PR description, link in project
95
+ 1. **Run cleanup pass** graduate resolved threads to decisions, archive (same as `/plan cleanup`)
96
+ 2. Check for unresolved discussions (warn if any)
97
+ 3. Validate required sections (Context, at least one Task)
98
+ 4. Update status to `ready`
99
+ 5. Offer: stay in brain, copy to PR description, link in project
97
100
 
98
101
  ## `/plan implement`
99
102
 
100
- 1. Parse tasks from `### Task N:` sections
101
- 2. Optionally convert to XML (see `references/xml-conversion.md`)
102
- 3. For each task:
103
+ 1. Load plan (warn if status is not `ready`)
104
+ 2. **Review plan** validate tasks against codebase, identify gaps (uses platform plan mode if available, otherwise structured self-review)
105
+ 3. Parse tasks from `### Task N:` sections
106
+ 4. Optionally convert to XML (see `references/xml-conversion.md`)
107
+ 5. For each task:
103
108
  - Execute per `**Files:**` section
104
109
  - Run `**Verify:**` command
105
110
  - Check `**Done:**` criteria
106
111
  - Mark complete in plan doc
107
- 4. Update status to `done`
112
+ 6. Update status to `done`
113
+
114
+ Use `--no-review` to skip the review step (e.g., re-running after partial implementation).
108
115
 
109
116
  ## Comment Conventions
110
117
 
@@ -122,6 +129,20 @@ Recognise planning intent and offer `/plan new`:
122
129
  - "Let's think through the implementation"
123
130
  - "Before we start coding..."
124
131
 
132
+ ## Plan Review Integration
133
+
134
+ Plan docs and the review step in `/plan implement` are complementary:
135
+
136
+ | Plan doc (persistent) | Review step (ephemeral) |
137
+ |-----------------------|-------------------------|
138
+ | Captures decisions and intent (*why*) | Validates against codebase (*how*) |
139
+ | Shareable, auditable trail | Private to the session |
140
+ | Survives across sessions | Scoped to current session |
141
+
142
+ **The workflow:** Write the plan doc to capture decisions. The review step validates and refines before implementing — it enriches, not duplicates.
143
+
144
+ **Platform-adaptive:** Some platforms offer a dedicated plan/review mode (e.g., Claude Code). Others get a structured self-review. The behaviour is the same — validate the plan against the codebase before executing.
145
+
125
146
  ## References
126
147
 
127
148
  - `references/templates.md` - Plan doc template with examples
@@ -15,9 +15,15 @@ If brain not configured, ask user for `brain_dir` location.
15
15
 
16
16
  ### Step 2: Determine Location
17
17
 
18
- Check if `/project` is active (check `{projects_dir}/{project}/PROJECT.md` exists):
18
+ Check if `/project` is active (check `{projects_dir}/{project}/PROJECT.md` exists) and read `save_related_in_project` from `droid config --get tools.project`:
19
19
 
20
- **If project active:**
20
+ **If project active AND `save_related_in_project` is true:**
21
+ ```
22
+ Use: {projects_dir}/{project}/plans/plan-{topic}.md
23
+ (No prompt — project folder is the default when opted in)
24
+ ```
25
+
26
+ **If project active AND `save_related_in_project` is false (default):**
21
27
  ```
22
28
  Offer choice via AskUserQuestion:
23
29
  - "Project folder" → {projects_dir}/{project}/plans/plan-{topic}.md
@@ -221,13 +227,18 @@ Report what was cleaned up:
221
227
 
222
228
  If no active plan, prompt to search for one.
223
229
 
224
- ### Step 2: Check Unresolved Discussions
230
+ ### Step 2: Run Cleanup Pass
225
231
 
226
- Search for `### Open:` sections:
232
+ Run the same logic as `/plan cleanup`:
233
+ - Find resolved `@droid` / `@{user_mention}` threads
234
+ - Graduate decisions to the Locked-In Decisions table
235
+ - Archive resolved threads to Discussion Log
227
236
 
228
- ```bash
229
- grep -c "### Open:" {plan_path}
230
- ```
237
+ If nothing to clean up, this is a no-op. `/plan cleanup` still exists as a standalone command for mid-iteration use.
238
+
239
+ ### Step 3: Check Unresolved Discussions
240
+
241
+ Search for remaining `@droid` / `@{user_mention}` threads that weren't resolved:
231
242
 
232
243
  If any found, warn:
233
244
  ```
@@ -236,7 +247,7 @@ If any found, warn:
236
247
  - "Mark ready anyway" → Continue
237
248
  ```
238
249
 
239
- ### Step 3: Validate Required Sections
250
+ ### Step 4: Validate Required Sections
240
251
 
241
252
  Check for:
242
253
  - `## Context` section with content
@@ -244,11 +255,11 @@ Check for:
244
255
 
245
256
  If missing, warn and list what's needed.
246
257
 
247
- ### Step 4: Update Status
258
+ ### Step 5: Update Status
248
259
 
249
260
  Change `**Status:** draft` or `**Status:** in-progress` to `**Status:** ready`
250
261
 
251
- ### Step 5: Offer Distribution
262
+ ### Step 6: Offer Distribution
252
263
 
253
264
  Ask via AskUserQuestion:
254
265
  ```
@@ -271,7 +282,26 @@ Check status - warn if not `ready`:
271
282
  "This plan is still '{status}'. Implement anyway?"
272
283
  ```
273
284
 
274
- ### Step 2: Parse Tasks
285
+ ### Step 2: Plan Review
286
+
287
+ **Default behaviour.** Skip if user passes `--no-review` (or says "skip review", "just implement").
288
+
289
+ Review the plan against the codebase before executing:
290
+
291
+ 1. **Read each task's `**Files:**` section** — verify referenced files and patterns exist in the codebase
292
+ 2. **Check for gaps** — missing files, outdated patterns, unaccounted dependencies between tasks
293
+ 3. **Validate `**Verify:**` commands** — confirm they're runnable
294
+ 4. **Note concerns or refinements** — anything that needs adjusting before execution
295
+
296
+ If the platform supports a dedicated plan/review mode, use it for this step. Otherwise, perform the review inline as a structured self-review before proceeding.
297
+
298
+ **Plan preservation:** If the review produces material refinements, save the revised plan as `{original-name}-implementation.md` alongside the original. The original plan is **never modified** during review — it's the decision record. The implementation variant includes `Parent plan: [[{original-name}]]` at the top.
299
+
300
+ After review, implementation executes from whichever plan came out of this step:
301
+ - No material changes → execute from the original
302
+ - Revised plan produced → execute from the `-implementation` variant
303
+
304
+ ### Step 3: Parse Tasks
275
305
 
276
306
  Find all `### Task N:` sections. For each, extract:
277
307
  - **Name** from header
@@ -280,7 +310,7 @@ Find all `### Task N:` sections. For each, extract:
280
310
  - **Verify** from `**Verify:**` line
281
311
  - **Done** from `**Done:**` line
282
312
 
283
- ### Step 3: Optional XML Conversion
313
+ ### Step 4: Optional XML Conversion
284
314
 
285
315
  For complex multi-task plans, offer:
286
316
  ```
@@ -289,7 +319,7 @@ For complex multi-task plans, offer:
289
319
  - "No" → Use markdown as-is
290
320
  ```
291
321
 
292
- ### Step 4: Execute Tasks
322
+ ### Step 5: Execute Tasks
293
323
 
294
324
  For each task in order:
295
325
 
@@ -308,7 +338,7 @@ If verification fails:
308
338
  - "Stop implementation"
309
339
  ```
310
340
 
311
- ### Step 5: Update Status
341
+ ### Step 6: Update Status
312
342
 
313
343
  When all tasks complete, change `**Status:** ready` to `**Status:** done`
314
344
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "droid-project",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Manage project context files for persistent AI memory across sessions. Load, update, or create project context before working on multi-session features.",
5
5
  "author": {
6
6
  "name": "Orderful",
@@ -1,7 +1,9 @@
1
1
  name: project
2
2
  description: "Manage project context files for persistent AI memory across sessions. Load, update, or create project context before working on multi-session features."
3
- version: 0.4.0
3
+ version: 0.5.0
4
4
  status: beta
5
+ audience:
6
+ - all
5
7
 
6
8
  includes:
7
9
  skills:
@@ -19,6 +21,10 @@ config_schema:
19
21
  type: string
20
22
  description: Path to projects directory (required - no default)
21
23
  required: true
24
+ save_related_in_project:
25
+ type: boolean
26
+ description: "When true, plan/brain skills default to saving artifacts under the active project folder"
27
+ default: false
22
28
  preset:
23
29
  type: select
24
30
  description: "Link style: obsidian uses [[wikilinks]], markdown uses [standard](links)"
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: project
3
3
  description: "Persistent project context for AI memory across sessions. Use when working on multi-session features, refactors, or any work that benefits from accumulated context. User prompts like 'load the project', 'update project context', 'what's the current project?'."
4
- argument-hint: "[{keywords} | update | create {name}]"
4
+ argument-hint: "[search {keywords} | update | create {name} | pull [codex:{name}] | push [codex:{name}]]"
5
5
  allowed-tools: [Read, Write, Glob, Grep, Bash]
6
6
  ---
7
7
 
@@ -32,6 +32,7 @@ Chat history disappears. Projects persist.
32
32
  | -------------- | ------------ | -------------------------------------------------- |
33
33
  | `projects_dir` | **required** | Where projects are stored (must be configured) |
34
34
  | `preset` | `markdown` | Link style: `obsidian` uses `[[wikilinks]]`, `markdown` uses `[standard](links)` |
35
+ | `save_related_in_project` | `false` | When true, plan/brain skills default to saving artifacts under the active project folder instead of the brain inbox |
35
36
  | `override` | (none) | User-defined behaviour overrides |
36
37
 
37
38
  **Overrides:** This skill supports user-defined overrides. See `/droid` skill § Skill Overrides.
@@ -58,9 +59,17 @@ echo "projects_dir: /path/to/projects" >> ~/.droid/skills/project/overrides.yaml
58
59
  | `/project create {name}` | Create new project (requires `create` keyword) |
59
60
  | `/project create --from codex:{name}` | Create project seeded with codex context |
60
61
  | `/project update` | Update from conversation context |
62
+ | `/project pull [codex:{name}]` | Pull codex updates into existing project |
63
+ | `/project push [codex:{name}]` | Push team-relevant content to codex via PR |
61
64
 
62
65
  **IMPORTANT:** Use `/project search {keywords}` to find and load existing projects. Only use `/project create {name}` when the user explicitly wants to create a new project.
63
66
 
67
+ ## PROJECT.md Frontmatter
68
+
69
+ | Field | Purpose |
70
+ | ---------------- | -------------------------------------------------------------------- |
71
+ | `codex_project` | Codex project name for pull/push (set on first use, remembered) |
72
+
64
73
  ## Loading a Project
65
74
 
66
75
  **Trigger:** `/project search {keywords}` or user asks to load/open a project
@@ -86,6 +95,28 @@ Full procedure: `references/updating.md`
86
95
  Version rules: `references/versioning.md`
87
96
  Changelog format: `references/changelog.md`
88
97
 
98
+ ## Pulling from Codex
99
+
100
+ **Trigger:** `/project pull [codex:{name}]`
101
+
102
+ **TLDR:** Read codex project docs, diff against current PROJECT.md, propose only critical updates that fit within context limits, apply with changelog entry.
103
+
104
+ First use: `/project pull codex:transaction-templates` — saves `codex_project` to frontmatter.
105
+ Subsequent: `/project pull` — reads from frontmatter.
106
+
107
+ Full procedure: `references/pulling.md`
108
+
109
+ ## Pushing to Codex
110
+
111
+ **Trigger:** `/project push` or user asks to push learnings to codex
112
+
113
+ **TLDR:** Extract team-relevant decisions, patterns, and architecture updates from PROJECT.md. Propose codex updates via PR.
114
+
115
+ First use: `/project push codex:transaction-templates` — saves `codex_project` to frontmatter.
116
+ Subsequent: `/project push` — reads from frontmatter. Either push or pull can set it first.
117
+
118
+ Full procedure: `references/pushing.md`
119
+
89
120
  ## Creating a Project
90
121
 
91
122
  **Trigger:** `/project create {name?}` or user asks to start a new project
@@ -34,6 +34,7 @@
34
34
  - Use project contents for all subsequent work in the session
35
35
  - **Do NOT read companion docs by default** — CHANGELOG.md, DECISIONS.md, and WORKLOG.md exist for on-demand lookup only. PROJECT.md already references them; that is enough context.
36
36
  - If the user asks about decisions, past work, or history, THEN read the relevant companion doc.
37
+ - **Cross-skill routing:** When `save_related_in_project` is true (check `droid config --get tools.project`), signal to the session that related artifacts (plans, research, ideas) should default to `{project_folder}/plans/`, `{project_folder}/research/`, etc. Other skills (plan, brain) check for an active project and route accordingly.
37
38
 
38
39
  7. **If `-- {instruction}` provided:** Execute the follow-up instruction against the loaded project
39
40
 
@@ -0,0 +1,57 @@
1
+ # Pulling from Codex
2
+
3
+ **Trigger:** `/project pull [codex:{name}]`
4
+
5
+ Pull shared organizational context into an existing local project.
6
+
7
+ ## Procedure
8
+
9
+ 1. **Resolve codex project name:**
10
+ - If `codex:{name}` provided → use it, save to PROJECT.md frontmatter as `codex_project: {name}`
11
+ - If not provided → read `codex_project` from PROJECT.md frontmatter
12
+ - If neither → ask user
13
+
14
+ 2. **Identify the local project:**
15
+ - If in a loaded project session → use that project
16
+ - If no project loaded → search and load first (same as `/project search`)
17
+
18
+ 3. **Load codex entry:**
19
+ - Run `droid config --get tools.codex` and get `codex_repo` from the JSON output
20
+ - Sync: `git -C {codex_repo} pull --rebase --quiet`
21
+ - Locate `{codex_repo}/projects/{name}/`
22
+ - If not found → error with suggestions from available codex projects
23
+
24
+ 4. **Read codex documents:**
25
+ - PRD.md → goals, requirements, status
26
+ - TECH-DESIGN.md → architecture, patterns, key paths
27
+ - DECISIONS.md → recent decisions
28
+ - Any other docs in the codex project folder
29
+
30
+ 5. **Read current PROJECT.md** and identify:
31
+ - Sections that overlap with codex content
32
+ - Codex content that's newer or more detailed
33
+ - Local content that has no codex equivalent (leave untouched)
34
+
35
+ 6. **Propose updates** (never auto-apply):
36
+ - **Be highly selective** — PROJECT.md has context limits. Only propose content that is critical for the AI to have when working on this project.
37
+ - Categorise: "New from codex", "Updated in codex", "No change needed"
38
+ - Preserve local implementation details — codex updates should ADD context, not overwrite working notes
39
+ - Prefer links to codex over copying large sections
40
+
41
+ 7. **After approval:**
42
+ - Apply approved changes
43
+ - Update frontmatter: `codex_project: {name}`
44
+ - Add `## Codex Sync` entry or update existing one:
45
+ ```
46
+ **Last pulled:** {date} from codex:{name}
47
+ ```
48
+ - Determine version bump (patch for context updates, minor if goals/scope changed)
49
+ - Add changelog entry noting codex pull
50
+
51
+ ## Key Principles
52
+
53
+ - **Selective, not exhaustive** — only pull what's critical for project context. The project file has size limits.
54
+ - **Additive, not destructive** — codex updates enrich the local project, they don't replace local work
55
+ - **User reviews every change** — always propose, never auto-apply
56
+ - **Provenance tracked** — changelog and sync date show where context came from
57
+ - **Links over copies** — for large sections, link to codex rather than duplicating