Skip to content

feat: migrate images to assets repo, add MakerWorld extract/publish tooling#337

Merged
kellervater merged 7 commits intomainfrom
feat/sync-instructions-dynamic-discovery
Apr 13, 2026
Merged

feat: migrate images to assets repo, add MakerWorld extract/publish tooling#337
kellervater merged 7 commits intomainfrom
feat/sync-instructions-dynamic-discovery

Conversation

@kellervater
Copy link
Copy Markdown
Member

@kellervater kellervater commented Apr 13, 2026

📦 What

  • 🖼️ Migrate all images to kellerlabs/assets repo
  • 📁 Restructure auto-gen PNGs into renders/ subfolders
  • 🌐 Add MakerWorld description extract/publish tooling (md-to-mw.py, SKILL.md)
  • 📝 Extract Core model DESCRIPTION.md with WYSIWYG HTML formatting
  • 📋 Create ADR-001 and MakerWorld workflow guide

💡 Why

  • Images bloat git history — every change/optimization permanently grows clone size
  • MakerWorld descriptions should be versioned and reviewable in git
  • Dual licensing (CC BY-SA vs source-available) needs separate image hosting
  • See ADR-001

🔧 How

Images: All refs now use https://raw.githubusercontent.com/kellerlabs/assets/main/homeracker/... absolute URLs. Auto-gen render PNGs stay in source repos under renders/ dirs.

MakerWorld workflow:

  1. Extract: #makerworld-description Copilot skill scrapes a MakerWorld page → DESCRIPTION.md + images to assets repo
  2. Publish: python cmd/export/md-to-mw.py models/<name>/makerworld/DESCRIPTION.md → HTML → paste into MakerWorld

DESCRIPTION.md format:

  • <img> tags with width (no height) for proper scaling
  • <h2 style="text-align: center"> / <p style="text-align: center"> for centered elements
  • YouTube linked thumbnails → auto-converted to CKEditor embeds by md-to-mw.py

Security fixes (from review):

  • 🔒 strip_frontmatter(): robust regex instead of naive text.find("---", 3)
  • 🔒 embed_local_images(): path traversal guard via is_relative_to()

⚠️ Cross-repo: requires kellerlabs/assets for images. Maintainers push to assets/main; outside collaborators open PRs.

