Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Fetch and follow instructions from https://raw.githubusercontent.com/gaoguobin/c
Fetch and follow instructions from https://raw.githubusercontent.com/gaoguobin/codex-eide-rebuild/main/integrations/claude-code/INSTALL.md
```

The agent follows the install doc, runs `doctor`, and reports the JSON result. Restart the agent after `doctor.ok=true`.
The agent follows the install doc, runs `doctor`, and reports the JSON result. After `doctor.ok=true`, restart Codex or run `/reload-plugins` in Claude Code.

## Update

Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Fetch and follow instructions from https://raw.githubusercontent.com/gaoguobin/c
Fetch and follow instructions from https://raw.githubusercontent.com/gaoguobin/codex-eide-rebuild/main/integrations/claude-code/INSTALL.md
```

Agent 会按安装文档完成安装、运行 `doctor`、回报 JSON 结果。`doctor.ok=true` 之后重启 Agent
Agent 会按安装文档完成安装、运行 `doctor`、回报 JSON 结果。`doctor.ok=true` 之后,Codex 需要重启,Claude Code 运行 `/reload-plugins`

## 升级

Expand Down
2 changes: 1 addition & 1 deletion integrations/claude-code/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ python ~/.codex/codex-eide-rebuild/runtime/python/eide_rebuild.py doctor
```

Report the JSON result in the reply.
When the JSON contains `"ok": true`, tell the user to restart Claude Code so it picks up the new command and agent.
When the JSON contains `"ok": true`, tell the user to run `/reload-plugins` so Claude Code picks up the new command and agent.

## After install

Expand Down
2 changes: 1 addition & 1 deletion integrations/claude-code/UNINSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ If the Codex junction exists, warn the user that removing the repo will also bre

### 3. Done

Tell the user to restart Claude Code so the removed command and agent are no longer loaded.
Tell the user to run `/reload-plugins` so the removed command and agent are no longer loaded.
2 changes: 1 addition & 1 deletion integrations/claude-code/UPDATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ python ~/.codex/codex-eide-rebuild/runtime/python/eide_rebuild.py doctor
```

Report the JSON result in the reply.
When the JSON contains `"ok": true`, tell the user to restart Claude Code so it picks up the updated templates.
When the JSON contains `"ok": true`, tell the user to run `/reload-plugins` so Claude Code picks up the updated templates.
8 changes: 3 additions & 5 deletions runtime/python/eide_rebuild/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,13 @@ def _preferred_candidate(candidates: list[Path]) -> Path:


def _extension_roots() -> list[Path]:
roots: list[Path] = []
override = os.environ.get("EIDE_REBUILD_VSCODE_EXTENSIONS_ROOT")
if override:
roots.append(Path(override))
return _iter_existing_dirs([Path(override)])
home_override = os.environ.get("EIDE_REBUILD_HOME")
if home_override:
roots.append(Path(home_override) / ".vscode" / "extensions")
roots.append(Path.home() / ".vscode" / "extensions")
return _iter_existing_dirs(roots)
return _iter_existing_dirs([Path(home_override) / ".vscode" / "extensions"])
return _iter_existing_dirs([Path.home() / ".vscode" / "extensions"])


def find_eide_extension_dir() -> str:
Expand Down
15 changes: 15 additions & 0 deletions runtime/tests/test_codex_install_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,28 @@ def test_readmes_use_block_lifecycle_prompts(self) -> None:
content = readme.read_text(encoding="utf-8")
self.assertNotIn("`Fetch and follow instructions from", content)

def test_readmes_name_codex_restart_and_claude_reload(self) -> None:
english = README_EN.read_text(encoding="utf-8")
chinese = README_ZH.read_text(encoding="utf-8")
self.assertIn("restart Codex", english)
self.assertIn("`/reload-plugins` in Claude Code", english)
self.assertIn("Codex 需要重启", chinese)
self.assertIn("Claude Code 运行 `/reload-plugins`", chinese)

