@orderful/droid 0.23.0 → 0.25.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 (53) hide show
  1. package/.eslintrc.json +6 -4
  2. package/AGENTS.md +58 -0
  3. package/CHANGELOG.md +44 -0
  4. package/README.md +11 -6
  5. package/dist/bin/droid.js +384 -170
  6. package/dist/commands/config.d.ts +15 -1
  7. package/dist/commands/config.d.ts.map +1 -1
  8. package/dist/commands/exec.d.ts +10 -0
  9. package/dist/commands/exec.d.ts.map +1 -0
  10. package/dist/commands/tui.d.ts.map +1 -1
  11. package/dist/index.js +171 -33
  12. package/dist/lib/migrations.d.ts.map +1 -1
  13. package/dist/lib/skills.d.ts.map +1 -1
  14. package/dist/tools/codex/TOOL.yaml +2 -2
  15. package/dist/tools/codex/agents/codex-document-processor.md +8 -4
  16. package/dist/tools/codex/commands/codex.md +18 -10
  17. package/dist/tools/codex/skills/droid-codex/SKILL.md +140 -67
  18. package/dist/tools/codex/skills/droid-codex/references/creating.md +13 -51
  19. package/dist/tools/codex/skills/droid-codex/references/decisions.md +15 -19
  20. package/dist/tools/codex/skills/droid-codex/references/loading.md +49 -13
  21. package/dist/tools/codex/skills/droid-codex/references/topics.md +14 -12
  22. package/dist/tools/codex/skills/droid-codex/scripts/git-finish-write.d.ts +31 -0
  23. package/dist/tools/codex/skills/droid-codex/scripts/git-finish-write.d.ts.map +1 -0
  24. package/dist/tools/codex/skills/droid-codex/scripts/git-finish-write.ts +236 -0
  25. package/dist/tools/codex/skills/droid-codex/scripts/git-preamble.d.ts +20 -0
  26. package/dist/tools/codex/skills/droid-codex/scripts/git-preamble.d.ts.map +1 -0
  27. package/dist/tools/codex/skills/droid-codex/scripts/git-preamble.ts +156 -0
  28. package/dist/tools/codex/skills/droid-codex/scripts/git-scripts.test.ts +364 -0
  29. package/dist/tools/codex/skills/droid-codex/scripts/git-start-write.d.ts +23 -0
  30. package/dist/tools/codex/skills/droid-codex/scripts/git-start-write.d.ts.map +1 -0
  31. package/dist/tools/codex/skills/droid-codex/scripts/git-start-write.ts +172 -0
  32. package/package.json +1 -1
  33. package/src/bin/droid.ts +9 -0
  34. package/src/commands/config.ts +38 -4
  35. package/src/commands/exec.ts +96 -0
  36. package/src/commands/install.ts +1 -1
  37. package/src/commands/setup.ts +6 -6
  38. package/src/commands/tui.tsx +254 -175
  39. package/src/lib/migrations.ts +103 -10
  40. package/src/lib/quotes.ts +6 -6
  41. package/src/lib/skills.ts +168 -45
  42. package/src/tools/codex/TOOL.yaml +2 -2
  43. package/src/tools/codex/agents/codex-document-processor.md +8 -4
  44. package/src/tools/codex/commands/codex.md +18 -10
  45. package/src/tools/codex/skills/droid-codex/SKILL.md +140 -67
  46. package/src/tools/codex/skills/droid-codex/references/creating.md +13 -51
  47. package/src/tools/codex/skills/droid-codex/references/decisions.md +15 -19
  48. package/src/tools/codex/skills/droid-codex/references/loading.md +49 -13
  49. package/src/tools/codex/skills/droid-codex/references/topics.md +14 -12
  50. package/src/tools/codex/skills/droid-codex/scripts/git-finish-write.ts +236 -0
  51. package/src/tools/codex/skills/droid-codex/scripts/git-preamble.ts +156 -0
  52. package/src/tools/codex/skills/droid-codex/scripts/git-scripts.test.ts +364 -0
  53. package/src/tools/codex/skills/droid-codex/scripts/git-start-write.ts +172 -0
package/.eslintrc.json CHANGED
@@ -3,9 +3,7 @@
3
3
  "node": true,
4
4
  "es2022": true
5
5
  },
6
- "extends": [
7
- "eslint:recommended"
8
- ],
6
+ "extends": ["eslint:recommended"],
9
7
  "parser": "@typescript-eslint/parser",
10
8
  "parserOptions": {
11
9
  "ecmaVersion": "latest",
@@ -14,7 +12,11 @@
14
12
  "plugins": ["@typescript-eslint"],
15
13
  "rules": {
16
14
  "no-unused-vars": "off",
17
- "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }]
15
+ "@typescript-eslint/no-unused-vars": [
16
+ "error",
17
+ { "argsIgnorePattern": "^_" }
18
+ ],
19
+ "quotes": ["error", "single", { "avoidEscape": true }]
18
20
  },
19
21
  "ignorePatterns": ["dist/", "node_modules/", "*.test.ts"]
20
22
  }
