Repository navigation
fix(init): refresh Cline, Windsurf and Kilo Code rules instead of skipping any file mentioning rtk - #5234
Open
boss477 wants to merge 1 commit into
Open
fix(init): refresh Cline, Windsurf and Kilo Code rules instead of skipping any file mentioning rtk#5234boss477 wants to merge 1 commit into
boss477 wants to merge 1 commit into
Conversation
…pping any file mentioning rtk `rtk init --agent cline|windsurf|kilocode` treated any rules file containing the letters "rtk" as already configured, so a project rule such as "prefer RTK Query" blocked the install, and a rules file RTK wrote itself was never refreshed when its wording changed. These installers now write RTK's rules as the same marker block Kimi and Codex use: added when missing, replaced in place when stale, left alone when current, with the user's own text kept. Rules appended without markers by earlier versions are migrated to the block when they end the file. Fixes rtk-ai#3406 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Fixes #3406
Summary
rtk init --agent cline|windsurf|kilocodeno longer treats any rules file containing "rtk" as already configured. A.clinerulesthat says "prefer RTK Query" now gets RTK's rules added after the user's text.write_rtk_block): added when missing, replaced in place when stale, left alone when current. This covers the second half KuSh found on Nov 3: a rules file RTK wrote itself now picks up newrtk-awareness-full.mdwording on re-run.# RTK,# RTK - Rust Token Killer …) and the file ends with the last line of a shipped RTK text (checked against every version in git history). Anything the user wrote after RTK's text means the file is left as it is and the block is appended.write_rtk_blockgains a sibling,write_rtk_block_into, that takes already-read content, so the migration can hand over the file without its legacy section.write_rtk_blockitself behaves as before.Test plan
cargo fmt --all --check,cargo clippy --all-targets(no warnings)cargo test: 4866 passed, 1 failed. The failure iscore::stream::tests::test_read_lines_lossy_preserves_lines_after_invalid_utf8, which also fails on unmodifieddevelopon Windows, so it isn't related to this change.rtk init --agent clinein a project whose.clinerulessays "Prefer RTK Query for data fetching." adds the block after the user's rules; a second run reports "already up to date".🤖 Generated with Claude Code