一键导入
scroll-invariant
Prevents scroll regression when editing PageContent or LessonSection. Trigger on any edit to PageContent.tsx, LessonSection.tsx, or PageLayout.tsx.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Prevents scroll regression when editing PageContent or LessonSection. Trigger on any edit to PageContent.tsx, LessonSection.tsx, or PageLayout.tsx.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when writing tests for CourseReader code. Nature-based: unit, page snapshot, component, hook, store. Trigger on "write tests", "add tests", "test this", or when creating new files that need test coverage.
Codified patterns from CourseReader refactor. Component decomposition, prop elimination, store optimization, React 19 idioms. Trigger when user says "refactor", "clean up", "extract component", "optimize store", "remove prop drilling", or "apply refactor patterns".
| name | scroll-invariant |
| description | Prevents scroll regression when editing PageContent or LessonSection. Trigger on any edit to PageContent.tsx, LessonSection.tsx, or PageLayout.tsx. |
PageContent MUST have flex flex-col classes. Without them:
div.flex.flex-1.overflow-hidden inside LessonSection gets unbounded heightcontentRef (overflow-y-auto) never overflowsscrollToSection calls on contentRef.scrollTop silently do nothingcontentRef only when PageContent is a flex containersrc/mainview/layouts/PageContent.tsx — must preserve flex flex-colsrc/mainview/sections/LessonSection.tsx — depends on this layoutit('maintains scroll container layout', () => {
const { container } = render(<PageContent><div /></PageContent>);
expect(container.firstChild).toHaveClass('flex', 'flex-col');
});
Do not remove or modify flex flex-col from PageContent for any reason. If layout needs adjustment, add wrappers inside PageContent instead.