claudekit-codex-sync 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ ClaudeKit uses `~/.claude/` conventions and agent markdown frontmatter. Codex us
|
|
|
13
13
|
| **Scope select** | Sync to project `./.codex/` (default) or global `~/.codex/` (`-g`) |
|
|
14
14
|
| **Fresh clean** | Optional `-f` cleanup of target dirs before sync |
|
|
15
15
|
| **Source resolve** | Uses live `~/.claude/` or `--zip` export |
|
|
16
|
-
| **Asset sync** | Copies commands/output-styles/scripts
|
|
16
|
+
| **Asset sync** | Copies agents `.md` → `agents/` (for TOML conversion), commands/output-styles/rules/scripts → `codex_home/claudekit/` |
|
|
17
17
|
| **Skill sync** | Copies skills into `codex_home/skills/` |
|
|
18
18
|
| **Path normalize** | Rewrites `.claude` references to `.codex` |
|
|
19
19
|
| **Config enforce** | Ensures `config.toml`, feature flags, and agent registration |
|
package/docs/codebase-summary.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
### Core Orchestration
|
|
19
19
|
|
|
20
20
|
- **`cli.py`** — Main entry point with 8-flag interface (`-g`, `-f`, `--force`, `--zip`, `--source`, `--mcp`, `--no-deps`, `-n`).
|
|
21
|
-
- **`clean_target.py`** — Fresh-sync cleaner for `--fresh` (
|
|
21
|
+
- **`clean_target.py`** — Fresh-sync cleaner for `--fresh` (deletes real `.venv`, keeps symlinks).
|
|
22
22
|
|
|
23
23
|
### Source Resolution
|
|
24
24
|
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
### Asset & Skill Sync
|
|
28
28
|
|
|
29
|
-
- **`asset_sync_dir.py`** — Live sync for assets and skills
|
|
29
|
+
- **`asset_sync_dir.py`** — Live sync for assets, agents, and skills. Copies agents directly to `codex_home/agents/` for TOML conversion. Registry-aware overwrite/backup.
|
|
30
30
|
- **`asset_sync_zip.py`** — Zip-based sync path.
|
|
31
31
|
|
|
32
32
|
### Normalization & Conversion
|
|
@@ -75,6 +75,6 @@ Configured Codex home (.codex project scope or ~/.codex global)
|
|
|
75
75
|
|---|---|
|
|
76
76
|
| `tests/test_config_enforcer.py` | 4 |
|
|
77
77
|
| `tests/test_path_normalizer.py` | 7 |
|
|
78
|
-
| `tests/test_clean_target.py` |
|
|
78
|
+
| `tests/test_clean_target.py` | 5 |
|
|
79
79
|
| `tests/test_cli_args.py` | 6 |
|
|
80
|
-
| **Total** | **
|
|
80
|
+
| **Total** | **22** |
|
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
┌─────────────────────┐ ┌──────────────────────────┐
|
|
7
7
|
│ ClaudeKit Source │ │ Codex Target │
|
|
8
8
|
│ ~/.claude/ or zip │───▶│ ./.codex or ~/.codex │
|
|
9
|
+
│ agents/*.md │ │ agents/*.toml (convert) │
|
|
9
10
|
│ skills/* │ │ skills/* │
|
|
10
11
|
│ commands/ │ │ claudekit/commands/ │
|
|
11
12
|
│ output-styles/ │ │ claudekit/output-styles/│
|
|
13
|
+
│ rules/ │ │ claudekit/rules/ │
|
|
12
14
|
│ scripts/ │ │ claudekit/scripts/ │
|
|
13
15
|
└─────────────────────┘ │ prompts/* (generated) │
|
|
14
16
|
│ config.toml │
|
|
@@ -25,12 +27,15 @@ Workspace baseline: `./AGENTS.md` is ensured in the current working directory.
|
|
|
25
27
|
- Select source: live (`~/.claude/`) or zip (`--zip`)
|
|
26
28
|
|
|
27
29
|
2. **Asset/skill sync**
|
|
28
|
-
- Copy
|
|
30
|
+
- Copy agents `.md` directly to `codex_home/agents/` (for TOML conversion)
|
|
31
|
+
- Copy managed assets (commands, output-styles, rules, scripts) to `codex_home/claudekit/`
|
|
32
|
+
- Copy skills to `codex_home/skills/`
|
|
29
33
|
- Apply registry-aware overwrite behavior (`--force`)
|
|
30
34
|
|
|
31
35
|
3. **Normalization**
|
|
32
36
|
- Rewrite `.claude` references to `.codex`
|
|
33
|
-
-
|
|
37
|
+
- Convert agent `.md` (YAML frontmatter) → `.toml` with model mapping
|
|
38
|
+
- Normalize existing agent TOMLs and compatibility patches
|
|
34
39
|
|
|
35
40
|
4. **Config enforcement**
|
|
36
41
|
- Enforce `config.toml` defaults
|
|
@@ -64,6 +69,7 @@ Workspace baseline: `./AGENTS.md` is ensured in the current working directory.
|
|
|
64
69
|
## Design Notes
|
|
65
70
|
|
|
66
71
|
- Project-first scope reduces accidental global writes while developing.
|
|
67
|
-
- `
|
|
72
|
+
- Agents copied to top-level `agents/` (not `claudekit/agents/`) to match conversion function expectations.
|
|
73
|
+
- `clean_target.py` deletes real `.venv` dirs (keeps symlinks) so re-symlink works on refresh.
|
|
74
|
+
- Bootstrap skips pip install when venv is symlinked — packages already present.
|
|
68
75
|
- Registry writes are defensive (`mkdir` before save) to avoid missing-path failures.
|
|
69
|
-
- Bootstrap path prefers symlink reuse for speed; fallback path ensures portability.
|
package/package.json
CHANGED
|
@@ -112,6 +112,28 @@ def sync_assets_from_dir(
|
|
|
112
112
|
if registry and not dry_run and dst.exists():
|
|
113
113
|
update_entry(registry, rel_path, src, dst)
|
|
114
114
|
|
|
115
|
+
# Copy agents directly to codex_home/agents/ (NOT claudekit/agents/)
|
|
116
|
+
# so convert_agents_md_to_toml() can find and convert them
|
|
117
|
+
agents_src = source / "agents"
|
|
118
|
+
if agents_src.exists():
|
|
119
|
+
agents_dst = codex_home / "agents"
|
|
120
|
+
if not dry_run:
|
|
121
|
+
agents_dst.mkdir(parents=True, exist_ok=True)
|
|
122
|
+
for src_file in sorted(agents_src.rglob("*.md")):
|
|
123
|
+
if not src_file.is_file():
|
|
124
|
+
continue
|
|
125
|
+
rel = src_file.relative_to(agents_src)
|
|
126
|
+
dst = agents_dst / rel
|
|
127
|
+
data = src_file.read_bytes()
|
|
128
|
+
changed, is_added = write_bytes_if_changed(dst, data, mode=None, dry_run=dry_run)
|
|
129
|
+
if changed:
|
|
130
|
+
if is_added:
|
|
131
|
+
added += 1
|
|
132
|
+
print(f"add: agents/{rel}")
|
|
133
|
+
else:
|
|
134
|
+
updated += 1
|
|
135
|
+
print(f"update: agents/{rel}")
|
|
136
|
+
|
|
115
137
|
return {"added": added, "updated": updated, "removed": 0, "skipped": skipped}
|
|
116
138
|
|
|
117
139
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from typing import List, Set, Tuple
|
|
4
4
|
|
|
5
|
-
ASSET_DIRS = {"commands", "output-styles", "scripts"}
|
|
6
|
-
ASSET_FILES = {".env.example"}
|
|
5
|
+
ASSET_DIRS = {"commands", "output-styles", "rules", "scripts"}
|
|
6
|
+
ASSET_FILES = {".env.example", ".ck.json"}
|
|
7
7
|
ASSET_MANIFEST = ".sync-manifest-assets.txt"
|
|
8
8
|
PROMPT_MANIFEST = ".claudekit-generated-prompts.txt"
|
|
9
9
|
REGISTRY_FILE = ".claudekit-sync-registry.json"
|