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 從公開儲存庫中收錄這些內容。

檢舉或申請下架