一键导入
add-tool-page
Add a new tool page to dev.tools — covers ToolView, Editor, and Custom patterns
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Add a new tool page to dev.tools — covers ToolView, Editor, and Custom patterns
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Add or update an app in the dev.tools software installer catalog
Add a prompt or skill to the dev.tools prompts collection (TypeScript catalog workflow)
Scaffold a new tool page in dev.tools following the established pattern
Internal dev.tools project conventions — state, styling, contexts, typing, and code style rules
Run the complete dev.tools pre-commit verification pipeline
Extend the LLM VRAM calculator — add quant families, update formulas, add test anchors
| name | add-tool-page |
| description | Add a new tool page to dev.tools — covers ToolView, Editor, and Custom patterns |
Three patterns. Choose one and follow it exactly. See docs/howto/add-a-tool-page.md for prose context.
Use for text-transform tools (input → output, grouped by category).
Reference: src/pages/string-utils/index.tsx.
src/common/<name>-utils.ts with exported, pure, testable functions (no React).create<Name>Utils() and create<Name>UtilList() to src/common/utils-factory.ts. Import new functions at the top.src/pages/<name>/index.tsx using the stub below.{ itemName: '<Display Name>', itemLink: '/<name>', icon: '⊕' } to the appropriate group in src/components/app-layout/ApplicationSidebar.tsx.src/styles/<name>.scss; import it in src/pages/_app.tsx.test/common/<name>-utils.test.ts covering all exported functions + edge cases.test/pages/<name>.test.tsx confirming the page mounts without errors.npm run verify
npm run build
npm run validate:sw
npm run verify:ui
git add -A && git commit -m "feat: add <name> tool page" then git status must be clean.'use client';
import { create<Name>UtilList } from '@/common/utils-factory';
import { usePage } from '@/contexts/PageContext';
import ToolAbout from '@/controls/ToolAbout';
import React, { useEffect, useMemo } from 'react';
import ToolView, { ToolViewFunctionGroups, ToolViewGroup } from '../../components/elements/column/ToolView';
const IndexPage = (): React.JSX.Element => {
const { setPageTitle } = usePage();
useEffect(() => {
setPageTitle('<Page Title>');
}, [setPageTitle]);
const toolsGroups = useMemo(() => {
const groupsMap: ToolViewFunctionGroups = new Map();
create<Name>UtilList().forEach((tool) => {
const toolGroup: ToolViewGroup = {
funcGroupId: tool.toolGroupId,
funcGroupName: tool.displayName,
functions: tool.utils.map((func) => ({
funcId: func.toolId,
funcName: func.textToDisplay,
funcDescription: func.description,
func: (text, onSuccess, onFailure) => {
try {
onSuccess(func.toolFunction(text));
} catch (e) {
onFailure(e);
}
},
})),
};
groupsMap.set(tool.toolGroupId, toolGroup);
});
return groupsMap;
}, []);
return (
<div style={{ display: 'flex', flexDirection: 'column', flex: 1, minHeight: 0 }}>
<ToolAbout routeKey="<name>">Description shown in the collapsible About panel.</ToolAbout>
<ToolView searchable showCharCount toolChoseHeader="Select Utils" toolViewFunctionGroups={toolsGroups} />
</div>
);
};
export default IndexPage;
Use for Monaco-based editor + preview layouts.
Reference: src/pages/mermaid-editor/index.tsx.
SplitPreviewEditor from ../../components/elements/editor/SplitPreviewEditor..editorpane, .eh, .eb CSS classes from primitives.scss for full-height layout.Use for bespoke layouts that don't fit Pattern 1 or 2.
Reference: src/pages/software-installer/index.tsx.
toolId, toolGroupId) must be kebab-case and unique across the app.utils-factory.ts, never in the page component.<ToolAbout> unless the page has no useful description.