@jakkrichm/create-nexus-devflow 2.0.19 → 2.0.21
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/dist/lib/update.js +19 -8
- package/dist/lib/update.js.map +1 -1
- package/package.json +1 -1
- package/template/.agents/skills/00-discover/SKILL.md +28 -116
- package/template/.agents/skills/40-execute/SKILL.md +1 -1
- package/template/.agents/skills/50-verify/SKILL.md +28 -161
- package/template/.agents/skills/60-report/SKILL.md +19 -92
- package/template/.agents/skills/70-release/SKILL.md +36 -11
- package/template/.agents/skills/check/SKILL.md +19 -7
- package/template/.agents/skills/complete/SKILL.md +21 -10
- package/template/.claude/skills/00-discover/SKILL.md +28 -116
- package/template/.claude/skills/40-execute/SKILL.md +1 -1
- package/template/.claude/skills/50-verify/SKILL.md +28 -161
- package/template/.claude/skills/60-report/SKILL.md +19 -92
- package/template/.claude/skills/70-release/SKILL.md +36 -11
- package/template/.claude/skills/check/SKILL.md +19 -7
- package/template/.claude/skills/complete/SKILL.md +21 -10
- package/template/AGENTS.md +1 -1
- package/template/devflow/context/coding-standards.md +40 -29
- package/template/.agents/skills/agent/SKILL.md +0 -165
- package/template/.agents/skills/api-and-interface-design/SKILL.md +0 -294
- package/template/.agents/skills/app-builder/SKILL.md +0 -75
- package/template/.agents/skills/app-builder/agent-coordination.md +0 -71
- package/template/.agents/skills/app-builder/feature-building.md +0 -53
- package/template/.agents/skills/app-builder/project-detection.md +0 -34
- package/template/.agents/skills/app-builder/scaffolding.md +0 -118
- package/template/.agents/skills/app-builder/tech-stack.md +0 -40
- package/template/.agents/skills/app-builder/templates/SKILL.md +0 -39
- package/template/.agents/skills/app-builder/templates/astro-static/TEMPLATE.md +0 -76
- package/template/.agents/skills/app-builder/templates/chrome-extension/TEMPLATE.md +0 -92
- package/template/.agents/skills/app-builder/templates/cli-tool/TEMPLATE.md +0 -88
- package/template/.agents/skills/app-builder/templates/electron-desktop/TEMPLATE.md +0 -88
- package/template/.agents/skills/app-builder/templates/express-api/TEMPLATE.md +0 -83
- package/template/.agents/skills/app-builder/templates/flutter-app/TEMPLATE.md +0 -90
- package/template/.agents/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +0 -90
- package/template/.agents/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +0 -122
- package/template/.agents/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +0 -122
- package/template/.agents/skills/app-builder/templates/nextjs-static/TEMPLATE.md +0 -169
- package/template/.agents/skills/app-builder/templates/nuxt-app/TEMPLATE.md +0 -134
- package/template/.agents/skills/app-builder/templates/python-fastapi/TEMPLATE.md +0 -83
- package/template/.agents/skills/app-builder/templates/react-native-app/TEMPLATE.md +0 -119
- package/template/.agents/skills/architecture/SKILL.md +0 -55
- package/template/.agents/skills/architecture/context-discovery.md +0 -43
- package/template/.agents/skills/architecture/examples.md +0 -94
- package/template/.agents/skills/architecture/pattern-selection.md +0 -68
- package/template/.agents/skills/architecture/patterns-reference.md +0 -50
- package/template/.agents/skills/architecture/trade-off-analysis.md +0 -77
- package/template/.agents/skills/bash-linux/SKILL.md +0 -199
- package/template/.agents/skills/behavioral-modes/SKILL.md +0 -242
- package/template/.agents/skills/brainstorm/SKILL.md +0 -168
- package/template/.agents/skills/changelog/SKILL.md +0 -109
- package/template/.agents/skills/codebase-design/DEEPENING.md +0 -24
- package/template/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +0 -28
- package/template/.agents/skills/codebase-design/SKILL.md +0 -58
- package/template/.agents/skills/commit/SKILL.md +0 -59
- package/template/.agents/skills/competitor-analysis/SKILL.md +0 -66
- package/template/.agents/skills/context-engineering/SKILL.md +0 -290
- package/template/.agents/skills/database-design/SKILL.md +0 -52
- package/template/.agents/skills/database-design/database-selection.md +0 -43
- package/template/.agents/skills/database-design/indexing.md +0 -39
- package/template/.agents/skills/database-design/migrations.md +0 -48
- package/template/.agents/skills/database-design/optimization.md +0 -36
- package/template/.agents/skills/database-design/orm-selection.md +0 -30
- package/template/.agents/skills/database-design/schema-design.md +0 -56
- package/template/.agents/skills/database-design/scripts/schema_validator.py +0 -172
- package/template/.agents/skills/deploy/SKILL.md +0 -63
- package/template/.agents/skills/documentation-and-adrs/SKILL.md +0 -278
- package/template/.agents/skills/domain-modeling/ADR-FORMAT.md +0 -47
- package/template/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +0 -60
- package/template/.agents/skills/domain-modeling/SKILL.md +0 -74
- package/template/.agents/skills/followup/SKILL.md +0 -83
- package/template/.agents/skills/frontend-ui-engineering/SKILL.md +0 -326
- package/template/.agents/skills/frontend-ui-engineering/accessibility-checklist.md +0 -159
- package/template/.agents/skills/goal/SKILL.md +0 -148
- package/template/.agents/skills/handoff/SKILL.md +0 -46
- package/template/.agents/skills/help/SKILL.md +0 -253
- package/template/.agents/skills/i18n-localization/SKILL.md +0 -154
- package/template/.agents/skills/i18n-localization/scripts/i18n_checker.py +0 -241
- package/template/.agents/skills/insight/SKILL.md +0 -42
- package/template/.agents/skills/issue-triage/SKILL.md +0 -115
- package/template/.agents/skills/lint-and-validate/SKILL.md +0 -45
- package/template/.agents/skills/lint-and-validate/scripts/lint_runner.py +0 -184
- package/template/.agents/skills/lint-and-validate/scripts/type_coverage.py +0 -173
- package/template/.agents/skills/mcp-builder/SKILL.md +0 -176
- package/template/.agents/skills/merge/SKILL.md +0 -76
- package/template/.agents/skills/mobile-design/SKILL.md +0 -394
- package/template/.agents/skills/mobile-design/decision-trees.md +0 -516
- package/template/.agents/skills/mobile-design/mobile-backend.md +0 -491
- package/template/.agents/skills/mobile-design/mobile-color-system.md +0 -420
- package/template/.agents/skills/mobile-design/mobile-debugging.md +0 -122
- package/template/.agents/skills/mobile-design/mobile-design-thinking.md +0 -357
- package/template/.agents/skills/mobile-design/mobile-navigation.md +0 -458
- package/template/.agents/skills/mobile-design/mobile-performance.md +0 -767
- package/template/.agents/skills/mobile-design/mobile-testing.md +0 -356
- package/template/.agents/skills/mobile-design/mobile-typography.md +0 -433
- package/template/.agents/skills/mobile-design/platform-android.md +0 -666
- package/template/.agents/skills/mobile-design/platform-ios.md +0 -561
- package/template/.agents/skills/mobile-design/scripts/mobile_audit.py +0 -670
- package/template/.agents/skills/mobile-design/touch-psychology.md +0 -537
- package/template/.agents/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +0 -312
- package/template/.agents/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +0 -240
- package/template/.agents/skills/nextjs-react-expert/3-server-server-side-performance.md +0 -490
- package/template/.agents/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +0 -264
- package/template/.agents/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +0 -581
- package/template/.agents/skills/nextjs-react-expert/6-rendering-rendering-performance.md +0 -432
- package/template/.agents/skills/nextjs-react-expert/7-js-javascript-performance.md +0 -684
- package/template/.agents/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +0 -150
- package/template/.agents/skills/nextjs-react-expert/SKILL.md +0 -286
- package/template/.agents/skills/nextjs-react-expert/scripts/convert_rules.py +0 -222
- package/template/.agents/skills/nextjs-react-expert/scripts/react_performance_checker.py +0 -252
- package/template/.agents/skills/nodejs-best-practices/SKILL.md +0 -333
- package/template/.agents/skills/package-json-generator/SKILL.md +0 -60
- package/template/.agents/skills/package-json-generator/scripts/generate.js +0 -120
- package/template/.agents/skills/package-json-generator/scripts/run.sh +0 -19
- package/template/.agents/skills/parallel-agents/SKILL.md +0 -144
- package/template/.agents/skills/performance-optimization/SKILL.md +0 -299
- package/template/.agents/skills/performance-optimization/performance-checklist.md +0 -113
- package/template/.agents/skills/powershell-windows/SKILL.md +0 -167
- package/template/.agents/skills/pr/SKILL.md +0 -93
- package/template/.agents/skills/prd/SKILL.md +0 -127
- package/template/.agents/skills/preview/SKILL.md +0 -42
- package/template/.agents/skills/python-patterns/SKILL.md +0 -441
- package/template/.agents/skills/research/SKILL.md +0 -143
- package/template/.agents/skills/review/SKILL.md +0 -71
- package/template/.agents/skills/roadmap-strategy/SKILL.md +0 -94
- package/template/.agents/skills/security-review/SKILL.md +0 -63
- package/template/.agents/skills/seo-fundamentals/SKILL.md +0 -129
- package/template/.agents/skills/seo-fundamentals/scripts/seo_checker.py +0 -219
- package/template/.agents/skills/server-management/SKILL.md +0 -161
- package/template/.agents/skills/simplify/SKILL.md +0 -70
- package/template/.agents/skills/skill-development/SKILL.md +0 -86
- package/template/.agents/skills/spec/SKILL.md +0 -39
- package/template/.agents/skills/spec-driven-development/SKILL.md +0 -207
- package/template/.agents/skills/tailwind-patterns/SKILL.md +0 -269
- package/template/.agents/skills/type-design/SKILL.md +0 -84
- package/template/.agents/skills/ui-ux-pro-max/SKILL.md +0 -75
- package/template/.claude/skills/agent/SKILL.md +0 -165
- package/template/.claude/skills/api-and-interface-design/SKILL.md +0 -294
- package/template/.claude/skills/app-builder/SKILL.md +0 -75
- package/template/.claude/skills/app-builder/agent-coordination.md +0 -71
- package/template/.claude/skills/app-builder/feature-building.md +0 -53
- package/template/.claude/skills/app-builder/project-detection.md +0 -34
- package/template/.claude/skills/app-builder/scaffolding.md +0 -118
- package/template/.claude/skills/app-builder/tech-stack.md +0 -40
- package/template/.claude/skills/app-builder/templates/SKILL.md +0 -39
- package/template/.claude/skills/app-builder/templates/astro-static/TEMPLATE.md +0 -76
- package/template/.claude/skills/app-builder/templates/chrome-extension/TEMPLATE.md +0 -92
- package/template/.claude/skills/app-builder/templates/cli-tool/TEMPLATE.md +0 -88
- package/template/.claude/skills/app-builder/templates/electron-desktop/TEMPLATE.md +0 -88
- package/template/.claude/skills/app-builder/templates/express-api/TEMPLATE.md +0 -83
- package/template/.claude/skills/app-builder/templates/flutter-app/TEMPLATE.md +0 -90
- package/template/.claude/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +0 -90
- package/template/.claude/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +0 -122
- package/template/.claude/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +0 -122
- package/template/.claude/skills/app-builder/templates/nextjs-static/TEMPLATE.md +0 -169
- package/template/.claude/skills/app-builder/templates/nuxt-app/TEMPLATE.md +0 -134
- package/template/.claude/skills/app-builder/templates/python-fastapi/TEMPLATE.md +0 -83
- package/template/.claude/skills/app-builder/templates/react-native-app/TEMPLATE.md +0 -119
- package/template/.claude/skills/architecture/SKILL.md +0 -55
- package/template/.claude/skills/architecture/context-discovery.md +0 -43
- package/template/.claude/skills/architecture/examples.md +0 -94
- package/template/.claude/skills/architecture/pattern-selection.md +0 -68
- package/template/.claude/skills/architecture/patterns-reference.md +0 -50
- package/template/.claude/skills/architecture/trade-off-analysis.md +0 -77
- package/template/.claude/skills/bash-linux/SKILL.md +0 -199
- package/template/.claude/skills/behavioral-modes/SKILL.md +0 -242
- package/template/.claude/skills/brainstorm/SKILL.md +0 -168
- package/template/.claude/skills/changelog/SKILL.md +0 -109
- package/template/.claude/skills/codebase-design/DEEPENING.md +0 -24
- package/template/.claude/skills/codebase-design/DESIGN-IT-TWICE.md +0 -28
- package/template/.claude/skills/codebase-design/SKILL.md +0 -58
- package/template/.claude/skills/commit/SKILL.md +0 -59
- package/template/.claude/skills/competitor-analysis/SKILL.md +0 -66
- package/template/.claude/skills/context-engineering/SKILL.md +0 -290
- package/template/.claude/skills/database-design/SKILL.md +0 -52
- package/template/.claude/skills/database-design/database-selection.md +0 -43
- package/template/.claude/skills/database-design/indexing.md +0 -39
- package/template/.claude/skills/database-design/migrations.md +0 -48
- package/template/.claude/skills/database-design/optimization.md +0 -36
- package/template/.claude/skills/database-design/orm-selection.md +0 -30
- package/template/.claude/skills/database-design/schema-design.md +0 -56
- package/template/.claude/skills/database-design/scripts/schema_validator.py +0 -172
- package/template/.claude/skills/deploy/SKILL.md +0 -63
- package/template/.claude/skills/documentation-and-adrs/SKILL.md +0 -278
- package/template/.claude/skills/domain-modeling/ADR-FORMAT.md +0 -47
- package/template/.claude/skills/domain-modeling/CONTEXT-FORMAT.md +0 -60
- package/template/.claude/skills/domain-modeling/SKILL.md +0 -74
- package/template/.claude/skills/followup/SKILL.md +0 -83
- package/template/.claude/skills/frontend-ui-engineering/SKILL.md +0 -326
- package/template/.claude/skills/frontend-ui-engineering/accessibility-checklist.md +0 -159
- package/template/.claude/skills/goal/SKILL.md +0 -148
- package/template/.claude/skills/handoff/SKILL.md +0 -46
- package/template/.claude/skills/help/SKILL.md +0 -253
- package/template/.claude/skills/i18n-localization/SKILL.md +0 -154
- package/template/.claude/skills/i18n-localization/scripts/i18n_checker.py +0 -241
- package/template/.claude/skills/insight/SKILL.md +0 -42
- package/template/.claude/skills/issue-triage/SKILL.md +0 -115
- package/template/.claude/skills/lint-and-validate/SKILL.md +0 -45
- package/template/.claude/skills/lint-and-validate/scripts/lint_runner.py +0 -184
- package/template/.claude/skills/lint-and-validate/scripts/type_coverage.py +0 -173
- package/template/.claude/skills/mcp-builder/SKILL.md +0 -176
- package/template/.claude/skills/merge/SKILL.md +0 -76
- package/template/.claude/skills/mobile-design/SKILL.md +0 -394
- package/template/.claude/skills/mobile-design/decision-trees.md +0 -516
- package/template/.claude/skills/mobile-design/mobile-backend.md +0 -491
- package/template/.claude/skills/mobile-design/mobile-color-system.md +0 -420
- package/template/.claude/skills/mobile-design/mobile-debugging.md +0 -122
- package/template/.claude/skills/mobile-design/mobile-design-thinking.md +0 -357
- package/template/.claude/skills/mobile-design/mobile-navigation.md +0 -458
- package/template/.claude/skills/mobile-design/mobile-performance.md +0 -767
- package/template/.claude/skills/mobile-design/mobile-testing.md +0 -356
- package/template/.claude/skills/mobile-design/mobile-typography.md +0 -433
- package/template/.claude/skills/mobile-design/platform-android.md +0 -666
- package/template/.claude/skills/mobile-design/platform-ios.md +0 -561
- package/template/.claude/skills/mobile-design/scripts/mobile_audit.py +0 -670
- package/template/.claude/skills/mobile-design/touch-psychology.md +0 -537
- package/template/.claude/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +0 -312
- package/template/.claude/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +0 -240
- package/template/.claude/skills/nextjs-react-expert/3-server-server-side-performance.md +0 -490
- package/template/.claude/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +0 -264
- package/template/.claude/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +0 -581
- package/template/.claude/skills/nextjs-react-expert/6-rendering-rendering-performance.md +0 -432
- package/template/.claude/skills/nextjs-react-expert/7-js-javascript-performance.md +0 -684
- package/template/.claude/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +0 -150
- package/template/.claude/skills/nextjs-react-expert/SKILL.md +0 -286
- package/template/.claude/skills/nextjs-react-expert/scripts/convert_rules.py +0 -222
- package/template/.claude/skills/nextjs-react-expert/scripts/react_performance_checker.py +0 -252
- package/template/.claude/skills/nodejs-best-practices/SKILL.md +0 -333
- package/template/.claude/skills/package-json-generator/SKILL.md +0 -60
- package/template/.claude/skills/package-json-generator/scripts/generate.js +0 -120
- package/template/.claude/skills/package-json-generator/scripts/run.sh +0 -19
- package/template/.claude/skills/parallel-agents/SKILL.md +0 -144
- package/template/.claude/skills/performance-optimization/SKILL.md +0 -299
- package/template/.claude/skills/performance-optimization/performance-checklist.md +0 -113
- package/template/.claude/skills/powershell-windows/SKILL.md +0 -167
- package/template/.claude/skills/pr/SKILL.md +0 -93
- package/template/.claude/skills/prd/SKILL.md +0 -127
- package/template/.claude/skills/preview/SKILL.md +0 -42
- package/template/.claude/skills/python-patterns/SKILL.md +0 -441
- package/template/.claude/skills/research/SKILL.md +0 -143
- package/template/.claude/skills/review/SKILL.md +0 -71
- package/template/.claude/skills/roadmap-strategy/SKILL.md +0 -94
- package/template/.claude/skills/security-review/SKILL.md +0 -63
- package/template/.claude/skills/seo-fundamentals/SKILL.md +0 -129
- package/template/.claude/skills/seo-fundamentals/scripts/seo_checker.py +0 -219
- package/template/.claude/skills/server-management/SKILL.md +0 -161
- package/template/.claude/skills/simplify/SKILL.md +0 -70
- package/template/.claude/skills/skill-development/SKILL.md +0 -86
- package/template/.claude/skills/spec/SKILL.md +0 -39
- package/template/.claude/skills/spec-driven-development/SKILL.md +0 -207
- package/template/.claude/skills/tailwind-patterns/SKILL.md +0 -269
- package/template/.claude/skills/type-design/SKILL.md +0 -84
- package/template/.claude/skills/ui-ux-pro-max/SKILL.md +0 -75
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""
|
|
3
|
-
Schema Validator - Database schema validation
|
|
4
|
-
Validates Prisma schemas and checks for common issues.
|
|
5
|
-
|
|
6
|
-
Usage:
|
|
7
|
-
python schema_validator.py <project_path>
|
|
8
|
-
|
|
9
|
-
Checks:
|
|
10
|
-
- Prisma schema syntax
|
|
11
|
-
- Missing relations
|
|
12
|
-
- Index recommendations
|
|
13
|
-
- Naming conventions
|
|
14
|
-
"""
|
|
15
|
-
|
|
16
|
-
import sys
|
|
17
|
-
import json
|
|
18
|
-
import re
|
|
19
|
-
from pathlib import Path
|
|
20
|
-
from datetime import datetime
|
|
21
|
-
|
|
22
|
-
# Fix Windows console encoding
|
|
23
|
-
try:
|
|
24
|
-
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
|
|
25
|
-
except:
|
|
26
|
-
pass
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def find_schema_files(project_path: Path) -> list:
|
|
30
|
-
"""Find database schema files."""
|
|
31
|
-
schemas = []
|
|
32
|
-
|
|
33
|
-
# Prisma schema
|
|
34
|
-
prisma_files = list(project_path.glob('**/prisma/schema.prisma'))
|
|
35
|
-
schemas.extend([('prisma', f) for f in prisma_files])
|
|
36
|
-
|
|
37
|
-
# Drizzle schema files
|
|
38
|
-
drizzle_files = list(project_path.glob('**/drizzle/*.ts'))
|
|
39
|
-
drizzle_files.extend(project_path.glob('**/schema/*.ts'))
|
|
40
|
-
for f in drizzle_files:
|
|
41
|
-
if 'schema' in f.name.lower() or 'table' in f.name.lower():
|
|
42
|
-
schemas.append(('drizzle', f))
|
|
43
|
-
|
|
44
|
-
return schemas[:10] # Limit
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
def validate_prisma_schema(file_path: Path) -> list:
|
|
48
|
-
"""Validate Prisma schema file."""
|
|
49
|
-
issues = []
|
|
50
|
-
|
|
51
|
-
try:
|
|
52
|
-
content = file_path.read_text(encoding='utf-8', errors='ignore')
|
|
53
|
-
|
|
54
|
-
# Find all models
|
|
55
|
-
models = re.findall(r'model\s+(\w+)\s*{([^}]+)}', content, re.DOTALL)
|
|
56
|
-
|
|
57
|
-
for model_name, model_body in models:
|
|
58
|
-
# Check naming convention (PascalCase)
|
|
59
|
-
if not model_name[0].isupper():
|
|
60
|
-
issues.append(f"Model '{model_name}' should be PascalCase")
|
|
61
|
-
|
|
62
|
-
# Check for id field
|
|
63
|
-
if '@id' not in model_body and 'id' not in model_body.lower():
|
|
64
|
-
issues.append(f"Model '{model_name}' might be missing @id field")
|
|
65
|
-
|
|
66
|
-
# Check for createdAt/updatedAt
|
|
67
|
-
if 'createdAt' not in model_body and 'created_at' not in model_body:
|
|
68
|
-
issues.append(f"Model '{model_name}' missing createdAt field (recommended)")
|
|
69
|
-
|
|
70
|
-
# Check for @relation without fields
|
|
71
|
-
relations = re.findall(r'@relation\([^)]*\)', model_body)
|
|
72
|
-
for rel in relations:
|
|
73
|
-
if 'fields:' not in rel and 'references:' not in rel:
|
|
74
|
-
pass # Implicit relation, ok
|
|
75
|
-
|
|
76
|
-
# Check for @@index suggestions
|
|
77
|
-
foreign_keys = re.findall(r'(\w+Id)\s+\w+', model_body)
|
|
78
|
-
for fk in foreign_keys:
|
|
79
|
-
if f'@@index([{fk}])' not in content and f'@@index(["{fk}"])' not in content:
|
|
80
|
-
issues.append(f"Consider adding @@index([{fk}]) for better query performance in {model_name}")
|
|
81
|
-
|
|
82
|
-
# Check for enum definitions
|
|
83
|
-
enums = re.findall(r'enum\s+(\w+)\s*{', content)
|
|
84
|
-
for enum_name in enums:
|
|
85
|
-
if not enum_name[0].isupper():
|
|
86
|
-
issues.append(f"Enum '{enum_name}' should be PascalCase")
|
|
87
|
-
|
|
88
|
-
except Exception as e:
|
|
89
|
-
issues.append(f"Error reading schema: {str(e)[:50]}")
|
|
90
|
-
|
|
91
|
-
return issues
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
def main():
|
|
95
|
-
project_path = Path(sys.argv[1] if len(sys.argv) > 1 else ".").resolve()
|
|
96
|
-
|
|
97
|
-
print(f"\n{'='*60}")
|
|
98
|
-
print(f"[SCHEMA VALIDATOR] Database Schema Validation")
|
|
99
|
-
print(f"{'='*60}")
|
|
100
|
-
print(f"Project: {project_path}")
|
|
101
|
-
print(f"Time: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
|
|
102
|
-
print("-"*60)
|
|
103
|
-
|
|
104
|
-
# Find schema files
|
|
105
|
-
schemas = find_schema_files(project_path)
|
|
106
|
-
print(f"Found {len(schemas)} schema files")
|
|
107
|
-
|
|
108
|
-
if not schemas:
|
|
109
|
-
output = {
|
|
110
|
-
"script": "schema_validator",
|
|
111
|
-
"project": str(project_path),
|
|
112
|
-
"schemas_checked": 0,
|
|
113
|
-
"issues_found": 0,
|
|
114
|
-
"passed": True,
|
|
115
|
-
"message": "No schema files found"
|
|
116
|
-
}
|
|
117
|
-
print(json.dumps(output, indent=2))
|
|
118
|
-
sys.exit(0)
|
|
119
|
-
|
|
120
|
-
# Validate each schema
|
|
121
|
-
all_issues = []
|
|
122
|
-
|
|
123
|
-
for schema_type, file_path in schemas:
|
|
124
|
-
print(f"\nValidating: {file_path.name} ({schema_type})")
|
|
125
|
-
|
|
126
|
-
if schema_type == 'prisma':
|
|
127
|
-
issues = validate_prisma_schema(file_path)
|
|
128
|
-
else:
|
|
129
|
-
issues = [] # Drizzle validation could be added
|
|
130
|
-
|
|
131
|
-
if issues:
|
|
132
|
-
all_issues.append({
|
|
133
|
-
"file": str(file_path.name),
|
|
134
|
-
"type": schema_type,
|
|
135
|
-
"issues": issues
|
|
136
|
-
})
|
|
137
|
-
|
|
138
|
-
# Summary
|
|
139
|
-
print("\n" + "="*60)
|
|
140
|
-
print("SCHEMA ISSUES")
|
|
141
|
-
print("="*60)
|
|
142
|
-
|
|
143
|
-
if all_issues:
|
|
144
|
-
for item in all_issues:
|
|
145
|
-
print(f"\n{item['file']} ({item['type']}):")
|
|
146
|
-
for issue in item["issues"][:5]: # Limit per file
|
|
147
|
-
print(f" - {issue}")
|
|
148
|
-
if len(item["issues"]) > 5:
|
|
149
|
-
print(f" ... and {len(item['issues']) - 5} more issues")
|
|
150
|
-
else:
|
|
151
|
-
print("No schema issues found!")
|
|
152
|
-
|
|
153
|
-
total_issues = sum(len(item["issues"]) for item in all_issues)
|
|
154
|
-
# Schema issues are warnings, not failures
|
|
155
|
-
passed = True
|
|
156
|
-
|
|
157
|
-
output = {
|
|
158
|
-
"script": "schema_validator",
|
|
159
|
-
"project": str(project_path),
|
|
160
|
-
"schemas_checked": len(schemas),
|
|
161
|
-
"issues_found": total_issues,
|
|
162
|
-
"passed": passed,
|
|
163
|
-
"issues": all_issues
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
print("\n" + json.dumps(output, indent=2))
|
|
167
|
-
|
|
168
|
-
sys.exit(0)
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
if __name__ == "__main__":
|
|
172
|
-
main()
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: deploy
|
|
3
|
-
description: "[Devflow] Production deployment pre-flight checks, smoke validation, and deployment execution."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Production Deployment & Launch Readiness
|
|
7
|
-
|
|
8
|
-
## Overview
|
|
9
|
-
|
|
10
|
-
This is the comprehensive deployment master skill for Nexus-DevFlow. It handles pre-flight validation, multi-platform deployment execution (Vercel, Render, Railway, Fly.io, Docker), health checks, smoke verification, and safe rollback readiness.
|
|
11
|
-
|
|
12
|
-
```text
|
|
13
|
-
Pre-Flight Checks ➔ Build & Smoke Test ➔ Deployment Execution ➔ Health Verification ➔ Release Logging
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## 1. Pre-Flight Verification Checklist
|
|
19
|
-
|
|
20
|
-
Before initiating any deployment, verify:
|
|
21
|
-
1. **Code & Quality**: Zero syntax/type errors, linters clean, unit & integration tests passing (`npm test`).
|
|
22
|
-
2. **Security**: No secrets in source code, environment variables documented in `.env.example`, `npm audit` checked.
|
|
23
|
-
3. **Database & Migrations**: Schema migrations verified backwards-compatible and applied.
|
|
24
|
-
4. **Performance & Assets**: Production bundles compiled, assets compressed, Core Web Vitals considered.
|
|
25
|
-
5. **Observability**: Healthcheck endpoint (`/api/health`) responsive, error tracking configured.
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## 2. Platform Deployment Matrix
|
|
30
|
-
|
|
31
|
-
| Target Platform | Deploy Method / Command | Verification Method |
|
|
32
|
-
| :--- | :--- | :--- |
|
|
33
|
-
| **Vercel** | `vercel --prod` or Git push | Inspect deployment URL & build logs |
|
|
34
|
-
| **Render / Railway** | `railway up` or Git integration | Check service status & container logs |
|
|
35
|
-
| **Fly.io** | `fly deploy` | Check `fly status` and HTTP response |
|
|
36
|
-
| **Docker / VPS** | `docker compose up -d --build` | Check container health & PM2 logs |
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## 3. Post-Deployment Smoke Verification & Health Check
|
|
41
|
-
|
|
42
|
-
1. Send an HTTP request to the deployed domain: verify HTTP 200 OK.
|
|
43
|
-
2. Test critical paths (Authentication, API endpoints, core database transactions).
|
|
44
|
-
3. Confirm telemetry and error log stream are free of unhandled exceptions.
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## 4. Rollback Readiness
|
|
49
|
-
|
|
50
|
-
Always have an immediate rollback plan before triggering production releases:
|
|
51
|
-
- Pin the previous stable build artifact, Docker image tag, or Git commit hash.
|
|
52
|
-
- If post-deployment smoke tests fail, trigger rollback immediately:
|
|
53
|
-
```text
|
|
54
|
-
deploy rollback
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
## Relationship To DevFlow 2.0
|
|
60
|
-
|
|
61
|
-
- **Classification**: Companion command & Delivery support
|
|
62
|
-
- **Mainline integration**: Invoked after `70-release` when ready to deploy.
|
|
63
|
-
- **Handoff**: `60-report`, `changelog`, `rollback`
|
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: documentation-and-adrs
|
|
3
|
-
description: "[Devflow] Records decisions and documentation. Use when making architectural decisions, changing public APIs, shipping features, or when you need to record context that future engineers and agents will need to understand the codebase."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Documentation and ADRs
|
|
7
|
-
|
|
8
|
-
## Overview
|
|
9
|
-
|
|
10
|
-
Document decisions, not just code. The most valuable documentation captures the *why* — the context, constraints, and trade-offs that led to a decision. Code shows *what* was built; documentation explains *why it was built this way* and *what alternatives were considered*. This context is essential for future humans and agents working in the codebase.
|
|
11
|
-
|
|
12
|
-
## When to Use
|
|
13
|
-
|
|
14
|
-
- Making a significant architectural decision
|
|
15
|
-
- Choosing between competing approaches
|
|
16
|
-
- Adding or changing a public API
|
|
17
|
-
- Shipping a feature that changes user-facing behavior
|
|
18
|
-
- Onboarding new team members (or agents) to the project
|
|
19
|
-
- When you find yourself explaining the same thing repeatedly
|
|
20
|
-
|
|
21
|
-
**When NOT to use:** Don't document obvious code. Don't add comments that restate what the code already says. Don't write docs for throwaway prototypes.
|
|
22
|
-
|
|
23
|
-
## Architecture Decision Records (ADRs)
|
|
24
|
-
|
|
25
|
-
ADRs capture the reasoning behind significant technical decisions. They're the highest-value documentation you can write.
|
|
26
|
-
|
|
27
|
-
### When to Write an ADR
|
|
28
|
-
|
|
29
|
-
- Choosing a framework, library, or major dependency
|
|
30
|
-
- Designing a data model or database schema
|
|
31
|
-
- Selecting an authentication strategy
|
|
32
|
-
- Deciding on an API architecture (REST vs. GraphQL vs. tRPC)
|
|
33
|
-
- Choosing between build tools, hosting platforms, or infrastructure
|
|
34
|
-
- Any decision that would be expensive to reverse
|
|
35
|
-
|
|
36
|
-
### ADR Template
|
|
37
|
-
|
|
38
|
-
Store ADRs in `docs/decisions/` with sequential numbering:
|
|
39
|
-
|
|
40
|
-
```markdown
|
|
41
|
-
# ADR-001: Use PostgreSQL for primary database
|
|
42
|
-
|
|
43
|
-
## Status
|
|
44
|
-
Accepted | Superseded by ADR-XXX | Deprecated
|
|
45
|
-
|
|
46
|
-
## Date
|
|
47
|
-
2025-01-15
|
|
48
|
-
|
|
49
|
-
## Context
|
|
50
|
-
We need a primary database for the task management application. Key requirements:
|
|
51
|
-
- Relational data model (users, tasks, teams with relationships)
|
|
52
|
-
- ACID transactions for task state changes
|
|
53
|
-
- Support for full-text search on task content
|
|
54
|
-
- Managed hosting available (for small team, limited ops capacity)
|
|
55
|
-
|
|
56
|
-
## Decision
|
|
57
|
-
Use PostgreSQL with Prisma ORM.
|
|
58
|
-
|
|
59
|
-
## Alternatives Considered
|
|
60
|
-
|
|
61
|
-
### MongoDB
|
|
62
|
-
- Pros: Flexible schema, easy to start with
|
|
63
|
-
- Cons: Our data is inherently relational; would need to manage relationships manually
|
|
64
|
-
- Rejected: Relational data in a document store leads to complex joins or data duplication
|
|
65
|
-
|
|
66
|
-
### SQLite
|
|
67
|
-
- Pros: Zero configuration, embedded, fast for reads
|
|
68
|
-
- Cons: Limited concurrent write support, no managed hosting for production
|
|
69
|
-
- Rejected: Not suitable for multi-user web application in production
|
|
70
|
-
|
|
71
|
-
### MySQL
|
|
72
|
-
- Pros: Mature, widely supported
|
|
73
|
-
- Cons: PostgreSQL has better JSON support, full-text search, and ecosystem tooling
|
|
74
|
-
- Rejected: PostgreSQL is the better fit for our feature requirements
|
|
75
|
-
|
|
76
|
-
## Consequences
|
|
77
|
-
- Prisma provides type-safe database access and migration management
|
|
78
|
-
- We can use PostgreSQL's full-text search instead of adding Elasticsearch
|
|
79
|
-
- Team needs PostgreSQL knowledge (standard skill, low risk)
|
|
80
|
-
- Hosting on managed service (Supabase, Neon, or RDS)
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### ADR Lifecycle
|
|
84
|
-
|
|
85
|
-
```
|
|
86
|
-
PROPOSED → ACCEPTED → (SUPERSEDED or DEPRECATED)
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
- **Don't delete old ADRs.** They capture historical context.
|
|
90
|
-
- When a decision changes, write a new ADR that references and supersedes the old one.
|
|
91
|
-
|
|
92
|
-
## Inline Documentation
|
|
93
|
-
|
|
94
|
-
### When to Comment
|
|
95
|
-
|
|
96
|
-
Comment the *why*, not the *what*:
|
|
97
|
-
|
|
98
|
-
```typescript
|
|
99
|
-
// BAD: Restates the code
|
|
100
|
-
// Increment counter by 1
|
|
101
|
-
counter += 1;
|
|
102
|
-
|
|
103
|
-
// GOOD: Explains non-obvious intent
|
|
104
|
-
// Rate limit uses a sliding window — reset counter at window boundary,
|
|
105
|
-
// not on a fixed schedule, to prevent burst attacks at window edges
|
|
106
|
-
if (now - windowStart > WINDOW_SIZE_MS) {
|
|
107
|
-
counter = 0;
|
|
108
|
-
windowStart = now;
|
|
109
|
-
}
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### When NOT to Comment
|
|
113
|
-
|
|
114
|
-
```typescript
|
|
115
|
-
// Don't comment self-explanatory code
|
|
116
|
-
function calculateTotal(items: CartItem[]): number {
|
|
117
|
-
return items.reduce((sum, item) => sum + item.price * item.quantity, 0);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// Don't leave TODO comments for things you should just do now
|
|
121
|
-
// TODO: add error handling ← Just add it
|
|
122
|
-
|
|
123
|
-
// Don't leave commented-out code
|
|
124
|
-
// const oldImplementation = () => { ... } ← Delete it, git has history
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
### Document Known Gotchas
|
|
128
|
-
|
|
129
|
-
```typescript
|
|
130
|
-
/**
|
|
131
|
-
* IMPORTANT: This function must be called before the first render.
|
|
132
|
-
* If called after hydration, it causes a flash of unstyled content
|
|
133
|
-
* because the theme context isn't available during SSR.
|
|
134
|
-
*
|
|
135
|
-
* See ADR-003 for the full design rationale.
|
|
136
|
-
*/
|
|
137
|
-
export function initializeTheme(theme: Theme): void {
|
|
138
|
-
// ...
|
|
139
|
-
}
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
## API Documentation
|
|
143
|
-
|
|
144
|
-
For public APIs (REST, GraphQL, library interfaces):
|
|
145
|
-
|
|
146
|
-
### Inline with Types (Preferred for TypeScript)
|
|
147
|
-
|
|
148
|
-
```typescript
|
|
149
|
-
/**
|
|
150
|
-
* Creates a new task.
|
|
151
|
-
*
|
|
152
|
-
* @param input - Task creation data (title required, description optional)
|
|
153
|
-
* @returns The created task with server-generated ID and timestamps
|
|
154
|
-
* @throws {ValidationError} If title is empty or exceeds 200 characters
|
|
155
|
-
* @throws {AuthenticationError} If the user is not authenticated
|
|
156
|
-
*
|
|
157
|
-
* @example
|
|
158
|
-
* const task = await createTask({ title: 'Buy groceries' });
|
|
159
|
-
* console.log(task.id); // "task_abc123"
|
|
160
|
-
*/
|
|
161
|
-
export async function createTask(input: CreateTaskInput): Promise<Task> {
|
|
162
|
-
// ...
|
|
163
|
-
}
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### OpenAPI / Swagger for REST APIs
|
|
167
|
-
|
|
168
|
-
```yaml
|
|
169
|
-
paths:
|
|
170
|
-
/api/tasks:
|
|
171
|
-
post:
|
|
172
|
-
summary: Create a task
|
|
173
|
-
requestBody:
|
|
174
|
-
required: true
|
|
175
|
-
content:
|
|
176
|
-
application/json:
|
|
177
|
-
schema:
|
|
178
|
-
$ref: '#/components/schemas/CreateTaskInput'
|
|
179
|
-
responses:
|
|
180
|
-
'201':
|
|
181
|
-
description: Task created
|
|
182
|
-
content:
|
|
183
|
-
application/json:
|
|
184
|
-
schema:
|
|
185
|
-
$ref: '#/components/schemas/Task'
|
|
186
|
-
'422':
|
|
187
|
-
description: Validation error
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
## README Structure
|
|
191
|
-
|
|
192
|
-
Every project should have a README that covers:
|
|
193
|
-
|
|
194
|
-
```markdown
|
|
195
|
-
# Project Name
|
|
196
|
-
|
|
197
|
-
One-paragraph description of what this project does.
|
|
198
|
-
|
|
199
|
-
## Quick Start
|
|
200
|
-
1. Clone the repo
|
|
201
|
-
2. Install dependencies: `npm install`
|
|
202
|
-
3. Set up environment: `cp .env.example .env`
|
|
203
|
-
4. Run the dev server: `npm run dev`
|
|
204
|
-
|
|
205
|
-
## Commands
|
|
206
|
-
| Command | Description |
|
|
207
|
-
|---------|-------------|
|
|
208
|
-
| `npm run dev` | Start development server |
|
|
209
|
-
| `npm test` | Run tests |
|
|
210
|
-
| `npm run build` | Production build |
|
|
211
|
-
| `npm run lint` | Run linter |
|
|
212
|
-
|
|
213
|
-
## Architecture
|
|
214
|
-
Brief overview of the project structure and key design decisions.
|
|
215
|
-
Link to ADRs for details.
|
|
216
|
-
|
|
217
|
-
## Contributing
|
|
218
|
-
How to contribute, coding standards, PR process.
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
## Changelog Maintenance
|
|
222
|
-
|
|
223
|
-
For shipped features:
|
|
224
|
-
|
|
225
|
-
```markdown
|
|
226
|
-
# Changelog
|
|
227
|
-
|
|
228
|
-
## [1.2.0] - 2025-01-20
|
|
229
|
-
### Added
|
|
230
|
-
- Task sharing: users can share tasks with team members (#123)
|
|
231
|
-
- Email notifications for task assignments (#124)
|
|
232
|
-
|
|
233
|
-
### Fixed
|
|
234
|
-
- Duplicate tasks appearing when rapidly clicking create button (#125)
|
|
235
|
-
|
|
236
|
-
### Changed
|
|
237
|
-
- Task list now loads 50 items per page (was 20) for better UX (#126)
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
## Documentation for Agents
|
|
241
|
-
|
|
242
|
-
Special consideration for AI agent context:
|
|
243
|
-
|
|
244
|
-
- **CLAUDE.md / rules files** — Document project conventions so agents follow them
|
|
245
|
-
- **Spec files** — Keep specs updated so agents build the right thing
|
|
246
|
-
- **ADRs** — Help agents understand why past decisions were made (prevents re-deciding)
|
|
247
|
-
- **Inline gotchas** — Prevent agents from falling into known traps
|
|
248
|
-
|
|
249
|
-
## Common Rationalizations
|
|
250
|
-
|
|
251
|
-
| Rationalization | Reality |
|
|
252
|
-
|---|---|
|
|
253
|
-
| "The code is self-documenting" | Code shows what. It doesn't show why, what alternatives were rejected, or what constraints apply. |
|
|
254
|
-
| "We'll write docs when the API stabilizes" | APIs stabilize faster when you document them. The doc is the first test of the design. |
|
|
255
|
-
| "Nobody reads docs" | Agents do. Future engineers do. Your 3-months-later self does. |
|
|
256
|
-
| "ADRs are overhead" | A 10-minute ADR prevents a 2-hour debate about the same decision six months later. |
|
|
257
|
-
| "Comments get outdated" | Comments on *why* are stable. Comments on *what* get outdated — that's why you only write the former. |
|
|
258
|
-
|
|
259
|
-
## Red Flags
|
|
260
|
-
|
|
261
|
-
- Architectural decisions with no written rationale
|
|
262
|
-
- Public APIs with no documentation or types
|
|
263
|
-
- README that doesn't explain how to run the project
|
|
264
|
-
- Commented-out code instead of deletion
|
|
265
|
-
- TODO comments that have been there for weeks
|
|
266
|
-
- No ADRs in a project with significant architectural choices
|
|
267
|
-
- Documentation that restates the code instead of explaining intent
|
|
268
|
-
|
|
269
|
-
## Verification
|
|
270
|
-
|
|
271
|
-
After documenting:
|
|
272
|
-
|
|
273
|
-
- [ ] ADRs exist for all significant architectural decisions
|
|
274
|
-
- [ ] README covers quick start, commands, and architecture overview
|
|
275
|
-
- [ ] API functions have parameter and return type documentation
|
|
276
|
-
- [ ] Known gotchas are documented inline where they matter
|
|
277
|
-
- [ ] No commented-out code remains
|
|
278
|
-
- [ ] Rules files (CLAUDE.md etc.) are current and accurate
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# ADR Format
|
|
2
|
-
|
|
3
|
-
ADRs live in `docs/adr/` and use sequential numbering: `0001-slug.md`, `0002-slug.md`, and so on.
|
|
4
|
-
|
|
5
|
-
Create the `docs/adr/` directory lazily, only when the first ADR is needed.
|
|
6
|
-
|
|
7
|
-
## Template
|
|
8
|
-
|
|
9
|
-
```md
|
|
10
|
-
# {Short title of the decision}
|
|
11
|
-
|
|
12
|
-
{1-3 sentences: what is the context, what did we decide, and why.}
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
That is enough for many ADRs. The value is in recording that a decision was made and why, not in filling out sections.
|
|
16
|
-
|
|
17
|
-
## Optional Sections
|
|
18
|
-
|
|
19
|
-
Only include these when they add genuine value:
|
|
20
|
-
|
|
21
|
-
- Status frontmatter: `proposed`, `accepted`, `deprecated`, or `superseded by ADR-NNNN`
|
|
22
|
-
- Considered Options: only when the rejected alternatives are worth remembering
|
|
23
|
-
- Consequences: only when non-obvious downstream effects need to be called out
|
|
24
|
-
|
|
25
|
-
## Numbering
|
|
26
|
-
|
|
27
|
-
Scan `docs/adr/` for the highest existing number and increment by one.
|
|
28
|
-
|
|
29
|
-
## When To Offer An ADR
|
|
30
|
-
|
|
31
|
-
All three of these must be true:
|
|
32
|
-
|
|
33
|
-
1. Hard to reverse: the cost of changing your mind later is meaningful.
|
|
34
|
-
2. Surprising without context: a future reader will wonder why the decision was made.
|
|
35
|
-
3. Based on a real trade-off: there were genuine alternatives and one was chosen for specific reasons.
|
|
36
|
-
|
|
37
|
-
If a decision is easy to reverse, skip it. If it is not surprising, nobody will need the explanation. If there was no real alternative, there is nothing to record beyond doing the obvious thing.
|
|
38
|
-
|
|
39
|
-
## What Qualifies
|
|
40
|
-
|
|
41
|
-
- Architectural shape, such as monorepo structure or event-sourced write models.
|
|
42
|
-
- Integration patterns between contexts.
|
|
43
|
-
- Technology choices that carry lock-in, such as database, message bus, auth provider, or deployment target.
|
|
44
|
-
- Boundary and scope decisions.
|
|
45
|
-
- Deliberate deviations from the obvious path.
|
|
46
|
-
- Constraints not visible in the code.
|
|
47
|
-
- Rejected alternatives when the rejection is non-obvious.
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# CONTEXT.md Format
|
|
2
|
-
|
|
3
|
-
## Structure
|
|
4
|
-
|
|
5
|
-
```md
|
|
6
|
-
# {Context Name}
|
|
7
|
-
|
|
8
|
-
{One or two sentence description of what this context is and why it exists.}
|
|
9
|
-
|
|
10
|
-
## Language
|
|
11
|
-
|
|
12
|
-
**Order**:
|
|
13
|
-
{A one or two sentence description of the term}
|
|
14
|
-
_Avoid_: Purchase, transaction
|
|
15
|
-
|
|
16
|
-
**Invoice**:
|
|
17
|
-
A request for payment sent to a customer after delivery.
|
|
18
|
-
_Avoid_: Bill, payment request
|
|
19
|
-
|
|
20
|
-
**Customer**:
|
|
21
|
-
A person or organization that places orders.
|
|
22
|
-
_Avoid_: Client, buyer, account
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Rules
|
|
26
|
-
|
|
27
|
-
- Be opinionated. When multiple words exist for the same concept, pick the best one and list the others under `_Avoid_`.
|
|
28
|
-
- Keep definitions tight. One or two sentences max. Define what it is, not what it does.
|
|
29
|
-
- Only include terms specific to this project's context. General programming concepts do not belong.
|
|
30
|
-
- Group terms under subheadings when natural clusters emerge. If all terms belong to a single cohesive area, a flat list is fine.
|
|
31
|
-
|
|
32
|
-
## Single vs Multi-Context Repos
|
|
33
|
-
|
|
34
|
-
Single context: one `CONTEXT.md` at the repo root.
|
|
35
|
-
|
|
36
|
-
Multiple contexts: a `CONTEXT-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:
|
|
37
|
-
|
|
38
|
-
```md
|
|
39
|
-
# Context Map
|
|
40
|
-
|
|
41
|
-
## Contexts
|
|
42
|
-
|
|
43
|
-
- [Ordering](./src/ordering/CONTEXT.md) - receives and tracks customer orders
|
|
44
|
-
- [Billing](./src/billing/CONTEXT.md) - generates invoices and processes payments
|
|
45
|
-
- [Fulfillment](./src/fulfillment/CONTEXT.md) - manages warehouse picking and shipping
|
|
46
|
-
|
|
47
|
-
## Relationships
|
|
48
|
-
|
|
49
|
-
- **Ordering -> Fulfillment**: Ordering emits `OrderPlaced` events; Fulfillment consumes them to start picking
|
|
50
|
-
- **Fulfillment -> Billing**: Fulfillment emits `ShipmentDispatched` events; Billing consumes them to generate invoices
|
|
51
|
-
- **Ordering <-> Billing**: Shared types for `CustomerId` and `Money`
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
The skill infers which structure applies:
|
|
55
|
-
|
|
56
|
-
- If `CONTEXT-MAP.md` exists, read it to find contexts.
|
|
57
|
-
- If only a root `CONTEXT.md` exists, use single context.
|
|
58
|
-
- If neither exists, create a root `CONTEXT.md` lazily when the first term is resolved.
|
|
59
|
-
|
|
60
|
-
When multiple contexts exist and the current topic is unclear, ask.
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: domain-modeling
|
|
3
|
-
description: "[Devflow] Build and sharpen a project's domain model. Use when the user wants to pin down domain terminology or a ubiquitous language, record an architectural decision, or when another skill needs to maintain the domain model."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Domain Modeling
|
|
7
|
-
|
|
8
|
-
Actively build and sharpen the project's domain model as you design. This is the active discipline: challenging terms, inventing edge-case scenarios, and writing the glossary and decisions down when they crystallize.
|
|
9
|
-
|
|
10
|
-
## File Structure
|
|
11
|
-
|
|
12
|
-
Most repos have a single context:
|
|
13
|
-
|
|
14
|
-
```text
|
|
15
|
-
/
|
|
16
|
-
|-- CONTEXT.md
|
|
17
|
-
|-- docs/
|
|
18
|
-
| `-- adr/
|
|
19
|
-
| |-- 0001-event-sourced-orders.md
|
|
20
|
-
| `-- 0002-postgres-for-write-model.md
|
|
21
|
-
`-- src/
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
If a `CONTEXT-MAP.md` exists at the root, the repo has multiple contexts. The map points to where each one lives:
|
|
25
|
-
|
|
26
|
-
```text
|
|
27
|
-
/
|
|
28
|
-
|-- CONTEXT-MAP.md
|
|
29
|
-
|-- docs/
|
|
30
|
-
| `-- adr/ system-wide decisions
|
|
31
|
-
`-- src/
|
|
32
|
-
|-- ordering/
|
|
33
|
-
| |-- CONTEXT.md
|
|
34
|
-
| `-- docs/adr/ context-specific decisions
|
|
35
|
-
`-- billing/
|
|
36
|
-
|-- CONTEXT.md
|
|
37
|
-
`-- docs/adr/
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Create files lazily. If no `CONTEXT.md` exists, create one when the first term is resolved. If no `docs/adr/` exists, create it when the first ADR is needed.
|
|
41
|
-
|
|
42
|
-
## During The Session
|
|
43
|
-
|
|
44
|
-
### Challenge Against The Glossary
|
|
45
|
-
|
|
46
|
-
When the user uses a term that conflicts with the existing language in `CONTEXT.md`, call it out immediately and ask which meaning should win.
|
|
47
|
-
|
|
48
|
-
### Sharpen Fuzzy Language
|
|
49
|
-
|
|
50
|
-
When the user uses vague or overloaded terms, propose a precise canonical term. For example, distinguish `Customer` from `User` when those concepts have different responsibilities.
|
|
51
|
-
|
|
52
|
-
### Discuss Concrete Scenarios
|
|
53
|
-
|
|
54
|
-
When domain relationships are being discussed, stress-test them with specific scenarios. Invent scenarios that probe edge cases and force precision about the boundaries between concepts.
|
|
55
|
-
|
|
56
|
-
### Cross-Reference With Code
|
|
57
|
-
|
|
58
|
-
When the user states how something works, check whether the code agrees. If you find a contradiction, surface it and route the decision back to the active DevFlow stage.
|
|
59
|
-
|
|
60
|
-
### Update `CONTEXT.md` Inline
|
|
61
|
-
|
|
62
|
-
When a term is resolved, update `CONTEXT.md` as part of the session. Use the format in `CONTEXT-FORMAT.md`.
|
|
63
|
-
|
|
64
|
-
`CONTEXT.md` is a glossary only. It should not contain implementation details, specification text, scratch notes, or implementation decisions.
|
|
65
|
-
|
|
66
|
-
### Offer ADRs Sparingly
|
|
67
|
-
|
|
68
|
-
Only offer to create an ADR when all three are true:
|
|
69
|
-
|
|
70
|
-
1. Hard to reverse: the cost of changing your mind later is meaningful.
|
|
71
|
-
2. Surprising without context: a future reader will wonder why the decision was made.
|
|
72
|
-
3. Based on a real trade-off: there were genuine alternatives and one was chosen for specific reasons.
|
|
73
|
-
|
|
74
|
-
If any condition is missing, skip the ADR. Use the format in `ADR-FORMAT.md`.
|