Skip to content

insightflo/edu-deck-skills / edu-deck

edu-deck

Flagged

Entry skill for education deck requests. Use FIRST when the user wants 교육자료, 강의 자료, 교육용 슬라이드, 직원 교육 덱, or a training series (예: "○○ 교육자료 만들어줘", "사내 교육 시리즈 만들어", "여러 편으로 나눠 교육 자료"). 판별 후 단일 발행(주제 하나, 파일 하나)이면 edu-deck-solo 경로를, 여러 편 시리즈·진도 관리·허브가 필요하면 edu-deck-series 경로를 탄다. 애매하면 사용자에게 한 번 묻는다. 덱 제작 절차는 이 스킬에 없고 각 하위 스킬에 있다.

FileKindSize
SKILL.mdskill md14.1 KB
distribution/NOTICES.mdmarkdown1.5 KB
distribution/README.mdmarkdown3.4 KB
distribution/USAGE.mdmarkdown5.5 KB
shared/assets/css/components.cssother23.2 KB
shared/assets/css/core.cssother15.1 KB
shared/assets/css/pack-runtime.cssother9.4 KB
shared/assets/css/responsive.cssother10.6 KB
shared/assets/css/theme-switch.cssother3.4 KB
shared/assets/css/themes.cssother11.2 KB
shared/assets/css/tokens.cssother2.5 KB
shared/assets/css/viewer.cssother17.5 KB
shared/assets/css/visual-motion.cssother19.3 KB
shared/assets/fonts/GowunBatang-Regular.woff2binary523.3 KB
shared/assets/fonts/GowunDodum-Regular.woff2binary435.5 KB
shared/assets/fonts/OFL-GowunBatang.txtmarkdown4.3 KB
shared/assets/fonts/OFL-GowunDodum.txtmarkdown4.3 KB
shared/assets/fonts/OFL.txtmarkdown4.3 KB
shared/assets/fonts/PretendardVariable.woff2binary2.0 MB
shared/assets/icons/base.svgother9.3 KB
shared/assets/icons/extra.svgother18.4 KB
shared/assets/icons/si.svgother7.6 KB
shared/assets/js/cover-art.jsscript82.9 KB
shared/assets/js/motion.jsscript84.4 KB
shared/assets/js/patterns.jsscript7.2 KB
shared/assets/js/responsive.jsscript21.6 KB
shared/assets/js/sheet.jsscript1.5 KB
shared/assets/js/study.jsscript33.6 KB
shared/assets/js/talk.jsscript9.2 KB
shared/assets/js/themes.jsscript7.8 KB
shared/assets/js/viewer.jsscript29.1 KB
shared/assets/kit/patterns.cssother5.4 KB
shared/assets/kit/stack.jsscript15.8 KB
shared/assets/pack-shell.htmlother2.9 MB
shared/assets/packs/atlas/style.cssother1.7 KB
shared/assets/packs/atlas/template.htmlother2.1 KB
shared/assets/packs/base.cssother2.2 KB
shared/assets/packs/briefing/style.cssother1.4 KB
shared/assets/packs/briefing/template.htmlother1.7 KB
shared/assets/packs/casebook/style.cssother1.4 KB
shared/assets/packs/casebook/template.htmlother1.5 KB
shared/assets/packs/catalog.jsonconfig10.3 KB
shared/assets/packs/editorial/style.cssother1.2 KB
shared/assets/packs/editorial/template.htmlother2.0 KB
shared/assets/packs/field/style.cssother1.5 KB
shared/assets/packs/field/template.htmlother1.6 KB
shared/assets/packs/flows.jsonconfig21.8 KB
shared/assets/packs/lab/style.cssother1.4 KB
shared/assets/packs/lab/template.htmlother1.6 KB
shared/assets/packs/seminar/style.cssother1.4 KB
shared/assets/packs/seminar/template.htmlother1.7 KB
shared/assets/packs/workbook/style.cssother1.6 KB
shared/assets/packs/workbook/template.htmlother1.7 KB
shared/assets/shell.htmlother2.9 MB
shared/assets/snippets/01-cover-bauhaus.htmlother3.3 KB
shared/assets/snippets/01-cover-bento.htmlother6.7 KB
shared/assets/snippets/01-cover-bigstat.htmlother2.3 KB
shared/assets/snippets/01-cover-blueprint.htmlother4.3 KB
shared/assets/snippets/01-cover-bold-poster.htmlother3.4 KB
shared/assets/snippets/01-cover-center.htmlother2.5 KB
shared/assets/snippets/01-cover-diagram.htmlother2.4 KB
shared/assets/snippets/01-cover-editorial-lab.htmlother3.6 KB
shared/assets/snippets/01-cover-future-portal.htmlother3.6 KB
shared/assets/snippets/01-cover-learning-path.htmlother3.7 KB
shared/assets/snippets/01-cover-modular-cards.htmlother3.9 KB
shared/assets/snippets/01-cover-monograph.htmlother3.1 KB
shared/assets/snippets/01-cover-mosaic.htmlother2.4 KB
shared/assets/snippets/01-cover-paper-collage.htmlother3.1 KB
shared/assets/snippets/01-cover-split.htmlother2.8 KB
shared/assets/snippets/01-cover-stripes.htmlother2.4 KB
shared/assets/snippets/01-cover-workbook-notes.htmlother3.8 KB
shared/assets/snippets/02-agenda.htmlother21.2 KB
shared/assets/snippets/03-timeline.htmlother14.2 KB
shared/assets/snippets/04-map.htmlother16.3 KB
shared/assets/snippets/05-mechanism.htmlother14.5 KB
shared/assets/snippets/06-traits-grid.htmlother16.9 KB
shared/assets/snippets/07-meter.htmlother17.1 KB
shared/assets/snippets/08-compare-2.htmlother18.2 KB
shared/assets/snippets/09-compare-table.htmlother16.0 KB
shared/assets/snippets/10-hub.htmlother15.1 KB
shared/assets/snippets/11-levels.htmlother15.1 KB
shared/assets/snippets/12-tile-grid.htmlother12.3 KB
shared/assets/snippets/13-sequence.htmlother15.0 KB
shared/assets/snippets/14-mapping.htmlother13.7 KB
shared/assets/snippets/15-mock-legend.htmlother11.2 KB
shared/assets/snippets/16-mock-options.htmlother10.5 KB
shared/assets/snippets/17-statement.htmlother7.5 KB
shared/assets/snippets/18-build-up.htmlother14.0 KB
shared/assets/snippets/19-frame-form.htmlother9.2 KB
shared/assets/snippets/20-before-after.htmlother13.6 KB
shared/assets/snippets/21-worked-example.htmlother16.5 KB
shared/assets/snippets/22-worked-artifact.htmlother9.2 KB
shared/assets/snippets/23-quiz-ab.htmlother7.1 KB
shared/assets/snippets/24-quiz-sort.htmlother8.0 KB
shared/assets/snippets/25-quiz-ox.htmlother6.9 KB
shared/assets/snippets/26-rules-dark.htmlother13.7 KB
shared/assets/snippets/27-checklist.htmlother8.3 KB
shared/assets/snippets/28-sources.htmlother9.8 KB
shared/assets/snippets/29-closing.htmlother6.0 KB
shared/assets/snippets/30-check.htmlother10.3 KB
shared/assets/snippets/31-stat-strip.htmlother11.4 KB
shared/assets/snippets/32-screen-cite.htmlother14.1 KB
shared/assets/snippets/33-chart-bar.htmlother17.0 KB
shared/assets/snippets/34-chart-line.htmlother17.9 KB
shared/assets/snippets/35-explore.htmlother9.6 KB
shared/assets/snippets/36-detail-sheet.htmlother9.9 KB
shared/assets/snippets/37-arch-flow.htmlother17.2 KB
shared/assets/snippets/38-part-divider.htmlother7.0 KB
shared/assets/snippets/39-quadrant.htmlother10.0 KB
shared/assets/snippets/40-flashcards.htmlother12.4 KB
shared/assets/snippets/41-ops-report.htmlother22.8 KB
shared/assets/snippets/42-sankey-flow.htmlother9.7 KB
shared/assets/snippets/43-decision-tree.htmlother8.7 KB
shared/assets/snippets/44-kanban-board.htmlother9.4 KB
shared/assets/snippets/45-version-graph.htmlother8.9 KB
shared/assets/snippets/46-event-fanout.htmlother8.1 KB
shared/assets/snippets/47-route-tour.htmlother9.3 KB
shared/assets/snippets/48-waterfall.htmlother7.9 KB
shared/assets/snippets/49-mesh-network.htmlother7.8 KB
shared/assets/snippets/50-heatmap-grid.htmlother11.9 KB
shared/assets/snippets/51-swimlane.htmlother8.2 KB
shared/assets/snippets/52-cycle-ring.htmlother7.1 KB
shared/assets/snippets/53-verdict.htmlother6.9 KB
shared/assets/snippets/54-diagnose.htmlother3.0 KB
shared/assets/snippets/55-window-frame.htmlother3.3 KB
shared/assets/snippets/56-gate-chain.htmlother5.6 KB
shared/assets/snippets/patterns/code.htmlother1.2 KB
shared/assets/snippets/patterns/faq.htmlother839 B
shared/assets/snippets/patterns/fx.htmlother2.8 KB
shared/assets/snippets/patterns/pin-shot.htmlother1.5 KB
shared/assets/snippets/patterns/tabs.htmlother1.1 KB
shared/assets/style-sheets/README.mdmarkdown1.7 KB
shared/assets/style-sheets/previews/clean-professional.pngbinary1.4 MB
shared/assets/style-sheets/previews/creative-magazine.pngbinary2.1 MB
shared/assets/style-sheets/previews/data-dashboard.pngbinary1.3 MB
shared/assets/style-sheets/previews/e-ink-magazine.pngbinary2.4 MB
shared/assets/style-sheets/previews/handdrawn-technical.pngbinary2.0 MB
shared/assets/style-sheets/previews/handdrawn-whiteboard.pngbinary1.9 MB
shared/assets/style-sheets/previews/mckinsey-style.pngbinary1.7 MB
shared/assets/style-sheets/previews/party-government-red.pngbinary1.5 MB
shared/assets/style-sheets/previews/retro-flat-illustration.pngbinary2.3 MB
shared/assets/style-sheets/previews/scientific-defense.pngbinary1.4 MB
shared/assets/style-sheets/previews/teaching-courseware.pngbinary1.4 MB
shared/assets/style-sheets/previews/warm-handmade.pngbinary2.3 MB
shared/assets/style-sheets/党政红风格.mdmarkdown8.5 KB
shared/assets/style-sheets/创意杂志风.mdmarkdown3.3 KB
shared/assets/style-sheets/复古扁平插画风.mdmarkdown3.3 KB
shared/assets/style-sheets/手绘技术解释风.mdmarkdown4.7 KB
shared/assets/style-sheets/手绘白板风.mdmarkdown3.3 KB
shared/assets/style-sheets/教学课件风.mdmarkdown9.7 KB
shared/assets/style-sheets/数据仪表盘风.mdmarkdown3.4 KB
shared/assets/style-sheets/清爽专业风.mdmarkdown4.4 KB
shared/assets/style-sheets/温暖手工风.mdmarkdown3.3 KB
shared/assets/style-sheets/电子墨水杂志风.mdmarkdown4.6 KB
shared/assets/style-sheets/科研答辩风.mdmarkdown9.1 KB
shared/assets/style-sheets/麦肯锡风格.mdmarkdown14.8 KB
shared/dev/README.mdmarkdown12.7 KB
shared/dev/crayon-reference.htmlother19.1 KB
shared/dev/defect_test.pyscript5.7 KB
shared/dev/fill_test.pyscript3.4 KB
shared/dev/make_icons.pyscript10.0 KB
shared/dev/make_snippets.pyscript16.0 KB
shared/dev/pack_shell_template.htmlother35.7 KB
shared/dev/port.pyscript1.5 KB
shared/dev/shell_template.htmlother61.0 KB
shared/dev/test_absorb_snippets.pyscript5.5 KB
shared/dev/test_arch_lanes.pyscript12.0 KB
shared/dev/test_arch_si.pyscript17.5 KB
shared/dev/test_arch_trace.pyscript5.6 KB
shared/dev/test_check_talk_est.pyscript4.1 KB
shared/dev/test_chrome_menu.pyscript13.2 KB
shared/dev/test_consult_chart.pyscript35.9 KB
shared/dev/test_consult_regen.pyscript3.5 KB
shared/dev/test_consulting_check.pyscript7.4 KB
shared/dev/test_contrast_backdrop.pyscript8.6 KB
shared/dev/test_contrast_matrix.pyscript9.2 KB
shared/dev/test_cover_art.pyscript10.7 KB
shared/dev/test_cover_custom.pyscript10.8 KB
shared/dev/test_cover_rework.pyscript8.3 KB
shared/dev/test_dblclick_finish.pyscript6.5 KB
shared/dev/test_diagram_variants.pyscript13.8 KB
shared/dev/test_extract_copy.pyscript7.3 KB
shared/dev/test_extract_style.pyscript13.8 KB
shared/dev/test_figslot.pyscript14.0 KB
shared/dev/test_final_gate.pyscript2.5 KB
shared/dev/test_flint_model.pyscript5.5 KB
shared/dev/test_flint_theme.pyscript4.6 KB
shared/dev/test_free_mode.pyscript10.7 KB
shared/dev/test_fx_absorb.pyscript13.8 KB
shared/dev/test_fx_draft.pyscript38.0 KB
shared/dev/test_fx_patterns.pyscript16.8 KB
shared/dev/test_key_motion.pyscript9.3 KB
shared/dev/test_koboyo_icons.pyscript8.6 KB
shared/dev/test_miniflow.pyscript11.7 KB
shared/dev/test_motion_techniques.pyscript11.9 KB
shared/dev/test_ops_report.pyscript11.4 KB
shared/dev/test_pack_browser.pyscript15.7 KB
shared/dev/test_pack_checker.pyscript10.1 KB
shared/dev/test_pack_icons.pyscript6.5 KB
shared/dev/test_pack_router.pyscript5.1 KB

