Skip to content

fix(install): prefix language-specific rules to prevent overwriting common rules#651

Closed
tonymfer wants to merge 2 commits intoaffaan-m:mainfrom
tonymfer:fix/rule-file-collision
Closed

fix(install): prefix language-specific rules to prevent overwriting common rules#651
tonymfer wants to merge 2 commits intoaffaan-m:mainfrom
tonymfer:fix/rule-file-collision

Conversation

@tonymfer
Copy link
Copy Markdown

@tonymfer tonymfer commented Mar 19, 2026

Summary

  • Prefix language-specific rule files during install to prevent overwriting common rules
  • Fix applied to the configure-ecc skill (English, Japanese, Chinese versions)
  • Added troubleshooting note about the prefixed naming convention

Why

When installing common + multiple language-specific rules via the configure-ecc skill, files with identical names (coding-style.md, security.md, testing.md, hooks.md, patterns.md) exist in both rules/common/ and rules/<language>/. The cp -r in Step 3 silently overwrites common rules with language-specific ones, so the last language installed "wins" and common rules are lost.

The fix prefixes language-specific files at copy time (e.g., python-coding-style.md instead of coding-style.md), matching the approach already used by the Antigravity install target adapter in install-executor.js.

Closes #432

Test plan

  • Install common + python + go rules — verify all three sets of files are present
  • Verify no filename collisions between common and language-specific rules
  • validate-rules.js and validate-skills.js CI validators pass

🤖 Generated with Claude Code


Summary by cubic

Prefix language-specific rule files during install to stop overwriting common rules, and harden the copy commands for reliability. Updates the configure-ecc skill instructions (EN/JA/ZH) and troubleshooting for the new prefixed naming.

  • Bug Fixes
    • Step 3 now copies language rules into $TARGET/rules/ with a <lang>- prefix (e.g., python-coding-style.md), preserving common rules and matching the install target adapter in install-executor.js.
    • Copy loops now use cp -r, quote $ECC_ROOT, and add [ -e "$f" ] guards to handle subdirectories, paths with spaces, and empty globs.

Written for commit f7a3311. Summary will update on new commits.

Summary by CodeRabbit

  • Documentation
    • Clarified skill configuration docs to explain language-specific rule files are now copied with language-prefixed names to avoid overwriting common rules.
    • Updated troubleshooting section with corrected examples showing the new prefixed naming and how to verify installed rules.

…ommon rules

