Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计通过

vite-architectureVite 架构

Agent Skill

vite-architecture 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

874

周安装

35

GitHub Stars

3

下载量

283
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:vite-architecture(Vite 架构)
来源仓库:https://github.com/alpoxdev/hypercore
仓库路径:skills/vite-architecture
安装命令:
npx skills add https://github.com/alpoxdev/hypercore --skill vite-architecture
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/alpoxdev/hypercore --skill vite-architecture

简介

用于查找、检索和筛选相关信息,适合快速定位候选结果。

  • 可根据关键词或任务场景提供线索,辅助信息收集与决策支持。
  • 安装命令:npx skills add https://github.com/alpoxdev/hypercore --skill vite-architecture
  • 使用前建议确认权限范围和维护状态,避免触发联网或命令执行。
  • 注意检查是否会读写文件或修改项目结构。

SKILL.md

Vite + TanStack Router Architecture Enforcement

Overview

Enforces hypercore Vite + TanStack Router architecture rules with strict validation before editing code.

This skill is RIGID. Follow exactly. No exceptions.

OPERATING MODE: This skill must stay self-contained. Do not block on external orchestration surfaces just to apply architecture rules. If a repo-local persistence loop is already active, carry these gates into that loop. Otherwise proceed directly with this skill.

NOTE: Some rules in this skill are stricter than TanStack Router defaults. Treat them as hypercore team conventions unless the user explicitly asks to follow official TanStack defaults instead.

Trigger Examples

Positive

  • Audit this Vite + TanStack Router app for route structure, validateSearch, and service boundaries before editing.
  • Add a new route folder in a Vite + TanStack Router app and keep hooks/services compliant.
  • Refactor a TanStack Router page so the UI stays in the route and logic moves into -hooks/.

Negative

  • Create a new Codex skill for browser QA.
  • Review a TanStack Start app that uses createServerFn and @tanstack/react-start.

Boundary

  • Make a tiny copy-only text change in a Vite route file. Direct editing can be enough if the change does not cross an architecture boundary, but touched files still need a quick compliance check.
  • The repo actually uses @tanstack/react-start. Route away to tanstack-start-architecture instead of forcing Vite rules onto a Start project.

Step 1: Project Validation

Before any work, confirm a Vite + TanStack Router project:

# Check for Vite + TanStack Router indicators (ANY of these)
grep -r "@tanstack/react-router" package.json 2>/dev/null
grep -r "vite" package.json 2>/dev/null
ls vite.config.ts 2>/dev/null
ls src/routes/__root.tsx 2>/dev/null

If NONE found: STOP. This skill does not apply. Inform the user and return to the normal implementation or review path.

If @tanstack/react-start or app.config.ts is present: STOP. Route to tanstack-start-architecture.

If the repo matches Vite + TanStack Router: proceed with architecture enforcement.

Step 2: Read Architecture Rules

Load the detailed rules reference:

REQUIRED: Read architecture-rules.md in this skill directory before writing any code.

For detailed patterns and examples, also read the relevant rule files:

  • rules/conventions.md - naming, TypeScript, imports, comments
  • rules/routes.md - route folder structure, route.tsx, loaders, search params
  • rules/services.md - public API services, query options, mutations, client boundaries
  • rules/hooks.md - custom hook separation and internal order
  • rules/execution-model.md - loader/runtime boundaries, SSR-aware caveats, env safety
  • rules/platform.md - vite.config.ts, router setup, generated files, env and alias rules

Step 3: Pre-Change Validation Checklist

Before writing ANY code, verify the planned change against these gates:

Brownfield Adoption Rule

  • Do not treat every untouched legacy deviation as an immediate project-wide failure.
  • Safety or boundary issues still block immediately, especially in touched files.
  • Hypercore-specific style or structure drift in untouched legacy code can be recorded as migration backlog.
  • Any file you touch should be brought into compliance unless that would require a materially risky migration.

Gate 1: Layer Violations

Routes -> Services -> External API
CheckRule
Route calling fetch/axios directly?BLOCKED. Must go through services
Hook calling fetch/axios directly?BLOCKED. Must go through services
Service returning raw Response to routes/hooks?BLOCKED. Return typed data
createServerFn, useServerFn, or Start-only middleware APIs in a Vite app?BLOCKED

Gate 2: Route Structure

CheckRule
Flat file route for a page that owns UI/logic? (routes/users.tsx)BLOCKED. Use a folder route (routes/users/index.tsx)
Missing -components/ folder?BLOCKED. Every page needs it
Missing -hooks/ folder?BLOCKED. Every page needs it
-functions/ folder present?BLOCKED. Vite skill does not allow server functions
const Route without export?BLOCKED. Must be export const Route
Logic in page component?BLOCKED. Extract to -hooks/
Layout route missing route.tsx while it owns shared loader/beforeLoad/layout work?BLOCKED
Route with search params but no validateSearch?BLOCKED. Use zodValidator
Route with loader but no pendingComponent?WARNING. Recommended

Gate 3: Services

CheckRule
POST/PUT/PATCH without schema validation?BLOCKED. Validate with Zod before calling
Direct fetch/axios in route or hook?BLOCKED. Use service functions
services/index.ts barrel export?BLOCKED. Import directly from concrete files
Missing explicit return type on service function?BLOCKED

Gate 4: Hooks

CheckRule
Hook logic left inside page component?BLOCKED. Move to -hooks/
Wrong hook order?BLOCKED. State -> Global -> Query -> Handlers -> Memo -> Effect
Missing exported return type interface?BLOCKED
camelCase hook filename?BLOCKED. Use use-kebab-case.ts
useServerFn in a Vite hook?BLOCKED

Gate 5: Conventions

CheckRule
camelCase filename?BLOCKED. Use kebab-case
function keyword?BLOCKED. Use const arrow functions
any type?BLOCKED. Use unknown
Missing explicit return type?BLOCKED
Wrong import order?BLOCKED. External -> @/ -> Relative -> Type
Missing Korean block comments for grouped logic?BLOCKED
Using z.string().email()?BLOCKED. Use z.email() in Zod 4

Gate 6: Execution Model

CheckRule
Treating a route loader as a private server-only boundary?BLOCKED. Loaders are client-reachable and may also participate in SSR/manual rendering
Secret, DB, filesystem, or privileged SDK access inside a route module or loader?BLOCKED. Keep it behind an actual backend/API boundary
Browser-only APIs used at module scope or in shared route helpers without a client boundary?BLOCKED
Non-VITE_ env access in client-reachable code?BLOCKED

Gate 7: Platform Setup

CheckRule
vite.config.ts missing tanstackRouter() or plugin order is wrong?BLOCKED. Router plugin must stay explicit and precede react()
routeTree.gen.ts hand-edited?BLOCKED. Treat as generated output
Router setup hidden or inconsistent with SSR/manual rendering needs?WARNING. Keep src/router.tsx explicit; use a fresh router factory when SSR/manual rendering exists
Path alias or env setup relies on implicit behavior only?WARNING. Keep tsconfig/Vite config and runtime validation explicit

Step 3.5: Auto-Remediation Policy

Auto-fix directly when the issue is local, reversible, and low-risk.

  • add missing validateSearch
  • move direct route/hook network access into services/
  • add missing pendingComponent or errorComponent
  • create missing -components/ or -hooks/ folders for touched pages
  • add or correct tanstackRouter() plugin setup, router scaffolding, or explicit env/alias wiring

Do not auto-apply broad or potentially breaking migrations without explicit justification.

  • mass route/file renames
  • sweeping route-tree restructures across many pages
  • introducing SSR/manual server rendering where the repo was SPA-only
  • large auth or API-client rewrites

Step 4: Implementation

Carry these acceptance criteria into the active task:

- [ ] Layer architecture respected (Routes -> Services -> External API)
- [ ] Route uses folder structure with -components/ and -hooks/
- [ ] export const Route = createFileRoute(...) used
- [ ] No Start-only server-function APIs in this Vite project
- [ ] Search params use zodValidator from @tanstack/zod-adapter
- [ ] Custom Hooks live in -hooks/ with correct internal order
- [ ] Loaders stay public-safe and SSR-safe
- [ ] Vite/router platform setup stays explicit (router plugin, router file, generated files)
- [ ] All filenames kebab-case
- [ ] Korean block comments present
- [ ] const arrow functions with explicit return types

Step 5: Post-Change Verification

After writing code, verify:

  1. Structure check: confirm each touched page still has -components/ and -hooks/ and no -functions/
  2. Export check: grep for export const Route
  3. Layer check: no direct fetch/axios in touched route or hook files
  4. Convention check: no camelCase filenames, no function keyword declarations
  5. Hook order check: read touched hooks and verify State -> Global -> Query -> Handlers -> Memo -> Effect
  6. Execution check: loaders and route modules do not touch secrets, DB clients, or private env values directly
  7. Platform check: vite.config.ts, src/router.tsx, env wiring, and generated router files remain coherent

Quick Reference: Folder Structure

src/
├── routes/
│   ├── __root.tsx
│   ├── index.tsx
│   └── users/
│       ├── route.tsx          # shared layout / beforeLoad / loader
│       ├── index.tsx          # /users
│       ├── -components/
│       ├── -hooks/
│       ├── $id/
│       │   ├── index.tsx      # /users/$id
│       │   ├── -components/
│       │   └── -hooks/
│       └── -sections/         # optional for large pages
├── services/<domain>/
│   ├── schemas.ts
│   ├── queries.ts
│   └── mutations.ts
├── hooks/                     # global hooks
├── stores/
├── components/
├── config/
├── env/
├── lib/
├── src/router.tsx
└── routeTree.gen.ts           # generated, do not hand-edit

Common Mistakes

MistakeFix
routes/users.tsx for a full pageroutes/users/index.tsx
routes/users/$id.tsx while the page owns its own UI/logic foldersroutes/users/$id/index.tsx
const Route = createFileRoute(...)export const Route = createFileRoute(...)
Direct fetch() in route/hookmove to services/<domain>/queries.ts or mutations.ts
createServerFn(...) or useServerFn(...) in this appuse services + TanStack Query
Page component holds useState, useQuery, mutations inlineextract to -hooks/use-*.ts
routeTree.gen.ts edited manuallyregenerate it; do not hand-edit
Loader reads secrets or non-VITE_ env valuesmove behind a real backend/API boundary
validateSearch uses raw unvalidated searchadd zodValidator(schema)

Red Flags - STOP and Fix

  • @tanstack/react-start is present but the Vite skill is being applied
  • route or hook imports fetch/axios directly
  • missing export on const Route
  • page component contains inline state/query/mutation logic
  • createServerFn, useServerFn, or -functions/ appears in the route tree
  • loader or route module reads secrets, DB clients, or private env values directly
  • routeTree.gen.ts has hand edits
  • search params are used without validateSearch

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.99%
按下载量换算99

Claude

29%
按下载量换算82

Cursor

18.54%
按下载量换算52

Gemini CLI

9.76%
按下载量换算28

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills