Skip to content

feat(factorydroid): native commands, subagents, and skills with global scope + hooks.json - #1797

Merged
dyoshikawa merged 1 commit into
mainfrom
resolve-scrap-issue-1790-factorydroid-native
Jun 9, 2026
Merged

feat(factorydroid): native commands, subagents, and skills with global scope + hooks.json#1797
dyoshikawa merged 1 commit into
mainfrom
resolve-scrap-issue-1790-factorydroid-native

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Factory Droid (factorydroid) has matured upstream: custom commands, subagents (custom droids), and skills are now native (no longer simulated), support a global ~/.factory/ scope with richer frontmatter, and the hooks config path standardized to hooks.json. This PR folds all of these into one follow-up, as requested by the maintainer.

Closes #1790
Issue: #1790

Changes

Commands → native + global + argument-hint

  • FactorydroidCommand is now a native ToolCommand (Markdown), mirroring ClaudecodeCommand.
  • Paths: .factory/commands/ (project) and ~/.factory/commands/ (global).
  • Frontmatter description and argument-hint pass through; allowed-tools is reserved/optional (passed through via looseObject). Extra fields round-trip through the factorydroid rulesync section.
  • Processor entry: isSimulated: false, supportsGlobal: true.

Subagents (custom droids) → native + global + rich frontmatter

  • FactorydroidSubagent is now a native ToolSubagent. Paths: .factory/droids/ (project) and ~/.factory/droids/ (global).
  • Frontmatter name, description are preserved; model, reasoningEffort, tools, mcpServers (and any extra fields) round-trip through the factorydroid rulesync section (junie/geminicli pattern).
  • Processor entry: supportsSimulated: false, supportsGlobal: true.

Skills → native + global + frontmatter passthrough

  • FactorydroidSkill is now a native ToolSkill (mirrors GeminiCliSkill). Path: .factory/skills/<name>/SKILL.md (project) + global under home.
  • Frontmatter name, description, user-invocable, disable-model-invocation pass through.
  • Processor entry: supportsProject: true, supportsSimulated: false, supportsGlobal: true.

Hooks → hooks.json (+ global) with settings.json read fallback

  • getSettablePaths now returns .factory/hooks.json for both project and global.
  • fromFile reads .factory/hooks.json first; if absent, falls back to the hooks key in the legacy .factory/settings.json (back-compat, matching Droid's own fallback). Generation writes hooks.json only.
  • Because hooks.json is now a dedicated hooks file, it is deletable (consistent with devin/goose). The previous isDeletable() === false override was removed.

Conventions / gitignore / docs

  • Removed the obsolete simulated additionalConventions wiring for factorydroid in rules-processor.ts (commands/subagents/skills are native now).
  • gitignore-entries.ts: factorydroid hooks entry changed from **/.factory/settings.json (general) to **/.factory/hooks.json (hooks). Regenerated project .gitignore and cleaned up a stale stray **/.factory/settings.json line.
  • Docs matrix (docs/reference/supported-tools.md): factorydroid commands/subagents/skills changed from 🎮 to ✅ 🌏. skills/rulesync/supported-tools.md auto-synced. README already showed and needs no change.

Tests

  • Rewrote the unit tests for the three native classes (commands/subagents/skills) to cover native generation, global scope, and frontmatter round-trip.
  • Updated factorydroid-hooks.test.ts for the hooks.json path, the settings.json read-fallback, and isDeletable === true.
  • Updated the processor target-list tests (commands/subagents/skills) to reflect the native + global membership changes.
  • Updated the Tool × Feature e2e happy-path matrices (commands/subagents/skills/hooks) — moved factorydroid from the simulated matrices to the native project + global matrices and updated the hooks output path to .factory/hooks.json.

Verification

pnpm cicheck is fully green (format, oxlint 0 warnings, typecheck, 6095 unit tests, skill-docs sync, cspell, secretlint). The e2e specs (run via pnpm test:e2e) also pass (251 tests across the four affected specs).

🤖 Generated with Claude Code

…global scope and move hooks to hooks.json

Factory Droid has matured upstream: custom commands, subagents (custom
droids), and skills are now native (not simulated), support a global
~/.factory/ scope with richer frontmatter, and the hooks config path
standardized to hooks.json.

- Commands: native Markdown in .factory/commands/ (project) and
  ~/.factory/commands/ (global). Frontmatter description/argument-hint
  pass through; allowed-tools reserved/optional.
- Subagents (custom droids): native .md in .factory/droids/ with
  name/description plus model/reasoningEffort/tools/mcpServers passed
  through via the factorydroid rulesync section.
- Skills: native .factory/skills/<name>/SKILL.md with
  name/description plus user-invocable/disable-model-invocation
  passthrough.
- Hooks: primary path is now .factory/hooks.json (project + global),
  with .factory/settings.json hooks key kept as a read-time fallback.
  The dedicated hooks.json is now deletable.
- Remove the now-obsolete simulated additionalConventions wiring for
  factorydroid in rules-processor.
- Update gitignore (hooks.json), docs matrix, and the Tool x Feature
  e2e happy-path matrices accordingly.

Closes #1790

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dyoshikawa
dyoshikawa merged commit 1e68a62 into main Jun 9, 2026
9 checks passed
@dyoshikawa
dyoshikawa deleted the resolve-scrap-issue-1790-factorydroid-native branch June 9, 2026 13:28
@dyoshikawa

Copy link
Copy Markdown
Owner Author

@dyoshikawa Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow up Factory Droid upstream updates: native custom commands and standardized hooks.json path

2 participants