feat: exclude documentation files from command installation#19
Merged
Conversation
Add functionality to automatically exclude README.md and CLAUDE.md files from being installed as slash commands when using 'cccsc add user/repo'. Changes: - Add shouldExcludeFile function to filter documentation files - Integrate exclusion logic into findMarkdownFiles - Support case-insensitive matching - Add comprehensive test coverage - Simplify file name normalization (remove hyphen/underscore conversion) This prevents documentation files from cluttering the slash command autocomplete list, improving user experience.
syou6162
force-pushed
the
feat/add_not_include_readme
branch
from
July 30, 2025 22:48
4708fa6 to
454508c
Compare
syou6162
marked this pull request as ready for review
July 30, 2025 22:53
Owner
|
@syou6162 Thank you for your contribution! |
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.
This PR adds functionality to automatically exclude documentation files (README.md and CLAUDE.md) from being installed as slash commands when using
cccsc add user/repo.Background
First of all, thank you for creating such a wonderful CLI tool. I use it daily and find it extremely helpful. I've been using it to manage my custom slash commands at https://github.com/syou6162/claude-code-commands.
The Problem
When installing slash commands with:
The installation succeeds, but README.md and CLAUDE.md files appear in the slash command autocomplete suggestions:
These documentation files are not meant to be slash commands and clutter the autocomplete list.
Changes
shouldExcludeFileutility function to identify documentation filesfindMarkdownFilesto filter out README and CLAUDE filesImplementation Details
The exclusion is applied by default without requiring any configuration. The implementation:
Breaking Change Consideration
This is a breaking change that alters the default behavior. I considered:
However, given the purpose of this tool (managing Claude Code slash commands), excluding documentation files by default seems more appropriate. Documentation files are rarely, if ever, intended as executable commands.
If you prefer a non-breaking approach with configuration options, I'm happy to revise the implementation accordingly.
Testing
Added unit tests to verify:
This change improves the user experience by preventing accidental installation of documentation files as commands.