refactor-legacy
Skill by cartography-cncf
Refactors legacy Cartography intel modules from handwritten Cypher to the declarative data model. It is for contributors who need to convert old load and cleanup jobs to load() and GraphJob.from_node_schema().
Install refactor-legacy
Built from the published package, never by AI.
git clone --depth 1 https://github.com/cartography-cncf/cartography /tmp/cartography && mkdir -p ~/.claude/skills && cp -r /tmp/cartography/.agents/skills/refactor-legacy ~/.claude/skills/refactor-legacyRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/cartography-cncf/cartography /tmp/cartography && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/cartography/.agents/skills/refactor-legacy ~/.gemini/antigravity-cli/skills/refactor-legacyAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill guides an AI agent through converting a legacy Cartography sync module. Legacy modules use handwritten Cypher MERGE queries in load_* functions and cleanup/*.json jobs for cleanup. The skill has the agent first confirm an integration test exists and passes against the legacy code, then create node and relationship schemas, replace load_* functions with load(), and replace cleanup_* functions with GraphJob.from_node_schema().
After conversion, the skill has the agent remove manual index entries in indexes.cypher and the cleanup JSON files for fully converted nodes or modules. It sets a checklist and success criteria, and tells the agent to stop and ask the user when legacy business logic is unclear or modules are interdependent. It is aimed at developers maintaining the Cartography project.
Written from the project's SKILL.md and checked against it.
What it can do
- Test coverage checkConfirms an integration test calls the sync function and passes before any production code changes.
- Schema creationCreates node and relationship schemas in cartography/models for a module.
- load() conversionReplaces legacy load_* MERGE functions with the load() call and a CartographyNodeSchema.
- Cleanup conversionReplaces cleanup_* JSON jobs with GraphJob.from_node_schema().
- Legacy artefact removalRemoves manual index entries and cleanup JSON files for converted nodes only.
- Refactoring checklistProvides a checklist and success criteria for verifying a refactor.
What you need
- A Cartography codebase with the legacy intel module
- An integration test setup using the neo4j_session fixture
- Git, with signed commits (git commit -s)
Try asking
- Refactor the legacy EC2 instances sync to use load() and schemas.
- Remove the cleanup JSON job tied to the old MERGE query in this module.
- Migrate this legacy intel module to the declarative data model.
Good to know
- Production code must not change until an integration test passes against the legacy code.
- Cleanup is not tested unless there is a specific concern.
- The agent should stop and ask when relationships do not map cleanly or modules are interdependent.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/refactor-legacy/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md10 KB
Alternatives to refactor-legacy
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
refactor-legacy: common questions
When should I use this refactor-legacy skill?
Use it when asked to refactor, modernise, migrate, or clean up a legacy intel module, or to remove a cleanup JSON job tied to an old MERGE query.
Does it replace all handwritten writes?
No. If a hand-written write must remain temporarily, the skill says to switch it to run_write_query() and never keep raw neo4j_session.run() writes during refactors.
Does it delete indexes and cleanup files for every node?
No. The skill says to delete legacy artefacts only for the nodes actually converted, and to leave the rest alone.
How do I install refactor-legacy?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is refactor-legacy free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is refactor-legacy safe to use?
It scores 81 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to refactor-legacy?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