shared/dev/test_fx_patterns.py

View on GitHub
"""Acceptance: data-fx effects and authoring patterns (.code/.tabs/.faq/.pin-shot).

Builds a temporary deck into /tmp and drives real Chromium (channel='chrome'):
every fx fires an animation at its reveal moment and settles on the authored
final DOM/text/position; static modes (reduced motion, body.st-self, print
emulation) show the final state immediately; back-navigation never replays;
patterns behave without advancing the deck; check_deck reports the new rules.
"""
import sys, unittest
from pathlib import Path
from playwright.sync_api import sync_playwright
from bs4 import BeautifulSoup

S = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(S / 'scripts'))
from build_deck import build
from check_deck import launch, Report, static_checks

OUT = Path('/tmp/edudeck-fx-pat')
SRC = OUT / 'src'
NOTES = ('이 장에서는 시험용 내용을 차근차근 확인합니다. 발표 중에는 단계를 넘기며 '
         '각 요소가 정해진 순서에 드러나고, 자습 모드에서는 최종 상태만 보입니다. '
         '아래 설명을 따라 진행하면 됩니다. 추가 설명을 조금 더 덧붙입니다. ')

IMG1PX = ('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJ'
          'AAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==')

SLIDES = {
'01-cover.html': '''<section class="slide" data-archetype="cover">
  <div class="cx-inner"><p class="cx-eyebrow">시험</p><h2 class="cx-title">모션과 패턴 시험</h2></div>
  <aside class="notes">''' + NOTES + '''</aside></section>''',

'02-fx.html': '''<section class="slide" data-archetype="statement">
  <div class="head"><p class="eyebrow">모션 시험</p><h2 class="title">여덟 효과 점검</h2></div>
  <div class="big" style="font-size:64px">효과를 지켜봅니다</div>
  <p class="body" style="font-size:30px">기존 <s data-fx="strike">3일</s> 걸리던 일이
    <b data-fx="count" data-from="72">4</b>시간으로 줄고, 핵심은
    <span data-fx="mark">한 번의 확인</span>입니다.
    <span class="stamp ok" data-fx="stamp">통과</span>
    <span class="kbd" data-fx="press">Enter</span> 로 완료합니다.</p>
  <p class="body" data-fx="travel" style="--dx:-200px;font-size:28px">travel 문장이 자리로 들어옵니다.</p>
  <p class="body" data-fx="block" style="--dx:-200px;font-size:28px">block 문장이 벽에 부딪힙니다.</p>
  <p class="body" data-fx="type" data-fx-speed="30" style="font-size:28px">타자처럼 한 자씩 드러납니다.</p>
  <p class="body" style="font-size:28px"><span data-step="1" data-fx="strike" id="fx-step">단계 1에서 그어지는 선</span></p>
  <aside class="notes">''' + NOTES + '''</aside></section>''',

'03-patterns.html': '''<section class="slide" data-archetype="worked-example">
  <div class="head"><p class="eyebrow">패턴 시험</p><h2 class="title">도구 패턴 모음</h2></div>
  <div class="row" style="flex:1;min-height:0">
    <div class="col f1" style="display:flex;flex-direction:column;gap:24px">
      <div class="code">
        <div class="code-head"><span>터미널</span><button type="button" class="code-copy">복사</button></div>
<pre><span class="p">$ </span>python3 build.py
<span class="out">OK done</span>
<span class="p">$ </span>python3 check.py
<span class="c"># 이 주석은 복사되지 않는다</span></pre>
      </div>
      <div class="faq">
        <details><summary>질문 하나입니다</summary><p>첫 번째 답변입니다.</p></details>
        <details><summary>질문 둘입니다</summary><p>두 번째 답변입니다.</p></details>
      </div>
      <button type="button" class="go" data-go="4" data-tab="2">다음 장 2번 탭으로</button>
    </div>
    <div class="col f1" style="display:flex;flex-direction:column;gap:24px">
      <div class="tabs">
        <div class="tab-bar"><button>① 첫 탭</button><button>② 둘째 탭</button></div>
        <div class="tab-pane"><p class="body">첫 탭 내용입니다.</p></div>
        <div class="tab-pane"><p class="body">둘째 탭 내용입니다.</p></div>
      </div>
      <figure class="pin-shot">
        <div class="pin-frame"><img src="''' + IMG1PX + '''" alt="시험용 화면 이미지">
          <button type="button" class="pin" data-k="1" style="left:30%;top:30%">1</button>
          <button type="button" class="pin" data-k="2" style="left:65%;top:60%">2</button>
        </div>
      </figure>
      <ol class="pin-list"><li data-k="1">첫 지점 설명입니다</li><li data-k="2">둘째 지점 설명입니다</li></ol>
    </div>
  </div>
  <aside class="notes">''' + NOTES + '''</aside></section>''',

'04-tabs2.html': '''<section class="slide" data-archetype="worked-example">
  <div class="head"><p class="eyebrow">연결 시험</p><h2 class="title">탭 두 개 더</h2></div>
  <div class="tabs">
    <div class="tab-bar"><button>① 가나다</button><button>② 라마바</button></div>
    <div class="tab-pane"><p class="body">가나다 탭입니다.</p></div>
    <div class="tab-pane"><p class="body">라마바 탭입니다.</p></div>
  </div>
  <aside class="notes">''' + NOTES + '''</aside></section>''',

'05-checker.html': '''<section class="slide" data-archetype="statement">
  <div class="head"><p class="eyebrow">검사 시험</p><h2 class="title">검사기 규칙 확인</h2></div>
  <p class="body" style="font-size:28px"><span data-fx="spin">알 수 없는 효과</span></p>
  <p class="body" style="font-size:28px"><span data-fx="mark" data-crayon="underline">효과와 크레파스 중복</span></p>
  <p class="body" style="font-size:28px"><span data-fx="type" data-fx-at="2600">늦게 시작하는 타자</span></p>
  <p class="body" style="font-size:28px">The quick brown fox jumps over the lazy dog quickly again.</p>
  <figure class="pin-shot"><div class="pin-frame"><img src="https://example.com/shot.png" alt="외부 이미지">
    <button type="button" class="pin" data-k="1" style="left:10%;top:10%">1</button></div></figure>
  <ol class="pin-list"><li data-k="1">외부 주소는 허용하지 않습니다</li></ol>
  <aside class="notes">''' + NOTES + '''</aside></section>''',

'06-korean.html': '''<section class="slide" data-archetype="statement">
  <div class="head"><p class="eyebrow">문장 시험</p><h2 class="title">한국어 문장 속 이름</h2></div>
  <p class="body" style="font-size:30px">Claude Code 와 MCP 서버 설정은 환경 변수로 관리하고, API 키는 별도 보관함에 둡니다.</p>
  <aside class="notes">''' + NOTES + '''</aside></section>''',

'07-closing.html': '''<section class="slide" data-archetype="closing">
  <div class="head"><h2 class="title">마침</h2></div><p class="body">시험을 마칩니다.</p>
  <aside class="notes">''' + NOTES + '''</aside></section>''',
}


