一键导入
add-page
Add a new server-rendered page to the Liftosaur website. Use when creating new public-facing pages with routing, SSR, and client hydration.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Add a new server-rendered page to the Liftosaur website. Use when creating new public-facing pages with routing, SSR, and client hydration.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Add a new built-in exercise to Liftosaur end-to-end — image (gymvisual.com → S3), catalog registration, description page, and the LLM/MCP exercise list. Use when adding one or more built-in exercises to the app catalog.
Write idiomatic Liftoscript code for weightlifting programs. Use when creating or editing program files in programs/builtin/.
Manually test/QA the Liftosaur app on the iOS simulator — drive the real UI, inspect live app state, and set up test data. Use when asked to test, QA, stress-test, verify a change works, reproduce a bug, or hunt for bugs in the running app.
Generate an importance-ordered guided walkthrough of your changes this session and publish it to the reviewer's editor via the aireviewer publish_walkthrough tool. Use when the user asks you to explain, walk through, or give a tour of your changes.
Interactively investigate a production Rollbar error. Accepts an occurrence id, item id, item counter, or Rollbar URL. Fetches the error data, assesses how widespread it is, drills into affected users (events, logs, storage, captured state), and works with the developer toward a fix or ignore decision. Use for collaborative debugging; use /fix-rollbar for a straight fetch-and-fix of a single occurrence.
Investigate a user-reported issue using server logs, user events, storage snapshots, and Rollbar. Use when given a user id or email plus an issue description (e.g. from a support email).
| name | add-page |
| description | Add a new server-rendered page to the Liftosaur website. Use when creating new public-facing pages with routing, SSR, and client hydration. |
Create a new server-rendered page at the specified route. Requirements: $ARGUMENTS
Before creating files, read these existing examples to understand the patterns:
src/pages/allExercises/allExercisesHtml.tsx — simple HTML wrapper examplesrc/pages/allExercises/allExercisesContent.tsx — simple content componentsrc/allExercises.tsx — client entry hydrationlambda/allExercises.tsx — lambda render functionlambda/index.ts for the route registration pattern (search for getAllExercisesEndpoint)webpack.config.js for the entry point patternEvery public page uses 4 layers. For a page at /myroute with entry name mypage:
lambda/myPage.tsx)import { h } from "preact";
import { IAccount } from "../src/models/account";
import { MyPageHtml } from "../src/pages/myPage/myPageHtml";
import { renderPage } from "./render";
export function renderMyPageHtml(client: Window["fetch"], account?: IAccount): string {
return renderPage(<MyPageHtml client={client} account={account} />);
}
src/pages/myPage/myPageHtml.tsx)Wraps content in <Page>. Key props:
css={["mypage"]} / js={["mypage"]} — must match webpack entry keymaxWidth={1200} — page max widthtitle, canonical, description, ogUrl — SEO metadataaccount — optional user account for nav stateurl="/myroute" — highlights nav item in TopNavMenudata={data} — serialized for hydration (exclude client from data!)import { h, JSX } from "preact";
import { Page } from "../../components/page";
import { IAccount } from "../../models/account";
import { MyPageContent } from "./myPageContent";
interface IProps {
client: Window["fetch"];
account?: IAccount;
}
export function MyPageHtml(props: IProps): JSX.Element {
const { client, ...data } = props;
return (
<Page
css={["mypage"]} js={["mypage"]} maxWidth={1200}
title="Page Title | Liftosaur"
canonical="https://www.liftosaur.com/myroute"
description="Page description"
ogUrl="https://www.liftosaur.com/myroute"
account={props.account} data={data} client={client} url="/myroute"
>
<MyPageContent client={client} {...data} />
</Page>
);
}
src/pages/myPage/myPageContent.tsx)The interactive Preact component. Export the props interface (needed by Layer 4).
src/myPage.tsx)import { h } from "preact";
import { PageWrapper } from "./components/pageWrapper";
import { IMyPageContentProps, MyPageContent } from "./pages/myPage/myPageContent";
import { HydrateUtils } from "./utils/hydrate";
function main(): void {
HydrateUtils.hydratePage<IMyPageContentProps>((pageWrapperProps, data) => (
<PageWrapper {...pageWrapperProps}>
<MyPageContent {...data} client={window.fetch.bind(window)} />
</PageWrapper>
));
}
main();
webpack.config.js)Add to entry in mainConfig:
mypage: ["./src/myPage.tsx", "./src/index.css"],
lambda/index.ts)Add import:
import { renderMyPageHtml } from "./myPage";
Add endpoint + handler (near similar endpoints):
const getMyPageEndpoint = Endpoint.build("/myroute");
const getMyPageHandler: RouteHandler<IPayload, APIGatewayProxyResult, typeof getMyPageEndpoint> = async ({ payload }) => {
const { di } = payload;
let account: IAccount | undefined;
const userResult = await getUserAccount(payload, { withPrograms: true });
if (userResult.success) {
account = userResult.data.account;
}
return {
statusCode: 200,
body: renderMyPageHtml(di.fetch, account),
headers: { "content-type": "text/html" },
};
};
Register in router chain (~line 2700):
.get(getMyPageEndpoint, getMyPageHandler)
_redirects and _redirects_staging)Add redirect entries so the CDN (Netlify) proxies the route to the Lambda backend:
In _redirects:
/myroute https://api3.liftosaur.com/myroute 200
In _redirects_staging:
/myroute https://api3-dev.liftosaur.com/myroute 200
Place the entry before any parameterized routes for the same prefix (e.g. /myroute before /myroute/:id).
src/components/topNavMenu.tsx)If page should appear in nav, update getMenuItems().
PageWrapper (don't set nowrapper on <Page>)src/components/scrollableTabs.tsx): Tabbed contentsrc/components/selectLink.tsx): Dropdown link with bottom sheetsrc/components/exerciseImage.tsx): Exercise illustrationssrc/components/markdown.tsx): Renders markdownsrc/components/icons/src/models/builtinPrograms.ts): Metadata for builtin programslambda/dao/programDao.ts): Fetches program data from CDNdata prop on <Page> is serialized into a hidden #data div. Keep it lightweight.Settings.build() creates default settings for public pages without user context.npx tsc --noEmit after creating all files to verify no TypeScript errors.