refactor: centralize per-tool path conventions into constants modules - #1856
Merged
Conversation
各ツール(cursor, roo, kiro, kilo, geminicli, codexcli, agentsmd,
augmentcode, cline, copilot, devin, factorydroid, junie, opencode, pi,
amp, warp, goose, deepagents, rovodev, zed, takt, qwencode, antigravity,
antigravity-cli, antigravity-ide, replit)について
src/constants/{tool}-paths.ts を新規作成し、ディレクトリ名・ファイル名の
文字列リテラルを一元管理する。
feature ファイル群(rules, commands, skills, mcp, subagents, ignore,
permissions, hooks)はすべてこれらの constants からインポートするよう更新。
これによりツール固有パスの変更が単一ファイルの修正で完結するようになり、
コンパイル時に依存箇所が漏れなく検出される。
oxfmt format pass on changed files; remove dead code left by the constants migration (unused DEFAULT_TAKT_SUBAGENT_DIR, DEFAULT_TAKT_COMMAND_DIR, WARP_MEMORIES_DIR_PATH import, and two ANTIGRAVITY_* imports).
Contributor
|
Thank you for your contribution! Unfortunately, this PR has 1326 added lines, which exceeds the limit of 1000 lines for external contributors. Please split your changes into smaller PRs. See CONTRIBUTING.md for details. |
Owner
|
@saitota Thank you! |
rudironsoni
pushed a commit
to rudironsoni/rulesync
that referenced
this pull request
Jun 18, 2026
Follow-ups from PR dyoshikawa#1856. - Dedupe the Antigravity CLI permissions constants. `antigravity-paths.ts` is now the single source of truth for `ANTIGRAVITY_CLI_PERMISSIONS_SUBDIR` / `_DIR_PATH` / `_FILE_NAME`; `antigravity-cli-paths.ts` re-exports them (the subdir under the `ANTIGRAVITY_CLI_GLOBAL_SUBDIR` name its skill consumer uses) instead of redefining identical literals. - Remove genuinely dead exported path constants that no consumer imports (verified with knip + grep): the unused `ANTIGRAVITY_*_PATH` / `ANTIGRAVITY_RULE_FILE_*` / `ANTIGRAVITY_COMMANDS_DIR_PATH` family, the dead `antigravity-ide` config/skills/ mcp/hooks constants, and the unused `*_RULES_DIR_PATH` / `*_STEERING_DIR_PATH` / `*_MEMORIES_DIR_PATH` / `*_INSTRUCTIONS_DIR_PATH` constants left over from the centralization (cursor, kilo, roo, augmentcode, kiro, copilot, etc.). - Drop `export` from constants used only as internal building blocks (`WINDSURF_SUBDIR`, `PI_AGENT_DIR`, `TAKT_FACETS_DIR_PATH`) so they stay private rather than appearing as unused public exports. - Add `src/constants/paths.test.ts` pinning key centralized constants to their expected path strings, including that the deduped Antigravity CLI constants resolve identically through both modules. Closes dyoshikawa#1864
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.
Background
Each external tool's configuration conventions — directory names, file names, scope-specific paths — were independently hardcoded as string literals across up to 9 feature files per tool (
{tool}-rule.ts,{tool}-command.ts,{tool}-skill.ts,{tool}-mcp.ts, etc.). There was no programmatic connection between these scattered literals; they were implicit duplicates of the same knowledge.This created a concrete maintenance burden: when a tool renames its config directory (e.g. the Gemini CLI → Antigravity migration that produced
antigravity-rule.ts/antigravity-cli-rule.ts/antigravity-ide-rule.tsand legacy aliases), up to 9 files required changes with no compile-time safety net. A missed file produces a silent mismatch in generated output — no type error, no test failure.Changes
src/constants/{tool}-paths.tsfor every supported tool (27 new files), each exporting the tool's directory names, file names, and scope-specific paths as named constants.src/features/**/{tool}-*.tsfiles to import path constants from the corresponding module instead of repeating string literals.No runtime behavior changes. Path values are identical — this is a pure refactor.
Why this structure
The feature-first directory layout (
src/features/rules/,src/features/commands/, …) is preserved. Only the volatile knowledge — where a tool stores its files — is extracted to a single authoritative location per tool. A tool path change now requires editing one file; all dependents get a compile-time error if they break.Test plan
pnpm build— cleanpnpm typecheck— cleanpnpm test— 6301/6302 pass (1 pre-existing failure inwarp-permissions.test.tsunrelated to this change)pnpm oxlint— cleanpnpm fmt— applied