Project Architecture

C3SC0-V4113/Scaffold/skills/project-architecture

作者 C3SC0-V4113ba1fac59145ed48f727247299ebb09289b87f27bApache-2.03 个星标收录于 2026年10月9日更新于 2026年10月9日仓库3天前更新

Trigger: UI change, layout, component architecture, state flow, theming, server/client boundary, Astro island. Keep Next.js or Astro apps server-first.

AI 生成的概览

在改动 UI、布局、状态流或服务端/客户端边界时,让 Next.js 或 Astro 应用保持服务端优先的架构护栏。

功能
该技能为 Next.js 和 Astro 项目提供架构护栏,要求代理在动手前先检测框架,并保持服务端优先渲染。它会把代理引导到按框架划分的参考文件,以获取服务端/客户端边界规则和 Astro 岛屿规则。它还要求显式处理加载、空数据和错误状态,优先复用现有组件与设计令牌,并完成收尾前检查清单。输出需报告检测到的框架、每一处新增或移动的服务端/客户端边界及其原因,以及检查清单的答案。
适用场景
在改动 Next.js 或 Astro 应用的 UI、布局、组件结构、状态流、主题、数据展示或服务端/客户端边界之前使用。适用于需要尽量缩小客户端代码范围并遵守框架边界的工作。
运行要求
不含脚本,仅为说明性内容。需要存在 Next.js 或 Astro 项目,包含 package.json 和根配置文件,并可能引用 DESIGN.md 等项目文件以及可选安装的技能。还要求代理阅读所安装框架自身的文档。

Project Architecture Guardrails

Activation Contract

Load this skill before changing UI, layout, component structure, state flow, theming, data display, or the server/client boundary of a Next.js or Astro app.

Hard Rules

  1. Detect the framework from the project before acting; never assume it.
  2. Keep rendering server-first. Add client-side code only when the interaction cannot work without it, and keep that surface as small as possible.
  3. Read the installed framework's own docs before changing framework APIs or project structure.
  4. Follow DESIGN.md for visual and UX decisions when it exists.
  5. Build from existing shadcn primitives and semantic tokens before writing custom markup or styles; load shadcn-component-boundaries when it is installed.
  6. Make loading, empty, and error states explicit for every data display.
  7. Add tests proportional to risk, using the test tooling the project already has.

Decision Gates

Project signalFrameworkGuidance
next in package.json dependencies, or a next.config.* fileNext.jsreferences/next.md [blocked]
astro in package.json dependencies, or an astro.config.* fileAstroreferences/astro.md [blocked]
Both or neitherUnknownStop and ask which app the change targets

Execution Steps

  1. Read package.json and list the root config files to detect the framework.
  2. Load the matching reference and apply its boundary rules.
  3. Search existing components, routes, and styles before creating new ones.
  4. Implement the change with the smallest client-side surface that works.
  5. Answer the pre-close checklist, then load project-min-evaluation when it is installed, or run the project's quality scripts.

Pre-close checklist:

  • Did the change add unnecessary client-side surface?
  • Does it follow DESIGN.md?
  • Are loading, empty, and error states explicit?

Output Contract

Report the detected framework, every server/client boundary added or moved (with its reason), and the checklist answers.

References

  • references/next.md [blocked] — Next.js server/client boundary rules.
  • references/astro.md [blocked] — Astro island boundary rules.

来源与署名

来源:C3SC0-V4113/Scaffold位于skills/project-architecture提交ba1fac5

许可证: Apache-2.0

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架