@bluefly/openstandardagents 0.2.5-RC → 0.2.7

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 (238) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.yml +63 -0
  2. package/.github/ISSUE_TEMPLATE/feature_request.yml +40 -0
  3. package/.github/workflows/dependabot-comment.yml +34 -0
  4. package/.github/workflows/pr-comment.yml +33 -0
  5. package/.husky/pre-commit +5 -0
  6. package/.kiro/config.json +21 -0
  7. package/.kiro/settings/mcp.json +61 -0
  8. package/.kiro/specs/scripts-migration-api-first/design.md +883 -0
  9. package/.kiro/specs/scripts-migration-api-first/requirements.md +165 -0
  10. package/.kiro/specs/scripts-migration-api-first/tasks.md +539 -0
  11. package/.kiro/specs/{website-design-audit → website-brand-identity}/design.md +381 -0
  12. package/.kiro/specs/{website-design-audit → website-brand-identity}/requirements.md +88 -0
  13. package/.kiro/specs/website-brand-identity/tasks.md +981 -0
  14. package/CHANGELOG.md +23 -0
  15. package/README.md +12 -3
  16. package/bin/ossa-dev +42 -0
  17. package/bin/ossa-export +32 -0
  18. package/bin/ossa-generate +60 -0
  19. package/bin/ossa-health +40 -0
  20. package/bin/ossa-init +26 -0
  21. package/dist/repositories/schema.repository.d.ts.map +1 -1
  22. package/dist/repositories/schema.repository.js +15 -10
  23. package/dist/repositories/schema.repository.js.map +1 -1
  24. package/dist/services/github-sync/github-client.d.ts +14 -0
  25. package/dist/services/github-sync/github-client.d.ts.map +1 -0
  26. package/dist/services/github-sync/github-client.js +41 -0
  27. package/dist/services/github-sync/github-client.js.map +1 -0
  28. package/dist/services/github-sync/gitlab-client.d.ts +17 -0
  29. package/dist/services/github-sync/gitlab-client.d.ts.map +1 -0
  30. package/dist/services/github-sync/gitlab-client.js +42 -0
  31. package/dist/services/github-sync/gitlab-client.js.map +1 -0
  32. package/dist/services/github-sync/schemas.d.ts +46 -0
  33. package/dist/services/github-sync/schemas.d.ts.map +1 -0
  34. package/dist/services/github-sync/schemas.js +36 -0
  35. package/dist/services/github-sync/schemas.js.map +1 -0
  36. package/dist/services/github-sync/sync.service.d.ts +27 -0
  37. package/dist/services/github-sync/sync.service.d.ts.map +1 -0
  38. package/dist/services/github-sync/sync.service.js +99 -0
  39. package/dist/services/github-sync/sync.service.js.map +1 -0
  40. package/dist/services/runtime/claude/capability-mapper.d.ts +84 -0
  41. package/dist/services/runtime/claude/capability-mapper.d.ts.map +1 -0
  42. package/dist/services/runtime/claude/capability-mapper.js +245 -0
  43. package/dist/services/runtime/claude/capability-mapper.js.map +1 -0
  44. package/dist/services/runtime/claude/claude-adapter.d.ts +80 -0
  45. package/dist/services/runtime/claude/claude-adapter.d.ts.map +1 -0
  46. package/dist/services/runtime/claude/claude-adapter.js +287 -0
  47. package/dist/services/runtime/claude/claude-adapter.js.map +1 -0
  48. package/dist/services/runtime/claude/manifest-parser.d.ts +77 -0
  49. package/dist/services/runtime/claude/manifest-parser.d.ts.map +1 -0
  50. package/dist/services/runtime/claude/manifest-parser.js +169 -0
  51. package/dist/services/runtime/claude/manifest-parser.js.map +1 -0
  52. package/dist/services/runtime/claude/types.d.ts +115 -0
  53. package/dist/services/runtime/claude/types.d.ts.map +1 -0
  54. package/dist/services/runtime/claude/types.js +6 -0
  55. package/dist/services/runtime/claude/types.js.map +1 -0
  56. package/dist/services/validation.service.d.ts.map +1 -1
  57. package/dist/services/validation.service.js +12 -1
  58. package/dist/services/validation.service.js.map +1 -1
  59. package/dist/spec/v0.2.4/ossa-0.2.4.schema.json +85 -208
  60. package/dist/spec/v0.2.6/CHANGELOG.md +401 -0
  61. package/dist/spec/v0.2.6/README.md +72 -0
  62. package/dist/spec/v0.2.6/migrations/v0.2.3-to-v0.2.4.md +599 -0
  63. package/dist/spec/v0.2.6/migrations/v0.2.5-RC-to-v0.2.6.md +65 -0
  64. package/dist/spec/v0.2.6/ossa-0.2.6.schema.json +1786 -0
  65. package/dist/spec/v0.2.6/ossa-0.2.6.yaml +581 -0
  66. package/dist/spec/v0.2.6-dev/CHANGELOG.md +164 -0
  67. package/dist/spec/v0.2.6-dev/README.md +75 -0
  68. package/dist/spec/v0.2.6-dev/migrations/v0.2.2-to-v0.2.3.md +343 -0
  69. package/dist/spec/v0.2.6-dev/migrations/v0.2.3-to-v0.2.4.md +599 -0
  70. package/dist/spec/{v0.2.4/ossa-0.2.4-dev.schema.json → v0.2.6-dev/ossa-0.2.5.schema.json} +9 -9
  71. package/dist/spec/v0.2.6-dev/ossa-0.2.5.yaml +581 -0
  72. package/{spec/v0.2.4/ossa-0.2.4-dev.schema.json → dist/spec/v0.2.6-dev/ossa-0.2.6-dev.schema.json} +9 -9
  73. package/dist/spec/v0.2.6-dev/ossa-0.2.6-dev.yaml +448 -0
  74. package/dist/spec/v0.2.7/core/agentgraph.md +324 -0
  75. package/dist/spec/v0.2.7/resources/agentgraph.yaml +135 -0
  76. package/docs/brand-guide/01-brand-overview.md +37 -0
  77. package/docs/brand-guide/02-logo-usage.md +43 -0
  78. package/docs/brand-guide/03-color-palette.md +70 -0
  79. package/docs/brand-guide/04-typography.md +82 -0
  80. package/docs/brand-guide/05-voice-and-tone.md +108 -0
  81. package/docs/brand-guide/06-visual-elements.md +137 -0
  82. package/docs/brand-guide/07-application-examples.md +153 -0
  83. package/docs/brand-guide/OssaLogo/OssA_Logo.svg +21 -0
  84. package/docs/brand-guide/OssaLogo/brand.af +0 -0
  85. package/docs/brand-guide/README.md +107 -0
  86. package/docs/comparison.md +315 -0
  87. package/docs/operations/automation-roadmap.md +245 -0
  88. package/docs/operations/github-sync-strategy.md +357 -0
  89. package/examples/anthropic/claude-assistant.ossa.json +5 -4
  90. package/examples/autogen/multi-agent.ossa.json +6 -4
  91. package/examples/crewai/research-team.ossa.json +14 -5
  92. package/examples/cursor/code-review-agent.ossa.json +21 -6
  93. package/examples/langchain/chain-agent.ossa.json +21 -5
  94. package/examples/langflow/workflow-agent.ossa.json +2 -3
  95. package/examples/langgraph/state-machine-agent.ossa.json +2 -3
  96. package/examples/llamaindex/rag-agent.ossa.json +2 -3
  97. package/examples/openai/multi-tool-agent.ossa.json +32 -9
  98. package/examples/openai/swarm-agent.ossa.json +18 -5
  99. package/examples/vercel/edge-agent.ossa.json +5 -4
  100. package/openapi/github-sync.yaml +115 -0
  101. package/package.json +25 -4
  102. package/scripts/README.md +103 -0
  103. package/scripts/auto-rebase-mrs.ts +106 -0
  104. package/scripts/batch-dependabot.sh +57 -0
  105. package/scripts/configure-gitlab-branch-protection.ts +95 -0
  106. package/scripts/create-issue-helper.ts +238 -0
  107. package/scripts/create-milestone-issue.ts +73 -0
  108. package/scripts/fix-schema-formats.js +82 -0
  109. package/scripts/generate-agents-catalog.ts +77 -0
  110. package/scripts/generate-api-docs.ts +218 -0
  111. package/scripts/generate-cli-docs.ts +410 -0
  112. package/scripts/generate-config-docs.ts +109 -0
  113. package/scripts/generate-errors-docs.ts +76 -0
  114. package/scripts/generate-examples-docs.ts +99 -0
  115. package/scripts/generate-schema-docs.ts +296 -0
  116. package/scripts/generate-types-docs.ts +48 -0
  117. package/scripts/lowercase-docs.ts +43 -0
  118. package/scripts/manage-milestone-mrs.ts +279 -0
  119. package/scripts/rebase-all-mrs.sh +75 -0
  120. package/scripts/sync-github-pr.sh +48 -0
  121. package/scripts/sync-version.js +40 -0
  122. package/scripts/sync-wiki.sh +50 -0
  123. package/scripts/validate-all.js +127 -0
  124. package/spec/v0.2.4/ossa-0.2.4.schema.json +85 -208
  125. package/spec/v0.2.6/CHANGELOG.md +401 -0
  126. package/spec/v0.2.6/README.md +72 -0
  127. package/spec/v0.2.6/migrations/v0.2.3-to-v0.2.4.md +599 -0
  128. package/spec/v0.2.6/migrations/v0.2.5-RC-to-v0.2.6.md +65 -0
  129. package/spec/v0.2.6/ossa-0.2.6.schema.json +1786 -0
  130. package/spec/v0.2.6/ossa-0.2.6.yaml +581 -0
  131. package/spec/v0.2.6-dev/CHANGELOG.md +164 -0
  132. package/spec/v0.2.6-dev/README.md +75 -0
  133. package/spec/v0.2.6-dev/migrations/v0.2.2-to-v0.2.3.md +343 -0
  134. package/spec/v0.2.6-dev/migrations/v0.2.3-to-v0.2.4.md +599 -0
  135. package/spec/v0.2.6-dev/ossa-0.2.5.schema.json +1696 -0
  136. package/spec/v0.2.6-dev/ossa-0.2.5.yaml +581 -0
  137. package/spec/v0.2.6-dev/ossa-0.2.6-dev.schema.json +1696 -0
  138. package/spec/v0.2.6-dev/ossa-0.2.6-dev.yaml +448 -0
  139. package/spec/v0.2.7/core/agentgraph.md +324 -0
  140. package/spec/v0.2.7/resources/agentgraph.yaml +135 -0
  141. package/website/DESIGN_SYSTEM_IMPLEMENTATION.md +445 -0
  142. package/website/app/about/page.tsx +53 -44
  143. package/website/app/ecosystem/page.tsx +146 -111
  144. package/website/app/globals.scss +256 -21
  145. package/website/app/page.tsx +394 -182
  146. package/website/app/page.tsx.bak +679 -0
  147. package/website/app/page.tsx.bak2 +649 -0
  148. package/website/app/schema/page.tsx +3 -3
  149. package/website/app/specification/page.tsx +1 -1
  150. package/website/components/layout/Header.tsx +27 -23
  151. package/website/components/ui/Badge.tsx +82 -0
  152. package/website/components/ui/Button.tsx +116 -0
  153. package/website/components/ui/Card.tsx +167 -0
  154. package/website/components/ui/Checkbox.tsx +141 -0
  155. package/website/components/ui/Input.tsx +169 -0
  156. package/website/components/ui/Radio.tsx +141 -0
  157. package/website/components/ui/Select.tsx +182 -0
  158. package/website/components/ui/Tag.tsx +158 -0
  159. package/website/components/ui/Textarea.tsx +195 -0
  160. package/website/components/ui/index.ts +11 -0
  161. package/website/content/docs/{00-HOME.md → 00-home.md} +1 -1
  162. package/website/content/docs/agents/catalog.md +28 -0
  163. package/website/content/docs/{AIFlow-Framework-Integration-with-OSSA.md → aiflow-framework-integration-with-ossa.md} +2 -2
  164. package/website/content/docs/api-reference/index.md +38 -0
  165. package/website/content/docs/api-reference/ossa-core-api.md +634 -0
  166. package/website/content/docs/api-reference/ossa-registry-api.md +515 -0
  167. package/website/content/docs/api-reference/unified-agent-gateway.md +599 -0
  168. package/website/content/docs/cli-reference/index.md +111 -0
  169. package/website/content/docs/cli-reference/ossa-agents.md +70 -0
  170. package/website/content/docs/cli-reference/ossa-export.md +56 -0
  171. package/website/content/docs/cli-reference/ossa-generate.md +66 -0
  172. package/website/content/docs/cli-reference/ossa-gitlab-agent.md +57 -0
  173. package/website/content/docs/cli-reference/ossa-import.md +56 -0
  174. package/website/content/docs/cli-reference/ossa-init.md +57 -0
  175. package/website/content/docs/cli-reference/ossa-migrate.md +62 -0
  176. package/website/content/docs/cli-reference/ossa-run.md +66 -0
  177. package/website/content/docs/cli-reference/ossa-schema.md +57 -0
  178. package/website/content/docs/cli-reference/ossa-setup.md +57 -0
  179. package/website/content/docs/cli-reference/ossa-validate.md +66 -0
  180. package/website/content/docs/configuration/index.md +97 -0
  181. package/website/content/docs/deployment/github-mirroring.md +924 -0
  182. package/website/content/docs/documentation.md +100 -0
  183. package/website/content/docs/ecosystem/framework-support.md +551 -9
  184. package/website/content/docs/errors/index.md +10 -0
  185. package/website/content/docs/examples/{AIFlow-Framework-Integration-with-OSSA.md → aiflow-framework-integration-with-ossa.md} +2 -2
  186. package/website/content/docs/examples/catalog.md +300 -0
  187. package/website/content/docs/for-audiences/{Students-Researchers.md → students-researchers.md} +1 -1
  188. package/website/content/docs/getting-started/{Installation.md → installation.md} +1 -1
  189. package/website/content/docs/getting-started.md +1 -1
  190. package/website/content/docs/integrations/aiflow.md +2 -2
  191. package/website/content/docs/migration-guides/anthropic-mcp-to-ossa.md +5 -5
  192. package/website/content/docs/migration-guides/crewai-to-ossa.md +3 -3
  193. package/website/content/docs/migration-guides/drupal-eca-to-ossa.md +7 -7
  194. package/website/content/docs/migration-guides/langchain-to-ossa.md +4 -4
  195. package/website/content/docs/openapi-extensions/index.md +1 -1
  196. package/website/content/docs/ossa-compliant-badge.md +1 -1
  197. package/website/content/docs/pre-release/index.md +5 -5
  198. package/website/content/docs/releases/v0.2.6.md +99 -0
  199. package/website/content/docs/schema-reference/agent-capabilities.md +50 -0
  200. package/website/content/docs/schema-reference/agent-id.md +52 -0
  201. package/website/content/docs/schema-reference/agent-name.md +50 -0
  202. package/website/content/docs/schema-reference/agent-role.md +54 -0
  203. package/website/content/docs/schema-reference/agent-version.md +50 -0
  204. package/website/content/docs/schema-reference/index.md +26 -157
  205. package/website/content/docs/types-reference/index.md +105 -0
  206. package/website/content/docs/versioning.md +3 -3
  207. package/website/dev.sh +53 -0
  208. package/website/docker-compose.dev.yml +36 -0
  209. package/website/lib/version.ts +1 -1
  210. package/website/lib/versions.json +45 -20
  211. package/website/package.json +1 -1
  212. package/website/styles/_spacing.scss +453 -0
  213. package/website/styles/_tokens.scss +245 -0
  214. package/website/styles/_typography.scss +361 -0
  215. package/website/styles/_variables.scss +270 -19
  216. package/website/tailwind.config.ts +113 -79
  217. package/.kiro/specs/agent-buildkit-templates/design.md +0 -495
  218. package/.kiro/specs/agent-buildkit-templates/requirements.md +0 -165
  219. package/.kiro/specs/kiro-ide-supercharger/README.md +0 -202
  220. package/.kiro/specs/kiro-ide-supercharger/design.md +0 -1005
  221. package/.kiro/specs/kiro-ide-supercharger/requirements.md +0 -141
  222. package/.kiro/specs/kiro-ide-supercharger/tasks.md +0 -507
  223. package/docs/issue-19-completion-summary.md +0 -648
  224. package/docs/issue-19-validation.md +0 -351
  225. package/website/content/docs/Examples.md +0 -71
  226. package/website/content/docs/OpenAPI-Extensions.md +0 -934
  227. package/website/content/docs/core-concepts/Project-Structure.md +0 -348
  228. package/website/content/docs/examples/Migration-Guides.md +0 -214
  229. package/website/content/docs/for-audiences/Architects.md +0 -224
  230. package/website/content/docs/for-audiences/Developers.md +0 -220
  231. package/website/content/docs/for-audiences/Enterprises.md +0 -256
  232. package/website/content/docs/getting-started/5-Minute-Overview.md +0 -85
  233. package/website/content/docs/getting-started/First-Agent.md +0 -196
  234. package/website/content/docs/getting-started/Hello-World.md +0 -184
  235. package/website/content/docs/migration-guides/00-INDEX.md +0 -76
  236. package/website/content/docs/migration-guides/README.md +0 -133
  237. /package/dist/spec/v0.2.4/{ossa-0.2.4-dev.yaml → ossa-0.2.4.yaml} +0 -0
  238. /package/spec/v0.2.4/{ossa-0.2.4-dev.yaml → ossa-0.2.4.yaml} +0 -0
