@paulduvall/claude-dev-toolkit 0.0.1-alpha.2 → 0.0.1-alpha.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.
Files changed (143) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +88 -37
  3. package/bin/claude-commands +307 -65
  4. package/commands/active/xarchitecture.md +393 -0
  5. package/commands/active/xconfig.md +127 -0
  6. package/commands/active/xcontinue.md +92 -0
  7. package/commands/active/xdebug.md +130 -0
  8. package/commands/active/xdocs.md +178 -0
  9. package/commands/active/xexplore.md +94 -0
  10. package/commands/active/xgit.md +149 -0
  11. package/commands/active/xpipeline.md +152 -0
  12. package/commands/active/xquality.md +96 -0
  13. package/commands/active/xrefactor.md +198 -0
  14. package/commands/active/xrelease.md +142 -0
  15. package/commands/active/xsecurity.md +92 -0
  16. package/commands/active/xspec.md +174 -0
  17. package/commands/active/xtdd.md +151 -0
  18. package/commands/active/xtest.md +89 -0
  19. package/commands/active/xverify.md +80 -0
  20. package/commands/experiments/xact.md +742 -0
  21. package/commands/experiments/xanalytics.md +113 -0
  22. package/commands/experiments/xanalyze.md +70 -0
  23. package/commands/experiments/xapi.md +161 -0
  24. package/commands/experiments/xatomic.md +112 -0
  25. package/commands/experiments/xaws.md +85 -0
  26. package/commands/experiments/xcicd.md +337 -0
  27. package/commands/experiments/xcommit.md +122 -0
  28. package/commands/experiments/xcompliance.md +182 -0
  29. package/commands/experiments/xconstraints.md +89 -0
  30. package/commands/experiments/xcoverage.md +90 -0
  31. package/commands/experiments/xdb.md +102 -0
  32. package/commands/experiments/xdesign.md +121 -0
  33. package/commands/experiments/xdevcontainer.md +238 -0
  34. package/commands/experiments/xevaluate.md +111 -0
  35. package/commands/experiments/xfootnote.md +12 -0
  36. package/commands/experiments/xgenerate.md +117 -0
  37. package/commands/experiments/xgovernance.md +149 -0
  38. package/commands/experiments/xgreen.md +66 -0
  39. package/commands/experiments/xiac.md +118 -0
  40. package/commands/experiments/xincident.md +137 -0
  41. package/commands/experiments/xinfra.md +115 -0
  42. package/commands/experiments/xknowledge.md +115 -0
  43. package/commands/experiments/xmaturity.md +120 -0
  44. package/commands/experiments/xmetrics.md +118 -0
  45. package/commands/experiments/xmonitoring.md +128 -0
  46. package/commands/experiments/xnew.md +903 -0
  47. package/commands/experiments/xobservable.md +114 -0
  48. package/commands/experiments/xoidc.md +165 -0
  49. package/commands/experiments/xoptimize.md +115 -0
  50. package/commands/experiments/xperformance.md +112 -0
  51. package/commands/experiments/xplanning.md +131 -0
  52. package/commands/experiments/xpolicy.md +115 -0
  53. package/commands/experiments/xproduct.md +98 -0
  54. package/commands/experiments/xreadiness.md +75 -0
  55. package/commands/experiments/xred.md +55 -0
  56. package/commands/experiments/xrisk.md +128 -0
  57. package/commands/experiments/xrules.md +124 -0
  58. package/commands/experiments/xsandbox.md +120 -0
  59. package/commands/experiments/xscan.md +102 -0
  60. package/commands/experiments/xsetup.md +123 -0
  61. package/commands/experiments/xtemplate.md +116 -0
  62. package/commands/experiments/xtrace.md +212 -0
  63. package/commands/experiments/xux.md +171 -0
  64. package/commands/experiments/xvalidate.md +104 -0
  65. package/commands/experiments/xworkflow.md +113 -0
  66. package/hooks/.smellrc.example.json +19 -0
  67. package/hooks/README.md +263 -0
  68. package/hooks/check-commit-signing.py +127 -0
  69. package/hooks/check-complexity.py +38 -0
  70. package/hooks/check-security.py +37 -0
  71. package/hooks/claude-wrapper.sh +29 -0
  72. package/hooks/config.py +110 -0
  73. package/hooks/file-logger.sh +100 -0
  74. package/hooks/lib/argument-parser.sh +427 -0
  75. package/hooks/lib/config-constants.sh +230 -0
  76. package/hooks/lib/context-manager.sh +560 -0
  77. package/hooks/lib/error-handler.sh +423 -0
  78. package/hooks/lib/execution-engine.sh +444 -0
  79. package/hooks/lib/execution-results.sh +113 -0
  80. package/hooks/lib/execution-simulation.sh +114 -0
  81. package/hooks/lib/field-validators.sh +104 -0
  82. package/hooks/lib/file-utils.sh +398 -0
  83. package/hooks/lib/subagent-discovery.sh +468 -0
  84. package/hooks/lib/subagent-validator.sh +407 -0
  85. package/hooks/lib/validation-reporter.sh +134 -0
  86. package/hooks/on-error-debug.sh +226 -0
  87. package/hooks/pre-commit-quality.sh +204 -0
  88. package/hooks/pre-commit-test-runner.sh +132 -0
  89. package/hooks/pre-write-security.sh +115 -0
  90. package/hooks/prevent-credential-exposure.sh +279 -0
  91. package/hooks/security_bandit.py +177 -0
  92. package/hooks/security_checks.py +97 -0
  93. package/hooks/security_secrets.py +81 -0
  94. package/hooks/security_trojan.py +61 -0
  95. package/hooks/settings.example.json +52 -0
  96. package/hooks/smell_checks.py +238 -0
  97. package/hooks/smell_javascript.py +231 -0
  98. package/hooks/smell_python.py +110 -0
  99. package/hooks/smell_ruff.py +70 -0
  100. package/hooks/smell_types.py +72 -0
  101. package/hooks/subagent-trigger-simple.sh +202 -0
  102. package/hooks/subagent-trigger.sh +253 -0
  103. package/hooks/suppression.py +82 -0
  104. package/hooks/tab-color.sh +70 -0
  105. package/hooks/verify-before-edit.sh +135 -0
  106. package/lib/backup-restore-command.js +140 -0
  107. package/lib/base/base-command.js +252 -0
  108. package/lib/base/command-result.js +184 -0
  109. package/lib/config/constants.js +255 -0
  110. package/lib/config.js +48 -6
  111. package/lib/configure-command.js +428 -0
  112. package/lib/dependency-validator.js +64 -5
  113. package/lib/hook-installer-core.js +2 -2
  114. package/lib/installation-instruction-generator.js +213 -495
  115. package/lib/installer.js +134 -56
  116. package/lib/oidc-command.js +740 -0
  117. package/lib/services/backup-list-service.js +226 -0
  118. package/lib/services/backup-service.js +230 -0
  119. package/lib/services/command-installer-service.js +217 -0
  120. package/lib/services/logger-service.js +201 -0
  121. package/lib/services/package-manager-service.js +319 -0
  122. package/lib/services/platform-instruction-service.js +294 -0
  123. package/lib/services/recovery-instruction-service.js +348 -0
  124. package/lib/services/restore-service.js +221 -0
  125. package/lib/setup-command.js +359 -0
  126. package/lib/setup-wizard.js +155 -262
  127. package/lib/uninstall-command.js +100 -0
  128. package/lib/utils/claude-path-config.js +184 -0
  129. package/lib/utils/file-system-utils.js +152 -0
  130. package/lib/utils.js +8 -4
  131. package/lib/verify-command.js +430 -0
  132. package/package.json +7 -3
  133. package/scripts/postinstall.js +172 -157
  134. package/subagents/debug-specialist.md +7 -0
  135. package/templates/README.md +115 -0
  136. package/templates/basic-settings.json +30 -0
  137. package/templates/comprehensive-settings.json +57 -0
  138. package/templates/global-claude.md +344 -0
  139. package/templates/hybrid-hook-config.yaml +132 -0
  140. package/templates/security-focused-settings.json +62 -0
  141. package/templates/subagent-hooks.yaml +188 -0
  142. package/lib/package-manager-service.js +0 -270
  143. package/subagents/debug-context.md +0 -197
