Skip to content

Commit 30dbfe4

Browse files
committed
fix: sync claude-code-config with renamed/removed skills and clean broken symlinks
The skills config in core/claude-code-config.json was never updated after commit 151c4fe renamed and removed several skills. This caused `smartem-workspace check --fix` to report missing skills and fail to create symlinks for targets that no longer exist. - Rename database-admin -> database - Rename technical-writer -> tech-writer - Rename playwright-skill -> playwright - Remove github (merged into git) - Remove ascii-art (deleted) - Sync bundled copy in packages/smartem-workspace/ Also enhance check.py to detect and remove stale broken symlinks under .claude/skills/ during --fix. The cleanup is constrained to entries that are (1) symlinks, (2) whose target does not exist, and (3) whose name is not in the expected skills list -- so user-created skills and valid symlinks are never touched. Bump smartem-workspace version 0.6.0 -> 0.6.1.
1 parent c623d8c commit 30dbfe4

6 files changed

Lines changed: 39 additions & 13 deletions

File tree

core/claude-code-config.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44
"description": "Claude Code integration configuration for SmartEM workspace",
55
"claudeConfig": {
66
"skills": [
7-
{ "name": "database-admin", "path": "claude-code/shared/skills/database-admin" },
7+
{ "name": "database", "path": "claude-code/shared/skills/database" },
88
{ "name": "devops", "path": "claude-code/shared/skills/devops" },
9-
{ "name": "technical-writer", "path": "claude-code/shared/skills/technical-writer" },
9+
{ "name": "tech-writer", "path": "claude-code/shared/skills/tech-writer" },
1010
{ "name": "git", "path": "claude-code/shared/skills/git" },
11-
{ "name": "github", "path": "claude-code/shared/skills/github" },
12-
{ "name": "ascii-art", "path": "claude-code/shared/skills/ascii-art" },
13-
{ "name": "playwright-skill", "path": "claude-code/smartem-frontend/skills/playwright-skill" }
11+
{ "name": "playwright", "path": "claude-code/smartem-frontend/skills/playwright" }
1412
],
1513
"defaultPermissions": {
1614
"allow": [

packages/smartem-workspace/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "smartem-workspace"
7-
version = "0.6.0"
7+
version = "0.6.1"
88
description = "CLI tool to automate SmartEM multi-repo workspace setup"
99
readme = "README.md"
1010
license = "Apache-2.0"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""SmartEM workspace setup CLI tool."""
22

3-
__version__ = "0.6.0"
3+
__version__ = "0.6.1"

packages/smartem-workspace/smartem_workspace/commands/check.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,27 @@ def run_claude_checks(workspace_path: Path, claude_config: ClaudeCodeConfig) ->
276276
else:
277277
results.append(CheckResult(".claude/skills directory", "ok", "Present"))
278278

279+
expected_skill_names = {skill.name for skill in claude_config.claudeConfig.skills}
279280
for skill in claude_config.claudeConfig.skills:
280281
skill_link = skills_dir / skill.name
281282
skill_target = devtools_path / skill.path
282283
results.append(check_symlink(skill_link, skill_target, f"skill: {skill.name}"))
283284

285+
if skills_dir.exists():
286+
for entry in skills_dir.iterdir():
287+
if entry.name in expected_skill_names:
288+
continue
289+
if entry.is_symlink() and not entry.exists():
290+
results.append(
291+
CheckResult(
292+
f"skill: {entry.name}",
293+
"warning",
294+
"Broken symlink (stale)",
295+
fixable=True,
296+
fix_data={"remove_broken_symlink": str(entry)},
297+
)
298+
)
299+
284300
settings_path = workspace_path / ".claude" / "settings.local.json"
285301
if settings_path.exists():
286302
results.append(check_json_valid(settings_path, "settings.local.json"))
@@ -407,6 +423,20 @@ def apply_fixes(workspace_path: Path, reports: list[CheckReport]) -> tuple[int,
407423
console.print(f" [red]Failed to create directory: {e}[/red]")
408424
failed += 1
409425

426+
elif "remove_broken_symlink" in fix_data:
427+
broken_path = Path(fix_data["remove_broken_symlink"])
428+
try:
429+
if broken_path.is_symlink() and not broken_path.exists():
430+
broken_path.unlink()
431+
console.print(f" [green]Removed broken symlink: {broken_path.name}[/green]")
432+
fixed += 1
433+
else:
434+
console.print(f" [yellow]Skipped (no longer broken): {broken_path.name}[/yellow]")
435+
failed += 1
436+
except OSError as e:
437+
console.print(f" [red]Failed to remove broken symlink: {e}[/red]")
438+
failed += 1
439+
410440
elif "link" in fix_data and "target" in fix_data:
411441
link_path = Path(fix_data["link"])
412442
target_path = Path(fix_data["target"])

packages/smartem-workspace/smartem_workspace/config/claude-code-config.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44
"description": "Claude Code integration configuration for SmartEM workspace",
55
"claudeConfig": {
66
"skills": [
7-
{ "name": "database-admin", "path": "claude-code/shared/skills/database-admin" },
7+
{ "name": "database", "path": "claude-code/shared/skills/database" },
88
{ "name": "devops", "path": "claude-code/shared/skills/devops" },
9-
{ "name": "technical-writer", "path": "claude-code/shared/skills/technical-writer" },
9+
{ "name": "tech-writer", "path": "claude-code/shared/skills/tech-writer" },
1010
{ "name": "git", "path": "claude-code/shared/skills/git" },
11-
{ "name": "github", "path": "claude-code/shared/skills/github" },
12-
{ "name": "ascii-art", "path": "claude-code/shared/skills/ascii-art" },
13-
{ "name": "playwright-skill", "path": "claude-code/smartem-frontend/skills/playwright-skill" }
11+
{ "name": "playwright", "path": "claude-code/smartem-frontend/skills/playwright" }
1412
],
1513
"defaultPermissions": {
1614
"allow": [

packages/smartem-workspace/uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)