@@ -0,0 +1,883 @@
1
+ # Design Document
2
+
3
+ ## Overview
4
+
5
+ This design document outlines the architecture for migrating the `/scripts` directory into `/src` following API-first, DRY, CRUD, Zod validation, and OpenAPI principles. The migration transforms 30+ standalone scripts into a cohesive service-oriented architecture with proper separation of concerns, comprehensive validation, and formal API contracts.
6
+
7
+ ### Goals
8
+
9
+ - **API-First**: Define OpenAPI specifications before implementation
10
+ - **DRY**: Eliminate code duplication through shared services and utilities
11
+ - **CRUD**: Implement repository pattern for all data access
12
+ - **Type Safety**: Use Zod for runtime validation matching TypeScript types
13
+ - **Testability**: Achieve 80%+ code coverage with unit and property-based tests
14
+ - **Incremental Migration**: Maintain backward compatibility throughout transition
15
+
16
+ ### Non-Goals
17
+
18
+ - Changing the functionality of existing scripts
19
+ - Adding new features beyond consolidation
20
+ - Migrating CLI commands to HTTP APIs (remains CLI-focused)
21
+
22
+ ## Architecture
23
+
24
+ ### High-Level Architecture
25
+
26
+ ```
27
+ ┌─────────────────────────────────────────────────────────────┐
28
+ │ CLI Layer │
29
+ │ (src/cli/commands/) - Commander.js commands │
30
+ │ - Argument validation with Zod │
31
+ │ - Service resolution from DI container │
32
+ │ - Error formatting and user feedback │
33
+ └────────────────┬────────────────────────────────────────────┘
34
+
35
+
36
+ ┌─────────────────────────────────────────────────────────────┐
37
+ │ Service Layer │
38
+ │ (src/services/) - Business logic and orchestration │
39
+ │ - VersionService: Version management operations │
40
+ │ - DocumentationService: Doc generation operations │
41
+ │ - GitLabService: GitLab API operations │
42
+ │ - SchemaService: Schema validation and generation │
43
+ │ - Input/output validation with Zod │
44
+ │ - Dependency injection │
45
+ └────────────────┬────────────────────────────────────────────┘
46
+
47
+
48
+ ┌─────────────────────────────────────────────────────────────┐
49
+ │ Repository Layer │
50
+ │ (src/repositories/) - Data access with CRUD operations │
51
+ │ - VersionRepository: .version.json, package.json │
52
+ │ - DocumentationRepository: Markdown files │
53
+ │ - SchemaRepository: JSON schemas (existing) │
54
+ │ - ManifestRepository: OSSA manifests (existing) │
55
+ │ - Data validation with Zod │
56
+ │ - Typed domain objects │
57
+ └────────────────┬────────────────────────────────────────────┘
58
+
59
+
60
+ ┌─────────────────────────────────────────────────────────────┐
61
+ │ Utility Layer │
62
+ │ (src/utils/) - Shared utilities │
63
+ │ - file-ops: File system operations │
64
+ │ - exec: Command execution │
65
+ │ - markdown-builder: Markdown generation │
66
+ │ - openapi-parser: OpenAPI spec parsing │
67
+ │ - retry: Retry logic with backoff │
68
+ └─────────────────────────────────────────────────────────────┘
69
+ ```
70
+
71
+ ### Directory Structure
72
+
73
+ ```
74
+ src/
75
+ ├── cli/
76
+ │ └── commands/
77
+ │ ├── version.command.ts # Version management commands
78
+ │ ├── docs.command.ts # Documentation generation commands
79
+ │ ├── gitlab.command.ts # GitLab operations commands
80
+ │ └── schema.command.ts # Schema operations commands
81
+ ├── services/
82
+ │ ├── version.service.ts # Version management service
83
+ │ ├── documentation.service.ts # Documentation generation service
84
+ │ ├── gitlab.service.ts # GitLab operations service
85
+ │ ├── schema.service.ts # Schema operations service (extends existing)
86
+ │ ├── validation.service.ts # Existing validation service
87
+ │ ├── generation.service.ts # Existing generation service
88
+ │ └── migration.service.ts # Existing migration service
89
+ ├── repositories/
90
+ │ ├── base.repository.ts # Base repository interface
91
+ │ ├── version.repository.ts # Version data repository
92
+ │ ├── documentation.repository.ts # Documentation file repository
93
+ │ ├── schema.repository.ts # Existing schema repository
94
+ │ └── manifest.repository.ts # Existing manifest repository
95
+ ├── utils/
96
+ │ ├── file-ops.ts # File system operations (from scripts/lib)
97
+ │ ├── exec.ts # Command execution (from scripts/lib)
98
+ │ ├── markdown-builder.ts # Markdown generation utility
99
+ │ ├── openapi-parser.ts # OpenAPI spec parser
100
+ │ ├── retry.ts # Retry logic with exponential backoff
101
+ │ └── errors.ts # Typed domain errors
102
+ ├── schemas/
103
+ │ ├── version.schemas.ts # Version-related Zod schemas
104
+ │ ├── documentation.schemas.ts # Documentation-related Zod schemas
105
+ │ ├── gitlab.schemas.ts # GitLab-related Zod schemas
106
+ │ └── schema.schemas.ts # Schema operation Zod schemas
107
+ └── types/
108
+ ├── version.types.ts # Version domain types
109
+ ├── documentation.types.ts # Documentation domain types
110
+ └── gitlab.types.ts # GitLab domain types
111
+
112
+ openapi/
113
+ └── services/
114
+ ├── version-service.openapi.yaml # Version service API contract
115
+ ├── documentation-service.openapi.yaml # Documentation service API contract
116
+ ├── gitlab-service.openapi.yaml # GitLab service API contract
117
+ └── schema-service.openapi.yaml # Schema service API contract
118
+
119
+ scripts/
120
+ └── (deprecated wrappers that delegate to services)
121
+ ```
122
+
123
+ ## Components and Interfaces
124
+
125
+ ### Base Repository Interface
126
+
127
+ ```typescript
128
+ // src/repositories/base.repository.ts
129
+ export interface IRepository<T, ID = string> {
130
+ create(data: T): Promise<T>;
131
+ read(id: ID): Promise<T | null>;
132
+ update(id: ID, data: Partial<T>): Promise<T>;
133
+ delete(id: ID): Promise<void>;
134
+ list(): Promise<T[]>;
135
+ }
136
+
137
+ export interface IFileRepository<T> extends IRepository<T, string> {
138
+ exists(path: string): Promise<boolean>;
139
+ readRaw(path: string): Promise<string>;
140
+ writeRaw(path: string, content: string): Promise<void>;
141
+ }
142
+ ```
143
+
144
+ ### Version Service
145
+
146
+ ```typescript
147
+ // src/services/version.service.ts
148
+ export interface IVersionService {
149
+ getCurrentVersion(): Promise<VersionInfo>;
150
+ bumpVersion(type: BumpType): Promise<VersionInfo>;
151
+ syncVersions(): Promise<SyncResult>;
152
+ validateVersion(version: string): boolean;
153
+ getSchemaPath(version: string): string;
154
+ }
155
+
156
+ export type BumpType = 'major' | 'minor' | 'patch' | 'rc' | 'release';
157
+
158
+ export interface VersionInfo {
159
+ current: string;
160
+ latest_stable: string;
161
+ previous: string[];
162
+ }
163
+
164
+ export interface SyncResult {
165
+ updated: string[];
166
+ skipped: string[];
167
+ errors: Array<{ file: string; error: string }>;
168
+ }
169
+ ```
170
+
171
+ ### Documentation Service
172
+
173
+ ```typescript
174
+ // src/services/documentation.service.ts
175
+ export interface IDocumentationService {
176
+ generateApiDocs(options: ApiDocsOptions): Promise<GenerationResult>;
177
+ generateCliDocs(options: CliDocsOptions): Promise<GenerationResult>;
178
+ generateSchemaDocs(options: SchemaDocsOptions): Promise<GenerationResult>;
179
+ generateExamplesDocs(options: ExamplesDocsOptions): Promise<GenerationResult>;
180
+ generateAllDocs(): Promise<GenerationResult[]>;
181
+ }
182
+
183
+ export interface ApiDocsOptions {
184
+ specPath: string;
185
+ outputPath: string;
186
+ format?: 'markdown' | 'html';
187
+ }
188
+
189
+ export interface GenerationResult {
190
+ success: boolean;
191
+ filesGenerated: string[];
192
+ errors: string[];
193
+ }
194
+ ```
195
+
196
+ ### GitLab Service
197
+
198
+ ```typescript
199
+ // src/services/gitlab.service.ts
200
+ export interface IGitLabService {
201
+ rebaseMergeRequests(projectId: number, options: RebaseOptions): Promise<RebaseResult>;
202
+ configureBranchProtection(projectId: number, config: BranchProtectionConfig): Promise<void>;
203
+ createIssue(projectId: number, issue: IssueData): Promise<Issue>;
204
+ createMilestoneIssue(projectId: number, milestone: MilestoneData): Promise<Issue>;
205
+ manageMilestoneM Rs(projectId: number, milestoneId: number, action: MRAction): Promise<MRResult>;
206
+ }
207
+
208
+ export interface RebaseOptions {
209
+ targetBranch?: string;
210
+ dryRun?: boolean;
211
+ maxRetries?: number;
212
+ }
213
+
214
+ export interface RebaseResult {
215
+ rebased: number[];
216
+ failed: Array<{ mrId: number; error: string }>;
217
+ skipped: number[];
218
+ }
219
+ ```
220
+
221
+ ### Schema Service
222
+
223
+ ```typescript
224
+ // src/services/schema.service.ts
225
+ export interface ISchemaService {
226
+ validateSchema(
227
+ schemaPath: string,
228
+ options?: ValidationOptions
229
+ ): Promise<ValidationResult>;
230
+ fixSchemaFormats(schemaPath: string): Promise<FixResult>;
231
+ generateTypes(
232
+ schemaPath: string,
233
+ outputPath: string
234
+ ): Promise<GenerationResult>;
235
+ generateZodSchemas(
236
+ schemaPath: string,
237
+ outputPath: string
238
+ ): Promise<GenerationResult>;
239
+ }
240
+
241
+ export interface ValidationOptions {
242
+ strict?: boolean;
243
+ formats?: string[];
244
+ }
245
+
246
+ export interface FixResult {
247
+ fixed: boolean;
248
+ removedFormats: string[];
249
+ outputPath: string;
250
+ }
251
+ ```
252
+
253
+ ## Data Models
254
+
255
+ ### Version Domain Models
256
+
257
+ ```typescript
258
+ // src/types/version.types.ts
259
+ export interface VersionConfig {
260
+ current: string;
261
+ latest_stable: string;
262
+ previous: string[];
263
+ deprecated?: string[];
264
+ }
265
+
266
+ export interface PackageJson {
267
+ name: string;
268
+ version: string;
269
+ [key: string]: any;
270
+ }
271
+
272
+ export interface VersionBump {
273
+ from: string;
274
+ to: string;
275
+ type: BumpType;
276
+ timestamp: Date;
277
+ }
278
+ ```
279
+
280
+ ### Documentation Domain Models
281
+
282
+ ```typescript
283
+ // src/types/documentation.types.ts
284
+ export interface OpenAPISpec {
285
+ openapi: string;
286
+ info: OpenAPIInfo;
287
+ servers?: OpenAPIServer[];
288
+ paths: Record<string, PathItem>;
289
+ components?: Components;
290
+ }
291
+
292
+ export interface DocumentationMetadata {
293
+ title: string;
294
+ version: string;
295
+ generatedAt: Date;
296
+ sourceFile: string;
297
+ }
298
+
299
+ export interface MarkdownSection {
300
+ heading: string;
301
+ level: number;
302
+ content: string;
303
+ subsections?: MarkdownSection[];
304
+ }
305
+ ```
306
+
307
+ ### GitLab Domain Models
308
+
309
+ ```typescript
310
+ // src/types/gitlab.types.ts
311
+ export interface MergeRequest {
312
+ id: number;
313
+ iid: number;
314
+ title: string;
315
+ source_branch: string;
316
+ target_branch: string;
317
+ state: MRState;
318
+ }
319
+
320
+ export type MRState = 'opened' | 'closed' | 'merged' | 'locked';
321
+
322
+ export interface Issue {
323
+ id: number;
324
+ iid: number;
325
+ title: string;
326
+ description: string;
327
+ labels: string[];
328
+ milestone?: Milestone;
329
+ }
330
+
331
+ export interface Milestone {
332
+ id: number;
333
+ title: string;
334
+ description: string;
335
+ due_date?: string;
336
+ }
337
+ ```
338
+
339
+ ## Correctness Properties
340
+
341
+ _A property is a characteristic or behavior that should hold true across all valid executions of a system-essentially, a formal statement about what the system should do. Properties serve as the bridge between human-readable specifications and machine-verifiable correctness guarantees._
342
+
343
+ ### Property 1: Input Validation Universality
344
+
345
+ _For any_ service method that accepts input parameters, when invalid data is provided, the system should reject the input with a ZodError before executing business logic.
346
+
347
+ **Validates: Requirements 1.4, 7.1, 7.3**
348
+
349
+ ### Property 2: Version String Validation
350
+
351
+ _For any_ string that does not match semver format (major.minor.patch or major.minor.patch-RC), the VersionService should reject it with a validation error.
352
+
353
+ **Validates: Requirements 2.2**
354
+
355
+ ### Property 3: Version Bump Correctness
356
+
357
+ _For any_ valid semver version and bump type (major, minor, patch, rc), the resulting version should follow semver rules: major increments reset minor and patch to 0, minor increments reset patch to 0, patch increments only patch, rc appends -RC suffix.
358
+
359
+ **Validates: Requirements 2.4**
360
+
361
+ ### Property 4: Version Sync Consistency
362
+
363
+ _For any_ version sync operation, after completion, the version in package.json, .version.json current field, and the latest spec directory name should all match.
364
+
365
+ **Validates: Requirements 2.5**
366
+
367
+ ### Property 5: Documentation Input Validation
368
+
369
+ _For any_ documentation generation operation with invalid input specifications (malformed OpenAPI, missing required fields), the DocumentationService should reject the input with a validation error before attempting generation.
370
+
371
+ **Validates: Requirements 3.2**
372
+
373
+ ### Property 6: GitLab Input Validation
374
+
375
+ _For any_ GitLab operation with invalid inputs (negative project IDs, invalid MR IDs, malformed issue data), the GitLabService should reject the input with a validation error before making API calls.
376
+
377
+ **Validates: Requirements 4.3**
378
+
379
+ ### Property 7: GitLab Retry Behavior
380
+
381
+ _For any_ GitLab API operation that receives a rate limit error (429 status), the system should retry the operation with exponential backoff, waiting progressively longer between attempts (e.g., 1s, 2s, 4s, 8s).
382
+
383
+ **Validates: Requirements 4.4**
384
+
385
+ ### Property 8: GitLab Authentication Validation
386
+
387
+ _For any_ GitLab operation requiring authentication, when an invalid or missing API token is provided, the system should reject the operation with an authentication error before making API calls.
388
+
389
+ **Validates: Requirements 4.5**
390
+
391
+ ### Property 9: TypeScript Generation Validity
392
+
393
+ _For any_ valid JSON schema, the generated TypeScript types should compile without errors when checked with the TypeScript compiler.
394
+
395
+ **Validates: Requirements 5.3**
396
+
397
+ ### Property 10: Zod Schema Generation Validity
398
+
399
+ _For any_ valid JSON schema, the generated Zod schema should successfully validate data that conforms to the original JSON schema.
400
+
401
+ **Validates: Requirements 5.4**
402
+
403
+ ### Property 11: Schema Format Fix Preservation
404
+
405
+ _For any_ JSON schema with unsupported format constraints, after fixing, the modified schema should validate the same set of valid inputs as the original schema (semantic equivalence).
406
+
407
+ **Validates: Requirements 5.5**
408
+
409
+ ### Property 12: Repository Data Validation
410
+
411
+ _For any_ repository write operation (create, update), when invalid data is provided, the repository should reject the operation with a validation error before persisting to storage.
412
+
413
+ **Validates: Requirements 6.2**
414
+
415
+ ### Property 13: Repository Type Safety
416
+
417
+ _For any_ repository read operation, the returned value should be either null (if not found) or a properly typed domain object that passes Zod schema validation.
418
+
419
+ **Validates: Requirements 6.3**
420
+
421
+ ### Property 14: Repository Error Types
422
+
423
+ _For any_ repository operation that encounters an error (file not found, permission denied, invalid data), the thrown error should be a typed domain error (not generic Error) with an appropriate error code.
424
+
425
+ **Validates: Requirements 6.4**
426
+
427
+ ### Property 15: Service Output Validation
428
+
429
+ _For any_ service method that returns data, the output should pass Zod schema validation before being returned to the caller.
430
+
431
+ **Validates: Requirements 7.2**
432
+
433
+ ### Property 16: Validation Error Detail
434
+
435
+ _For any_ validation failure, the thrown ZodError should contain detailed error messages indicating which fields failed validation and why.
436
+
437
+ **Validates: Requirements 7.3**
438
+
439
+ ### Property 17: OpenAPI Specification Validity
440
+
441
+ _For any_ OpenAPI specification created for a service, the spec should pass Redocly CLI validation without errors.
442
+
443
+ **Validates: Requirements 8.4**
444
+
445
+ ### Property 18: CLI Service Resolution
446
+
447
+ _For any_ CLI command execution, services should be successfully resolved from the DI container before business logic executes.
448
+
449
+ **Validates: Requirements 9.2**
450
+
451
+ ### Property 19: CLI Argument Validation
452
+
453
+ _For any_ CLI command with arguments, invalid arguments should be rejected with a validation error and user-friendly message before the command executes.
454
+
455
+ **Validates: Requirements 9.3**
456
+
457
+ ### Property 20: CLI Error Formatting
458
+
459
+ _For any_ service error thrown during CLI command execution, the CLI should catch the error and format it as a user-friendly message (not a stack trace) before exiting.
460
+
461
+ **Validates: Requirements 9.4**
462
+
463
+ ### Property 21: Migration Backward Compatibility
464
+
465
+ _For any_ migrated script, when executed with the same inputs, the wrapper script should produce the same output and exit code as the original script behavior.
466
+
467
+ **Validates: Requirements 11.1**
468
+
469
+ ### Property 22: Deprecation Warning Presence
470
+
471
+ _For any_ deprecated script wrapper, when executed, a deprecation warning with migration instructions should be displayed to the user before delegating to the service.
472
+
473
+ **Validates: Requirements 11.4**
474
+
475
+ ### Property 23: Utility Configuration Validation
476
+
477
+ _For any_ utility that accepts configuration, invalid configuration should be rejected with a validation error before the utility executes.
478
+
479
+ **Validates: Requirements 12.4**
480
+
481
+ ### Property 24: Utility Error Types
482
+
483
+ _For any_ utility operation that encounters an error, the thrown error should be a typed domain error with an appropriate error code (not generic Error).
484
+
485
+ **Validates: Requirements 12.5**
486
+
487
+ ## Error Handling
488
+
489
+ ### Error Hierarchy
490
+
491
+ ```typescript
492
+ // src/utils/errors.ts
493
+ export class DomainError extends Error {
494
+ constructor(
495
+ message: string,
496
+ public code: string,
497
+ public details?: Record<string, any>
498
+ ) {
499
+ super(message);
500
+ this.name = this.constructor.name;
501
+ }
502
+ }
503
+
504
+ export class ValidationError extends DomainError {
505
+ constructor(message: string, details?: Record<string, any>) {
506
+ super(message, 'VALIDATION_ERROR', details);
507
+ }
508
+ }
509
+
510
+ export class NotFoundError extends DomainError {
511
+ constructor(resource: string, id: string) {
512
+ super(`${resource} not found: ${id}`, 'NOT_FOUND', { resource, id });
513
+ }
514
+ }
515
+
516
+ export class GitLabError extends DomainError {
517
+ constructor(
518
+ message: string,
519
+ public statusCode?: number
520
+ ) {
521
+ super(message, 'GITLAB_ERROR', { statusCode });
522
+ }
523
+ }
524
+
525
+ export class SchemaError extends DomainError {
526
+ constructor(
527
+ message: string,
528
+ public schemaPath?: string
529
+ ) {
530
+ super(message, 'SCHEMA_ERROR', { schemaPath });
531
+ }
532
+ }
533
+ ```
534
+
535
+ ### Error Handling Patterns
536
+
537
+ 1. **Service Layer**: Catch repository errors, add context, rethrow as domain errors
538
+ 2. **Repository Layer**: Catch file system errors, validate data, throw typed errors
539
+ 3. **CLI Layer**: Catch all errors, format user-friendly messages, exit with appropriate codes
540
+ 4. **Utility Layer**: Throw typed errors with detailed context
541
+
542
+ ### Error Response Format
543
+
544
+ ```typescript
545
+ interface ErrorResponse {
546
+ error: string; // Error code
547
+ message: string; // Human-readable message
548
+ details?: Record<string, any>; // Additional context
549
+ stack?: string; // Stack trace (development only)
550
+ }
551
+ ```
552
+
553
+ ## Testing Strategy
554
+
555
+ ### Unit Testing
556
+
557
+ **Framework**: Jest with TypeScript support
558
+
559
+ **Coverage Target**: Minimum 80% code coverage
560
+
561
+ **Approach**:
562
+
563
+ - Mock repository dependencies using Jest mocks
564
+ - Test each service method in isolation
565
+ - Test error conditions and edge cases
566
+ - Test validation logic with invalid inputs
567
+
568
+ **Example**:
569
+
570
+ ```typescript
571
+ describe('VersionService', () => {
572
+ let service: VersionService;
573
+ let mockRepository: jest.Mocked<IVersionRepository>;
574
+
575
+ beforeEach(() => {
576
+ mockRepository = {
577
+ read: jest.fn(),
578
+ update: jest.fn(),
579
+ // ... other methods
580
+ } as any;
581
+ service = new VersionService(mockRepository);
582
+ });
583
+
584
+ it('should bump patch version correctly', async () => {
585
+ mockRepository.read.mockResolvedValue({
586
+ current: '1.2.3',
587
+ latest_stable: '1.2.3',
588
+ previous: [],
589
+ });
590
+
591
+ const result = await service.bumpVersion('patch');
592
+
593
+ expect(result.current).toBe('1.2.4');
594
+ expect(mockRepository.update).toHaveBeenCalled();
595
+ });
596
+ });
597
+ ```
598
+
599
+ ### Property-Based Testing
600
+
601
+ **Framework**: fast-check
602
+
603
+ **Configuration**: Minimum 100 iterations per property
604
+
605
+ **Approach**:
606
+
607
+ - Generate random valid and invalid inputs
608
+ - Verify universal properties hold across all inputs
609
+ - Test invariants and round-trip properties
610
+ - Focus on validation, transformation, and consistency properties
611
+
612
+ **Example**:
613
+
614
+ ```typescript
615
+ import * as fc from 'fast-check';
616
+
617
+ /**
618
+ * Feature: scripts-migration-api-first, Property 3: Version Bump Correctness
619
+ * Validates: Requirements 2.4
620
+ */
621
+ describe('Property: Version Bump Correctness', () => {
622
+ it('should follow semver rules for all bump types', () => {
623
+ fc.assert(
624
+ fc.property(
625
+ fc.record({
626
+ major: fc.nat(100),
627
+ minor: fc.nat(100),
628
+ patch: fc.nat(100),
629
+ }),
630
+ fc.constantFrom('major', 'minor', 'patch'),
631
+ (version, bumpType) => {
632
+ const versionString = `${version.major}.${version.minor}.${version.patch}`;
633
+ const service = new VersionService(mockRepository);
634
+ const result = service.bumpVersionString(versionString, bumpType);
635
+
636
+ const [newMajor, newMinor, newPatch] = result.split('.').map(Number);
637
+
638
+ if (bumpType === 'major') {
639
+ return (
640
+ newMajor === version.major + 1 && newMinor === 0 && newPatch === 0
641
+ );
642
+ } else if (bumpType === 'minor') {
643
+ return (
644
+ newMajor === version.major &&
645
+ newMinor === version.minor + 1 &&
646
+ newPatch === 0
647
+ );
648
+ } else {
649
+ return (
650
+ newMajor === version.major &&
651
+ newMinor === version.minor &&
652
+ newPatch === version.patch + 1
653
+ );
654
+ }
655
+ }
656
+ ),
657
+ { numRuns: 100 }
658
+ );
659
+ });
660
+ });
661
+ ```
662
+
663
+ ### Integration Testing
664
+
665
+ **Approach**:
666
+
667
+ - Test service + repository integration with real file system
668
+ - Use temporary directories for file operations
669
+ - Test CLI commands end-to-end
670
+ - Verify OpenAPI spec generation and validation
671
+
672
+ **Example**:
673
+
674
+ ```typescript
675
+ describe('VersionService Integration', () => {
676
+ let tempDir: string;
677
+ let service: VersionService;
678
+
679
+ beforeEach(async () => {
680
+ tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'version-test-'));
681
+ const repository = new VersionRepository(tempDir);
682
+ service = new VersionService(repository);
683
+ });
684
+
685
+ afterEach(async () => {
686
+ await fs.rm(tempDir, { recursive: true });
687
+ });
688
+
689
+ it('should sync versions across all files', async () => {
690
+ // Create test files
691
+ await fs.writeFile(
692
+ path.join(tempDir, 'package.json'),
693
+ JSON.stringify({ version: '1.0.0' })
694
+ );
695
+ await fs.writeFile(
696
+ path.join(tempDir, '.version.json'),
697
+ JSON.stringify({ current: '1.0.0' })
698
+ );
699
+
700
+ await service.syncVersions();
701
+
702
+ // Verify all files updated
703
+ const pkg = JSON.parse(
704
+ await fs.readFile(path.join(tempDir, 'package.json'), 'utf8')
705
+ );
706
+ const ver = JSON.parse(
707
+ await fs.readFile(path.join(tempDir, '.version.json'), 'utf8')
708
+ );
709
+
710
+ expect(pkg.version).toBe(ver.current);
711
+ });
712
+ });
713
+ ```
714
+
715
+ ### Test Organization
716
+
717
+ ```
718
+ tests/
719
+ ├── unit/
720
+ │ ├── services/
721
+ │ │ ├── version.service.test.ts
722
+ │ │ ├── documentation.service.test.ts
723
+ │ │ ├── gitlab.service.test.ts
724
+ │ │ └── schema.service.test.ts
725
+ │ ├── repositories/
726
+ │ │ ├── version.repository.test.ts
727
+ │ │ └── documentation.repository.test.ts
728
+ │ └── utils/
729
+ │ ├── markdown-builder.test.ts
730
+ │ └── retry.test.ts
731
+ ├── properties/
732
+ │ ├── version-properties.test.ts
733
+ │ ├── validation-properties.test.ts
734
+ │ └── repository-properties.test.ts
735
+ ├── integration/
736
+ │ ├── version-integration.test.ts
737
+ │ ├── documentation-integration.test.ts
738
+ │ └── cli-integration.test.ts
739
+ └── fixtures/
740
+ ├── openapi-specs/
741
+ ├── json-schemas/
742
+ └── version-configs/
743
+ ```
744
+
745
+ ## Migration Strategy
746
+
747
+ ### Phase 1: Foundation (Week 1)
748
+
749
+ 1. Create base repository interface and utilities
750
+ 2. Move `scripts/lib/*` to `src/utils/`
751
+ 3. Create error hierarchy
752
+ 4. Set up Zod schema directory structure
753
+ 5. Create OpenAPI spec templates
754
+
755
+ ### Phase 2: Version Service (Week 2)
756
+
757
+ 1. Define OpenAPI spec for VersionService
758
+ 2. Implement VersionRepository with CRUD operations
759
+ 3. Implement VersionService with all version operations
760
+ 4. Create CLI commands for version operations
761
+ 5. Write unit and property-based tests
762
+ 6. Create wrapper scripts that delegate to service
763
+
764
+ ### Phase 3: Documentation Service (Week 3)
765
+
766
+ 1. Define OpenAPI spec for DocumentationService
767
+ 2. Implement DocumentationRepository
768
+ 3. Implement MarkdownBuilder utility
769
+ 4. Implement OpenAPIParser utility
770
+ 5. Implement DocumentationService
771
+ 6. Create CLI commands for documentation operations
772
+ 7. Write unit and property-based tests
773
+ 8. Create wrapper scripts
774
+
775
+ ### Phase 4: GitLab Service (Week 4)
776
+
777
+ 1. Define OpenAPI spec for GitLabService
778
+ 2. Implement retry utility with exponential backoff
779
+ 3. Implement GitLabService with all GitLab operations
780
+ 4. Create CLI commands for GitLab operations
781
+ 5. Write unit and property-based tests
782
+ 6. Create wrapper scripts
783
+
784
+ ### Phase 5: Schema Service (Week 5)
785
+
786
+ 1. Define OpenAPI spec for SchemaService
787
+ 2. Extend existing SchemaRepository
788
+ 3. Implement SchemaService extending existing validation service
789
+ 4. Create CLI commands for schema operations
790
+ 5. Write unit and property-based tests
791
+ 6. Create wrapper scripts
792
+
793
+ ### Phase 6: Cleanup and Documentation (Week 6)
794
+
795
+ 1. Verify all wrapper scripts work correctly
796
+ 2. Add deprecation warnings to wrapper scripts
797
+ 3. Update all documentation
798
+ 4. Run full test suite
799
+ 5. Verify 80%+ code coverage
800
+ 6. Create migration guide for users
801
+
802
+ ### Backward Compatibility Strategy
803
+
804
+ Each migrated script will be replaced with a thin wrapper that:
805
+
806
+ 1. Displays a deprecation warning
807
+ 2. Resolves the appropriate service from DI container
808
+ 3. Validates arguments using Zod
809
+ 4. Delegates to the service method
810
+ 5. Formats output to match original script behavior
811
+ 6. Exits with the same exit codes
812
+
813
+ Example wrapper:
814
+
815
+ ```typescript
816
+ #!/usr/bin/env tsx
817
+ // scripts/bump-version.ts (deprecated wrapper)
818
+
819
+ import { container } from '../src/di-container.js';
820
+ import { IVersionService } from '../src/services/version.service.js';
821
+ import chalk from 'chalk';
822
+
823
+ console.warn(
824
+ chalk.yellow('⚠️ This script is deprecated. Use: ossa version bump <type>')
825
+ );
826
+ console.warn(
827
+ chalk.yellow(' Migration guide: https://docs.ossa.dev/migration/scripts\n')
828
+ );
829
+
830
+ const service = container.get<IVersionService>('VersionService');
831
+ const bumpType = process.argv[2] || 'patch';
832
+
833
+ try {
834
+ const result = await service.bumpVersion(bumpType as any);
835
+ console.log(`✅ Bumped version to ${result.current}`);
836
+ process.exit(0);
837
+ } catch (error) {
838
+ console.error(chalk.red('❌ Error:'), error.message);
839
+ process.exit(1);
840
+ }
841
+ ```
842
+
843
+ ## Dependencies
844
+
845
+ ### New Dependencies
846
+
847
+ - `fast-check`: Property-based testing framework
848
+ - None (all other dependencies already exist in package.json)
849
+
850
+ ### Existing Dependencies
851
+
852
+ - `zod`: Runtime validation (already installed)
853
+ - `commander`: CLI framework (already installed)
854
+ - `inversify`: Dependency injection (already installed)
855
+ - `@gitbeaker/node`: GitLab API client (already installed)
856
+ - `json-schema-to-typescript`: Type generation (already installed)
857
+ - `json-schema-to-zod`: Zod schema generation (already installed)
858
+ - `yaml`: YAML parsing (already installed)
859
+ - `jest`: Testing framework (already installed)
860
+
861
+ ## Performance Considerations
862
+
863
+ 1. **Lazy Loading**: Services should be lazily instantiated from DI container
864
+ 2. **Caching**: Version information should be cached to avoid repeated file reads
865
+ 3. **Parallel Operations**: Documentation generation should process multiple specs in parallel
866
+ 4. **Streaming**: Large file operations should use streams when possible
867
+ 5. **Retry Limits**: GitLab operations should have configurable retry limits to prevent infinite loops
868
+
869
+ ## Security Considerations
870
+
871
+ 1. **API Token Storage**: GitLab tokens should be read from environment variables, never hardcoded
872
+ 2. **Path Validation**: All file paths should be validated to prevent directory traversal
873
+ 3. **Command Injection**: Command execution should use parameterized commands, not string concatenation
874
+ 4. **Schema Validation**: All external inputs should be validated before processing
875
+ 5. **Error Messages**: Error messages should not leak sensitive information (paths, tokens)
876
+
877
+ ## Monitoring and Observability
878
+
879
+ 1. **Logging**: Use structured logging with log levels (debug, info, warn, error)
880
+ 2. **Metrics**: Track operation counts, durations, and error rates
881
+ 3. **Tracing**: Add correlation IDs for tracking operations across services
882
+ 4. **Health Checks**: Implement health check endpoints for service status
883
+ 5. **Audit Trail**: Log all version bumps and GitLab operations for audit purposes