docs(hooks): document hooks.json storage path and migration#1162
Merged
Conversation
Reflects PR Factory-AI/factory-mono#13674 (CLI-558): hooks now persist to `.factory/hooks.json` instead of the nested `.factory/hooks/hooks.json`. Mirrors the change in the Japanese translation. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Contributor
|
Droid finished @factory-ain3sh's task —— View job Droid review complete. The updated hooks.json paths and migration note look consistent within the touched pages, but several other hook guides still direct users to configure hooks via settings.json, which will conflict with the new canonical guidance. |
Addresses review on #1162: hook guides previously told users to add hook config to .factory/settings.json. They now point to the canonical .factory/hooks.json (or ~/.factory/hooks.json) and the JSON examples are unwrapped from the outer `hooks` key to match the hooks.json schema. Also adds hooks.json to the .factory/ folder inventory in the enterprise hierarchical-settings page and the power-user setup checklist. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
shashank-factory
approved these changes
May 28, 2026
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.
Description
Documents the new
hooks.jsonstorage path that replaces the nested.factory/hooks/hooks.jsonlocation for Droid hook configuration. The hooks reference now declares~/.factory/hooks.jsonand.factory/hooks.jsonas the canonical homes (withsettings.jsonas a documented fallback); every hook cookbook ships copy-pasteable JSON in the canonical schema (events at the top level, no outer"hooks"wrapper); and the enterprise / power-user folder inventories listhooks.jsonalongsidesettings.jsonandmcp.json. Existing nested files keep working unchanged — the next save through/hookswriteshooks.jsonat the scope root and archives the legacy file ashooks/hooks.migrated.json.Out of scope: plugin-local hook layout (
hooks/hooks.jsoninside.factory-plugin/) — that path is unchanged by the runtime work and the plugin / reference docs already describe it correctly.Related Issue
Closes CLI-688
Reviewer Guide
Read order:
docs/reference/hooks-reference.mdx(canonical schema, fallback semantics, migration note) →docs/cli/configuration/hooks-guide.mdx(Quickstart step now points athooks.json) → one cookbook (e.g.docs/guides/hooks/notifications.mdx) to verify the JSON unwrap pattern →docs/enterprise/hierarchical-settings-and-org-control.mdx+docs/guides/power-user/setup-checklist.mdx(folder inventory rows). JP files mirror their EN counterparts 1:1 — spot-check one to confirm parity.Review depth: Standard. The only live design call is presenting the legacy
settings.jsonlocation as a fallback rather than as a parallel authoring path; the JSON unwrap is mechanical (regex-driven) so the diff is large only because nesting collapses by one indent level.Risk & Impact
These pages are user-facing config recipes — a wrong path or schema would silently steer pasted JSON to a file Droid no longer prefers. Risk is bounded by the runtime's own backward compatibility:
settings.jsonand the nestedhooks/hooks.jsonboth still load, so any pre-update copy-paste continues to work; conversely the new canonical examples write to the same path the CLI itself persists to, so docs and runtime now agree. No code, schema, or CI changes.Migration & Rollout
Order: docs publish as-is — no flag, no migration, no coordinated release. The corresponding runtime migration (canonical write + legacy archive) is already merged on the dev channel and ships to stable on the next CLI rollout.
User-facing migration story: existing
.factory/hooks/hooks.jsonfiles keep loading; the first save through/hookswrites the new canonical file and archives the old one ashooks/hooks.migrated.json. The reference page documents this; no doc covers a manual migration path because none is required.Rollback: revert this PR. The pre-update reference text was accurate against the prior CLI release and would not mislead users on older versions.
Verification
Behavior verified. Re-read every changed page; prose, JSON snippets, and the Note block in the reference page agree on path (
hooks.json), fallback (settings.json), and migration target (hooks/hooks.migrated.json). Each cookbook example was checked against the canonical schema — events at the top level, the per-matcher innerhooksarray preserved.Regression coverage.
rg 'hooks.*settings\.json' docs/andrg '"hooks":\s*\{' docs/guides/hooks docs/jp/guides/hookscome back empty. The only survivingsettings.jsonmention in the hook surface is the deliberate fallback note inhooks-reference.mdx;.vscode/settings.jsoninauto-formatting.mdxis an unrelated editor-config example.Not tested. I did not render the JP pages under the docs theme — the substitution is structural and parallel to EN, so theme-side regression is unlikely.
Standard validators. No
.mdxlint/test job in this repo; the Mintlify build runs on merge.