def anims(page, sel):
    return page.evaluate(
        "(s)=>{const e=document.querySelector(s);return e?e.getAnimations({subtree:true}).length:0;}", sel)


class FxPatterns(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        SRC.mkdir(parents=True, exist_ok=True)
        srcs = []
        for name, html in sorted(SLIDES.items()):
            p = SRC / name
            p.write_text(html, encoding='utf-8')
            srcs.append(p)
        cls.html = OUT / 'deck.html'
        build('모션·패턴 시험', srcs, [S / 'assets/css'], [S / 'assets/icons'], cls.html)
        cls.pw = sync_playwright().start()
        cls.browser = launch(cls.pw)

    @classmethod
    def tearDownClass(cls):
        cls.browser.close(); cls.pw.stop()

    def page(self, reduced=False):
        c = self.browser.new_context(
            viewport={'width': 1920, 'height': 1080},
            reduced_motion='reduce' if reduced else 'no-preference')
        self.addCleanup(c.close)
        p = c.new_page()
        p.goto(self.html.as_uri())
        p.evaluate('document.fonts.ready')
        return p

    # ---------- B: data-fx ----------
    def test_fx_fire_at_reveal(self):
        p = self.page()
        p.evaluate('deckGo(1,0)')
        p.wait_for_timeout(80)
        for sel in ('[data-fx="strike"]', '[data-fx="mark"]', '[data-fx="stamp"]',
                    '[data-fx="travel"]', '[data-fx="block"]', '[data-fx="press"]',
                    '[data-fx="type"]'):
            self.assertGreater(anims(p, f'.slide.active {sel}'), 0, sel)
        # count 타자(count/type)는 요소 상태로 발화를 본다
        self.assertTrue(p.evaluate(
            "document.querySelector('.slide.active [data-fx=type] .ed-fx-ch')!=null"))
        cnt = p.evaluate("document.querySelector('.slide.active [data-fx=count]').textContent")
        self.assertNotEqual(cnt, '4')
        # step 가림 요소는 아직 발화하지 않는다
        self.assertIsNone(p.evaluate(
            "document.querySelector('#fx-step .ed-fx-strike')"))
        self.assertEqual(anims(p, '#fx-step'), 0)
        # 단계를 넘기면 그때 발화한다
        p.evaluate('deckGo(1,1)')
        p.wait_for_timeout(80)
        self.assertIsNotNone(p.evaluate(
            "document.querySelector('#fx-step .ed-fx-strike')"))

    def test_fx_settle_on_final(self):
        p = self.page()
        p.evaluate('deckGo(1,1)')
        p.wait_for_timeout(2600)
        ok = p.evaluate('''()=>{
          const s=document.querySelector('.slide.active');
          const out={};
          out.countText=s.querySelector('[data-fx=count]').textContent==='4';
          out.typeText=s.querySelector('[data-fx=type]').textContent==='타자처럼 한 자씩 드러납니다.';
          out.noChars=!s.querySelector('.ed-fx-ch');
          out.strike=!!s.querySelector('[data-fx=strike]>.ed-fx-strike');
          out.mark=!!s.querySelector('[data-fx=mark]>.ed-fx-mark');
          out.transforms=['travel','block','press'].every(n=>{
            const m=getComputedStyle(s.querySelector('[data-fx='+n+']')).transform;
            return m==='none'||m==='matrix(1, 0, 0, 1, 0, 0)';});
          // .stamp 의 최종은 도장 각도 rotate(-12deg) 그대로
          const dm=new DOMMatrixReadOnly(getComputedStyle(s.querySelector('[data-fx=stamp]')).transform);
          out.stampRot=Math.abs(Math.atan2(dm.b,dm.a)*180/Math.PI+12)<0.5;
          out.anims=s.getAnimations({subtree:true}).filter(a=>a.playState==='running').length===0;
          return out;}''')
        self.assertTrue(all(ok.values()), ok)

    def test_fx_static_modes_final_immediately(self):
        p = self.page(reduced=True)
        p.evaluate('deckGo(1,1)')
        p.wait_for_timeout(60)
        ok = p.evaluate('''()=>{
          const s=document.querySelector('.slide.active');
          return {strike:!!s.querySelector('[data-fx=strike]>.ed-fx-strike'),
            mark:!!s.querySelector('[data-fx=mark]>.ed-fx-mark'),
            count:s.querySelector('[data-fx=count]').textContent==='4',
            type:s.querySelector('[data-fx=type]').textContent==='타자처럼 한 자씩 드러납니다.',
            none:document.getAnimations().filter(a=>a.playState==='running').length===0};}''')
        self.assertTrue(all(ok.values()), ok)
        # body.st-self 도 같은 즉시 최종 상태
        p2 = self.page()
        p2.evaluate("document.body.classList.add('st-self')")
        p2.evaluate('deckGo(1,1)')
        p2.wait_for_timeout(60)
        ok2 = p2.evaluate('''()=>{
          const s=document.querySelector('.slide.active');
          return {strike:!!s.querySelector('[data-fx=strike]>.ed-fx-strike'),
            count:s.querySelector('[data-fx=count]').textContent==='4',
            none:document.getAnimations().filter(a=>a.playState==='running').length===0};}''')
        self.assertTrue(all(ok2.values()), ok2)

    def test_fx_no_replay_on_back(self):
        p = self.page()
        p.evaluate('deckGo(1,0)')
        p.wait_for_timeout(120)
        p.evaluate('deckGo(0,0)')
        p.wait_for_timeout(60)
        p.evaluate('deckGo(1,0)')
        p.wait_for_timeout(120)
        self.assertEqual(
            p.evaluate('document.querySelector(".slide.active").getAnimations({subtree:true}).filter(a=>a.playState==="running").length'), 0)

    # ---------- C: patterns ----------
    def test_code_copy_excludes_prompt_out_comment(self):
        p = self.page()
        p.evaluate('deckGo(2,0)')
        p.evaluate('''()=>{window.__copied=null;
          Object.defineProperty(navigator,'clipboard',{configurable:true,value:
            {writeText:t=>{window.__copied=t;return Promise.resolve();}}});}''')
        p.click('.code-copy')
        p.wait_for_timeout(60)
        copied = p.evaluate('window.__copied')
        self.assertIsNotNone(copied)
        self.assertIn('python3 build.py', copied)
        self.assertIn('python3 check.py', copied)
        self.assertNotIn('OK done', copied)
        self.assertNotIn('주석', copied)
        self.assertNotIn('$', copied)
        self.assertEqual(p.evaluate("document.querySelector('.code-copy').textContent"), '복사됨')

    def test_tabs_click_and_arrow(self):
        p = self.page()
        p.evaluate('deckGo(2,0)')
        self.assertTrue(p.evaluate("document.querySelectorAll('.active .tab-pane')[1].hidden"))
        p.click('.active .tab-bar button:nth-child(2)')
        self.assertFalse(p.evaluate("document.querySelectorAll('.active .tab-pane')[1].hidden"))
        self.assertTrue(p.evaluate("document.querySelectorAll('.active .tab-pane')[0].hidden"))
        p.locator('.active .tab-bar button[aria-selected="true"]').press('ArrowRight')
        self.assertFalse(p.evaluate("document.querySelectorAll('.active .tab-pane')[0].hidden"))
        self.assertTrue(p.evaluate("document.querySelectorAll('.active .tab-pane')[1].hidden"))

    def test_tabs_faq_in_print_and_study(self):
        p = self.page()
        p.evaluate('deckGo(2,0)')
        p.emulate_media(media='print')
        p.wait_for_timeout(60)
        self.assertEqual(p.evaluate(
            "document.querySelectorAll('.active .tab-pane:not([hidden])').length"), 2)
        self.assertEqual(p.evaluate(
            "document.querySelectorAll('.active .tab-pane-label').length"), 2)
        self.assertEqual(p.evaluate(
            "document.querySelectorAll('.active .faq details[open]').length"), 2)
        p.emulate_media(media='screen')
        p.wait_for_timeout(60)
        self.assertEqual(p.evaluate(
            "document.querySelectorAll('.active .tab-pane:not([hidden])').length"), 1)
        p.evaluate("document.body.classList.add('st-self')")
        p.wait_for_timeout(60)
        self.assertEqual(p.evaluate(
            "document.querySelectorAll('.active .tab-pane:not([hidden])').length"), 2)
        self.assertEqual(p.evaluate(
            "document.querySelectorAll('.active .faq details[open]').length"), 2)

    def test_pins_pair_highlight(self):
        p = self.page()
        p.evaluate('deckGo(2,0)')
        p.hover('.pin[data-k="2"]')
        self.assertTrue(p.evaluate("document.querySelector('.pin[data-k=\\'2\\']').classList.contains('on')"))
        self.assertTrue(p.evaluate("document.querySelector('.pin-list li[data-k=\\'2\\']').classList.contains('on')"))
        p.click('.pin-list li[data-k="1"]')
        self.assertTrue(p.evaluate("document.querySelector('.pin[data-k=\\'1\\']').classList.contains('on')"))
        self.assertTrue(p.evaluate("document.querySelector('.pin-list li[data-k=\\'1\\']').classList.contains('on')"))

    def test_pattern_clicks_do_not_advance(self):
        p = self.page()
        p.evaluate('deckGo(2,0)')
        p.wait_for_timeout(60)
        for sel in ('.code pre', '.tab-pane', '.faq summary', '.pin-list li',
                    '.pin-frame', '.tab-bar button:first-child'):
            p.locator(f'.active {sel}').first.click()
            self.assertEqual(p.evaluate('deckInfo().slide'), 2, sel)

    def test_go_link_jumps_slide_and_tab(self):
        p = self.page()
        p.evaluate('deckGo(2,0)')
        p.click('.active .go')
        p.wait_for_timeout(80)
        self.assertEqual(p.evaluate('deckInfo().slide'), 3)
        self.assertFalse(p.evaluate("document.querySelectorAll('.active .tab-pane')[1].hidden"))

    # ---------- E: check_deck rules ----------
    def test_checker_rules(self):
        text = self.html.read_text(encoding='utf-8')
        # TASK-free-mode: 취향 규칙의 기존 심각도(WARN)를 검증하려면 --style 모드 리포트가 필요하다
        rep = Report(style=True)
        static_checks(text, BeautifulSoup(text, 'html.parser'), rep, False)
        items = rep.items
        has = lambda kind, sev=None, slide=None, frag='': any(
            x['kind'] == kind and (sev is None or x['sev'] == sev)
            and (slide is None or x['slide'] == slide) and frag in x['message']
            for x in items)
        self.assertTrue(has('모션', 'ERROR', 5, 'spin'), items)
        self.assertTrue(has('모션', 'WARN', 5, 'crayon'), items)
        self.assertTrue(has('모션 길이', 'WARN', 5), items)
        self.assertTrue(has('외국어 문장', 'WARN', 5), items)
        self.assertTrue(has('화면 핀', 'ERROR', 5), items)
        self.assertFalse(has('외국어 문장', 'WARN', 6), items)


if __name__ == '__main__':
    unittest.main()
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall