refactor: rename source dir to bin, reorganize templates, remove personal info

- Rename myclaude/ source directory → bin/
- Update all Python imports (myclaude.* → bin.*) and mock patch paths
- Update pyproject.toml: entry point and packages config
- Move workspace_template/ → templates/workspace/ for future extensibility
- Migrate .claude/skills/ to global ~/.claude/skills/ and remove local copies
- Remove SessionStart hook (sync-global.sh) from settings.local.json
- Remove unrelated script rename_funcs_to_snake.py
- Remove personal info (name, org, paths) from CLAUDE.md, README.md, settings
- Update .gitignore with standard Python/runtime exclusions
- Clean .DS_Store, __pycache__, .mypy_cache, .pytest_cache, .ruff_cache,
  .playwright-mcp runtime files
This commit is contained in:
Zhengshou Lai
2026-04-26 09:37:13 +08:00
parent 432b700265
commit ab597d1d02
42 changed files with 80 additions and 6524 deletions
+8 -8
View File
@@ -5,7 +5,7 @@ from unittest.mock import MagicMock, patch
from click.testing import CliRunner
from myclaude.cli import cli
from bin.cli import cli
class TestCliHelp:
@@ -48,8 +48,8 @@ class TestCliDefaultBehavior:
runner = CliRunner()
with (
patch("myclaude.cli.shutil.which", return_value="/usr/bin/claude"),
patch("myclaude.cli.subprocess.run") as mock_run,
patch("bin.cli.shutil.which", return_value="/usr/bin/claude"),
patch("bin.cli.subprocess.run") as mock_run,
):
mock_run.return_value = MagicMock(returncode=0)
result = runner.invoke(cli, [])
@@ -62,7 +62,7 @@ class TestCliDefaultBehavior:
"""Should exit with error when claude binary not found."""
runner = CliRunner()
with patch("myclaude.cli.shutil.which", return_value=None):
with patch("bin.cli.shutil.which", return_value=None):
result = runner.invoke(cli, [])
assert result.exit_code == 127
assert "not found" in result.output.lower()
@@ -74,8 +74,8 @@ class TestCliDefaultBehavior:
test_dir.mkdir()
with (
patch("myclaude.cli.shutil.which", return_value="/usr/bin/claude"),
patch("myclaude.cli.subprocess.run") as mock_run,
patch("bin.cli.shutil.which", return_value="/usr/bin/claude"),
patch("bin.cli.subprocess.run") as mock_run,
):
mock_run.return_value = MagicMock(returncode=0)
result = runner.invoke(cli, ["--cwd", str(test_dir)])
@@ -88,8 +88,8 @@ class TestCliDefaultBehavior:
runner = CliRunner()
with (
patch("myclaude.cli.shutil.which", return_value="/usr/bin/claude"),
patch("myclaude.cli.subprocess.run") as mock_run,
patch("bin.cli.shutil.which", return_value="/usr/bin/claude"),
patch("bin.cli.subprocess.run") as mock_run,
):
mock_run.return_value = MagicMock(returncode=0)
result = runner.invoke(cli, ["--dangerously-skip-permissions"])
+3 -3
View File
@@ -4,7 +4,7 @@ import os
from pathlib import Path
from unittest.mock import patch
from myclaude.project_root import get_myclaude_project_root, get_workspace_root
from bin.project_root import get_myclaude_project_root, get_workspace_root
class TestGetMyclaudeProjectRoot:
@@ -24,7 +24,7 @@ class TestGetMyclaudeProjectRoot:
"""When not in a repo, fallback to ~/.myclaude."""
with patch.dict(os.environ, {}, clear=True):
with patch("pathlib.Path.cwd", side_effect=OSError):
with patch("myclaude.project_root._pyproject_names_myclaude", return_value=False):
with patch("bin.project_root._pyproject_names_myclaude", return_value=False):
result = get_myclaude_project_root()
assert result == Path.home() / ".myclaude"
@@ -67,7 +67,7 @@ class TestGetWorkspaceRoot:
"""When no env var and no project workspace, default to ~/workspace."""
with (
patch.dict(os.environ, {}, clear=True),
patch("myclaude.project_root.get_myclaude_project_root", return_value=tmp_path / ".myclaude"),
patch("bin.project_root.get_myclaude_project_root", return_value=tmp_path / ".myclaude"),
patch.dict(os.environ, {}, clear=True),
):
with patch.dict(os.environ, {}, clear=True):