The configure-ecc skill's Step 3 flat-copies language-specific rule files
(e.g., rules/python/*) into the same $TARGET/rules/ directory as common
rules. Since both directories contain identically-named files
(coding-style.md, security.md, testing.md, hooks.md, patterns.md), the
last language installed silently overwrites common rules.

Fix by prefixing language-specific files during copy (e.g.,
python-coding-style.md, golang-testing.md). This matches the approach
already used by the Antigravity install target adapter.

Also updates the Japanese and Chinese translations of the skill, and
adds a troubleshooting note about the prefixed naming convention.

Closes affaan-m#432

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 19, 2026

📝 Walkthrough

Walkthrough

Changed language-specific rule installation: instead of flat-copying each language's files into $TARGET/rules/, installer now copies each language file with a <language>-<original-basename> prefix into $TARGET/rules/, avoiding filename collisions with common rules.

Changes

Cohort / File(s) Summary
Configure-ECC Skill Documentation
skills/configure-ecc/SKILL.md, docs/ja-JP/skills/configure-ecc/SKILL.md, docs/zh-CN/skills/configure-ecc/SKILL.md
Replaced flat copy instructions for language-specific rules with a per-file copy loop that prefixes filenames with the language (e.g., python-coding-style.md, typescript-coding-style.md), added explanatory comments and updated the "Rules not working" troubleshooting paths.

Sequence Diagram(s)

sequenceDiagram
    participant Installer
    participant ECC_ROOT
    participant TARGET_FS
    Installer->>ECC_ROOT: list common rules
    Installer->>TARGET_FS: copy common/* -> $TARGET/rules/ (flat)
    Installer->>ECC_ROOT: for each language selected, list files
    loop per-file
        Installer->>ECC_ROOT: read file `rules/<lang>/<file>`
        Installer->>TARGET_FS: copy as `<lang>-<file>` -> $TARGET/rules/
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • affaan-m

Poem

🐰 I hopped through rules to stop the fight,
I prefixed names so each file sits right,
Common remains whole, languages named,
No more overwrites — harmony reclaimed! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: prefixing language-specific rules to prevent overwriting common rules, which is the primary objective of the changeset.
Linked Issues check ✅ Passed The code changes directly implement the primary requirement from issue #432: prefixing language-specific rule files (e.g., 'python-coding-style.md') to prevent overwriting common rules during installation.
Out of Scope Changes check ✅ Passed All changes are scoped to documentation files for the configure-ecc skill and directly address the issue's recommended fix of prefixing language-specific files; no unrelated modifications present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

Migrating from UI to YAML configuration.

Use the @coderabbitai configuration command in a PR comment to get a dump of all your UI settings in YAML format. You can then edit this YAML file and upload it to the root of your repository to configure CodeRabbit programmatically.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 19, 2026

Greptile Summary

This PR fixes a real file-collision bug in the configure-ecc skill where language-specific rules (e.g., coding-style.md) silently overwrote identically-named common rules during installation. The fix replaces the flat cp -r $ECC_ROOT/rules/<lang>/* $TARGET/rules/ commands with a for-loop that prefixes each language-specific file at copy time (e.g., python-coding-style.md), consistent with the approach used by install-executor.js. The change is applied correctly in all three skill files (EN, JA, ZH-CN), and the for-loops correctly include both cp -r and a [ -e "$f" ] empty-glob guard.

Key observations:

  • The core bash logic is correct: cp -r "$f" handles the (currently non-existent) case of subdirectories inside a language rule folder, and the [ -e "$f" ] guard prevents a literal-glob-string copy when a language directory is empty or missing.
  • The EN SKILL.md adds a helpful new troubleshooting bullet explaining the prefixed naming convention; however, the equivalent bullet is missing from both the JA and ZH-CN localized versions, leaving those users without guidance when debugging "rules not working" issues.
  • Rules directories in the repo also contain kotlin, perl, php, swift, and cpp rule sets that are not surfaced in the skill's Step 3 options — this is pre-existing scope, not introduced by this PR.

Confidence Score: 4/5

  • Safe to merge — the fix is correct and addresses a real bug; only a minor documentation inconsistency remains between the EN and localized skill files.
  • The core bash logic is sound: cp -r with a [ -e "$f" ] guard is an improvement over the original flat glob copy. The change is applied consistently across all three locales for the installation step itself. The only gap is that the new troubleshooting bullet added in the EN version was not ported to the JA or ZH-CN versions, which is a low-severity documentation inconsistency, not a functional regression.
  • docs/ja-JP/skills/configure-ecc/SKILL.md and docs/zh-CN/skills/configure-ecc/SKILL.md — missing the new troubleshooting note about prefixed rule filenames.

Important Files Changed

Filename Overview
skills/configure-ecc/SKILL.md Core English skill file updated correctly: for-loop with cp -r and [ -e "$f" ] guard replaces the flat cp -r glob; a troubleshooting note for the prefixed naming convention is added. Change is technically sound.
docs/ja-JP/skills/configure-ecc/SKILL.md Japanese translation updated with the same for-loop fix, but missing the new "Language-specific rules are prefixed" troubleshooting bullet that was added to the EN version.
docs/zh-CN/skills/configure-ecc/SKILL.md Simplified-Chinese translation updated with the same for-loop fix, but missing the new "Language-specific rules are prefixed" troubleshooting bullet present in the EN version.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User runs configure-ecc] --> B{Select rule sets}
    B --> C[Common rules selected]
    B --> D[TypeScript selected]
    B --> E[Python selected]
    B --> F[Go selected]

    C --> G["cp -r $ECC_ROOT/rules/common/* $TARGET/rules/
    e.g. coding-style.md → $TARGET/rules/coding-style.md"]

    D --> H["for f in $ECC_ROOT/rules/typescript/*
    [ -e f ] && cp -r f $TARGET/rules/typescript-basename_f
    e.g. coding-style.md → typescript-coding-style.md"]

    E --> I["for f in $ECC_ROOT/rules/python/*
    [ -e f ] && cp -r f $TARGET/rules/python-basename_f
    e.g. coding-style.md → python-coding-style.md"]

    F --> J["for f in $ECC_ROOT/rules/golang/*
    [ -e f ] && cp -r f $TARGET/rules/golang-basename_f
    e.g. coding-style.md → golang-coding-style.md"]

    G --> K["$TARGET/rules/
    ├── coding-style.md (common)
    ├── security.md (common)
    ├── testing.md (common)
    ├── typescript-coding-style.md
    ├── python-coding-style.md
    └── golang-coding-style.md"]

    H --> K
    I --> K
    J --> K

    K --> L[Step 4: Post-install verification]
Loading

Last reviewed commit: "fix: add -r flag, qu..."

Comment on lines 362 to 365
### "Rules not working"
- Rules are flat files, not in subdirectories: `$TARGET/rules/coding-style.md` (correct) vs `$TARGET/rules/common/coding-style.md` (incorrect for flat install)
- Language-specific rules are prefixed: `$TARGET/rules/python-coding-style.md` (correct) vs `$TARGET/rules/coding-style.md` (incorrect — overwrites the common rule)
- Restart Claude Code after installing rules
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Step 4b verification command now flags benign ../common/ links in every prefixed rule file

The language-specific rule files (e.g. python-coding-style.md) contain relative markdown links like [common/coding-style.md](../common/coding-style.md). After flat installation these links were already non-navigable, but the Step 4b grep (grep -rn "../common/" $TARGET/rules/) will now report them as "path reference errors" for every prefixed file installed — potentially flooding the verification output with false positives and masking real issues.

Consider either:

  1. Noting in Step 4b that these ../common/ hits inside language-prefixed files are expected and non-functional (they are prose/documentation links, not runtime paths); or
  2. Filtering them out with a note, e.g. grep -rn "../common/" $TARGET/rules/ | grep -v "^Binary".

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/ja-JP/skills/configure-ecc/SKILL.md`:
- Around line 160-164: The troubleshooting section still refers to unprefixed
rule filenames (e.g., coding-style.md) while the install step copies
language-specific files with prefixes (examples in the diff:
typescript-coding-style.md, python-coding-style.md, golang-coding-style.md);
update the troubleshooting text to explicitly mention the prefixed filenames and
give the same English-style clarification (for example: python-coding-style.md
vs coding-style.md) so users know to look for language-prefixed files created by
the for-loop copy commands shown in the diff.

In `@docs/zh-CN/skills/configure-ecc/SKILL.md`:
- Around line 227-231: Update the troubleshooting text in SKILL.md to show a
prefixed language rule filename example (e.g., python-coding-style.md) so it
matches the earlier collision-fix logic; locate the troubleshooting/examples
paragraph that currently references unprefixed flat names and replace or augment
it with an explicit prefixed example like "python-coding-style.md". Also ensure
the guidance about Skills includes the required Markdown sections exactly as
"When to use", "How it works", and "Examples" so the documentation is consistent
end-to-end.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ed2dc6b8-7987-487b-8c7d-352bf0d6d40d

📥 Commits

Reviewing files that changed from the base of the PR and between 4bdbf57 and 6eee49a.

📒 Files selected for processing (3)
  • docs/ja-JP/skills/configure-ecc/SKILL.md
  • docs/zh-CN/skills/configure-ecc/SKILL.md
  • skills/configure-ecc/SKILL.md

Comment on lines +160 to +164
# 言語固有のルール(共通ルールの上書きを防ぐためプレフィックス付き)
# coding-style.md は typescript-coding-style.md のようになります
for f in $ECC_ROOT/rules/typescript/*; do cp "$f" "$TARGET/rules/typescript-$(basename "$f")"; done # 選択された場合
for f in $ECC_ROOT/rules/python/*; do cp "$f" "$TARGET/rules/python-$(basename "$f")"; done # 選択された場合
for f in $ECC_ROOT/rules/golang/*; do cp "$f" "$TARGET/rules/golang-$(basename "$f")"; done # 選択された場合
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add matching troubleshooting guidance for prefixed language rule filenames.

The install step now correctly prefixes language-specific files, but the troubleshooting section still reads like flat unprefixed rules. Please mirror the English-style clarification there (e.g., python-coding-style.md vs coding-style.md) to avoid user confusion.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/ja-JP/skills/configure-ecc/SKILL.md` around lines 160 - 164, The
troubleshooting section still refers to unprefixed rule filenames (e.g.,
coding-style.md) while the install step copies language-specific files with
prefixes (examples in the diff: typescript-coding-style.md,
python-coding-style.md, golang-coding-style.md); update the troubleshooting text
to explicitly mention the prefixed filenames and give the same English-style
clarification (for example: python-coding-style.md vs coding-style.md) so users
know to look for language-prefixed files created by the for-loop copy commands
shown in the diff.

Comment on lines +227 to +231
# Language-specific rules (prefixed to avoid overwriting common rules)
# Files like coding-style.md become typescript-coding-style.md, etc.
for f in $ECC_ROOT/rules/typescript/*; do cp "$f" "$TARGET/rules/typescript-$(basename "$f")"; done # if selected
for f in $ECC_ROOT/rules/python/*; do cp "$f" "$TARGET/rules/python-$(basename "$f")"; done # if selected
for f in $ECC_ROOT/rules/golang/*; do cp "$f" "$TARGET/rules/golang-$(basename "$f")"; done # if selected
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Great collision fix; also update troubleshooting examples to include prefixed language files.

This section is correct, but later troubleshooting text still emphasizes unprefixed flat naming. Add an explicit prefixed example there (like python-coding-style.md) so guidance is consistent end-to-end.

Based on learnings: “Skills must be formatted as Markdown files with clear sections: 'When to use', 'How it works', and 'Examples'.”

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/zh-CN/skills/configure-ecc/SKILL.md` around lines 227 - 231, Update the
troubleshooting text in SKILL.md to show a prefixed language rule filename
example (e.g., python-coding-style.md) so it matches the earlier collision-fix
logic; locate the troubleshooting/examples paragraph that currently references
unprefixed flat names and replace or augment it with an explicit prefixed
example like "python-coding-style.md". Also ensure the guidance about Skills
includes the required Markdown sections exactly as "When to use", "How it
works", and "Examples" so the documentation is consistent end-to-end.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/ja-JP/skills/configure-ecc/SKILL.md">

<violation number="1" location="docs/ja-JP/skills/configure-ecc/SKILL.md:162">
P2: Unquoted $ECC_ROOT in the glob loop will word-split paths with spaces, breaking installs when users provide a local clone path. Quote $ECC_ROOT in the glob to make the copy commands robust.</violation>
</file>

<file name="skills/configure-ecc/SKILL.md">

<violation number="1" location="skills/configure-ecc/SKILL.md:227">
P2: Prefixing language-specific rule files into a flat rules/ directory breaks their existing ../common/ relative links (e.g., rules/python/coding-style.md). The new copy instructions rename and flatten files without rewriting those references, so installed rules will point to non-existent paths.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

# Language-specific rules (prefixed to avoid overwriting common rules)
# Files like coding-style.md become typescript-coding-style.md, etc.
for f in $ECC_ROOT/rules/typescript/*; do cp "$f" "$TARGET/rules/typescript-$(basename "$f")"; done # if selected
for f in $ECC_ROOT/rules/python/*; do cp "$f" "$TARGET/rules/python-$(basename "$f")"; done # if selected
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Prefixing language-specific rule files into a flat rules/ directory breaks their existing ../common/ relative links (e.g., rules/python/coding-style.md). The new copy instructions rename and flatten files without rewriting those references, so installed rules will point to non-existent paths.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At skills/configure-ecc/SKILL.md, line 227:

<comment>Prefixing language-specific rule files into a flat rules/ directory breaks their existing ../common/ relative links (e.g., rules/python/coding-style.md). The new copy instructions rename and flatten files without rewriting those references, so installed rules will point to non-existent paths.</comment>

<file context>
@@ -221,10 +221,11 @@ Execute installation:
+# Language-specific rules (prefixed to avoid overwriting common rules)
+# Files like coding-style.md become typescript-coding-style.md, etc.
+for f in $ECC_ROOT/rules/typescript/*; do cp "$f" "$TARGET/rules/typescript-$(basename "$f")"; done   # if selected
+for f in $ECC_ROOT/rules/python/*; do cp "$f" "$TARGET/rules/python-$(basename "$f")"; done           # if selected
+for f in $ECC_ROOT/rules/golang/*; do cp "$f" "$TARGET/rules/golang-$(basename "$f")"; done           # if selected

</file context>


</details>

<a href="https://www.cubic.dev/action/fix/violation/469eb368-fa49-4391-b8ee-9feebe184d93" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://cubic.dev/buttons/fix-with-cubic-dark.svg">
    <source media="(prefers-color-scheme: light)" srcset="https://cubic.dev/buttons/fix-with-cubic-light.svg">
    <img alt="Fix with Cubic" src="https://cubic.dev/buttons/fix-with-cubic-dark.svg">
  </picture>
</a>

…ands

Address review feedback:
- Add `-r` flag to `cp` to handle potential subdirectories
- Quote `$ECC_ROOT` in glob to prevent word-splitting on paths with spaces
- Add `[ -e "$f" ]` guard to skip when glob doesn't match anything

Applied consistently across EN, JA, and ZH skill docs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (2)
docs/zh-CN/skills/configure-ecc/SKILL.md (1)

373-376: ⚠️ Potential issue | 🟡 Minor

Add explicit examples of prefixed language-specific rule filenames.

The troubleshooting section should clarify that language-specific rules are installed with prefixes (e.g., python-coding-style.md, typescript-coding-style.md) while common rules remain unprefixed (coding-style.md). This distinction will help users locate the correct files after running the installation commands shown in lines 229-231.

📝 Suggested clarification

Add examples after line 375 to clarify the naming convention:

 ### "规则不工作"
 
 * 规则是平面文件,不在子目录中:`$TARGET/rules/coding-style.md`(正确)对比 `$TARGET/rules/common/coding-style.md`(对于平面安装不正确)
+* 注意文件命名:
+  * 通用规则:`coding-style.md`(无前缀)
+  * 语言特定规则:`python-coding-style.md`、`typescript-coding-style.md` 等(带语言前缀)
 * 安装规则后重启 Claude Code
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/zh-CN/skills/configure-ecc/SKILL.md` around lines 373 - 376, Update the
"规则不工作" troubleshooting text in SKILL.md to explicitly show the naming
convention for installed rules: add examples that language-specific rule files
are prefixed with the language (e.g., python-coding-style.md,
typescript-coding-style.md) while shared/common rules remain unprefixed (e.g.,
coding-style.md); place this clarification immediately after the existing
examples about flat files vs subdirectories in the "规则不工作" section so readers
can easily match installed filenames to the shown installation commands.
docs/ja-JP/skills/configure-ecc/SKILL.md (1)

293-296: ⚠️ Potential issue | 🟡 Minor

Clarify that language-specific rules are prefixed, not common rules.

The troubleshooting section should explicitly distinguish between common rules (which remain unprefixed like coding-style.md) and language-specific rules (which are now prefixed like python-coding-style.md, typescript-coding-style.md). Currently, users might be confused when they see the prefixed filenames after running the installation commands shown in lines 162-164.

📝 Suggested clarification

Add a note after line 294 explaining the prefixed naming:

 ### "ルールが機能しません"
 - ルールはフラットファイルで、サブディレクトリにはありません: `$TARGET/rules/coding-style.md`(正しい) vs `$TARGET/rules/common/coding-style.md`(フラットインストールでは不正)
+- 共通ルール: `coding-style.md`(プレフィックスなし)
+- 言語固有のルール: `python-coding-style.md`, `typescript-coding-style.md` など(言語名のプレフィックス付き)
 - ルールをインストール後、Claude Code を再起動します
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/ja-JP/skills/configure-ecc/SKILL.md` around lines 293 - 296, Update the
troubleshooting note under the "ルールが機能しません" section to explicitly state that
common rule filenames remain unprefixed (e.g., coding-style.md) while
language-specific rules are installed with language prefixes (e.g.,
python-coding-style.md, typescript-coding-style.md); insert a short clarifying
sentence immediately after the existing bullets explaining this distinction and
mention that prefixed filenames are expected after running the install commands
so users do not mistake them for incorrect installs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@docs/ja-JP/skills/configure-ecc/SKILL.md`:
- Around line 293-296: Update the troubleshooting note under the "ルールが機能しません"
section to explicitly state that common rule filenames remain unprefixed (e.g.,
coding-style.md) while language-specific rules are installed with language
prefixes (e.g., python-coding-style.md, typescript-coding-style.md); insert a
short clarifying sentence immediately after the existing bullets explaining this
distinction and mention that prefixed filenames are expected after running the
install commands so users do not mistake them for incorrect installs.

In `@docs/zh-CN/skills/configure-ecc/SKILL.md`:
- Around line 373-376: Update the "规则不工作" troubleshooting text in SKILL.md to
explicitly show the naming convention for installed rules: add examples that
language-specific rule files are prefixed with the language (e.g.,
python-coding-style.md, typescript-coding-style.md) while shared/common rules
remain unprefixed (e.g., coding-style.md); place this clarification immediately
after the existing examples about flat files vs subdirectories in the "规则不工作"
section so readers can easily match installed filenames to the shown
installation commands.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d9adaac0-3a00-4142-9831-f0e192f3405e

📥 Commits

Reviewing files that changed from the base of the PR and between 6eee49a and f7a3311.

📒 Files selected for processing (3)
  • docs/ja-JP/skills/configure-ecc/SKILL.md
  • docs/zh-CN/skills/configure-ecc/SKILL.md
  • skills/configure-ecc/SKILL.md
✅ Files skipped from review due to trivial changes (1)
  • skills/configure-ecc/SKILL.md

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 3 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/ja-JP/skills/configure-ecc/SKILL.md">

<violation number="1" location="docs/ja-JP/skills/configure-ecc/SKILL.md:162">
P2: Recursive copy in language-rule loops can install subdirectories, conflicting with the documented flat rule layout and creating future correctness risk.</violation>
</file>

<file name="docs/zh-CN/skills/configure-ecc/SKILL.md">

<violation number="1" location="docs/zh-CN/skills/configure-ecc/SKILL.md:229">
P2: Documentation install commands diverge from installer behavior: docs now prefix/flatten language rules while `install-executor.js` copies into per-language subdirectories.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment on lines +162 to +164
for f in "$ECC_ROOT"/rules/typescript/*; do [ -e "$f" ] && cp -r "$f" "$TARGET/rules/typescript-$(basename "$f")"; done # 選択された場合
for f in "$ECC_ROOT"/rules/python/*; do [ -e "$f" ] && cp -r "$f" "$TARGET/rules/python-$(basename "$f")"; done # 選択された場合
for f in "$ECC_ROOT"/rules/golang/*; do [ -e "$f" ] && cp -r "$f" "$TARGET/rules/golang-$(basename "$f")"; done # 選択された場合
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Recursive copy in language-rule loops can install subdirectories, conflicting with the documented flat rule layout and creating future correctness risk.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/ja-JP/skills/configure-ecc/SKILL.md, line 162:

<comment>Recursive copy in language-rule loops can install subdirectories, conflicting with the documented flat rule layout and creating future correctness risk.</comment>

<file context>
@@ -159,9 +159,9 @@ cp -r $ECC_ROOT/rules/common/* $TARGET/rules/
-for f in $ECC_ROOT/rules/typescript/*; do cp "$f" "$TARGET/rules/typescript-$(basename "$f")"; done   # 選択された場合
-for f in $ECC_ROOT/rules/python/*; do cp "$f" "$TARGET/rules/python-$(basename "$f")"; done           # 選択された場合
-for f in $ECC_ROOT/rules/golang/*; do cp "$f" "$TARGET/rules/golang-$(basename "$f")"; done           # 選択された場合
+for f in "$ECC_ROOT"/rules/typescript/*; do [ -e "$f" ] && cp -r "$f" "$TARGET/rules/typescript-$(basename "$f")"; done   # 選択された場合
+for f in "$ECC_ROOT"/rules/python/*; do [ -e "$f" ] && cp -r "$f" "$TARGET/rules/python-$(basename "$f")"; done           # 選択された場合
+for f in "$ECC_ROOT"/rules/golang/*; do [ -e "$f" ] && cp -r "$f" "$TARGET/rules/golang-$(basename "$f")"; done           # 選択された場合
</file context>
Suggested change
for f in "$ECC_ROOT"/rules/typescript/*; do [ -e "$f" ] && cp -r "$f" "$TARGET/rules/typescript-$(basename "$f")"; done # 選択された場合
for f in "$ECC_ROOT"/rules/python/*; do [ -e "$f" ] && cp -r "$f" "$TARGET/rules/python-$(basename "$f")"; done # 選択された場合
for f in "$ECC_ROOT"/rules/golang/*; do [ -e "$f" ] && cp -r "$f" "$TARGET/rules/golang-$(basename "$f")"; done # 選択された場合
for f in "$ECC_ROOT"/rules/typescript/*; do [ -f "$f" ] && cp "$f" "$TARGET/rules/typescript-$(basename "$f")"; done # 選択された場合
for f in "$ECC_ROOT"/rules/python/*; do [ -f "$f" ] && cp "$f" "$TARGET/rules/python-$(basename "$f")"; done # 選択された場合
for f in "$ECC_ROOT"/rules/golang/*; do [ -f "$f" ] && cp "$f" "$TARGET/rules/golang-$(basename "$f")"; done # 選択された場合
Fix with Cubic

cp -r $ECC_ROOT/rules/golang/* $TARGET/rules/ # if selected
# Language-specific rules (prefixed to avoid overwriting common rules)
# Files like coding-style.md become typescript-coding-style.md, etc.
for f in "$ECC_ROOT"/rules/typescript/*; do [ -e "$f" ] && cp -r "$f" "$TARGET/rules/typescript-$(basename "$f")"; done # if selected
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Documentation install commands diverge from installer behavior: docs now prefix/flatten language rules while install-executor.js copies into per-language subdirectories.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/zh-CN/skills/configure-ecc/SKILL.md, line 229:

<comment>Documentation install commands diverge from installer behavior: docs now prefix/flatten language rules while `install-executor.js` copies into per-language subdirectories.</comment>

<file context>
@@ -226,9 +226,9 @@ cp -r $ECC_ROOT/rules/common/* $TARGET/rules/
-for f in $ECC_ROOT/rules/typescript/*; do cp "$f" "$TARGET/rules/typescript-$(basename "$f")"; done   # if selected
-for f in $ECC_ROOT/rules/python/*; do cp "$f" "$TARGET/rules/python-$(basename "$f")"; done           # if selected
-for f in $ECC_ROOT/rules/golang/*; do cp "$f" "$TARGET/rules/golang-$(basename "$f")"; done           # if selected
+for f in "$ECC_ROOT"/rules/typescript/*; do [ -e "$f" ] && cp -r "$f" "$TARGET/rules/typescript-$(basename "$f")"; done   # if selected
+for f in "$ECC_ROOT"/rules/python/*; do [ -e "$f" ] && cp -r "$f" "$TARGET/rules/python-$(basename "$f")"; done           # if selected
+for f in "$ECC_ROOT"/rules/golang/*; do [ -e "$f" ] && cp -r "$f" "$TARGET/rules/golang-$(basename "$f")"; done           # if selected
</file context>
Fix with Cubic

@affaan-m
Copy link
Copy Markdown
Owner

Thanks for identifying this real issue -- language-specific rules overwriting common rules is a legitimate bug.

However, this PR only updates the skill documentation (configure-ecc/SKILL.md and its translations) but does not update the actual install scripts (install.sh, install.ps1, scripts/install-*.js). The skill docs describe the expected behavior, but the install scripts that actually perform the copy still use the old flat-copy approach.

To complete this fix, please also update:

  1. install.sh -- add prefixing logic for language-specific rule copies
  2. install.ps1 -- same for Windows
  3. Any Node.js install scripts that handle rule copying

Once the actual install scripts match the documented behavior, this is ready to merge.

@affaan-m
Copy link
Copy Markdown
Owner

Superseded by rebased PR

@affaan-m affaan-m closed this Mar 20, 2026
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.

Bug: Language-specific rules overwrite common rules when installing multiple languages flat

2 participants