package/AGENTS.md CHANGED
@@ -73,3 +73,61 @@ Don't consolidate them. Using Ink for simple prompts would be overkill.
73
73
  - Prefer `const` over `let`
74
74
  - Use Canadian/British spelling (behaviour, colour, favourite)
75
75
  - Use "allow list/deny list" not "whitelist/blacklist"
76
+
77
+ ## Common Gotchas
78
+
79
+ Things that will bite you if you don't know:
80
+
81
+ | Gotcha | Why | What to do |
82
+ |--------|-----|------------|
83
+ | Single-line YAML descriptions | Claude Code's frontmatter parser doesn't handle multiline YAML (`>-`) | Use single-line quoted strings in frontmatter |
84
+ | Skill directories have `droid-` prefix | Workaround for Claude Code bug where directories matching command names block invocation | Name skill dirs `droid-{name}/`, commands stay as `{name}.md` |
85
+ | Bump tool version when skill content changes | Users won't get updates otherwise | Patch bump the tool's TOOL.yaml version |
86
+ | Config-first in commands | User overrides must take precedence | Always read `~/.droid/skills/{skill}/overrides.yaml` before using defaults |
87
+ | Changeset package name | npm package is scoped | Use `"@orderful/droid"` not `"droid"` in changesets |
88
+
89
+ ## Testing
90
+
91
+ ```bash
92
+ bun test src/ # Unit tests (lib/, commands/)
93
+ bun run test:tui # Ink component tests (Badge, TabBar, etc.)
94
+ bun run test:e2e # E2E with Playwright + ttyd (requires ttyd installed)
95
+ bun run screenshot # On-demand TUI screenshot for visual verification
96
+ ```
97
+
98
+ **When to run what:**
99
+ - Changed core logic (`lib/`) → `bun test src/`
100
+ - Changed TUI components → `bun run test:tui`
101
+ - Visual changes you want to verify → `bun run screenshot`
102
+ - E2E tests aren't in CI (ttyd not on runners) - use locally for visual feedback
103
+
104
+ ## Adding a New Skill
105
+
106
+ 1. Create directory: `src/tools/{tool}/skills/{skill}/`
107
+ 2. Add `SKILL.md` with frontmatter:
108
+ ```yaml
109
+ ---
110
+ name: droid-{skill}
111
+ description: "{What it does}. Use when {scenarios}. User prompts like {examples}."
112
+ globs: []
113
+ alwaysApply: false
114
+ allowed-tools: [Read, Edit, Write, Glob, Grep, Bash, Task]
115
+ ---
116
+ ```
117
+ 3. Add skill name to `TOOL.yaml` under `includes.skills`
118
+ 4. Bump tool version in `TOOL.yaml`
119
+ 5. Add changeset: `.changeset/{name}.md`
120
+
121
+ **Optional:** Add `references/` for context files, `scripts/` for deterministic CLI scripts.
122
+
123
+ ## Key Architecture Decisions
124
+
125
+ Decisions that affect how you work:
126
+
127
+ | Decision | Rationale |
128
+ |----------|-----------|
129
+ | "Scripts" not "tools" for skill CLIs | Avoids terminology collision—droid "tools" are packages, skill "scripts" are executables |
130
+ | Parallel skills (`{skill}-next`) for risky refactors | Dogfood new implementation alongside original, swap when confident |
131
+ | Each .md owns its metadata | Single source of truth per artifact, contributors can bring existing skills as-is |
132
+ | Ink + Inquirer (not consolidated) | Ink for stateful TUI, Inquirer for simple prompts—right tool for each job |
133
+ | Collision detection over prefixing | Detect conflicts at install time rather than polluting command names with prefixes |
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # @orderful/droid
2
2
 