def test_claude_code_lifecycle_docs_use_consistent_prompt_format(self) -> None:
for doc in (CC_INSTALL_DOC, CC_UPDATE_DOC, CC_UNINSTALL_DOC):
with self.subTest(doc=doc.name):
content = doc.read_text(encoding="utf-8")
self.assertIn("## One-paste prompt for engineers", content)
self.assertIn("Paste this into Claude Code:", content)

def test_claude_code_lifecycle_docs_use_reload_plugins(self) -> None:
for doc in (CC_INSTALL_DOC, CC_UPDATE_DOC, CC_UNINSTALL_DOC):
with self.subTest(doc=doc.name):
content = doc.read_text(encoding="utf-8")
self.assertIn("/reload-plugins", content)
self.assertNotIn("restart Claude Code", content)

def test_chinese_readme_keeps_core_sections_in_sync(self) -> None:
content = README_ZH.read_text(encoding="utf-8")
for heading in (
Expand Down
4 changes: 2 additions & 2 deletions runtime/tests/test_skill_bundle_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def _collect_files(root: Path) -> dict[str, bytes]:
return {
str(path.relative_to(root)).replace("\\", "/"): path.read_bytes()
for path in sorted(root.rglob("*"))
if path.is_file()
if path.is_file() and "__pycache__" not in path.parts and path.suffix not in {".pyc", ".pyo"}
}


Expand Down Expand Up @@ -69,7 +69,7 @@ def test_sync_copy_preserves_existing_package_when_staging_fails(self) -> None:
(package_target / "module.py").write_text("old package\n", encoding="utf-8")
legacy_vsix.write_text("legacy\n", encoding="utf-8")

def failing_copytree(source, target):
def failing_copytree(source, target, **kwargs):
raise OSError("copy failed")

with (
Expand Down
5 changes: 3 additions & 2 deletions scripts/sync_skill_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
PACKAGE_SOURCE = REPO_ROOT / "runtime" / "python" / "eide_rebuild"
PACKAGE_TARGET = REPO_ROOT / "skills" / "eide-rebuild" / "scripts" / "eide_rebuild"
LEGACY_VSIX_TARGET = REPO_ROOT / "skills" / "eide-rebuild" / "assets" / "eide-rebuild.cli-bridge-0.1.0.vsix"
GENERATED_PYTHON_PATTERNS = ("__pycache__", "*.pyc", "*.pyo")


# --- Helpers ---
Expand All @@ -35,7 +36,7 @@ def collect(root: Path) -> dict[str, bytes]:
return {
str(path.relative_to(root)).replace("\\", "/"): path.read_bytes()
for path in sorted(root.rglob("*"))
if path.is_file()
if path.is_file() and "__pycache__" not in path.parts and path.suffix not in {".pyc", ".pyo"}
}

return collect(left_root) == collect(right_root)
Expand Down Expand Up @@ -67,7 +68,7 @@ def _stage_tree_copy(source: Path, target: Path) -> Path:
target.parent.mkdir(parents=True, exist_ok=True)
staged = _temp_sibling(target, ".tmp")
try:
shutil.copytree(source, staged)
shutil.copytree(source, staged, ignore=shutil.ignore_patterns(*GENERATED_PYTHON_PATTERNS))
return staged
except Exception:
if staged.exists():
Expand Down
8 changes: 3 additions & 5 deletions skills/eide-rebuild/scripts/eide_rebuild/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,13 @@ def _preferred_candidate(candidates: list[Path]) -> Path:


def _extension_roots() -> list[Path]:
roots: list[Path] = []
override = os.environ.get("EIDE_REBUILD_VSCODE_EXTENSIONS_ROOT")
if override:
roots.append(Path(override))
return _iter_existing_dirs([Path(override)])
home_override = os.environ.get("EIDE_REBUILD_HOME")
if home_override:
roots.append(Path(home_override) / ".vscode" / "extensions")
roots.append(Path.home() / ".vscode" / "extensions")
return _iter_existing_dirs(roots)
return _iter_existing_dirs([Path(home_override) / ".vscode" / "extensions"])
return _iter_existing_dirs([Path.home() / ".vscode" / "extensions"])


def find_eide_extension_dir() -> str:
Expand Down
Loading