specdo 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +139 -0
- package/README.md +308 -0
- package/README.zh-CN.md +306 -0
- package/bin/specdo.js +3 -0
- package/dist/cli/index.d.ts +15 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +297 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/commands/_shared.d.ts +45 -0
- package/dist/commands/_shared.d.ts.map +1 -0
- package/dist/commands/_shared.js +124 -0
- package/dist/commands/_shared.js.map +1 -0
- package/dist/commands/apply.d.ts +30 -0
- package/dist/commands/apply.d.ts.map +1 -0
- package/dist/commands/apply.js +393 -0
- package/dist/commands/apply.js.map +1 -0
- package/dist/commands/archive.d.ts +25 -0
- package/dist/commands/archive.d.ts.map +1 -0
- package/dist/commands/archive.js +362 -0
- package/dist/commands/archive.js.map +1 -0
- package/dist/commands/doctor.d.ts +21 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +180 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/domains.d.ts +14 -0
- package/dist/commands/domains.d.ts.map +1 -0
- package/dist/commands/domains.js +107 -0
- package/dist/commands/domains.js.map +1 -0
- package/dist/commands/explore.d.ts +48 -0
- package/dist/commands/explore.d.ts.map +1 -0
- package/dist/commands/explore.js +378 -0
- package/dist/commands/explore.js.map +1 -0
- package/dist/commands/init.d.ts +45 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +243 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list.d.ts +23 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +135 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/propose.d.ts +22 -0
- package/dist/commands/propose.d.ts.map +1 -0
- package/dist/commands/propose.js +316 -0
- package/dist/commands/propose.js.map +1 -0
- package/dist/commands/show.d.ts +15 -0
- package/dist/commands/show.d.ts.map +1 -0
- package/dist/commands/show.js +214 -0
- package/dist/commands/show.js.map +1 -0
- package/dist/commands/status.d.ts +17 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +146 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/sync.d.ts +21 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +113 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/validate.d.ts +117 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +446 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/core/apply-brief-renderer.d.ts +35 -0
- package/dist/core/apply-brief-renderer.d.ts.map +1 -0
- package/dist/core/apply-brief-renderer.js +242 -0
- package/dist/core/apply-brief-renderer.js.map +1 -0
- package/dist/core/config-store.d.ts +190 -0
- package/dist/core/config-store.d.ts.map +1 -0
- package/dist/core/config-store.js +280 -0
- package/dist/core/config-store.js.map +1 -0
- package/dist/core/context-store.d.ts +96 -0
- package/dist/core/context-store.d.ts.map +1 -0
- package/dist/core/context-store.js +426 -0
- package/dist/core/context-store.js.map +1 -0
- package/dist/core/json-schemas.d.ts +349 -0
- package/dist/core/json-schemas.d.ts.map +1 -0
- package/dist/core/json-schemas.js +125 -0
- package/dist/core/json-schemas.js.map +1 -0
- package/dist/core/skill-content/cross-domain.d.ts +12 -0
- package/dist/core/skill-content/cross-domain.d.ts.map +1 -0
- package/dist/core/skill-content/cross-domain.js +291 -0
- package/dist/core/skill-content/cross-domain.js.map +1 -0
- package/dist/core/skill-content/protocol-examples.d.ts +13 -0
- package/dist/core/skill-content/protocol-examples.d.ts.map +1 -0
- package/dist/core/skill-content/protocol-examples.js +190 -0
- package/dist/core/skill-content/protocol-examples.js.map +1 -0
- package/dist/core/skill-content/workflow-content.d.ts +25 -0
- package/dist/core/skill-content/workflow-content.d.ts.map +1 -0
- package/dist/core/skill-content/workflow-content.js +1572 -0
- package/dist/core/skill-content/workflow-content.js.map +1 -0
- package/dist/core/skill-exporter.d.ts +186 -0
- package/dist/core/skill-exporter.d.ts.map +1 -0
- package/dist/core/skill-exporter.js +922 -0
- package/dist/core/skill-exporter.js.map +1 -0
- package/dist/core/spec-sync.d.ts +65 -0
- package/dist/core/spec-sync.d.ts.map +1 -0
- package/dist/core/spec-sync.js +226 -0
- package/dist/core/spec-sync.js.map +1 -0
- package/dist/core/task-parser.d.ts +58 -0
- package/dist/core/task-parser.d.ts.map +1 -0
- package/dist/core/task-parser.js +244 -0
- package/dist/core/task-parser.js.map +1 -0
- package/dist/core/template-renderer.d.ts +51 -0
- package/dist/core/template-renderer.d.ts.map +1 -0
- package/dist/core/template-renderer.js +362 -0
- package/dist/core/template-renderer.js.map +1 -0
- package/dist/domains/architecture.d.ts +34 -0
- package/dist/domains/architecture.d.ts.map +1 -0
- package/dist/domains/architecture.js +341 -0
- package/dist/domains/architecture.js.map +1 -0
- package/dist/domains/backend.d.ts +35 -0
- package/dist/domains/backend.d.ts.map +1 -0
- package/dist/domains/backend.js +367 -0
- package/dist/domains/backend.js.map +1 -0
- package/dist/domains/frontend.d.ts +36 -0
- package/dist/domains/frontend.d.ts.map +1 -0
- package/dist/domains/frontend.js +373 -0
- package/dist/domains/frontend.js.map +1 -0
- package/dist/domains/index.d.ts +49 -0
- package/dist/domains/index.d.ts.map +1 -0
- package/dist/domains/index.js +255 -0
- package/dist/domains/index.js.map +1 -0
- package/dist/domains/operations.d.ts +37 -0
- package/dist/domains/operations.d.ts.map +1 -0
- package/dist/domains/operations.js +344 -0
- package/dist/domains/operations.js.map +1 -0
- package/dist/domains/pool-ranking.d.ts +43 -0
- package/dist/domains/pool-ranking.d.ts.map +1 -0
- package/dist/domains/pool-ranking.js +153 -0
- package/dist/domains/pool-ranking.js.map +1 -0
- package/dist/domains/quality.d.ts +45 -0
- package/dist/domains/quality.d.ts.map +1 -0
- package/dist/domains/quality.js +368 -0
- package/dist/domains/quality.js.map +1 -0
- package/dist/domains/security.d.ts +19 -0
- package/dist/domains/security.d.ts.map +1 -0
- package/dist/domains/security.js +364 -0
- package/dist/domains/security.js.map +1 -0
- package/dist/domains/signal-match.d.ts +25 -0
- package/dist/domains/signal-match.d.ts.map +1 -0
- package/dist/domains/signal-match.js +67 -0
- package/dist/domains/signal-match.js.map +1 -0
- package/dist/domains/types.d.ts +354 -0
- package/dist/domains/types.d.ts.map +1 -0
- package/dist/domains/types.js +12 -0
- package/dist/domains/types.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/protocols/index.d.ts +36 -0
- package/dist/protocols/index.d.ts.map +1 -0
- package/dist/protocols/index.js +85 -0
- package/dist/protocols/index.js.map +1 -0
- package/dist/protocols/review-to-solid.d.ts +32 -0
- package/dist/protocols/review-to-solid.d.ts.map +1 -0
- package/dist/protocols/review-to-solid.js +309 -0
- package/dist/protocols/review-to-solid.js.map +1 -0
- package/dist/utils/prompt.d.ts +37 -0
- package/dist/utils/prompt.d.ts.map +1 -0
- package/dist/utils/prompt.js +81 -0
- package/dist/utils/prompt.js.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backend Domain Module
|
|
3
|
+
*
|
|
4
|
+
* 来源:
|
|
5
|
+
* - content/skills/senior-backend/SKILL.md (25 行)
|
|
6
|
+
* 契约优先、数据所有权、安全实施、smoke path
|
|
7
|
+
* - content/skills/senior-backend/references/api-guidelines.md (23 行)
|
|
8
|
+
* REST 基础、幂等性、分页、auth、可观测性默认值
|
|
9
|
+
* - content/skills/database-migration/SKILL.md (52 行)
|
|
10
|
+
* 零停机模式、安全检查清单、回滚脚本
|
|
11
|
+
* - content/roles/01-core-development/backend-developer.toml (43 行)
|
|
12
|
+
* entry point / 服务边界 / 写路径事务 / 认证授权
|
|
13
|
+
* - content/roles/05-data-ai/database-optimizer.toml (42 行)
|
|
14
|
+
* query plan 行为、索引适用性、锁竞争、N+1
|
|
15
|
+
* - content/roles/05-data-ai/data-engineer.toml (42 行)
|
|
16
|
+
* ETL、ingestion 契约、幂等回放、数据质量、世系
|
|
17
|
+
*
|
|
18
|
+
* 压缩方法:
|
|
19
|
+
* 1. senior-backend Quick Start 4 步 → design.checklist + verify.checklist
|
|
20
|
+
* 2. api-guidelines 默认值 → implement.focusAreas + design.checklist
|
|
21
|
+
* 3. database-migration 零停机模式 → design.patterns
|
|
22
|
+
* 4. database-optimizer query plan / index 关注点 → implement.focusAreas
|
|
23
|
+
* 5. data-engineer ETL 契约关注点 → implement.focusAreas + design.checklist
|
|
24
|
+
* 6. db-optimizer 反模式 (N+1, 无界查询) + senior-backend SQL 拼接 → implement.antiPatterns
|
|
25
|
+
* 7. backend-developer focus on entry-point + 事务边界 → design.checklist
|
|
26
|
+
*
|
|
27
|
+
* 与相邻领域的边界:
|
|
28
|
+
* - 单词 'api' 归 backend;架构域使用多词 'api contract' / 'api design'
|
|
29
|
+
* - 'auth' / 'oauth' / 'jwt' 归 security;backend 关注 "where authz check fires"
|
|
30
|
+
* - 'rollback' 单词归 operations (release rollback);backend 用 "migration rollback" 多词
|
|
31
|
+
* - 'cqrs' / 'microservice' / 'event-driven' 归架构;backend 不重复
|
|
32
|
+
*/
|
|
33
|
+
export const backendDomain = {
|
|
34
|
+
name: 'backend',
|
|
35
|
+
description: 'Backend services, API implementation, database schema and migrations, query optimization, data pipelines, and operational safety',
|
|
36
|
+
// ── Explore: 需求澄清 ─────────────────────────────────────
|
|
37
|
+
explore: {
|
|
38
|
+
signals: [
|
|
39
|
+
// API / 服务实现
|
|
40
|
+
'api', 'endpoint', 'rest', 'graphql', 'grpc',
|
|
41
|
+
'service', 'server-side', 'backend', 'controller', 'handler',
|
|
42
|
+
// 数据库 / 存储
|
|
43
|
+
'database', 'sql', 'postgres', 'postgresql', 'mysql', 'mongodb',
|
|
44
|
+
'redis', 'sqlite', 'orm', 'prisma', 'sequelize',
|
|
45
|
+
// Schema / 迁移
|
|
46
|
+
'schema migration', 'db migration', 'database migration',
|
|
47
|
+
'migration rollback', 'backfill', 'zero downtime',
|
|
48
|
+
'schema change', 'column', 'foreign key', 'constraint',
|
|
49
|
+
// 查询性能
|
|
50
|
+
'query plan', 'query optimization', 'n+1', 'slow query',
|
|
51
|
+
'index strategy', 'db index',
|
|
52
|
+
// 异步 / 数据管道
|
|
53
|
+
'queue', 'worker', 'cron', 'job', 'background task',
|
|
54
|
+
'etl', 'ingestion', 'data pipeline', 'data warehouse', 'lineage',
|
|
55
|
+
// 行为契约
|
|
56
|
+
'transaction', 'idempotency', 'idempotent', 'retry semantics',
|
|
57
|
+
'replay', 'consistency model',
|
|
58
|
+
// 实现细节
|
|
59
|
+
'cache', 'caching layer', 'rate limit',
|
|
60
|
+
'pagination', 'cursor pagination', 'request validation',
|
|
61
|
+
],
|
|
62
|
+
questions: {
|
|
63
|
+
defaultCount: 8,
|
|
64
|
+
items: [
|
|
65
|
+
// ── Tier 1: API / 契约 (priority 9-10) ─────────────────
|
|
66
|
+
{
|
|
67
|
+
text: 'What is the API / event contract for this change — inputs, outputs, error envelope, and idempotency expectations?',
|
|
68
|
+
signals: ['api', 'endpoint', 'contract', 'input', 'output', 'error', 'idempotency', 'rest', 'grpc'],
|
|
69
|
+
priority: 10,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
text: 'What authentication and authorization checks fire on every entry point? Have they been verified with at least two role accounts?',
|
|
73
|
+
signals: ['auth', 'authentication', 'authorization', 'rbac', 'role', 'permission', 'endpoint'],
|
|
74
|
+
priority: 9,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
text: 'What rate limiting or throttling applies to this endpoint? (per-user, per-IP, burst allowance, 429 response)',
|
|
78
|
+
signals: ['rate limit', 'throttle', 'api', 'endpoint', 'burst', '429'],
|
|
79
|
+
priority: 7,
|
|
80
|
+
},
|
|
81
|
+
// ── Tier 2: 数据模型与 Schema (priority 9) ────────────
|
|
82
|
+
{
|
|
83
|
+
text: 'Who owns the data being read or mutated, and which tables/collections is this change authoritative for?',
|
|
84
|
+
id: 'data-ownership',
|
|
85
|
+
signals: ['data', 'database', 'table', 'collection', 'ownership', 'schema', 'mutation', 'authoritative'],
|
|
86
|
+
priority: 9,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
text: 'For any schema change: what is the migration strategy (expand-contract, dual-write), the backfill plan, and the rollback procedure?',
|
|
90
|
+
signals: ['schema', 'migration', 'backfill', 'rollback', 'database', 'expand-contract', 'dual-write', 'ddl'],
|
|
91
|
+
priority: 9,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
text: 'Are database indexes aligned with the actual query patterns? Have EXPLAIN plans been reviewed for the dominant queries?',
|
|
95
|
+
signals: ['index', 'query', 'explain', 'database', 'performance', 'sql', 'nosql', 'plan'],
|
|
96
|
+
priority: 8,
|
|
97
|
+
requiresAnswer: ['backend:data-ownership'],
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
text: 'What is the data validation strategy? (type, format, length, business rules — validated at the boundary before reaching business logic)',
|
|
101
|
+
signals: ['validation', 'schema', 'input', 'type', 'format', 'boundary', 'zod', 'json schema'],
|
|
102
|
+
priority: 8,
|
|
103
|
+
},
|
|
104
|
+
// ── Tier 3: 事务与并发 (priority 8) ───────────────────
|
|
105
|
+
{
|
|
106
|
+
text: 'What is the concurrency model? (transaction isolation level, optimistic vs pessimistic locking, idempotency keys, retry behavior)',
|
|
107
|
+
id: 'concurrency-model',
|
|
108
|
+
signals: ['concurrency', 'transaction', 'isolation', 'locking', 'optimistic', 'pessimistic', 'idempotency', 'retry'],
|
|
109
|
+
priority: 9,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
text: 'What happens on concurrent writes to the same resource? Is there a last-write-wins or version-vector strategy?',
|
|
113
|
+
signals: ['concurrent', 'write', 'conflict', 'version', 'vector clock', 'last-write-wins', 'race condition'],
|
|
114
|
+
priority: 7,
|
|
115
|
+
requiresAnswer: ['backend:concurrency-model'],
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
text: 'For distributed transactions or sagas: what is the compensating action for each step, and how is partial failure recovered?',
|
|
119
|
+
signals: ['distributed', 'transaction', 'saga', 'compensating', 'rollback', 'failure', 'orchestration', 'choreography'],
|
|
120
|
+
priority: 7,
|
|
121
|
+
},
|
|
122
|
+
// ── Tier 4: 错误处理与韧性 (priority 8) ───────────────
|
|
123
|
+
{
|
|
124
|
+
text: 'What is the high-risk failure path? (DB unavailable, queue lag, partial write, duplicate event, downstream timeout) — how does the system behave?',
|
|
125
|
+
signals: ['failure', 'error', 'database', 'queue', 'timeout', 'partial', 'duplicate', 'downstream'],
|
|
126
|
+
priority: 8,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
text: 'What is the error handling strategy? Are errors classified (retryable vs non-retryable), and do error responses follow a consistent envelope?',
|
|
130
|
+
signals: ['error', 'handling', 'retry', 'classification', 'envelope', 'status code', 'exception'],
|
|
131
|
+
priority: 8,
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
text: 'How are timeouts configured per integration? (connect timeout, read timeout, overall request deadline — defaults and per-call overrides)',
|
|
135
|
+
signals: ['timeout', 'integration', 'connect', 'read', 'deadline', 'external', 'api'],
|
|
136
|
+
priority: 7,
|
|
137
|
+
},
|
|
138
|
+
// ── Tier 5: 数据管道与异步处理 (priority 7-8) ─────────
|
|
139
|
+
{
|
|
140
|
+
text: 'For async processing: what is the queue/message broker, the delivery guarantee, and the dead-letter handling?',
|
|
141
|
+
signals: ['async', 'queue', 'message', 'event', 'broker', 'delivery', 'dead letter', 'kafka', 'rabbitmq', 'sqs'],
|
|
142
|
+
priority: 8,
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
text: 'For data pipelines: how is replay, late-arrival, and duplicate handled? What is the exactly-once or at-least-once strategy?',
|
|
146
|
+
signals: ['pipeline', 'replay', 'late', 'duplicate', 'exactly-once', 'at-least-once', 'stream', 'batch'],
|
|
147
|
+
priority: 7,
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
text: 'What is the idempotency mechanism for mutating operations? (idempotency key header, database unique constraint, dedup table)',
|
|
151
|
+
signals: ['idempotency', 'key', 'duplicate', 'mutation', 'unique', 'dedup', 'constraint'],
|
|
152
|
+
priority: 8,
|
|
153
|
+
},
|
|
154
|
+
// ── Tier 6: 查询性能 (priority 7-8) ───────────────────
|
|
155
|
+
{
|
|
156
|
+
text: 'What are the dominant queries by volume and latency? Have their execution plans been reviewed and optimized?',
|
|
157
|
+
signals: ['query', 'performance', 'sql', 'database', 'explain', 'plan', 'latency', 'volume', 'optimization'],
|
|
158
|
+
priority: 8,
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
text: 'Is there an N+1 query risk in this change? Are related entities fetched with JOINs or batched lookups instead of per-item queries?',
|
|
162
|
+
signals: ['n+1', 'query', 'join', 'batch', 'orm', 'eager', 'lazy', 'performance', 'database'],
|
|
163
|
+
priority: 8,
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
text: 'What is the pagination strategy for list endpoints? (cursor-based for large sets, offset only for short lists; documented ordering)',
|
|
167
|
+
signals: ['pagination', 'cursor', 'offset', 'list', 'api', 'limit', 'page', 'order'],
|
|
168
|
+
priority: 7,
|
|
169
|
+
},
|
|
170
|
+
// ── Tier 7: 缓存策略 (priority 7) ─────────────────────
|
|
171
|
+
{
|
|
172
|
+
text: 'Is there a caching layer? What is cached (DB query results, API responses, computed values), and what is the invalidation strategy?',
|
|
173
|
+
id: 'caching-layer',
|
|
174
|
+
signals: ['cache', 'caching', 'redis', 'memcached', 'invalidation', 'ttl', 'stale', 'hit', 'miss'],
|
|
175
|
+
priority: 7,
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
text: 'What is the cache consistency strategy? (write-through, write-behind, cache-aside) — is stale data acceptable, and for how long?',
|
|
179
|
+
signals: ['cache', 'consistency', 'write-through', 'write-behind', 'cache-aside', 'stale', 'invalidation'],
|
|
180
|
+
priority: 7,
|
|
181
|
+
requiresAnswer: ['backend:caching-layer'],
|
|
182
|
+
},
|
|
183
|
+
// ── Tier 8: 认证/授权实现 (priority 7) ────────────────
|
|
184
|
+
{
|
|
185
|
+
text: 'How is tenant/user context propagated through the service chain? (header, context object, token passthrough) — is it tamper-proof?',
|
|
186
|
+
signals: ['tenant', 'user', 'context', 'propagation', 'header', 'token', 'service', 'chain'],
|
|
187
|
+
priority: 7,
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
text: 'Are permissions checked at the data layer, not just the API layer? (row-level security, ownership validation, tenant isolation)',
|
|
191
|
+
signals: ['permission', 'authorization', 'row-level', 'ownership', 'tenant', 'isolation', 'data'],
|
|
192
|
+
priority: 7,
|
|
193
|
+
},
|
|
194
|
+
// ── Tier 9: 日志与可观测性 (priority 6-7) ─────────────
|
|
195
|
+
{
|
|
196
|
+
text: 'What is logged for each request? (request ID, latency, status, user/tenant context — but no PII or secrets in logs)',
|
|
197
|
+
signals: ['logging', 'log', 'request', 'latency', 'trace', 'observability', 'structured', 'pii'],
|
|
198
|
+
priority: 7,
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
text: 'What metrics are emitted? (request count, error rate, latency percentiles, DB query time, cache hit ratio)',
|
|
202
|
+
signals: ['metrics', 'prometheus', 'grafana', 'datadog', 'latency', 'error rate', 'monitoring'],
|
|
203
|
+
priority: 6,
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
text: 'Is distributed tracing configured? Can we trace a request end-to-end across service boundaries?',
|
|
207
|
+
signals: ['tracing', 'distributed', 'trace', 'span', 'opentelemetry', 'jaeger', 'zipkin', 'propagation'],
|
|
208
|
+
priority: 6,
|
|
209
|
+
},
|
|
210
|
+
// ── Tier 10: 依赖与集成 (priority 6) ─────────────────
|
|
211
|
+
{
|
|
212
|
+
text: 'What external services does this depend on? What happens when each dependency is slow, unavailable, or returns unexpected data?',
|
|
213
|
+
signals: ['dependency', 'external', 'integration', 'circuit breaker', 'fallback', 'timeout', 'degradation'],
|
|
214
|
+
priority: 7,
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
text: 'How are API clients generated or shared? (OpenAPI/Swagger codegen, protobuf stubs, hand-written) — how are breaking changes communicated?',
|
|
218
|
+
signals: ['client', 'sdk', 'openapi', 'swagger', 'protobuf', 'codegen', 'breaking change', 'version'],
|
|
219
|
+
priority: 6,
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
text: 'Is there a feature flag or gradual rollout strategy for this change? How is it toggled and monitored?',
|
|
223
|
+
signals: ['feature flag', 'rollout', 'toggle', 'gradual', 'canary', 'launchdarkly', 'percentage'],
|
|
224
|
+
priority: 6,
|
|
225
|
+
},
|
|
226
|
+
// ── Tier 11: 数据安全 (priority 6-7) ──────────────────
|
|
227
|
+
{
|
|
228
|
+
text: 'Is sensitive data encrypted at rest and in transit? Are encryption keys managed and rotated?',
|
|
229
|
+
signals: ['encryption', 'at rest', 'in transit', 'key', 'sensitive', 'pii', 'tls', 'aes'],
|
|
230
|
+
priority: 7,
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
text: 'Are database credentials and connection strings managed via secret manager, not hardcoded or in config files?',
|
|
234
|
+
signals: ['secret', 'credential', 'database', 'connection', 'password', 'vault', 'env'],
|
|
235
|
+
priority: 7,
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
text: 'How is PII handled in the data layer? (encryption, tokenization, field-level masking, data retention/deletion)',
|
|
239
|
+
signals: ['pii', 'encryption', 'tokenization', 'masking', 'retention', 'deletion', 'gdpr', 'privacy'],
|
|
240
|
+
priority: 6,
|
|
241
|
+
},
|
|
242
|
+
],
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
// ── Design: 设计阶段 ─────────────────────────────────────
|
|
246
|
+
design: {
|
|
247
|
+
checklist: [
|
|
248
|
+
// 契约优先 (senior-backend Quick Start step 1)
|
|
249
|
+
'API / event contract defined first: inputs, outputs, errors, and idempotency expectations',
|
|
250
|
+
'Error responses use a stable, structured body with code / message / details — not free-form strings',
|
|
251
|
+
'HTTP status codes used correctly (4xx for client errors, 5xx for server errors); no 200 with error envelope',
|
|
252
|
+
'Pagination strategy declared per list endpoint with explicit ordering guarantees (cursor preferred for large datasets)',
|
|
253
|
+
'Idempotency strategy declared for every mutating operation that may be retried (idempotency key or natural key)',
|
|
254
|
+
// 数据所有权 (senior-backend step 2 + data-engineer)
|
|
255
|
+
'Data ownership clear: this change is authoritative for which tables / collections / streams',
|
|
256
|
+
'Schema change classified (additive / behavioral / breaking) with migration + backfill + rollback scripts written',
|
|
257
|
+
'Transaction boundary explicit: which operations must commit together vs which can be eventually consistent',
|
|
258
|
+
'Foreign key / referential integrity decisions made deliberately, not implied by ORM defaults',
|
|
259
|
+
// 数据管道 (data-engineer)
|
|
260
|
+
'For ingestion / ETL: schema and data-shape contracts at every boundary are documented',
|
|
261
|
+
'Replay / retry behavior preserves at-least-once semantics without duplicating critical records',
|
|
262
|
+
'Late-arrival / out-of-order handling defined (watermark, time window, or explicit reject)',
|
|
263
|
+
'Dead-letter / quarantine path exists for malformed input; no silent drops',
|
|
264
|
+
// 性能 (db-optimizer)
|
|
265
|
+
'Hot queries identified; query plans reviewed before adding new indexes — no speculative tuning',
|
|
266
|
+
'Index decisions weighed against write amplification and maintenance cost, not just read latency',
|
|
267
|
+
'Lock contention and transaction-duration risk considered for high-write paths',
|
|
268
|
+
'Caching layer (if any) declares key strategy, TTL, invalidation, and cache-stampede mitigation',
|
|
269
|
+
// 失败语义 (backend-developer)
|
|
270
|
+
'Failure semantics named explicitly: timeout, not-found, conflict, transient, permanent — not generic 500',
|
|
271
|
+
'Rate limit thresholds declared per endpoint with actionable response headers',
|
|
272
|
+
],
|
|
273
|
+
patterns: {
|
|
274
|
+
'Repository Pattern': 'Centralize data access behind a repository interface; controllers / handlers depend on the interface, not on ORM types. Keeps domain logic testable without a live DB.',
|
|
275
|
+
'Add-Backfill-Switch (Zero-Downtime Add Column)': 'Add column nullable / with default → backfill in bounded batches → application starts writing → add NOT NULL constraint after backfill completes. Reversible at every step.',
|
|
276
|
+
'Expand-Contract Schema Change': 'For renames / type changes: add new column → write to both → backfill → switch reads → drop old column in subsequent release. Each step is independently deployable and reversible.',
|
|
277
|
+
'Concurrent Index Creation': 'Use CREATE INDEX CONCURRENTLY (Postgres) or ALGORITHM=INPLACE (MySQL) on production tables; monitor lock-wait and replication lag during creation.',
|
|
278
|
+
'Idempotency Key Persistence': 'Persist (idempotency_key, response_hash, expires_at) for the SLA window of a retryable operation. Replays return the original outcome without re-executing side effects.',
|
|
279
|
+
'Outbox Pattern for Reliable Events': 'Write domain change + event row to the same DB transaction; a separate publisher reads the outbox and ships to the broker. Guarantees event publication matches DB commit.',
|
|
280
|
+
'Read-Through Cache with Stampede Protection': 'On cache miss, take a per-key lock or use single-flight; coalesce concurrent fills. Set TTL with jitter to avoid synchronized expiry across keys.',
|
|
281
|
+
},
|
|
282
|
+
antiPatterns: [
|
|
283
|
+
'Schema change without a written rollback script — every issue in production becomes a manual recovery',
|
|
284
|
+
'Adding a NOT NULL column with no default on a large existing table — exclusive lock + table rewrite blocks production',
|
|
285
|
+
'Foreign keys added before the data is consistent — migration fails partway and leaves the DB in a broken state',
|
|
286
|
+
'Designing batch jobs without a bounded batch size — one bad input ID locks the entire table',
|
|
287
|
+
'Implicit consistency assumptions across services that share a database — see "Shared database across services" in architecture',
|
|
288
|
+
'Letting framework defaults define transaction boundaries — implicit transactions either too wide (deadlocks) or too narrow (split writes)',
|
|
289
|
+
'"Cache everything" without a key strategy or invalidation plan — staleness becomes a permanent class of bug',
|
|
290
|
+
],
|
|
291
|
+
},
|
|
292
|
+
// ── Implement: 实施阶段 ──────────────────────────────────
|
|
293
|
+
implement: {
|
|
294
|
+
focusAreas: [
|
|
295
|
+
// 输入 / 验证 (senior-backend + backend-developer)
|
|
296
|
+
'Every API entry point validates type, format, length, and business rules at the boundary; raw input never reaches the domain layer',
|
|
297
|
+
'Authorization fires on the entry point itself, not buried in helpers; verified with at least two role accounts',
|
|
298
|
+
'Output is contract-safe: the public response type does not leak ORM internals or storage shape',
|
|
299
|
+
// 事务 / 幂等
|
|
300
|
+
'Transaction boundaries are tight and explicit; long transactions across external calls flagged and refactored',
|
|
301
|
+
'Mutating operations are idempotent or guarded by an idempotency key; retries do not produce duplicate side effects',
|
|
302
|
+
'Concurrent updates handled deliberately (optimistic locking, version columns, or row-level locks) — not by hope',
|
|
303
|
+
// 错误 / 可观测性
|
|
304
|
+
'Failure modes mapped to explicit response semantics: 400 (validation), 401, 403, 404, 409, 422, 429, 5xx — never a catch-all 500',
|
|
305
|
+
'Structured logging with correlation IDs, request IDs, and tenant scope on every log line in critical paths',
|
|
306
|
+
'Metrics emitted for latency, error rate, and saturation (golden signals) per endpoint or job',
|
|
307
|
+
// 数据库 / 性能 (db-optimizer)
|
|
308
|
+
'Queries reviewed via EXPLAIN / query plan before adding any index; bottleneck claim tied to evidence',
|
|
309
|
+
'N+1 queries detected during code review; ORM lazy loading inspected per high-traffic path',
|
|
310
|
+
'Pagination on list endpoints uses cursor (with stable ordering key) — never unbounded SELECT * over large tables',
|
|
311
|
+
'Index changes use concurrent / online algorithms on production-sized tables; lock-wait and replication lag monitored',
|
|
312
|
+
// 迁移 (database-migration)
|
|
313
|
+
'Forward and rollback migration scripts both exist; rollback tested against production-sized data or estimated',
|
|
314
|
+
'Backfills are batched (1k–10k rows), bounded by timeout, and resumable on failure — not single-shot UPDATE statements',
|
|
315
|
+
'NOT NULL constraints applied only after backfill completes and reads no longer expect null',
|
|
316
|
+
// 数据管道 (data-engineer)
|
|
317
|
+
'Replay / dedup logic ensures repeated processing does not corrupt downstream aggregates',
|
|
318
|
+
'Bad inputs route to a dead-letter / quarantine path; the ingestion job does not crash on malformed records',
|
|
319
|
+
'Lineage / provenance recorded for transformed data so downstream debugging traces back to source',
|
|
320
|
+
'Type coercion and null handling reviewed explicitly — silent business-meaning corruption is the most expensive class of bug',
|
|
321
|
+
],
|
|
322
|
+
patterns: {
|
|
323
|
+
'Validation at the Boundary': 'Validate the entire request DTO at the entry layer (controller / handler) using a schema (Zod / Joi / proto). Reject early with structured errors; never pass partially-validated input downstream.',
|
|
324
|
+
'Bounded Backfill Batches': 'Process backfills in batches of 1k–10k rows ordered by primary key; persist last-processed key for resumability; bound each batch with statement_timeout to avoid table locks.',
|
|
325
|
+
'EXPLAIN Before INDEX': 'For every reported slow query: capture EXPLAIN ANALYZE on production-shaped data, name the bottleneck (planner choice / cardinality / lock), then propose the smallest index or rewrite that addresses it.',
|
|
326
|
+
'Outbox + Periodic Publisher': 'Domain transactions write to an outbox table; a publisher worker reads committed outbox rows and ships to Kafka / SQS / Pub/Sub with idempotent delivery.',
|
|
327
|
+
'Dead-Letter Queue with Replay': 'Failed messages land in DLQ with full context (original payload, failure reason, retry count). Replay tooling exists and has been used at least once.',
|
|
328
|
+
},
|
|
329
|
+
antiPatterns: [
|
|
330
|
+
'Building SQL queries with string concatenation or template literals — see security domain for full impact; here the operational risk is also injection-class incidents',
|
|
331
|
+
'Trusting client-side validation — every server endpoint must re-validate input at the boundary',
|
|
332
|
+
'Catching all errors with a generic try/catch and returning 200 OK — kills retry semantics and hides regressions',
|
|
333
|
+
'SELECT * without LIMIT on tables that grow — works in dev, takes the DB down in production at 10× the size',
|
|
334
|
+
'N+1 queries (one query per item in a loop) — looks fine until the list grows; profile with a realistic dataset',
|
|
335
|
+
'Long-running transactions that span external HTTP calls — every external timeout becomes a database lock',
|
|
336
|
+
'Single-shot UPDATE on millions of rows — exclusive lock, replication lag spike, and rollback impossible mid-flight',
|
|
337
|
+
'Silent type coercion in ETL (string "0" treated as truthy, null treated as zero) — corrupts business meaning without alerting',
|
|
338
|
+
],
|
|
339
|
+
},
|
|
340
|
+
// ── Verify: 验证阶段 ─────────────────────────────────────
|
|
341
|
+
verify: {
|
|
342
|
+
checklist: [
|
|
343
|
+
// 契约 / API 验证
|
|
344
|
+
'Contract test passes for every endpoint: success path, validation failure, auth failure, not-found, and rate-limit response shapes match documented contract',
|
|
345
|
+
'Idempotency verified end-to-end for mutating operations: duplicate request returns original outcome, no duplicate side effect',
|
|
346
|
+
'Pagination verified on list endpoints: cursor stable across inserts, ordering deterministic, no skipped or duplicated rows',
|
|
347
|
+
'Authorization verified with at least two role accounts; cross-tenant access attempts are rejected at the boundary',
|
|
348
|
+
// 数据完整性
|
|
349
|
+
'Migration ran on a production-sized dataset (or duration estimated within a stated bound) before release',
|
|
350
|
+
'Rollback migration tested at least once on a representative dataset',
|
|
351
|
+
'Backfill completion verified — no rows remain with the old shape after the cut-over',
|
|
352
|
+
'Foreign key / referential constraints verified after migration; orphan-row check ran clean',
|
|
353
|
+
// 性能 / 故障路径
|
|
354
|
+
'Hot query plans reviewed; no full table scans on large tables in critical paths',
|
|
355
|
+
'High-risk failure path tested (DB unavailable, queue lag, partial write) — the system fails as designed, not by accident',
|
|
356
|
+
'Transaction rollback behavior verified for changed write paths — partial writes do not survive on error',
|
|
357
|
+
// 数据管道
|
|
358
|
+
'Replay / retry produces no duplicate or dropped records on the changed segment',
|
|
359
|
+
'Dead-letter / quarantine path exercised at least once with a known-bad input; downstream consumers notified as designed',
|
|
360
|
+
'Schema or contract change versioned or flagged for downstream owners; consumers had time to adapt',
|
|
361
|
+
// 可观测性
|
|
362
|
+
'Logs include correlation ID and tenant scope on every line for the changed path',
|
|
363
|
+
'Metrics emitted for latency / error rate / saturation per endpoint or job and are visible in the dashboard',
|
|
364
|
+
],
|
|
365
|
+
},
|
|
366
|
+
};
|
|
367
|
+
//# sourceMappingURL=backend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../../src/domains/backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAIH,MAAM,CAAC,MAAM,aAAa,GAAiB;IACzC,IAAI,EAAE,SAAS;IACf,WAAW,EACT,kIAAkI;IAEpI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,EACpB,4MAA4M;YAC9M,6BAA6B,EAC3B,2JAA2J;YAC7J,+BAA+B,EAC7B,uJAAuJ;SAC1J;QAED,YAAY,EAAE;YACZ,wKAAwK;YACxK,gGAAgG;YAChG,iHAAiH;YACjH,4GAA4G;YAC5G,gHAAgH;YAChH,0GAA0G;YAC1G,oHAAoH;YACpH,+HAA+H;SAChI;KACF;IAED,wDAAwD;IAExD,MAAM,EAAE;QACN,SAAS,EAAE;YACT,cAAc;YACd,8JAA8J;YAC9J,+HAA+H;YAC/H,4HAA4H;YAC5H,mHAAmH;YACnH,QAAQ;YACR,0GAA0G;YAC1G,qEAAqE;YACrE,qFAAqF;YACrF,4FAA4F;YAC5F,YAAY;YACZ,iFAAiF;YACjF,0HAA0H;YAC1H,yGAAyG;YACzG,OAAO;YACP,gFAAgF;YAChF,yHAAyH;YACzH,mGAAmG;YACnG,OAAO;YACP,iFAAiF;YACjF,4GAA4G;SAC7G;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frontend Domain Module
|
|
3
|
+
*
|
|
4
|
+
* 来源 (5 个):
|
|
5
|
+
* - content/skills/frontend-ui-design/SKILL.md (110 行)
|
|
6
|
+
* + references/aesthetic-playbook.md (49) / anti-patterns.md (23) /
|
|
7
|
+
* tokens-and-semantics.md (38) / implementation-patterns.md (56) /
|
|
8
|
+
* react-next-best-practices.md (25) / ai-native-ui-patterns.md (42)
|
|
9
|
+
* 设计方向 / 一个 signature move / 设计令牌 / 严格 vs 灵活规则 / a11y / 性能预算
|
|
10
|
+
* - content/skills/react-best-practices/SKILL.md (122 行)
|
|
11
|
+
* Vercel 8 类共 45 条规则索引:消除 waterfall / bundle / 服务端 / 客户端数据 / 重渲染 / 渲染性能 / JS / 高级模式
|
|
12
|
+
* - content/roles/01-core-development/frontend-developer.toml (42 行)
|
|
13
|
+
* 用户可见行为 + state 完整性;route/component/state/data 边界
|
|
14
|
+
* - content/roles/01-core-development/ui-engineer.toml (47 行)
|
|
15
|
+
* 设计任务 + 修复任务双模式;交互状态 / 焦点顺序 / 视觉一致性
|
|
16
|
+
* - content/roles/01-core-development/mobile-developer.toml (47 行)
|
|
17
|
+
* RN/Flutter/SwiftUI/Compose;导航 / 状态 / 离线 / 平台 API;触控目标
|
|
18
|
+
*
|
|
19
|
+
* 压缩方法:
|
|
20
|
+
* 1. frontend-ui-design Quick Start + Workflow → design.checklist + design.patterns
|
|
21
|
+
* 2. aesthetic-playbook 6 个方向 → design.patterns "Aesthetic Direction"
|
|
22
|
+
* 3. anti-patterns.md 视觉/字体/动效/UX 反例 → design.antiPatterns
|
|
23
|
+
* 4. tokens-and-semantics 严格 vs 灵活规则 → design.checklist + implement.focusAreas
|
|
24
|
+
* 5. react-best-practices 8 类 45 规则 → implement.patterns + implement.antiPatterns(核心模式)
|
|
25
|
+
* 6. frontend-developer + ui-engineer quality checks → verify.checklist
|
|
26
|
+
* 7. mobile-developer 平台特定关注点 → design.checklist + implement.focusAreas
|
|
27
|
+
*
|
|
28
|
+
* 与相邻领域的边界:
|
|
29
|
+
* - 'lighthouse' / 'core web vitals' / 'lcp' 归 frontend;quality 用通用 'baseline metric'
|
|
30
|
+
* - 'bundle size' 归 frontend(tree-shaking / code splitting);operations 关注 release artefact
|
|
31
|
+
* - 'css' / 'animation' / 'react' 归 frontend;quality 关注通用 testing / review 方法
|
|
32
|
+
* - 'accessibility' / 'a11y' 归 frontend;security 关注 authn/authz
|
|
33
|
+
*/
|
|
34
|
+
import type { DomainModule } from './types.js';
|
|
35
|
+
export declare const frontendDomain: DomainModule;
|
|
36
|
+
//# sourceMappingURL=frontend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontend.d.ts","sourceRoot":"","sources":["../../src/domains/frontend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,eAAO,MAAM,cAAc,EAAE,YAqX5B,CAAC"}
|