Skip to content

anbeime/skill / skills/cy-carousel-skill/cy-carousel-skill

cy-carousel

Verified

制作 AI 科技类小红书图文轮播(封面+10张内页,1440×1920,暗底或浅色纸底,电子青强调色):讲一个 AI 概念、一篇论文或一个产品,体裁是「AI 学习笔记」。查证一手出处、找开放授权素材(论文原文、真实截图、人物照),用 scripts/手排.py 照 ELIZA 的做法逐页手排(毛笔双色标题、原文纸条放大加红圈、电子青大数字、问句贴条),再用 render.py 渲染、check_all.py 检查、package.py 打包。用户要做 AI/科技/论文/产品类图文,或复用、精修这类轮播时使用。

FileKindSize
.github/ISSUE_TEMPLATE/bug_report.ymlconfig1.4 KB
.github/ISSUE_TEMPLATE/config.ymlconfig27 B
.github/ISSUE_TEMPLATE/feature_request.ymlconfig932 B
.github/agent/implement.mdmarkdown1.9 KB
.github/agent/review.mdmarkdown1.5 KB
.github/agent/triage.mdmarkdown2.9 KB
.github/labels.jsonconfig2.2 KB
.github/pull_request_template.mdmarkdown409 B
.github/scripts/apply_triage.pyscript6.4 KB
.github/scripts/dump_issue.shscript509 B
.github/scripts/intake_feedback.pyscript4.0 KB
.github/scripts/open_agent_pr.shscript3.8 KB
.github/workflows/agent-cleanup.ymlconfig1.9 KB
.github/workflows/agent-implement.ymlconfig4.5 KB
.github/workflows/agent-review.ymlconfig2.8 KB
.github/workflows/agent-triage.ymlconfig4.6 KB
.github/workflows/claude.ymlconfig2.9 KB
.github/workflows/feedback-intake.ymlconfig2.0 KB
.github/workflows/sync-labels.ymlconfig798 B
.github/workflows/validate.ymlconfig1.1 KB
.gitignoreother65 B
CLAUDE.mdmarkdown2.3 KB
LICENSEother1.2 KB
README.mdmarkdown10.6 KB
SKILL.mdskill md9.7 KB
assets/banner.jpgbinary422.3 KB
assets/fonts/LXGWWenKai-Medium.ttfbinary24.2 MB
assets/fonts/MaShanZheng-Regular.ttfbinary5.6 MB
assets/fonts/NotoSansSC[wght].ttfbinary16.9 MB
assets/fonts/NotoSerifSC[wght].ttfbinary24.0 MB
assets/fonts/README.mdmarkdown677 B
assets/fonts/licensed/README.mdmarkdown1.0 KB
assets/fonts/lxgwwenkai-OFL.txtmarkdown5.0 KB
assets/fonts/mashanzheng-OFL.txtmarkdown4.3 KB
assets/fonts/notosanssc-OFL.txtmarkdown4.3 KB
assets/fonts/notoserifsc-OFL.txtmarkdown4.2 KB
assets/fonts/来源与许可证.jsonconfig1.3 KB
docs/agent-workflow.mdmarkdown7.8 KB
examples/01-ELIZA/README.mdmarkdown846 B
examples/01-ELIZA/全套预览.jpgbinary408.3 KB
examples/01-ELIZA/标题.txtmarkdown67 B
examples/01-ELIZA/正文.txtmarkdown1.7 KB
examples/02-Dots/README.mdmarkdown875 B
examples/02-Dots/全套预览.jpgbinary408.9 KB
examples/02-Dots/标题.txtmarkdown69 B
examples/02-Dots/正文.txtmarkdown1.8 KB
examples/03-聪明汉斯/README.mdmarkdown1.1 KB
examples/03-聪明汉斯/全套预览.jpgbinary450.1 KB
examples/03-聪明汉斯/制作.pyscript14.2 KB
examples/04-AI幻觉/README.mdmarkdown1.4 KB
examples/04-AI幻觉/全套预览.jpgbinary668.3 KB
examples/04-AI幻觉/制作.pyscript12.7 KB
examples/04-AI幻觉/标题.txtmarkdown131 B
examples/04-AI幻觉/正文.txtmarkdown1010 B
references/排字细节.mdmarkdown6.9 KB
requirements.txtmanifest91 B
scripts/blind_test.pyscript3.6 KB
scripts/build.pyscript43.6 KB
scripts/check_all.pyscript13.3 KB
scripts/cutout.swiftscript858 B
scripts/emoji.swiftscript1.6 KB
scripts/io_paths.pyscript1.0 KB
scripts/layouts_v2.pyscript67.0 KB
scripts/ocr.swiftscript1.3 KB
scripts/ocrfind.swiftscript1.3 KB
scripts/package.pyscript4.0 KB
scripts/render.pyscript47.9 KB
scripts/保脸裁切.pyscript2.1 KB
scripts/图像等比.pyscript3.2 KB
scripts/对照.pyscript12.3 KB
scripts/手排.pyscript26.9 KB
scripts/检测人脸.swiftscript935 B
scripts/浅色排版.pyscript10.3 KB
scripts/验证排版.pyscript23.8 KB
scripts/验证留白.pyscript1.4 KB
scripts/验证背景.pyscript17.5 KB
tests/test_agent_workflow.pyscript7.4 KB
tests/test_cache_and_config.pyscript6.1 KB
tests/test_cross_platform.pyscript5.1 KB
tests/test_render_smoke.pyscript3.8 KB
tests/test_strict_visual.pyscript10.6 KB
tests/test_strict_visual_integration.pyscript6.7 KB
tools/submit_feedback.pyscript2.6 KB
tools/validate_repo.pyscript4.5 KB