Replace hardcoded file list with GitHub API discovery for
.github/instructions/*.instructions.md. New instruction files
are now synced automatically without script changes.
- URL-encode ref parameter with --data-urlencode
- Filter in jq with type guard instead of grep
- Add empty-line guard in while loop
- Use GITHUB_TOKEN for auth when available
- Document jq and GITHUB_TOKEN requirements in README
…ooling

- Move all manually-created images to kellerlabs/assets repo
- Restructure auto-gen PNGs into renders/ subfolders
- Add md-to-mw.py script and makerworld-description skill
- Extract Core model DESCRIPTION.md as first implementation
- Add ADR-001, MakerWorld workflow guide, assets repo policy
- Update all README image refs to absolute assets URLs
- Block image extensions in gitignore, whitelist renders/
Copilot AI review requested due to automatic review settings April 13, 2026 14:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restructures image handling to reduce git history bloat by moving manually-created images to a dedicated kellerlabs/assets repo, while keeping auto-generated preview renders tracked locally under renders/. Also adds tooling + docs to manage MakerWorld descriptions as git-tracked DESCRIPTION.md and convert them into CKEditor-friendly HTML for publishing.

Changes:

  • Migrated README/doc image references to raw.githubusercontent.com/kellerlabs/assets/... and introduced a repo-wide image ignore/whitelist strategy (**/renders/*.png + favicon.ico).
  • Updated export-png.sh and model READMEs to use renders/<name>.png paths for preview images.
  • Added cmd/export/md-to-mw.py, MakerWorld workflow docs, a Copilot skill doc, and an initial models/core/makerworld/DESCRIPTION.md.

Reviewed changes

Copilot reviewed 25 out of 65 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
requirements.txt Adds markdown dependency for the new MakerWorld conversion script.
README.md Updates image references to the assets repo.
.gitignore Ignores all image extensions by default; whitelists **/renders/*.png and favicon.ico; ignores generated DESCRIPTION.html.
.pre-commit-config.yaml Updates kellerlabs hooks rev; adds optimize-images; keeps flatten validation.
cmd/export/export-png.sh Writes PNG output into a renders/ subfolder next to the input .scad.
cmd/export/README.md Updates documentation to reflect renders/ output path.
cmd/export/md-to-mw.py New script to convert DESCRIPTION.md → pasteable MakerWorld HTML (embed local images, YouTube embed conversion).
docs/makerworld-workflow.md Documents extract/edit/publish workflow for MakerWorld descriptions.
docs/decisions/ADR-001-image-hosting-assets-repo.md ADR formalizing image hosting move to kellerlabs/assets + gitignore policy.
.github/skills/makerworld-description/SKILL.md New Copilot skill documentation for extracting/publishing MakerWorld descriptions.
.github/instructions/openscad.instructions.md Updates preview PNG guidance to use renders/ subfolders.
.github/copilot-instructions.md Adds assets policy + ADR policy guidance.
.github/agents/model-polish.agent.md Updates model-polish agent instructions to reference parts/renders/.
.github/actions/sync-instructions/sync-instructions.sh Dynamically discovers .instructions.md files via GitHub API before syncing.
.github/actions/sync-instructions/README.md Documents dynamic discovery + optional GITHUB_TOKEN usage.
models/README.md Updates model index preview paths to parts/renders/*.png; documents parts/renders/ convention.
models/core/README.md Updates preview paths to parts/renders/*.png.
models/core/makerworld/DESCRIPTION.md Adds initial git-tracked MakerWorld description source for Core.
models/flexmount/README.md Updates preview path to renders/flexmount.png.
models/wallmount/README.md Updates preview path to parts/renders/wallmount.png.
models/sleeve/README.md Updates preview path to parts/renders/sleeve.png.
models/rackmount_ears/README.md Updates preview paths to parts/renders/*.png.
models/racklink/README.md Updates preview path to parts/renders/racklink.png.
models/pinpusher/README.md Updates preview path to parts/renders/pinpusher.png.
models/inception/README.md Updates preview paths to parts/renders/supportbin.png / supportgrid.png.
models/gridfinity/README.md Updates preview paths to parts/renders/baseplate.png / binbase.png.
models/foot/README.md Updates preview path to parts/renders/foot.png.
models/sleeve/parts/renders/sleeve.png Adds/relocates generated preview render under whitelisted renders/.
models/racklink/parts/renders/racklink.png Adds/relocates generated preview render under whitelisted renders/.
models/pinpusher/parts/renders/pinpusher.png Adds/relocates generated preview render under whitelisted renders/.
models/inception/parts/renders/supportgrid.png Adds/relocates generated preview render under whitelisted renders/.
models/gridfinity/parts/renders/binbase.png Adds/relocates generated preview render under whitelisted renders/.
models/foot/parts/renders/foot.png Adds/relocates generated preview render under whitelisted renders/.
models/core/parts/renders/support.png Adds/relocates generated preview render under whitelisted renders/.
models/core/parts/renders/lockpin.png Adds/relocates generated preview render under whitelisted renders/.

Comment thread cmd/export/md-to-mw.py Outdated
Comment thread cmd/export/md-to-mw.py
Comment thread docs/makerworld-workflow.md Outdated
Comment thread docs/decisions/ADR-001-image-hosting-assets-repo.md Outdated
- Use re.match with DOTALL for robust frontmatter stripping
- Add path traversal guard in embed_local_images
- Add Why section to makerworld-workflow.md
- Fix ADR-001 date typo (2025 -> 2026)
- Switch DESCRIPTION.md images to <img> tags with width attribute
- Use inline HTML blocks for centered headings/paragraphs
- Omit height so images scale proportionally
- Update SKILL.md extraction instructions accordingly
- Update makerworld-workflow.md formatting section
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 25 out of 65 changed files in this pull request and generated 6 comments.

Comment thread cmd/export/md-to-mw.py
Comment thread cmd/export/md-to-mw.py
Comment thread docs/makerworld-workflow.md
Comment thread models/core/makerworld/DESCRIPTION.md
Comment thread models/core/makerworld/DESCRIPTION.md
Comment thread models/core/makerworld/DESCRIPTION.md Outdated
- remove duplicate padding-bottom in convert_youtube_embeds()
- revert h[1-6] in closing-tag regex (causes double spacing in CKEditor)
- add pip install -r requirements.txt to makerworld-workflow.md
- update kellervater→kellerlabs links in DESCRIPTION.md
- center community section elements, convert meme to img tag
- auto-append generated-by footer linking to workflow docs
- document alignment as known limitation in extraction skill
@kellervater kellervater merged commit 5d9da76 into main Apr 13, 2026
2 checks passed
@kellervater kellervater deleted the feat/sync-instructions-dynamic-discovery branch April 13, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants