fix(factorydroid): follow four documented Droid surfaces - #2572
Merged
Conversation
Add disabledSkills to the permissions override keys, carry the skills-frontmatter enabled and allowed-tools fields in both directions, forward the hooks commandRegex filter at matcher-group level, and stop emitting allowed-tools on custom commands, which Droid documents as unsupported ("Tool scoping is not available for custom commands"). Carrying commandRegex needed the group-passthrough mechanism, previously object-only, to accept scalars as well.
Address review feedback. commandRegex narrows when a hook fires, so sharing the group's first value would silently stop a hook that asked for no filter from firing at all. Group passthrough fields now declare whether they subdivide the group; Droid's commandRegex does, while AugmentCode's additive metadata keeps its existing merge-with-warning behavior. Group passthrough fields also declare their value shape, so a string field no longer accepts an object (or the reverse) and write a value that fails canonical validation on the next generate; string values are checked for control characters like the array passthrough path already was. Finally, allowed-tools is dropped on import as well as on generate, so a round trip cannot reintroduce a field Droid ignores.
The separator was written as a literal NUL rather than an escape, which made git treat tool-hooks-converter.ts as binary — the central change of this PR was unreadable in git diff, gh pr diff, and the GitHub review UI, while every CI check still passed. Also key the group on validated values only, so a value the tool cannot express does not split a group into entries that come out identical, and pin the value-shape guard with an AugmentCode regression test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves the four Factory Droid divergences in #2500. All four were re-verified against the live docs before implementing.
1.
disabledSkillspermission keyThe settings docs list
disabledSkills("Disable discovered skills without deleting their files.", an array of skill names) alongside the already-supportedhooksDisabled. It is now inFACTORYDROID_OVERRIDE_KEYS, so it can be authored in thefactorydroidoverride and is lifted back into it on import.2. Skills frontmatter:
enabledandallowed-toolsThe skills docs table documents 11 fields; rulesync modeled 4.
enabled(defaulttrue, "Set tofalseto keep the skill on disk but disable it") andallowed-tools("Declares the tools the skill is designed to use") are now inFactorydroidSkillFrontmatterSchemaand in thefactorydroidsection of the rulesync skill schema, threaded through both conversion directions —looseObjectalone was not enough, since both directions build explicit literals.3. Hooks
commandRegexDroid documents
commandRegexas an "Additional regex filter for Execute commands" sitting next tomatcheron the group:{"matcher": "Execute", "commandRegex": "^git ", "hooks": [...]}. Added toHookDefinitionSchemaand declared as agroupPassthroughFieldsentry for Droid. That mechanism previously carried plain objects only (AugmentCodemetadata), so it was generalized to carry scalars too; the existing disagreement warning and the object path are unchanged.4. Commands: drop
allowed-toolsThe custom-slash-commands docs list only
descriptionandargument-hint, and state verbatim: "Tool scoping is not available for custom commands. Use Skills or Custom Droids for tool policy."allowed-toolsis dropped on generate rather than written as frontmatter Droid ignores, matching the #2453 precedent of not emitting inert configuration. The stale schema comment and the commands row in the research reference map are corrected.Test plan
disabledSkillsround-trip, skillsenabled/allowed-toolsin both directions,commandRegexemitted on the group (and not duplicated onto the hook) plus imported onto every hook in the group, and the commands drop.npx vitest run --config vitest.e2e.config.ts src/e2e/e2e-hooks.spec.ts src/e2e/e2e-skills.spec.ts src/e2e/e2e-permissions.spec.ts src/e2e/e2e-commands.spec.ts— 377 passed.pnpm cicheck(full) passes;pnpm run generate:schemaandpnpm run generate:docs-contentregenerated.Closes #2500
🤖 Generated with Claude Code