@@ -0,0 +1,393 @@
1
+ ---
2
+ description: Design, analyze, and evolve system architecture using Domain-Driven Design, 12-Factor App, and proven patterns
3
+ tags: [architecture, design, patterns, ddd, domain-driven-design, bounded-contexts, aggregates, microservices, clean-architecture, 12-factor, cloud-native]
4
+ ---
5
+
6
+ Analyze and design system architecture using Domain-Driven Design, 12-Factor App principles, and proven patterns based on $ARGUMENTS.
7
+
8
+ ## Usage Examples
9
+
10
+ **Basic architecture analysis:**
11
+ ```
12
+ /xarchitecture
13
+ ```
14
+
15
+ **Analyze Domain-Driven Design patterns:**
16
+ ```
17
+ /xarchitecture --ddd
18
+ ```
19
+
20
+ **Check 12-Factor App compliance:**
21
+ ```
22
+ /xarchitecture --12factor
23
+ ```
24
+
25
+ **Design microservices architecture:**
26
+ ```
27
+ /xarchitecture --microservices
28
+ ```
29
+
30
+ ## Implementation
31
+
32
+ If $ARGUMENTS contains "help" or "--help":
33
+ Display this usage information and exit.
34
+
35
+ First, examine the current project structure:
36
+ !find . -type f -name "*.py" -o -name "*.js" -o -name "*.ts" | grep -v node_modules | grep -v __pycache__ | head -20
37
+ !ls -la src/ app/ lib/ services/ controllers/ models/ 2>/dev/null || echo "No standard architecture directories found"
38
+ !find . -name "docker-compose.yml" -o -name "Dockerfile" | head -3
39
+ !find . -name "*.md" | xargs grep -l "architecture\|design\|pattern" | head -5 2>/dev/null
40
+
41
+ Identify existing DDD elements:
42
+ !find . -name "*Entity*" -o -name "*ValueObject*" -o -name "*Aggregate*" -o -name "*Repository*" | head -10
43
+ !grep -r "BoundedContext\|DomainService\|UbiquitousLanguage" . --include="*.py" --include="*.js" --include="*.ts" | head -5 2>/dev/null
44
+
45
+ Check for domain-driven directory structure:
46
+ !ls -la domain/ infrastructure/ application/ 2>/dev/null || echo "No DDD layered architecture found"
47
+
48
+ Check for 12-Factor App compliance:
49
+ !find . -name ".env*" -o -name "config.*" | head -5
50
+ !find . -name "Dockerfile" -o -name "docker-compose.yml" | head -3
51
+ !find . -name "Procfile" -o -name "requirements.txt" -o -name "package.json" | head -5
52
+ !grep -r "process.env\|os.environ\|System.getenv" . --include="*.py" --include="*.js" --include="*.ts" | wc -l
53
+
54
+ Based on $ARGUMENTS, perform the appropriate DDD and 12-Factor informed architecture operation:
55
+
56
+ ## 1. Architecture Analysis (DDD + 12-Factor)
57
+
58
+ If analyzing current architecture (--analyze, --layers, --dependencies, --ddd, --12factor):
59
+ !find . -name "*.py" -o -name "*.js" -o -name "*.ts" | xargs grep -l "import\|require" | head -10
60
+ !python -c "import ast; print('Python AST analysis available')" 2>/dev/null || echo "Python not available for analysis"
61
+ !find . -name "package.json" -o -name "requirements.txt" | head -2
62
+
63
+ **DDD Strategic Design Analysis:**
64
+ !grep -r "BoundedContext\|Context\|Domain" . --include="*.py" --include="*.js" --include="*.ts" | wc -l
65
+ !find . -name "*Context*" -o -name "*Domain*" | head -10
66
+
67
+ **DDD Tactical Design Analysis:**
68
+ !find . -name "*Entity*" -o -name "*ValueObject*" -o -name "*Aggregate*" -o -name "*Repository*" -o -name "*DomainService*" | wc -l
69
+ !grep -r "Entity\|ValueObject\|Aggregate\|Repository" . --include="*.py" --include="*.js" --include="*.ts" | head -10
70
+
71
+ **12-Factor App Compliance Analysis:**
72
+ !git remote -v | wc -l || echo "No git remote found (Factor I: Codebase)"
73
+ !find . -name "requirements.txt" -o -name "package.json" -o -name "Pipfile" | wc -l
74
+ !find . -name ".env*" | wc -l
75
+ !grep -r "hardcoded.*password\|hardcoded.*key" . --include="*.py" --include="*.js" --include="*.ts" | wc -l
76
+ !find . -name "Dockerfile" | wc -l
77
+ !grep -r "console.log\|print\|logging" . --include="*.py" --include="*.js" --include="*.ts" | wc -l
78
+
79
+ Analyze 12-Factor App compliance:
80
+ - **I. Codebase**: Single codebase in version control with multiple deploys
81
+ - **II. Dependencies**: Explicit dependency declaration and isolation
82
+ - **III. Config**: Configuration stored in environment variables
83
+ - **IV. Backing Services**: External services treated as attached resources
84
+ - **V. Build/Release/Run**: Strict separation of build and run stages
85
+ - **VI. Processes**: Stateless process execution
86
+ - **VII. Port Binding**: Service export via port binding
87
+ - **VIII. Concurrency**: Horizontal scaling via process model
88
+ - **IX. Disposability**: Fast startup and graceful shutdown
89
+ - **X. Dev/Prod Parity**: Environment consistency across stages
90
+ - **XI. Logs**: Logs treated as event streams
91
+ - **XII. Admin Processes**: One-off admin tasks as separate processes
92
+
93
+ Analyze DDD architectural patterns:
94
+ - **Bounded Context boundaries** and context mapping
95
+ - **Domain model integrity** and ubiquitous language usage
96
+ - **Aggregate design** and consistency boundaries
97
+ - **Entity vs Value Object** modeling decisions
98
+ - **Repository pattern** implementation
99
+ - **Domain Service** vs Application Service separation
100
+ - **Infrastructure layer** isolation from domain
101
+ - **Anti-corruption layer** implementation
102
+ - **Layer separation** following DDD principles
103
+ - **Coupling and cohesion** within domain boundaries
104
+
105
+ ## 2. Architecture Design (DDD + 12-Factor)
106
+
107
+ If designing architecture (--design, --microservices, --event-driven, --bounded-contexts, --12factor, --cloud-native):
108
+ !find . -name "*.yml" -o -name "*.yaml" | xargs grep -l "service\|api" 2>/dev/null | head -5
109
+ !docker --version 2>/dev/null || echo "Docker not available for containerization"
110
+ !kubectl version --client 2>/dev/null || echo "Kubernetes not available for orchestration"
111
+
112
+ **DDD Strategic Design Patterns:**
113
+
114
+ If designing bounded contexts (--bounded-contexts):
115
+ Design context boundaries using:
116
+ - **Partnership**: Mutual dependency between teams
117
+ - **Shared Kernel**: Common code base between contexts
118
+ - **Customer/Supplier**: Upstream/downstream relationship
119
+ - **Conformist**: Downstream conforms to upstream model
120
+ - **Anti-corruption Layer**: Protect downstream from upstream changes
121
+ - **Open-host Service**: Published API for multiple consumers
122
+ - **Published Language**: Well-documented shared protocol
123
+
124
+ **DDD-Informed Microservices Design:**
125
+ - **Bounded Context = Microservice**: Each service owns its domain
126
+ - **Aggregate-based service boundaries**: Services align with aggregates
127
+ - **Domain events** for inter-service communication
128
+ - **Saga pattern** for distributed transactions
129
+ - **CQRS implementation** for read/write separation
130
+
131
+ **12-Factor Cloud-Native Design Patterns:**
132
+
133
+ If designing cloud-native architecture (--12factor, --cloud-native):
134
+ Design 12-Factor compliant solutions:
135
+ - **I. Codebase**: Single repository with environment-specific deployments
136
+ - **II. Dependencies**: Package manager integration (npm, pip, Maven)
137
+ - **III. Config**: Environment variable configuration strategy
138
+ - **IV. Backing Services**: Database, cache, and message queue abstraction
139
+ - **V. Build/Release/Run**: CI/CD pipeline with immutable releases
140
+ - **VI. Processes**: Stateless microservice design patterns
141
+ - **VII. Port Binding**: Self-contained services with HTTP/gRPC interfaces
142
+ - **VIII. Concurrency**: Horizontal scaling and load balancing design
143
+ - **IX. Disposability**: Graceful shutdown and fast startup patterns
144
+ - **X. Dev/Prod Parity**: Container-based environment consistency
145
+ - **XI. Logs**: Structured logging and centralized log aggregation
146
+ - **XII. Admin Processes**: Separate administrative service design
147
+
148
+ Design DDD + 12-Factor architectural solutions:
149
+ - **Domain modeling** with 12-Factor stateless entities and aggregates
150
+ - **Microservices decomposition** based on bounded contexts + 12-Factor processes
151
+ - **Event-driven architecture** using domain events + cloud messaging
152
+ - **API gateway** with context-aware routing + port binding
153
+ - **Database per bounded context** + backing services abstraction
154
+ - **Communication patterns** preserving domain boundaries + disposability
155
+ - **Configuration management** via environment variables across contexts
156
+ - **Logging strategy** for domain events and business processes
157
+
158
+ ## 3. Architecture Validation (DDD + 12-Factor)
159
+
160
+ If validating principles (--validate, --solid, --ddd, --clean, --ubiquitous-language, --12factor):
161
+ !find . -name "*.py" -o -name "*.js" -o -name "*.ts" | xargs grep -E "class|function|interface" | wc -l
162
+ !find . -name "test*" -o -name "*test*" | head -5 2>/dev/null
163
+ !grep -r "TODO\|FIXME\|XXX" . --include="*.py" --include="*.js" --include="*.ts" | wc -l
164
+
165
+ **DDD Strategic Design Validation:**
166
+ !grep -r "UbiquitousLanguage\|DomainExpert\|BoundedContext" . --include="*.py" --include="*.js" --include="*.ts" --include="*.md" | wc -l
167
+ !find . -name "*Context*" -type d | wc -l
168
+
169
+ **DDD Tactical Design Validation:**
170
+ !grep -r "Entity\|ValueObject\|Aggregate\|DomainService\|Repository" . --include="*.py" --include="*.js" --include="*.ts" | wc -l
171
+ !find . -name "*Aggregate*" -o -name "*Entity*" -o -name "*ValueObject*" | wc -l
172
+
173
+ **Domain Model Integrity Checks:**
174
+ !grep -r "import.*infrastructure\|require.*infrastructure" domain/ 2>/dev/null | wc -l || echo "No domain directory found"
175
+ !grep -r "import.*application\|require.*application" domain/ 2>/dev/null | wc -l || echo "No domain directory found"
176
+
177
+ **12-Factor App Validation:**
178
+ !echo "=== 12-Factor Compliance Validation ==="
179
+
180
+ **I. Codebase Validation:**
181
+ !git remote -v && echo "✓ Single codebase with multiple deploys" || echo "✗ Missing version control"
182
+
183
+ **II. Dependencies Validation:**
184
+ !find . -name "requirements.txt" -o -name "package.json" -o -name "Pipfile" && echo "✓ Explicit dependencies" || echo "✗ Missing dependency declarations"
185
+
186
+ **III. Config Validation:**
187
+ !grep -r "process.env\|os.environ" . --include="*.py" --include="*.js" --include="*.ts" | wc -l
188
+ !find . -name ".env*" && echo "✓ Environment-based config" || echo "✗ Config not externalized"
189
+
190
+ **IV. Backing Services Validation:**
191
+ !grep -r "DATABASE_URL\|REDIS_URL\|MONGO_URL" . --include="*.py" --include="*.js" --include="*.ts" | wc -l
192
+
193
+ **V. Build/Release/Run Validation:**
194
+ !find . -name "Dockerfile" -o -name "buildspec.yml" && echo "✓ Build stage separation" || echo "✗ No build automation"
195
+
196
+ **VI. Processes Validation:**
197
+ !grep -r "session\|state\|cache.*local" . --include="*.py" --include="*.js" --include="*.ts" | wc -l
198
+
199
+ **XI. Logs Validation:**
200
+ !grep -r "console.log\|logging\|print" . --include="*.py" --include="*.js" --include="*.ts" | wc -l
201
+
202
+ Validate 12-Factor App principles:
203
+ - **I. Codebase**: Single codebase tracked in version control
204
+ - **II. Dependencies**: Explicit dependency declaration and isolation
205
+ - **III. Config**: Environment-based configuration without hardcoded values
206
+ - **IV. Backing Services**: Attached resources via connection strings
207
+ - **V. Build/Release/Run**: Strict separation with immutable releases
208
+ - **VI. Processes**: Stateless execution without local state
209
+ - **VII. Port Binding**: Self-contained service exports
210
+ - **VIII. Concurrency**: Process-based horizontal scaling
211
+ - **IX. Disposability**: Fast startup and graceful shutdown
212
+ - **X. Dev/Prod Parity**: Environment consistency validation
213
+ - **XI. Logs**: Event streams to stdout/stderr
214
+ - **XII. Admin Processes**: Separate one-off administrative tasks
215
+
216
+ Validate DDD architectural principles:
217
+ - **Ubiquitous Language**: Consistent terminology across code and documentation
218
+ - **Bounded Context integrity**: Clear context boundaries and minimal coupling
219
+ - **Domain model purity**: Domain layer free from infrastructure dependencies
220
+ - **Aggregate consistency**: Proper aggregate boundaries and invariant enforcement
221
+ - **Repository abstraction**: Domain-focused repository interfaces
222
+ - **Domain Service clarity**: Pure domain logic without external dependencies
223
+ - **Anti-corruption layers**: Protection between external systems and domain
224
+ - **SOLID principles** compliance within domain boundaries
225
+ - **Clean architecture** dependency rules (domain → application → infrastructure)
226
+ - **Security architecture** assessment for domain protection
227
+ - **Testability** of domain logic in isolation
228
+
229
+ ## 4. Architecture Evolution Planning (DDD + 12-Factor)
230
+
231
+ If planning evolution (--evolve, --migration, --modernization, --strangler-fig, --cloud-migration):
232
+ !git log --oneline --since="6 months ago" | wc -l
233
+ !find . -name "*.legacy" -o -name "*deprecated*" | head -5 2>/dev/null
234
+ !docker ps 2>/dev/null | wc -l || echo "No containerized services running"
235
+
236
+ **DDD-Informed Evolution Strategies:**
237
+
238
+ **Strangler Fig Pattern** for legacy modernization:
239
+ - Identify bounded contexts within legacy monolith
240
+ - Extract contexts incrementally as microservices
241
+ - Implement anti-corruption layers for integration
242
+ - Gradually route traffic to new implementations
243
+
244
+ **Domain-First Migration Planning:**
245
+ - **Domain discovery** workshops with domain experts
246
+ - **Context mapping** of existing vs target architecture
247
+ - **Bounded context extraction** prioritization
248
+ - **Event storming** sessions for understanding domain flows
249
+
250
+ **12-Factor Cloud Migration Planning:**
251
+
252
+ If planning cloud migration (--cloud-migration):
253
+ Plan 12-Factor transformation:
254
+ - **I. Codebase**: Consolidate multiple repositories into single codebase
255
+ - **II. Dependencies**: Migrate to explicit dependency management
256
+ - **III. Config**: Extract hardcoded config to environment variables
257
+ - **IV. Backing Services**: Abstract database/service connections
258
+ - **V. Build/Release/Run**: Implement CI/CD with immutable artifacts
259
+ - **VI. Processes**: Refactor stateful components to stateless design
260
+ - **VII. Port Binding**: Containerize services with port exposure
261
+ - **VIII. Concurrency**: Design for horizontal scaling patterns
262
+ - **IX. Disposability**: Implement graceful shutdown handlers
263
+ - **X. Dev/Prod Parity**: Standardize environments with containers
264
+ - **XI. Logs**: Centralize logging to stdout/stderr streams
265
+ - **XII. Admin Processes**: Separate admin tasks from main processes
266
+
267
+ Plan DDD + 12-Factor architectural evolution:
268
+ - **Legacy to bounded context** migration with 12-Factor processes
269
+ - **Monolith decomposition** based on domain boundaries + stateless services
270
+ - **Domain model modernization** with cloud-native patterns
271
+ - **Event-driven transformation** using cloud messaging + disposability
272
+ - **Technology stack upgrade** preserving domain logic + environment parity
273
+ - **Configuration externalization** across all bounded contexts
274
+ - **Containerization strategy** for each domain service
275
+ - **Team topologies alignment** with bounded contexts + DevOps practices
276
+ - **Risk assessment** for domain continuity and 12-Factor compliance
277
+ - **Timeline and milestone** definition per bounded context + cloud migration
278
+
279
+ ## 5. DDD Tactical Pattern Implementation
280
+
281
+ If implementing patterns (--pattern, --repository, --factory, --strategy, --aggregate, --entity, --value-object):
282
+ !find . -name "*.py" -o -name "*.js" -o -name "*.ts" | xargs grep -l "Pattern\|Factory\|Strategy\|Repository\|Entity\|ValueObject\|Aggregate" | head -5
283
+ !ls -la patterns/ design/ architecture/ domain/ 2>/dev/null || echo "No pattern directories found"
284
+
285
+ **DDD Core Tactical Patterns:**
286
+
287
+ **Entity Implementation** (--entity):
288
+ - Identity-based objects with unique identifiers
289
+ - Mutable state with business logic encapsulation
290
+ - Lifecycle management and invariant enforcement
291
+
292
+ **Value Object Implementation** (--value-object):
293
+ - Immutable objects defined by attributes
294
+ - Equality based on value, not identity
295
+ - Self-validating with business rules
296
+
297
+ **Aggregate Implementation** (--aggregate):
298
+ - Consistency boundary with aggregate root
299
+ - Encapsulation of business invariants
300
+ - Transaction boundary definition
301
+ - Domain event emission
302
+
303
+ **Repository Pattern** (--repository):
304
+ - Domain-focused collection-like interface
305
+ - Aggregate persistence abstraction
306
+ - Infrastructure-independent data access
307
+
308
+ **Domain Service Implementation** (--domain-service):
309
+ - Stateless domain operations
310
+ - Multi-entity business logic coordination
311
+ - Pure domain concepts without dependencies
312
+
313
+ **Domain Event Implementation** (--domain-events):
314
+ - Domain occurrence modeling
315
+ - Decoupled communication between aggregates
316
+ - Event sourcing preparation
317
+
318
+ Implement DDD tactical patterns:
319
+ - **Entity pattern** with proper identity and business logic
320
+ - **Value Object pattern** for immutable domain concepts
321
+ - **Aggregate pattern** for consistency boundaries
322
+ - **Repository pattern** for domain-focused data access
323
+ - **Domain Service pattern** for complex business operations
324
+ - **Factory pattern** for complex object creation
325
+ - **Specification pattern** for business rule encapsulation
326
+ - **Strategy pattern** for domain algorithm selection
327
+ - **Observer pattern** for domain event handling
328
+ - **Dependency injection** for infrastructure abstraction
329
+
330
+ Think step by step about Domain-Driven Design + 12-Factor architectural requirements and provide:
331
+
332
+ 1. **Current State Assessment (DDD + 12-Factor)**:
333
+ - **Ubiquitous Language** consistency across codebase and documentation
334
+ - **Bounded Context** identification and boundary analysis
335
+ - **Domain model** vs technical implementation separation
336
+ - **Aggregate design** and consistency boundary evaluation
337
+ - **Repository pattern** usage and domain purity
338
+ - **12-Factor compliance** across all factors (I-XII)
339
+ - **Codebase** consolidation and version control status
340
+ - **Configuration externalization** and environment variable usage
341
+ - **Stateless process design** and backing service abstraction
342
+ - **Build/release/run separation** and deployment pipeline maturity
343
+ - **Logging strategy** and disposability patterns
344
+ - **Performance and scalability** within domain boundaries + horizontal scaling
345
+ - **Security and compliance** for domain protection + cloud-native security
346
+
347
+ 2. **Design Strategy (DDD + 12-Factor)**:
348
+ - **Strategic design** with context mapping and team organization
349
+ - **Tactical design** with entities, value objects, and aggregates
350
+ - **Bounded context decomposition** approach + process-based scaling
351
+ - **Domain event** communication patterns + backing service integration
352
+ - **Data consistency strategy** within and across aggregates + stateless design
353
+ - **Anti-corruption layer** design for external integrations + backing services
354
+ - **12-Factor architecture** design with cloud-native patterns
355
+ - **Configuration strategy** via environment variables across contexts
356
+ - **Logging and monitoring** design for domain events and business processes
357
+ - **Containerization strategy** for bounded context deployment
358
+
359
+ 3. **Implementation Roadmap (DDD + 12-Factor)**:
360
+ - **Domain discovery** and modeling workshops
361
+ - **12-Factor assessment** and gap analysis
362
+ - **Bounded context extraction** phases and milestones
363
+ - **Domain model implementation** with tactical patterns + stateless design
364
+ - **Configuration externalization** across all contexts
365
+ - **Containerization** and deployment pipeline setup
366
+ - **Event storming** sessions for process understanding
367
+ - **Team topology** alignment with domain boundaries + DevOps practices
368
+ - **Risk mitigation** for domain knowledge transfer + cloud migration
369
+ - **Testing strategy** for domain logic validation + 12-Factor compliance
370
+
371
+ 4. **Quality Assurance (DDD + 12-Factor)**:
372
+ - **Architecture Decision Records (ADRs)** for domain decisions + 12-Factor compliance
373
+ - **Domain model validation** and ubiquitous language consistency
374
+ - **12-Factor compliance** monitoring and automated validation
375
+ - **Bounded context health** monitoring and metrics
376
+ - **Configuration management** validation and drift detection
377
+ - **Stateless design** verification and process monitoring
378
+ - **Domain expert collaboration** processes
379
+ - **Continuous domain** model evolution practices
380
+ - **Cloud-native readiness** assessment and validation
381
+ - **Regular domain** model and architecture reviews + 12-Factor audits
382
+
383
+ Generate comprehensive DDD + 12-Factor architecture analysis with:
384
+ - **Strategic design** recommendations for context boundaries + cloud-native deployment
385
+ - **Tactical pattern** implementation guidance + stateless design patterns
386
+ - **12-Factor compliance** roadmap and implementation strategies
387
+ - **Domain-driven migration** strategies from legacy systems + cloud transformation
388
+ - **Quality assurance** measures for domain model integrity + cloud-native readiness
389
+ - **Team collaboration** approaches with domain experts + DevOps practices
390
+ - **Configuration and deployment** strategies for bounded contexts
391
+ - **Monitoring and observability** design for domain events and system health
392
+
393
+ If no specific operation is provided, perform comprehensive architecture health assessment combining DDD principles and 12-Factor App methodology, and recommend improvements based on domain analysis, cloud-native best practices, and strategic design patterns.
@@ -0,0 +1,127 @@
1
+ ---
2
+ description: Manage project configuration files, environment variables, and application settings
3
+ tags: [configuration, environment, validation, schema, security]
4
+ ---
5
+
6
+ Manage configuration files and settings based on the arguments provided in $ARGUMENTS.
7
+
8
+ ## Usage Examples
9
+
10
+ **Basic configuration analysis:**
11
+ ```
12
+ /xconfig
13
+ ```
14
+
15
+ **Validate configuration files:**
16
+ ```
17
+ /xconfig --validate
18
+ ```
19
+
20
+ **Check for security issues:**
21
+ ```
22
+ /xconfig --secrets
23
+ ```
24
+
25
+ **Convert between formats:**
26
+ ```
27
+ /xconfig --convert yaml json
28
+ ```
29
+
30
+ ## Implementation
31
+
32
+ If $ARGUMENTS contains "help" or "--help":
33
+ Display this usage information and exit.
34
+
35
+ First, examine the project structure for configuration files:
36
+ !ls -la | grep -E "(config|env|\.yml|\.yaml|\.json|\.toml)"
37
+ !find . -maxdepth 2 -name "*.yml" -o -name "*.yaml" -o -name "*.json" -o -name "*.toml" -o -name ".env*" | head -10
38
+
39
+ Based on $ARGUMENTS, perform the appropriate configuration operation:
40
+
41
+ ## 1. Configuration File Validation
42
+
43
+ If validating configuration (--validate):
44
+ !python -c "import yaml; print('YAML parser available')" 2>/dev/null || echo "Install PyYAML: pip install pyyaml"
45
+ !python -c "import json; print('JSON parser available')" 2>/dev/null
46
+
47
+ Validate configuration files:
48
+ @config.yml 2>/dev/null || @config.yaml 2>/dev/null || @config.json 2>/dev/null || echo "No standard config file found"
49
+
50
+ Check for:
51
+ - Valid syntax (YAML/JSON/TOML)
52
+ - Required fields present
53
+ - Correct data types
54
+ - Security issues (exposed secrets)
55
+
56
+ ## 2. Schema Operations
57
+
58
+ If working with schemas (--schema, --schema-validate):
59
+ !pip list | grep pydantic 2>/dev/null || echo "Install Pydantic: pip install pydantic"
60
+
61
+ For Python projects with Pydantic:
62
+ !find . -name "*.py" -exec grep -l "BaseModel\|pydantic" {} \; | head -5
63
+
64
+ Validate configuration against schema:
65
+ - Type checking
66
+ - Constraint validation
67
+ - Required field verification
68
+ - Default value application
69
+
70
+ ## 3. Environment Management
71
+
72
+ If managing environments (--env, --dev, --staging, --production):
73
+ !ls -la .env* 2>/dev/null || echo "No environment files found"
74
+ !printenv | grep -E "(NODE_ENV|ENVIRONMENT|ENV)" || echo "No environment variables set"
75
+
76
+ Manage environment-specific configurations:
77
+ - Development settings
78
+ - Staging configurations
79
+ - Production parameters
80
+ - Local overrides
81
+
82
+ ## 4. Template Generation
83
+
84
+ If generating templates (--template, --generate):
85
+ Create configuration templates based on project type:
86
+ !ls package.json 2>/dev/null && echo "Node.js project detected" || echo "Not a Node.js project"
87
+ !ls requirements.txt setup.py pyproject.toml 2>/dev/null && echo "Python project detected" || echo "Not a Python project"
88
+
89
+ Generate appropriate configuration templates for the detected project type.
90
+
91
+ ## 5. Format Conversion
92
+
93
+ If converting formats (--convert):
94
+ !python -c "import yaml, json, toml" 2>/dev/null || echo "Install required parsers: pip install pyyaml toml"
95
+
96
+ Convert between formats:
97
+ - YAML to JSON
98
+ - JSON to TOML
99
+ - Environment variables to YAML
100
+ - Configuration normalization
101
+
102
+ ## 6. Security and Secrets
103
+
104
+ If managing secrets (--secrets, --encrypt):
105
+ !grep -r "password\|secret\|key" . --include="*.yml" --include="*.yaml" --include="*.json" | grep -v "example\|template" | head -5
106
+
107
+ Check for:
108
+ - Hardcoded secrets
109
+ - Unencrypted sensitive data
110
+ - Proper secret management
111
+ - Environment variable usage
112
+
113
+ Recommend:
114
+ - Use environment variables for secrets
115
+ - Implement proper secret management
116
+ - Encrypt sensitive configuration data
117
+ - Use vault services for production
118
+
119
+ Think step by step about configuration management best practices and provide:
120
+ - Current configuration status
121
+ - Security recommendations
122
+ - Environment setup guidance
123
+ - Schema validation results
124
+ - Format conversion options
125
+
126
+ Report configuration health and suggest improvements for better configuration management.
127
+
@@ -0,0 +1,92 @@
1
+ ---
2
+ description: Continue an execution plan from where it left off across sessions
3
+ tags: [workflow, execution-plan, session-continuity, automation]
4
+ ---
5
+
6
+ # Execution Plan Continuation
7
+
8
+ Resume a multi-step execution plan, picking up at the next incomplete task.
9
+
10
+ ## Usage Examples
11
+
12
+ **Resume the current plan:**
13
+ ```
14
+ /xcontinue
15
+ ```
16
+
17
+ **Help and options:**
18
+ ```
19
+ /xcontinue help
20
+ /xcontinue --help
21
+ ```
22
+
23
+ ## Implementation
24
+
25
+ If $ARGUMENTS contains "help" or "--help":
26
+ Display this usage information and exit.
27
+
28
+ ### Step 1: Find the Execution Plan
29
+
30
+ Search for execution plan files in the current directory:
31
+
32
+ ```bash
33
+ find . -maxdepth 2 -iname "*plan*" -name "*.md" ! -path "*/node_modules/*" ! -path "*/.git/*" 2>/dev/null
34
+ ```
35
+
36
+ - Common names: `EXECUTION_PLAN.md`, `PLAN.md`, `execution-plan.md`
37
+
38
+ If no plan file is found:
39
+ - Tell the user: "No execution plan found in this directory."
40
+ - Suggest creating one with a basic template:
41
+
42
+ ```markdown
43
+ # Execution Plan
44
+
45
+ | # | Task | Status | Notes |
46
+ |---|------|--------|-------|
47
+ | 1 | [First task] | [ ] pending | |
48
+ | 2 | [Second task] | [ ] pending | |
49
+ ```
50
+
51
+ Stop and wait for user input.
52
+
53
+ ### Step 2: Parse Plan Progress
54
+
55
+ Read the plan file and identify:
56
+ - **Completed tasks**: Lines with `[x]`, `done`, or checkmarks
57
+ - **Pending tasks**: Lines with `[ ]`, `pending`, or unchecked items
58
+ - **In-progress tasks**: Lines with `in-progress` or `in progress`
59
+
60
+ Display a progress summary:
61
+ ```
62
+ Progress: X of Y tasks complete
63
+ Next task: [description of next pending task]
64
+ ```
65
+
66
+ If all tasks are complete:
67
+ - Congratulate the user
68
+ - Summarize what was accomplished
69
+ - Suggest cleanup: "Consider deleting the plan file if work is done."
70
+ - Stop execution.
71
+
72
+ ### Step 3: Execute Next Task
73
+
74
+ Pick the first task with status `pending` or `[ ]`:
75
+ 1. Read the task description and any acceptance criteria
76
+ 2. Implement the task fully
77
+ 3. Run validation if applicable (tests, lint, build)
78
+ 4. Verify acceptance criteria pass
79
+
80
+ ### Step 4: Update Plan and Handoff
81
+
82
+ After completing the task:
83
+ 1. Update the plan file — mark the task as `[x] done` with a timestamp
84
+ 2. Update any counters (Done/Remaining) in the plan header
85
+ 3. Tell the user:
86
+
87
+ ```
88
+ Task #N complete: [brief summary]
89
+ Run /clear then /xcontinue to proceed to the next task.
90
+ ```
91
+
92
+ This handoff protocol ensures context stays fresh across sessions.