Import alg docx is an AI agent skill from the GitHub repository 2017YANR02/cuberoot.me. Use when importing, migrating, or synchronizing curated 3x3 algorithm DOCX tables, especially OLL-style tables with diagrams, colored annotations, formula-type icons, or left-hand formulas. Preserve order, notation, classifications, tags, links, metrics, and right-hand derivations.
Claude Code: save it as .claude/skills/import-alg-docx/SKILL.md
Cursor: save it as .cursor/rules/import-alg-docx.md
Codex: save it as .agents/skills/import-alg-docx/SKILL.md
ChatGPT, Gemini and other assistants: paste it into custom or project instructions
Skill file
Import algorithm DOCX
Workflow
Start from the repository root, inspect the scoped worktree, and create or update a task tracker under docs/ before changing data.
Use the documents skill to render the DOCX and inspect every page; treat visual layout as evidence for table pairing, headings, arrows, and icon meaning.
Run scripts/extract_alg_docx.py for machine-readable extraction, then reconcile its output against the rendered pages and record counts in the tracker.
Ignore green text. Interpret a green -> or <- as a cross-cell scramble link, not as a formula.
Map embedded formula icons through references/import-contract.md; keep unknown icons unresolved until the user or document identifies them.
scripts/add_formula_setups.mts can produce diagnostic inverse states, but an algorithm solving its own inverse is not case validation. Validate every entry against the public case setup through alg_case_alignment.ts; include verified starting and finishing adjustments in the displayed sequence. Check confirmed relocations in docs/data/algorithms/alg-case-alignment-audit.md before reimporting, so source-table mistakes cannot overwrite reviewed corrections.
Preserve prime marks on 180-degree turns. Put curated DOCX formulas before existing formulas and remove an existing near-duplicate only after normalizing grouping whitespace and the optional prime after 2.
Keep the DOCX category and case order. Never substitute the site's previous grouping.
Treat DOCX one-handed formulas as left-handed. Reuse the PLL formula-tag and partner-first left-to-right-hand derivation path to expose right-handed formulas; do not mirror the current case and do not create another mirror implementation.
Reuse AlgCategoryView, AlgCaseView, CaseThumb, AlgPlayer, formula-tag helpers, and shared AlgCaseMeta; keep all formula-type badges neutral gray and the unfiltered menu option concise as All / 全部.
Store ETM as the first curated formula's execution count and store ETM*, HTM*, STM*, and ATM* as optimal metrics. ATM merges simultaneous parallel-layer turns; ETM only merges combinations that a person can execute together.
Run scripts/build_alg_migration.py with a state-verified mirror map; inspect the generated SQL before applying it.
Apply DB data changes in the next numbered migration, preserve unrelated rows, and synchronize the /dev/schema migration ledger without overwriting parallel edits.
Add parser, contract, UI, and migration regression tests; run targeted tests, client typecheck, migration validation, and desktop plus narrow-screen browser checks.
Update the tracker after every completed stage with concrete evidence and unresolved decisions.
Boundaries
Reject missing case numbers, duplicate case numbers, malformed five-number metric rows, unsupported arrows, and formulas left empty after green-text removal.
Preserve non-green inline styling as algHtml only through the existing safe algorithm-markup contract.
The main thumbnail, scramble, solution and player must share the case-level setup. Entry-level inverse setups are source metadata, never an independent starting state or proof that the entry belongs to the case. Preserve unresolved source text and report mismatches; relocate a misplaced entry only after its destination is verified, preserving its tags, markup and source fields. Relocation must not reduce the set's formula count.
Build meta.mirror from a state-verified M-plane mirror relation. Scramble arrows are unrelated and must not be reused as mirror links.
Require OLL mirror numbers to be unique, resolvable, and involutive; self-mirror cases point to themselves.
Do not import diagrams when the existing case sticker data already renders the same state.
Do not push unless the user explicitly asks or deployment is required by the repository policy.
Resources
scripts/extract_alg_docx.py: extract headings, paired cases, metrics, formulas, styles, icons, and arrow relations into JSON.
scripts/add_formula_setups.mts: normalize and invert each formula for source diagnostics; these inverse states must not override the public case in validation or playback.
scripts/build_alg_migration.py: generate the guarded, idempotent merge migration from extracted JSON and a verified mirror map.
references/import-contract.md: field, color, icon, ordering, deduplication, and handedness mapping.
Use this skill with your AI agent:Open on Skill Issue to copy, download, or add to your library.
Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.