3
+ ## 0.25.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#123](https://github.com/Orderful/droid/pull/123) [`9e8bdff`](https://github.com/Orderful/droid/commit/9e8bdffccfb2e0ddbc02c1e9022a803f07f70240) Thanks [@frytyler](https://github.com/frytyler)! - Add deterministic git scripts to codex skill for bulletproof git hygiene
8
+ - `git-preamble.ts` - Ensure clean main + pull latest
9
+ - `git-start-write.ts` - Preamble + create branch
10
+ - `git-finish-write.ts` - Commit + PR + return to main
11
+
12
+ These scripts prevent PM-unfriendly git errors by making git operations deterministic and recoverable.
13
+
14
+ - [#94](https://github.com/Orderful/droid/pull/94) [`3ddd79d`](https://github.com/Orderful/droid/commit/3ddd79d77da9c0ef78d70165066e3a3464422795) Thanks [@frytyler](https://github.com/frytyler)! - Add `droid exec` command for running deterministic skill scripts
15
+ - New `droid exec <skill> <script> [args]` command
16
+ - New `droid config <skill>` outputs merged config as JSON for scripts
17
+ - Skills can include a `scripts/` directory with TypeScript/Python tools
18
+ - Scripts are copied during skill installation
19
+
20
+ - [#126](https://github.com/Orderful/droid/pull/126) [`e36d0ce`](https://github.com/Orderful/droid/commit/e36d0cee1b09313a454ce53f8daee0f2f427e670) Thanks [@frytyler](https://github.com/frytyler)! - Add platform sync migration to auto-detect installed tools. When switching between Claude Code and OpenCode, droid now automatically detects installed tools and syncs them to config.
21
+
22
+ ### Patch Changes
23
+
24
+ - [#127](https://github.com/Orderful/droid/pull/127) [`316ac96`](https://github.com/Orderful/droid/commit/316ac96d7c89444a0506bbb392375e1fb155fd69) Thanks [@frytyler](https://github.com/frytyler)! - Fix agent installation bug where agents weren't copied during tool install/update. The code was filtering for directories but agents are .md files.
25
+
26
+ - [#126](https://github.com/Orderful/droid/pull/126) [`e36d0ce`](https://github.com/Orderful/droid/commit/e36d0cee1b09313a454ce53f8daee0f2f427e670) Thanks [@frytyler](https://github.com/frytyler)! - Fix platform switching collision detection. Allow tools to overwrite their own command files when reinstalling across platforms (Claude Code ↔ OpenCode).
27
+
28
+ ## 0.24.0
29
+
30
+ ### Minor Changes
31
+
32
+ - [#118](https://github.com/Orderful/droid/pull/118) [`9a9b27c`](https://github.com/Orderful/droid/commit/9a9b27c439d7fdbfb246faa6121495d0249b007c) Thanks [@frytyler](https://github.com/frytyler)! - Add domains and proposals categories to codex
33
+ - Add `domains/` category for business domain knowledge (the "what" and "why")
34
+ - Add `proposals/` category for ideas and future direction (not yet committed)
35
+ - Unify creation commands under `/codex new`:
36
+ - `/codex new domain {name}`
37
+ - `/codex new proposal {name}`
38
+ - `/codex new topic {name}` (replaces `/codex add topic`)
39
+ - `/codex new pattern {name}`
40
+ - Add list commands: `/codex domains`, `/codex proposals`
41
+ - Update document processor agent to support domain and proposal types
42
+
43
+ ### Patch Changes
44
+
45
+ - [#121](https://github.com/Orderful/droid/pull/121) [`8895c54`](https://github.com/Orderful/droid/commit/8895c547aea2070e7e97749028baa6100e2c85c0) Thanks [@frytyler](https://github.com/frytyler)! - Update codex skill to use index.yaml for fast entry lookups instead of searching through all categories
46
+
3
47
  ## 0.23.0
4
48
 
5
49
  ### Minor Changes
package/README.md CHANGED
@@ -46,6 +46,8 @@ Browse available tools, see what's installed, and manage everything from one pla
46
46
  | **comments** | Inline `@droid`/`@user` conversations in any file | beta |
47
47
  | **project** | Persistent project context across sessions | beta |
48
48
  | **brain** | Collaborative scratch pad for planning & research | beta |
49
+ | **coach** | Learning-mode AI - scaffolds don't implement, questions don't fix | beta |
50
+ | **codex** | Shared organizational knowledge - PRDs, tech designs, patterns | beta |
49
51
  | **code-review** | Multi-agent code review with specialized checkers | alpha |
50
52
 
51
53
  ### Comments
@@ -95,9 +97,9 @@ Config lives in `~/.droid/`:
95
97
  ```
96
98
  ~/.droid/
97
99
  ├── config.yaml # Global config
98
- └── tools/
99
- └── {tool}/
100
- └── overrides.yaml # Per-tool overrides
100
+ └── skills/
101
+ └── {skill}/
102
+ └── overrides.yaml # Per-skill overrides
101
103
  ```
102
104
 
103
105
  Tools install to your AI platform's location:
@@ -116,6 +118,7 @@ While the TUI is the primary interface, direct commands are available:
116
118
  | `droid uninstall <tool>` | Remove a tool |
117
119
  | `droid update` | Update droid and tools |
118
120
  | `droid config` | View/edit config |
121
+ | `droid exec <skill> <script>` | Run a skill's deterministic script |
119
122
 
120
123
  ## Development
121
124
 
@@ -132,10 +135,12 @@ bun unlink
132
135
 
133
136
  ### Adding Tools
134
137
 
138
+ See [AGENTS.md](AGENTS.md) for detailed contributor guidance. Quick overview:
139
+
135
140
  1. Create `src/tools/{name}/TOOL.yaml` (manifest)
136
- 2. Add skills in `src/tools/{name}/skills/{skill}/SKILL.yaml` and `SKILL.md`
137
- 3. Add commands in `src/tools/{name}/commands/*.md`
138
- 4. Add agents in `src/tools/{name}/agents/{agent}/AGENT.yaml` and `AGENT.md`
141
+ 2. Add skills in `src/tools/{name}/skills/{skill}/SKILL.md` (frontmatter + instructions)
142
+ 3. Add commands in `src/tools/{name}/commands/{command}.md` (frontmatter + instructions)
143
+ 4. Add agents in `src/tools/{name}/agents/{agent}.md` (frontmatter + instructions)
139
144
  5. Submit a PR
140
145
 
141
146
  ## License