NocodeMrLi/mini-program-engineering-skill-suite / skills/mini-program-architecture-skill
mini-program-architecture-skill
VerifiedTranslate a confirmed mini-program product specification or bounded feature into an implementable architecture covering modules, pages, components, services, canonical state sources, data models, interfaces, permissions, failures, caching, concurrency, idempotency, migration, rollback, external dependencies, and architecture decision records. Use when users ask how to structure a mini program, design data or APIs, divide frontend and cloud responsibilities, evolve an existing system safely, or prepare implementation after product semantics are stable. Preserves product meaning, current repository constraints, user-owned changes, and verifiable acceptance behavior rather than redesigning the product for technical convenience.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.0 KB |
| agents/openai.yaml | config | 295 B |
| assets/architecture-decision-record.md | markdown | 1.9 KB |
| references/architecture-workflow.md | markdown | 3.4 KB |
| references/cloud-state-and-write-contracts.md | markdown | 14.4 KB |
references/architecture-workflow.md
View on GitHub# 架构工作流与触发场景
## 质量检查
- 每个模块都能对应已确认的页面职责或质量目标,没有为技术炫技新增产品能力。
- 关键事实只有一个规范状态源;派生缓存可以被重建,跨页同步有明确触发点。
- 每个写操作都有身份、权限、校验、并发、幂等、失败和可观察结果。
- 一次性权益由存储层条件写/唯一约束/事务守住;创建型幂等持久化首次成功结果;多作用域查询把服务端作用域带到存储层。
- 可选云配置整组缺失与部分缺失有不同结论,互斥 provider 不会同时激活,health 区分进程与真实依赖。
- 外部服务只有业务有效结果才能改变完成态或扣减,调用成功和结果有效分开验证。
- 数据或接口演进包含兼容期、迁移顺序、回滚条件和恢复路径。
- ADR 同时记录选择和放弃的方案,并把验证映射回产品验收标准。
## 代表场景
### 场景 1:正常场景——从稳定规格设计新项目
规格已包含流程、页面和状态。应给出模块边界、状态源、数据模型、接口与权限、失败策略和 ADR,不直接生成业务代码。
### 场景 2:正常场景——已有项目增加跨页能力
先读取只读事实图和现有模式,再说明受影响模块、依赖方向、数据契约和验证范围;保护工作区已有改动。
### 场景 3:边界场景——局部功能不影响结构
只是固定文案或局部样式调整,现有状态和接口均不变。应说明无需完整架构阶段,保留现有边界并交给实现与验证。
### 场景 4:失败场景——迁移无法安全回滚
方案会覆盖存量数据且没有备份、兼容读取或回滚路径。应停止在架构决策点,列出需要补齐的恢复条件。
### 场景 5:不应触发——产品规则仍冲突
用户尚未决定一次性奖励能否重复领取。应先由产品规格阶段确认语义,不能用数据库唯一键替用户决定产品规则。
### 场景 6:边界场景——重复创建返回已存在
接口不只返回冲突。架构应读取已持久化赢家结果并恢复正常路径;同一幂等键但载荷不同则返回明确冲突,不能复用不相关结果。
## 交接原则
### 来源前态与目录生命周期
按已批准恢复/自动行为合同保存必要的最小动作来源与原关系,和对应业务变更共用原子边界;写入、读回校验、历史缺省及旧记录读取一致,不从当前页、筛选或缺字段猜前态。恢复先核父项存在、当前归属及允许状态,兜底按产品规格;未知写入沿原标识读回,并发/重复恢复沿原版本与幂等边界,不新增通知或重复权益。
有独立目录需求时用项目已有权威身份/存储,不从当前引用去重或空列表判断实体消失。获准迁移覆盖全量关系与草稿,保护零引用实体及删除最后引用前的目录。隐藏选用与历史关系分开,真正删除按获准迁移/级联原子处理;失败、错归属、版本冲突不部分迁移。无此需求或规格允许空项自动删除则沿原规则,不新增框架/表或后台清理任务。
实施交接包含范围、依赖、契约、顺序、门禁、验证和回滚条件。没有实际运行证据时,只称“架构已设计”,不能称功能已实现或验证通过。
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |