-
Notifications
You must be signed in to change notification settings - Fork 3
Migrating from Claude Code Optimization
If your project is built on
dilawarabbas1/Claude-Code-Optimization
(CLAUDE.md + .claude/hooks/* + docs/bug-registry.md etc. + prompts/*.md),
dotagent comes with a lossless migrator.
-
docs/*.mdis never copied. It stays as the source of truth. dotagent indexes it via.agent/config.yamlsources:. -
prompts/*.mdare imported as.agent/skills/imported-<slug>.mdwith a frontmatter wrapper. Originals stay untouched. -
Existing
CLAUDE.mdcontent is parsed and routed into.agent/{style,rules,architecture,patterns,preferences}.mdso your hand-written copy survives. -
.claude/hooks/*are preserved. dotagent's own.claude/hooks/post-tool.shis added alongside; existing hooks keep running. -
Pre-existing
CLAUDE.mdis also backed up to.agent/.imported/CLAUDE.md.original(one-time) before being replaced by dotagent's generated version. Restore withdotagent restore-originalif needed.
cd ~/code/your-cco-project
pipx install "git+https://github.com/dilawarabbas1/dotagent"
dotagent init --no-llm # scaffold .agent/ alongside existing docs/
dotagent migrate-cco # wire docs/ as sources + import prompts/
dotagent sync # render adapters with everything
dotagent doctor # confirm everything's wired-
References
docs/*.mdas sources. Updates.agent/config.yamlsources:block to point at every file from the CCO layout that exists:sources: bug_registry: docs/bug-registry.md # if exists anti_patterns: docs/anti-patterns.md # if exists redis_keys: docs/redis-key-registry.md # if exists db_impact_map: docs/db-impact-map.md # if exists dependency_map: docs/dependency-map.md # if exists architecture: docs/architecture.md # if exists
-
Imports
prompts/*.mdas skills. For every file inprompts/:prompts/deep-debug.md → .agent/skills/imported-deep-debug.md (with frontmatter wrapper) -
Ingests existing
CLAUDE.md/.cursorrules/.github/copilot-instructions.md/AGENTS.md. Each H2 is routed by keyword:H2 contains Routed to rule / constraint / must / do not .agent/rules.mdstyle / coding style .agent/style.mdarchitecture / system / components / services .agent/architecture.mdpattern / convention .agent/patterns.mdpreference / personal .agent/preferences.md(anything else) "Legacy notes" inside .agent/architecture.mdThis preserves your hand-written copy; nothing is dropped.
dotagent migrate-cco --dry-run # reports what WOULD changeOutput:
referenced sources (5):
· docs/bug-registry.md
· docs/anti-patterns.md
· ...
imported skills (3):
· imported-deep-debug.md
· imported-bug-hunt.md
· ...
ingested buckets (3): style, rules, architecture
note: docs/ kept as the single source of truth. dotagent indexes via
config.yaml `sources:`; no files are duplicated.
[dry-run] nothing was written.
| Before (CCO) | After (dotagent) |
|---|---|
Edit CLAUDE.md directly |
Edit docs/*.md (or .agent/*.md for project-wide) → dotagent sync
|
| Per-tool config maintained manually | Single source generates CLAUDE.md / .cursorrules / .github/copilot-instructions.md / AGENTS.md |
Bugs in docs/bug-registry.md invisible to AI |
Top-N bugs (severity-ranked) embedded in every adapter output |
Prompts in prompts/ invoked manually |
dotagent skill run <name> (or pipeline) |
Hooks in .claude/hooks/ only |
Same hooks + episodic memory + visibility commands |
- Your
docs/*.mdare untouched. -
.claude/hooks/*keep running (dotagent adds alongside, doesn't replace). -
prompts/*.mdare still inprompts/— imported skills reference them. - Your existing CLAUDE.md content lives on inside
.agent/*.md.
dotagent doctor # diagnose
dotagent context --format markdown # see the rendered context
# original CLAUDE.md backed up at:
ls .agent/.imported/
# restore the original if you don't like the regenerated version:
dotagent restore-original --name claude
# or all backed-up adapters:
dotagent restore-originalIf you want to un-do dotagent entirely:
dotagent restore-original # put back CLAUDE.md / .cursorrules / etc.
rm -rf .agent/ # remove dotagent state
# manually remove hooks if you want: .git/hooks/{pre-commit,post-commit,prepare-commit-msg}
# and .claude/hooks/post-tool.shNo — content is preserved by being ingested into .agent/*.md first, then
the original CLAUDE.md is backed up to .agent/.imported/CLAUDE.md.original,
and a new CLAUDE.md is rendered that includes those ingested sections.
The parsers are tolerant — they'll still extract whatever H2 sections + body
they can. Check the result with dotagent context --format markdown and
either reshape your doc slightly, or open an issue to add a kinder parser
variant.
Yes. It's idempotent — already-referenced sources stay, already-imported prompts are skipped (existing target files aren't overwritten).
- Getting Started — full new-project flow
- Sources and Docs — how indexing works after migration
-
Troubleshooting — what
dotagent doctorchecks
Repo · Issues · Changelog · License: MIT