Skip to content

feat: add Factory Droid adapter, mode shortcuts, and custom skills#397

Open
SparshGarg999 wants to merge 1 commit into
DietrichGebert:mainfrom
SparshGarg999:feature/droid-keybindings-custom-skills
Open

feat: add Factory Droid adapter, mode shortcuts, and custom skills#397
SparshGarg999 wants to merge 1 commit into
DietrichGebert:mainfrom
SparshGarg999:feature/droid-keybindings-custom-skills

Conversation

@SparshGarg999

Copy link
Copy Markdown

PR Description: Host Integration (Factory Droid), Mode Toggle Keybindings, and Custom Skills

This Pull Request implements support for Factory Droid adapter, introduces mode toggle keybindings / shortcut actions, and adds three new commands/skills: /ponytail-jedi (SOTA research), /ponytail-plan (minimalist planning), and /ponytail-ask (refining requirements).


Detailed Changes & Issue Resolution

1. Mode Toggle / Cycle Keybindings (Resolves #145)

  • Problem: Switching ponytail modes (lite, full, ultra, off) required typing slash commands every time, which interrupts developer flow.
  • Solution: Exposed keybindable shortcut actions in the pi-extension utilizing namespaced identifiers. Users can now bind these actions to key combinations in their keybindings.json configurations.
  • Registered Actions:
    • ponytail:cycleMode (cycles off → lite → full → ultra → off)
    • ponytail:modeLite
    • ponytail:modeFull
    • ponytail:modeUltra
    • ponytail:modeOff

2. Factory Droid Adapter Support (Resolves #167)

  • Problem: Droid was not supported as a host plugin with full hook/mode-tracking capability.
  • Solution: Added Droid adapter integration pointing to the existing thin hook files:
    • Created .factory-plugin/plugin.json containing the plugin manifest.
    • Created hooks/factory-hooks.json mapping Droid lifecycle hooks (SessionStart, SubagentStart, UserPromptSubmit) using the ${DROID_PLUGIN_ROOT} env variable.
    • Updated hooks/ponytail-runtime.js to detect isDroid and resolve the state file path to ~/.factory/.ponytail-active (or DROID_CONFIG_DIR).
    • Integrated Codex-compatible hook output format (systemMessage and hookSpecificOutput) for Droid sessions.
    • Bypassed statusline configuration warnings during activation on Droid.
    • Documented Factory Droid setup and installation commands in docs/agent-portability.md.

3. SOTA research: /ponytail-jedi and /ponytail-lightsaber (Resolves #240)

  • Problem: Request to give ponytail a lightsaber (Jedi mode) to research SOTA open-source solutions instead of starting from scratch.
  • Solution:
    • Created skills/ponytail-jedi/SKILL.md defining instructions to search, rank, clone, modify, extract, or connect to world-class trusted open-source repositories.
    • Created commands/ponytail-jedi.toml and commands/ponytail-lightsaber.toml command templates.
    • Created .opencode/command/ponytail-jedi.md and .opencode/command/ponytail-lightsaber.md.
    • Registered ponytail-jedi and ponytail-lightsaber in pi-extension/index.js and plugin.yaml.

4. Planning & Questioning: /ponytail-plan and /ponytail-ask (Resolves #243)

  • Problem: Request for skills to plan tasks (keeping them minimal/YAGNI) or clarify requirements before writing code.
  • Solution:
    • Created skills/ponytail-plan/SKILL.md (creating clean, minimal, YAGNI implementation plans or auditing existing plans).
    • Created skills/ponytail-ask/SKILL.md (refining tasks and clarifying ambiguity with targeted questions).
    • Created corresponding .toml command templates and OpenCode command .md files.
    • Registered commands in pi-extension/index.js and plugin.yaml.
    • Documented all new skills in skills/ponytail-help/SKILL.md quick reference card.

Verification & Testing

Automated Unit Tests

  • Created tests/factory-plugin.test.js validating manifest fields, hook paths, and all required command .toml file locations.
  • Updated tests/hooks.test.js verifying Droid environment detection (isDroid), correct state directory location, and stdout JSON hook formatting.
  • Updated pi-extension/test/extension.test.js adding tests for registered shortcuts, command listings, and mocking the shortcut registrar.
  • Ran all test suites successfully:
    • npm test inside pi-extension/: 16 tests, 16 passed, 0 failed
    • node scripts/build-openclaw-skills.js: successfully rebuilt all OpenClaw skill copies.
    • node scripts/check-rule-copies.js: successfully validated that rule copies are consistent.

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

Labels

None yet

Projects

None yet

1 participant