mirror of
https://github.com/SuperClaude-Org/SuperClaude_Framework.git
synced 2025-12-29 16:16:08 +00:00
Merge self-improvement loop
This commit is contained in:
@@ -281,6 +281,66 @@ class CommandsComponent(Component):
|
||||
project_root = Path(__file__).parent.parent.parent
|
||||
return project_root / "superclaude" / "commands"
|
||||
|
||||
def _discover_component_files(self) -> List[str]:
|
||||
"""
|
||||
Discover command files including modules subdirectory
|
||||
|
||||
Returns:
|
||||
List of relative file paths (e.g., ['pm.md', 'modules/token-counter.md'])
|
||||
"""
|
||||
source_dir = self._get_source_dir()
|
||||
|
||||
if not source_dir or not source_dir.exists():
|
||||
return []
|
||||
|
||||
files = []
|
||||
|
||||
# Discover top-level .md files (slash commands)
|
||||
for file_path in source_dir.iterdir():
|
||||
if (
|
||||
file_path.is_file()
|
||||
and file_path.suffix.lower() == ".md"
|
||||
and file_path.name not in ["README.md", "CHANGELOG.md", "LICENSE.md"]
|
||||
):
|
||||
files.append(file_path.name)
|
||||
|
||||
# Discover modules subdirectory files
|
||||
modules_dir = source_dir / "modules"
|
||||
if modules_dir.exists() and modules_dir.is_dir():
|
||||
for file_path in modules_dir.iterdir():
|
||||
if file_path.is_file() and file_path.suffix.lower() == ".md":
|
||||
# Store as relative path: modules/token-counter.md
|
||||
files.append(f"modules/{file_path.name}")
|
||||
|
||||
# Sort for consistent ordering
|
||||
files.sort()
|
||||
|
||||
self.logger.debug(
|
||||
f"Discovered {len(files)} command files (including modules)"
|
||||
)
|
||||
if files:
|
||||
self.logger.debug(f"Files found: {files}")
|
||||
|
||||
return files
|
||||
|
||||
def get_files_to_install(self) -> List[Tuple[Path, Path]]:
|
||||
"""
|
||||
Return list of files to install, including modules subdirectory
|
||||
|
||||
Returns:
|
||||
List of tuples (source_path, target_path)
|
||||
"""
|
||||
source_dir = self._get_source_dir()
|
||||
files = []
|
||||
|
||||
if source_dir:
|
||||
for filename in self.component_files:
|
||||
source = source_dir / filename
|
||||
target = self.install_component_subdir / filename
|
||||
files.append((source, target))
|
||||
|
||||
return files
|
||||
|
||||
def get_size_estimate(self) -> int:
|
||||
"""Get estimated installation size"""
|
||||
total_size = 0
|
||||
|
||||
Reference in New Issue
Block a user