Skip to main content

aidd-structure

Enforces source code structuring and interdependency best practices. Use when creating folders, moving files, adding imports, or when the user asks about architecture, layering, or module dependencies.

来源信息

仓库
paralleldrive/riteway
最近来源活动
2026年3月17日 20:30
检测到的 SKILL.md 语言
英语
星标
1,196
分支
40

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
2 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
aidd-structure
description
Enforces source code structuring and interdependency best practices. Use when creating folders, moving files, adding imports, or when the user asks about architecture, layering, or module dependencies.
# Standard folder structure ``` types ← services ← plugins ← components ↑ ↑ ↑ └─────────┴─────────┘ (types only depend on types) ``` ## Dependency rules ```sudolang LayerDependency { layer: "components" | "plugins" | "services" | "types" mayDependOn: String[] mustNotDependOn: String[] } DependencyRules [ { layer: "components", mayDependOn: ["plugins (Observe<Data>, void actions)", "types"], mustNotDependOn: ["services"] }, { layer: "plugins", mayDependOn: ["services", "types", "other plugins"], mustNotDependOn: [] }, { layer: "services", mayDependOn: ["other services", "types"], mustNotDependOn: ["components", "plugins"] }, { layer: "types", mayDependOn: ["other types"], mustNotDependOn: ["everything else"] } ] Constraints { Never: components → services Never: services → components or plugins Never: types → anything except types } ``` --- ## components UI components or elements (also called "elements"). **From plugins:** only Observe<Data> for reactive re-renders and void-returning action functions. ## plugins (if using @adobe/data/ecs for state) ECS Database.Plugin declarations. Usually depend on services, types, and other plugins. ## services Asynchronous data services, each in its own folder. Immutable data only. Adhere to [namespace](../aidd-namespace/SKILL.md) guidelines. **Async patterns only:** Observe<Data>, Promise<Data>, AsyncGenerator<Data>, void actions. **External code** depends only on interfaces, never on implementations. ## types Pure functional types and associated pure functions. Adhere to [namespace](../aidd-namespace/SKILL.md) guidelines. ## Nested structure When a component has implementation-specific sub-parts, mirror the root structure inside it: ``` components/my-component/ components/ plugins/ types/ ``` --- ## Execute ```sudolang fn whenAddingOrMovingCode() { Constraints { Place code in the correct layer (components, plugins, services, types) Check dependencies against the dependency rules Fix any violations (e.g. components importing services) } } ```
在 GitHub 查看