Skill · Portfolio
디자인 포트폴리오 구성·첨삭
리서치·스케치·렌더·시제품 자료로 근거 있는 가로형 포트폴리오를 구성하고 첨삭하는 원작 스킬(산업디자인). 원작자 truman-t3, MIT.
0installs
industrial-design-portfolio/scripts/sync_adapters.py
#!/usr/bin/env python3"""Generate cross-agent instruction adapters from canonical SKILL.md."""from __future__ import annotationsimport argparseimport reimport sysfrom pathlib import PathHEADERS = { "AGENTS.md": ( "# Industrial Design Portfolio (Agent-neutral adapter)\n\n" "> Generated from `SKILL.md`. Use the native Skill package when supported. " "Do not edit this file directly.\n\n" ), "CLAUDE.md": ( "# Industrial Design Portfolio (Claude Code adapter)\n\n" "> Generated from `SKILL.md`. Prefer `.claude/skills/industrial-design-portfolio/` " "for on-demand loading. Do not edit this file directly.\n\n" ), "GEMINI.md": ( "# Industrial Design Portfolio (Gemini CLI adapter)\n\n" "> Generated from `SKILL.md`. Prefer `.gemini/skills/industrial-design-portfolio/` " "for on-demand loading. Do not edit this file directly.\n\n" ),}def skill_body(text: str) -> str: match = re.match(r"\A---\s*\n.*?\n---\s*\n", text, re.S) if not match: raise ValueError("SKILL.md is missing valid YAML frontmatter boundaries") return text[match.end() :].lstrip()def render(root: Path) -> dict[str, str]: source = (root / "SKILL.md").read_text(encoding="utf-8") body = skill_body(source) return {name: header + body for name, header in HEADERS.items()}def main() -> int: parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("--check", action="store_true", help="Fail when adapters are missing or stale") args = parser.parse_args() root = Path(__file__).resolve().parent.parent expected = render(root) stale: list[str] = [] for name, content in expected.items(): path = root / name if args.check: if not path.is_file() or path.read_text(encoding="utf-8") != content: stale.append(name) else: path.write_text(content, encoding="utf-8", newline="\n") print(f"updated {name}") if stale: print("stale adapters: " + ", ".join(stale)) return 1 if args.check: print("adapters are synchronized") return 0if __name__ == "__main__": sys.exit(main())