tests/test_cross_platform.py

View on GitHub
"""跨平台兼容测试:UTF-8 读写、OCR 延迟初始化、清单结构报错、打包缺文稿提示。"""

import json
import re
import subprocess
import sys
import tempfile
import unittest
from pathlib import Path
from unittest import mock

ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / "scripts"))

import 手排 as S  # noqa: E402
import check_all  # noqa: E402
import package  # noqa: E402


class Utf8Tests(unittest.TestCase):
    def test_scripts_do_not_use_default_encoding(self):
        # 内建 open() 与 Path.read_text/write_text;Image.open 等带点号的调用不在此列
        call = re.compile(r"((?<![\w.])open|\.read_text|\.write_text)\(([^()]*(?:\([^()]*\)[^()]*)*)\)")
        binary = re.compile(r"""['"][rwax+]*b[rwax+]*['"]""")
        for path in (ROOT / "scripts").glob("*.py"):
            for m in call.finditer(path.read_text(encoding="utf-8")):
                args = m.group(2)
                if "encoding=" in args:
                    continue
                if m.group(1) == "open" and binary.search(args):
                    continue
                self.fail(f"{path.name}: {m.group(0)} 缺少 encoding=")

    def test_write_script_uses_utf8(self):
        with tempfile.TemporaryDirectory() as td:
            S.init(td)
            S.pages[:] = []
            S.write_script("测试", "手排.py")
            raw = (Path(td) / "页面脚本.json").read_bytes()
            self.assertEqual(json.loads(raw.decode("utf-8"))["topic"], "测试")


class LazyOcrTests(unittest.TestCase):
    def test_init_does_not_call_swiftc(self):
        with tempfile.TemporaryDirectory() as td, mock.patch.object(S.subprocess, "run") as run:
            S.init(td)
            run.assert_not_called()

    def test_missing_swift_gives_clear_error(self):
        with tempfile.TemporaryDirectory() as td:
            missing = Path(td) / "bin/tool"
            with mock.patch.object(S.sys, "platform", "win32"):
                with self.assertRaisesRegex(RuntimeError, "macOS"):
                    S._ensure_tool(missing, "ocrfind.swift", "OCR 词框")


class ManifestTests(unittest.TestCase):
    def test_array_manifest_gives_friendly_error(self):
        with tempfile.TemporaryDirectory() as td:
            p = Path(td) / "素材清单.json"
            p.write_text(json.dumps([{"path": "a.png", "sha256": "x"}]), encoding="utf-8")
            with self.assertRaisesRegex(ValueError, "assets"):
                check_all.load_manifest(p)

    def test_valid_manifest(self):
        with tempfile.TemporaryDirectory() as td:
            p = Path(td) / "素材清单.json"
            p.write_text(json.dumps({"assets": [{"path": "a.png", "sha256": "x"}]}), encoding="utf-8")
            self.assertEqual(check_all.load_manifest(p), [{"path": "a.png", "sha256": "x"}])

    def test_visual_acceptance_never_claims_pass(self):
        self.assertIn("未验收", check_all.visual_acceptance([]))
        self.assertIn("3 条", check_all.visual_acceptance(["a", "b", "c"]))


class PackageTests(unittest.TestCase):
    def test_missing_manuscript_lists_required_files(self):
        with tempfile.TemporaryDirectory() as td:
            note = Path(td) / "note"
            note.mkdir()
            with mock.patch.object(package, "check_note", return_value={"passed": True, "scope": "x"}):
                with self.assertRaisesRegex(ValueError, "标题.txt.*正文.txt.*置顶评论.txt.*来源.md"):
                    package.deliver(note, Path(td) / "pages", Path(td) / "out")

    def test_cli_success_path(self):
        from PIL import Image

        with tempfile.TemporaryDirectory() as td:
            td = Path(td)
            note, pages, out = td / "note", td / "pages", td / "out"
            note.mkdir()
            pages.mkdir()
            (note / "页面脚本.json").write_text(
                json.dumps({"topic": "测试", "pages": [{}]}), encoding="utf-8")
            for name in ("标题.txt", "正文.txt", "置顶评论.txt", "来源.md"):
                (note / name).write_text("内容", encoding="utf-8")
            Image.new("RGB", (1440, 1920), "white").save(pages / "p01.png")
            # 只替换检查环节,其余走真实的 CLI 入口与打包流程
            code = (
                "import sys, runpy, check_all;"
                "check_all.check_note = lambda *a, **k: dict(passed=True, errors=[], scope='test',"
                " visual_acceptance='未验收', advisories=[]);"
                "sys.argv = ['package.py'] + sys.argv[1:];"
                "runpy.run_path('package.py', run_name='__main__')"
            )
            proc = subprocess.run(
                [sys.executable, "-c", code, "--note", str(note), "--pages", str(pages), "--out", str(out)],
                cwd=ROOT / "scripts", capture_output=True, encoding="utf-8")
            self.assertEqual(proc.returncode, 0, proc.stderr)
            result = json.loads(proc.stdout)
            self.assertIn("visual_acceptance", result)
            self.assertEqual(result["images"], 1)
            self.assertTrue((out / "交付清单.json").is_file())


if __name__ == "__main__":
    unittest.main()
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 197kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall