@comfanion/workflow 3.0.0
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/README.md +185 -0
- package/bin/cli.js +406 -0
- package/package.json +50 -0
- package/src/build-info.json +16 -0
- package/src/opencode/ARCHITECTURE.md +255 -0
- package/src/opencode/FLOW.yaml +900 -0
- package/src/opencode/agents/analyst.md +141 -0
- package/src/opencode/agents/architect.md +177 -0
- package/src/opencode/agents/change-manager.md +263 -0
- package/src/opencode/agents/dev.md +171 -0
- package/src/opencode/agents/module-docs.md +628 -0
- package/src/opencode/agents/pm.md +157 -0
- package/src/opencode/agents/researcher.md +254 -0
- package/src/opencode/agents/sm.md +184 -0
- package/src/opencode/agents/workflow-orchestrator.md +249 -0
- package/src/opencode/checklists/architecture-checklist.md +166 -0
- package/src/opencode/checklists/code-review-checklist.md +151 -0
- package/src/opencode/checklists/prd-checklist.md +140 -0
- package/src/opencode/checklists/requirements-checklist.md +86 -0
- package/src/opencode/checklists/story-checklist.md +137 -0
- package/src/opencode/commands/architecture.md +68 -0
- package/src/opencode/commands/archive.md +146 -0
- package/src/opencode/commands/change.md +169 -0
- package/src/opencode/commands/clarify.md +132 -0
- package/src/opencode/commands/code-review.md +96 -0
- package/src/opencode/commands/coding-standards.md +102 -0
- package/src/opencode/commands/dev-story.md +80 -0
- package/src/opencode/commands/diagram.md +152 -0
- package/src/opencode/commands/epics.md +52 -0
- package/src/opencode/commands/help.md +139 -0
- package/src/opencode/commands/jira-sync.md +58 -0
- package/src/opencode/commands/module-docs.md +158 -0
- package/src/opencode/commands/prd.md +63 -0
- package/src/opencode/commands/quick.md +166 -0
- package/src/opencode/commands/requirements.md +49 -0
- package/src/opencode/commands/research.md +113 -0
- package/src/opencode/commands/sprint-plan.md +59 -0
- package/src/opencode/commands/stories.md +61 -0
- package/src/opencode/commands/validate.md +84 -0
- package/src/opencode/commands/workflow-status.md +150 -0
- package/src/opencode/config.yaml +223 -0
- package/src/opencode/opencode.json +36 -0
- package/src/opencode/skills/acceptance-criteria/SKILL.md +212 -0
- package/src/opencode/skills/adr-writing/SKILL.md +241 -0
- package/src/opencode/skills/architecture-design/SKILL.md +183 -0
- package/src/opencode/skills/architecture-validation/SKILL.md +199 -0
- package/src/opencode/skills/archiving/SKILL.md +191 -0
- package/src/opencode/skills/changelog/SKILL.md +280 -0
- package/src/opencode/skills/code-review/SKILL.md +193 -0
- package/src/opencode/skills/coding-standards/SKILL.md +430 -0
- package/src/opencode/skills/diagram-creation/SKILL.md +273 -0
- package/src/opencode/skills/doc-todo/SKILL.md +325 -0
- package/src/opencode/skills/epic-writing/SKILL.md +291 -0
- package/src/opencode/skills/jira-integration/SKILL.md +560 -0
- package/src/opencode/skills/methodologies/SKILL.md +376 -0
- package/src/opencode/skills/module-documentation/SKILL.md +214 -0
- package/src/opencode/skills/prd-validation/SKILL.md +164 -0
- package/src/opencode/skills/prd-writing/SKILL.md +104 -0
- package/src/opencode/skills/requirements-gathering/SKILL.md +132 -0
- package/src/opencode/skills/requirements-validation/SKILL.md +141 -0
- package/src/opencode/skills/research-methodology/SKILL.md +140 -0
- package/src/opencode/skills/sprint-planning/SKILL.md +217 -0
- package/src/opencode/skills/story-writing/SKILL.md +574 -0
- package/src/opencode/skills/test-design/SKILL.md +313 -0
- package/src/opencode/skills/translation/SKILL.md +411 -0
- package/src/opencode/templates/CHANGELOG.md +82 -0
- package/src/opencode/templates/adr-template.md +115 -0
- package/src/opencode/templates/architecture-template.md +362 -0
- package/src/opencode/templates/change-proposal-template.md +186 -0
- package/src/opencode/templates/epic-template.md +151 -0
- package/src/opencode/templates/git-workflow-template.md +384 -0
- package/src/opencode/templates/integration-tests-template.md +265 -0
- package/src/opencode/templates/jira-cache-template.yaml +103 -0
- package/src/opencode/templates/module-index-template.md +139 -0
- package/src/opencode/templates/module-test-cases-template.md +230 -0
- package/src/opencode/templates/prd-acceptance-criteria-template.md +124 -0
- package/src/opencode/templates/prd-template.md +479 -0
- package/src/opencode/templates/requirements-template.md +132 -0
- package/src/opencode/templates/sprint-status-template.yaml +84 -0
- package/src/opencode/templates/story-template.md +437 -0
- package/src/opencode/templates/testing-standards-template.md +359 -0
- package/src/opencode/workflows/dev-story/instructions.md +529 -0
- package/src/repo-structure/.gitattributes +64 -0
- package/src/repo-structure/CONTRIBUTING.md +182 -0
- package/src/repo-structure/README.md +77 -0
- package/src/repo-structure/docs/README.md +62 -0
- package/src/repo-structure/docs/api/README.md +43 -0
- package/src/repo-structure/docs/architecture/README.md +36 -0
- package/src/repo-structure/docs/architecture/adr/README.md +53 -0
- package/src/repo-structure/docs/architecture/diagrams/README.md +59 -0
- package/src/repo-structure/docs/coding-standards/README.md +52 -0
- package/src/repo-structure/docs/confluence/README.md +43 -0
- package/src/repo-structure/docs/requirements/README.md +28 -0
- package/src/repo-structure/docs/sprint-artifacts/README.md +76 -0
- package/src/repo-structure/docs/sprint-artifacts/backlog/README.md +24 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
-
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
-
|
|
15
|
+
|
|
16
|
+
### Deprecated
|
|
17
|
+
-
|
|
18
|
+
|
|
19
|
+
### Removed
|
|
20
|
+
-
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
-
|
|
24
|
+
|
|
25
|
+
### Security
|
|
26
|
+
-
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## [1.0.0] - YYYY-MM-DD
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
- Initial release
|
|
34
|
+
- Feature X
|
|
35
|
+
- Feature Y
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
-
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
-
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## [0.1.0] - YYYY-MM-DD
|
|
46
|
+
|
|
47
|
+
### Added
|
|
48
|
+
- Project skeleton
|
|
49
|
+
- Basic documentation
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
<!--
|
|
54
|
+
CHANGELOG GUIDELINES:
|
|
55
|
+
|
|
56
|
+
## Entry Format
|
|
57
|
+
- Start with verb: Add, Change, Fix, Remove, Deprecate
|
|
58
|
+
- Be specific: "Add user registration API" not "Add feature"
|
|
59
|
+
- Reference issues/PRs: "Fix login bug (#123)"
|
|
60
|
+
- Group related changes
|
|
61
|
+
|
|
62
|
+
## Categories
|
|
63
|
+
- Added: New features
|
|
64
|
+
- Changed: Changes in existing functionality
|
|
65
|
+
- Deprecated: Soon-to-be removed features
|
|
66
|
+
- Removed: Removed features
|
|
67
|
+
- Fixed: Bug fixes
|
|
68
|
+
- Security: Vulnerability fixes
|
|
69
|
+
|
|
70
|
+
## Versioning (SemVer)
|
|
71
|
+
- MAJOR: Breaking changes
|
|
72
|
+
- MINOR: New features (backward compatible)
|
|
73
|
+
- PATCH: Bug fixes (backward compatible)
|
|
74
|
+
|
|
75
|
+
## Example Entries
|
|
76
|
+
- Add product catalog API with CRUD operations
|
|
77
|
+
- Add user authentication via JWT tokens
|
|
78
|
+
- Change order status from string to enum
|
|
79
|
+
- Fix race condition in inventory reservation (#234)
|
|
80
|
+
- Remove deprecated v1 API endpoints
|
|
81
|
+
- Security: Fix SQL injection in search query
|
|
82
|
+
-->
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# ADR-NNN: [Title]
|
|
2
|
+
|
|
3
|
+
**Status:** Proposed | Accepted | Deprecated | Superseded
|
|
4
|
+
**Date:** YYYY-MM-DD
|
|
5
|
+
**Deciders:** [List of people involved]
|
|
6
|
+
**Supersedes:** [ADR-XXX if applicable]
|
|
7
|
+
**Superseded by:** [ADR-XXX if applicable]
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Context
|
|
12
|
+
|
|
13
|
+
[What is the issue that we're seeing that is motivating this decision or change?]
|
|
14
|
+
|
|
15
|
+
[Describe the forces at play (technical, political, social, project). These forces are probably in tension.]
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Decision
|
|
20
|
+
|
|
21
|
+
[What is the change that we're proposing and/or doing?]
|
|
22
|
+
|
|
23
|
+
**We will [decision].**
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Consequences
|
|
28
|
+
|
|
29
|
+
### Positive
|
|
30
|
+
|
|
31
|
+
- [Benefit 1]
|
|
32
|
+
- [Benefit 2]
|
|
33
|
+
- [Benefit 3]
|
|
34
|
+
|
|
35
|
+
### Negative
|
|
36
|
+
|
|
37
|
+
- [Drawback 1]
|
|
38
|
+
- [Drawback 2]
|
|
39
|
+
|
|
40
|
+
### Neutral
|
|
41
|
+
|
|
42
|
+
- [Trade-off 1]
|
|
43
|
+
- [Trade-off 2]
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Options Considered
|
|
48
|
+
|
|
49
|
+
### Option 1: [Name]
|
|
50
|
+
|
|
51
|
+
**Description:** [What this option entails]
|
|
52
|
+
|
|
53
|
+
**Pros:**
|
|
54
|
+
- [Pro 1]
|
|
55
|
+
- [Pro 2]
|
|
56
|
+
|
|
57
|
+
**Cons:**
|
|
58
|
+
- [Con 1]
|
|
59
|
+
- [Con 2]
|
|
60
|
+
|
|
61
|
+
### Option 2: [Name]
|
|
62
|
+
|
|
63
|
+
**Description:** [What this option entails]
|
|
64
|
+
|
|
65
|
+
**Pros:**
|
|
66
|
+
- [Pro 1]
|
|
67
|
+
|
|
68
|
+
**Cons:**
|
|
69
|
+
- [Con 1]
|
|
70
|
+
|
|
71
|
+
### Option 3: [Name] (Chosen)
|
|
72
|
+
|
|
73
|
+
**Description:** [What this option entails]
|
|
74
|
+
|
|
75
|
+
**Pros:**
|
|
76
|
+
- [Pro 1]
|
|
77
|
+
- [Pro 2]
|
|
78
|
+
|
|
79
|
+
**Cons:**
|
|
80
|
+
- [Con 1]
|
|
81
|
+
|
|
82
|
+
**Why chosen:** [Why this option was selected over others]
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Implementation
|
|
87
|
+
|
|
88
|
+
[If applicable, describe how this decision will be implemented]
|
|
89
|
+
|
|
90
|
+
### Action Items
|
|
91
|
+
|
|
92
|
+
- [ ] [Action 1]
|
|
93
|
+
- [ ] [Action 2]
|
|
94
|
+
- [ ] [Action 3]
|
|
95
|
+
|
|
96
|
+
### Timeline
|
|
97
|
+
|
|
98
|
+
| Phase | Description | Target Date |
|
|
99
|
+
|-------|-------------|-------------|
|
|
100
|
+
| Phase 1 | [Description] | YYYY-MM-DD |
|
|
101
|
+
| Phase 2 | [Description] | YYYY-MM-DD |
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Related
|
|
106
|
+
|
|
107
|
+
- [Link to related ADR]
|
|
108
|
+
- [Link to related documentation]
|
|
109
|
+
- [Link to relevant code/PR]
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Notes
|
|
114
|
+
|
|
115
|
+
[Any additional notes, context, or information]
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
# [Project Name] - Architecture Document
|
|
2
|
+
|
|
3
|
+
**Author:** [Name]
|
|
4
|
+
**Date:** [YYYY-MM-DD]
|
|
5
|
+
**Version:** [X.Y]
|
|
6
|
+
**Status:** Draft | Review | Approved
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Architecture Overview
|
|
11
|
+
|
|
12
|
+
### System Context
|
|
13
|
+
|
|
14
|
+
[High-level description of system boundaries and external actors]
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
┌─────────────────────────────────────────┐
|
|
18
|
+
│ External Systems │
|
|
19
|
+
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
|
|
20
|
+
│ │ PIM │ │ DAX │ │ Payment │ │
|
|
21
|
+
│ └────┬────┘ └────┬────┘ └────┬────┘ │
|
|
22
|
+
└───────┼────────────┼────────────┼──────┘
|
|
23
|
+
│ │ │
|
|
24
|
+
┌───────▼────────────▼────────────▼──────┐
|
|
25
|
+
│ API Gateway │
|
|
26
|
+
└───────────────────┬────────────────────┘
|
|
27
|
+
│
|
|
28
|
+
┌───────────────────▼────────────────────┐
|
|
29
|
+
│ Your System │
|
|
30
|
+
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
|
|
31
|
+
│ │Module A │ │Module B │ │Module C │ │
|
|
32
|
+
│ └─────────┘ └─────────┘ └─────────┘ │
|
|
33
|
+
└─────────────────────────────────────────┘
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Architecture Style
|
|
37
|
+
|
|
38
|
+
| Aspect | Choice | Rationale |
|
|
39
|
+
|--------|--------|-----------|
|
|
40
|
+
| Overall | Modular Monolith / Microservices | [Why] |
|
|
41
|
+
| Communication | REST + Kafka Events | [Why] |
|
|
42
|
+
| Data | PostgreSQL + Redis | [Why] |
|
|
43
|
+
| Deployment | Kubernetes | [Why] |
|
|
44
|
+
|
|
45
|
+
### Key Decisions Summary
|
|
46
|
+
|
|
47
|
+
| Decision | Choice | ADR |
|
|
48
|
+
|----------|--------|-----|
|
|
49
|
+
| [Decision 1] | [Choice] | ADR-001 |
|
|
50
|
+
| [Decision 2] | [Choice] | ADR-002 |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Module/Service Architecture
|
|
55
|
+
|
|
56
|
+
### [Module 1 Name]
|
|
57
|
+
|
|
58
|
+
**Responsibility:** [Single responsibility description]
|
|
59
|
+
|
|
60
|
+
#### Boundaries
|
|
61
|
+
|
|
62
|
+
| Aspect | Details |
|
|
63
|
+
|--------|---------|
|
|
64
|
+
| **Owns** | [Entities/data this module owns] |
|
|
65
|
+
| **Consumes** | [Events/APIs it consumes from other modules] |
|
|
66
|
+
| **Produces** | [Events/APIs it produces for other modules] |
|
|
67
|
+
|
|
68
|
+
#### Internal Structure
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
module-name/
|
|
72
|
+
├── domain/ # Business logic (NO infrastructure imports!)
|
|
73
|
+
│ ├── aggregate/ # Entities with business rules
|
|
74
|
+
│ │ └── entity.go
|
|
75
|
+
│ ├── valueobject/ # Immutable value objects
|
|
76
|
+
│ │ └── entity_id.go
|
|
77
|
+
│ ├── service/ # Domain services
|
|
78
|
+
│ └── repository/ # Repository INTERFACES (ports)
|
|
79
|
+
│ └── entity_repository.go
|
|
80
|
+
├── application/ # Use cases (orchestration)
|
|
81
|
+
│ └── usecase/
|
|
82
|
+
│ └── CreateEntity/
|
|
83
|
+
│ ├── inport.go # Interface
|
|
84
|
+
│ ├── dto.go # Command & Result
|
|
85
|
+
│ ├── handler.go # Orchestration
|
|
86
|
+
│ └── mappers.go # Explicit mapping
|
|
87
|
+
└── infrastructure/ # Adapters (implements ports)
|
|
88
|
+
├── repo/ # Database implementations
|
|
89
|
+
├── http/ # HTTP handlers, routes
|
|
90
|
+
└── kafka/ # Event bus implementations
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### API Endpoints
|
|
94
|
+
|
|
95
|
+
| Method | Endpoint | Description | Auth |
|
|
96
|
+
|--------|----------|-------------|------|
|
|
97
|
+
| POST | /api/v1/entities | Create entity | JWT |
|
|
98
|
+
| GET | /api/v1/entities/{id} | Get entity | JWT |
|
|
99
|
+
| PUT | /api/v1/entities/{id} | Update entity | JWT |
|
|
100
|
+
|
|
101
|
+
#### Events
|
|
102
|
+
|
|
103
|
+
| Event | Direction | Description |
|
|
104
|
+
|-------|-----------|-------------|
|
|
105
|
+
| entity.created | Produces | When entity is created |
|
|
106
|
+
| other.event | Consumes | Triggers action X |
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
### [Module 2 Name]
|
|
111
|
+
|
|
112
|
+
**Responsibility:** [Single responsibility description]
|
|
113
|
+
|
|
114
|
+
[Same structure as above...]
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Data Architecture
|
|
119
|
+
|
|
120
|
+
### Database Design
|
|
121
|
+
|
|
122
|
+
#### [Table 1 Name]
|
|
123
|
+
|
|
124
|
+
```sql
|
|
125
|
+
CREATE TABLE entities (
|
|
126
|
+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
127
|
+
name VARCHAR(255) NOT NULL,
|
|
128
|
+
status VARCHAR(50) NOT NULL,
|
|
129
|
+
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
130
|
+
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
131
|
+
version INTEGER NOT NULL DEFAULT 1 -- Optimistic locking
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
-- Indexes
|
|
135
|
+
CREATE INDEX idx_entities_status ON entities(status);
|
|
136
|
+
CREATE INDEX idx_entities_name_trgm ON entities USING gin(name gin_trgm_ops);
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
#### Entity Relationship Diagram
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
┌──────────────┐ ┌──────────────┐
|
|
143
|
+
│ Entity A │ │ Entity B │
|
|
144
|
+
├──────────────┤ ├──────────────┤
|
|
145
|
+
│ id (PK) │──────<│ entity_a_id │
|
|
146
|
+
│ name │ │ id (PK) │
|
|
147
|
+
│ status │ │ data │
|
|
148
|
+
└──────────────┘ └──────────────┘
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Data Flow
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
[External] → [API Gateway] → [Module A] → [Database]
|
|
155
|
+
│
|
|
156
|
+
▼
|
|
157
|
+
[Kafka Topic]
|
|
158
|
+
│
|
|
159
|
+
▼
|
|
160
|
+
[Module B] → [External System]
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Event Schema
|
|
164
|
+
|
|
165
|
+
#### entity.created
|
|
166
|
+
|
|
167
|
+
```json
|
|
168
|
+
{
|
|
169
|
+
"event_type": "entity.created",
|
|
170
|
+
"version": "1.0",
|
|
171
|
+
"timestamp": "2026-01-23T10:00:00Z",
|
|
172
|
+
"correlation_id": "uuid",
|
|
173
|
+
"payload": {
|
|
174
|
+
"entity_id": "uuid",
|
|
175
|
+
"name": "string",
|
|
176
|
+
"created_by": "uuid"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Integration Architecture
|
|
184
|
+
|
|
185
|
+
### External Systems
|
|
186
|
+
|
|
187
|
+
| System | Type | Protocol | Data Exchanged | Frequency |
|
|
188
|
+
|--------|------|----------|----------------|-----------|
|
|
189
|
+
| [System 1] | Inbound | REST API | Product data | On-demand |
|
|
190
|
+
| [System 2] | Outbound | Kafka | Order events | Real-time |
|
|
191
|
+
| [System 3] | Sync | REST API | Inventory levels | Every 5 min |
|
|
192
|
+
|
|
193
|
+
### API Contracts
|
|
194
|
+
|
|
195
|
+
#### [External API 1]
|
|
196
|
+
|
|
197
|
+
**Base URL:** https://external-system.com/api/v1
|
|
198
|
+
**Authentication:** API Key in header
|
|
199
|
+
|
|
200
|
+
| Endpoint | Method | Purpose |
|
|
201
|
+
|----------|--------|---------|
|
|
202
|
+
| /resources | GET | Fetch resources |
|
|
203
|
+
| /resources | POST | Create resource |
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Cross-Cutting Concerns
|
|
208
|
+
|
|
209
|
+
### Security
|
|
210
|
+
|
|
211
|
+
| Concern | Implementation |
|
|
212
|
+
|---------|---------------|
|
|
213
|
+
| Authentication | JWT tokens via API Gateway |
|
|
214
|
+
| Authorization | Role-based (RBAC) |
|
|
215
|
+
| Data Protection | TLS 1.3, AES-256 at rest |
|
|
216
|
+
| Secrets | HashiCorp Vault |
|
|
217
|
+
|
|
218
|
+
### Observability
|
|
219
|
+
|
|
220
|
+
| Concern | Tool | Implementation |
|
|
221
|
+
|---------|------|----------------|
|
|
222
|
+
| Logging | Loki + zerolog | Structured JSON logs |
|
|
223
|
+
| Metrics | VictoriaMetrics | Prometheus exposition |
|
|
224
|
+
| Tracing | Tempo | OpenTelemetry |
|
|
225
|
+
| Profiling | Pyroscope | Continuous profiling |
|
|
226
|
+
|
|
227
|
+
### Error Handling
|
|
228
|
+
|
|
229
|
+
| Error Type | HTTP Code | Strategy |
|
|
230
|
+
|------------|-----------|----------|
|
|
231
|
+
| Validation | 400 | Return structured errors |
|
|
232
|
+
| Not Found | 404 | Return with message |
|
|
233
|
+
| Business Rule | 422 | Return with error code |
|
|
234
|
+
| Internal | 500 | Log + correlation ID |
|
|
235
|
+
| External Failure | 503 | Circuit breaker + retry |
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## Architecture Decision Records (ADRs)
|
|
240
|
+
|
|
241
|
+
### ADR-001: [Decision Title]
|
|
242
|
+
|
|
243
|
+
**Status:** Accepted | Superseded | Deprecated
|
|
244
|
+
**Date:** YYYY-MM-DD
|
|
245
|
+
**Deciders:** [Names]
|
|
246
|
+
|
|
247
|
+
**Context:**
|
|
248
|
+
[Why this decision was needed - the problem or requirement]
|
|
249
|
+
|
|
250
|
+
**Decision:**
|
|
251
|
+
[What was decided - the chosen solution]
|
|
252
|
+
|
|
253
|
+
**Consequences:**
|
|
254
|
+
- **Positive:** [Benefits]
|
|
255
|
+
- **Negative:** [Trade-offs]
|
|
256
|
+
- **Risks:** [What could go wrong]
|
|
257
|
+
|
|
258
|
+
**Alternatives Considered:**
|
|
259
|
+
1. [Alternative 1] - Rejected because [reason]
|
|
260
|
+
2. [Alternative 2] - Rejected because [reason]
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
### ADR-002: [Decision Title]
|
|
265
|
+
|
|
266
|
+
[Same structure...]
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## NFR Compliance
|
|
271
|
+
|
|
272
|
+
| NFR ID | Requirement | Architectural Support |
|
|
273
|
+
|--------|-------------|----------------------|
|
|
274
|
+
| NFR-001 | Response time < 200ms | Caching, connection pooling |
|
|
275
|
+
| NFR-002 | 99.9% availability | K8s HA, health checks |
|
|
276
|
+
| NFR-003 | 1000 RPS throughput | Horizontal scaling |
|
|
277
|
+
| NFR-010 | Data encryption | TLS + encryption at rest |
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## Deployment Architecture
|
|
282
|
+
|
|
283
|
+
### Infrastructure
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
287
|
+
│ Kubernetes Cluster │
|
|
288
|
+
│ ┌──────────────────────────────────────────────────────┐ │
|
|
289
|
+
│ │ Namespace: prod │ │
|
|
290
|
+
│ │ ┌────────────┐ ┌────────────┐ ┌────────────┐ │ │
|
|
291
|
+
│ │ │ Service A │ │ Service B │ │ Service C │ │ │
|
|
292
|
+
│ │ │ (3 pods) │ │ (3 pods) │ │ (2 pods) │ │ │
|
|
293
|
+
│ │ └────────────┘ └────────────┘ └────────────┘ │ │
|
|
294
|
+
│ └──────────────────────────────────────────────────────┘ │
|
|
295
|
+
│ │
|
|
296
|
+
│ ┌──────────────────────────────────────────────────────┐ │
|
|
297
|
+
│ │ External Services │ │
|
|
298
|
+
│ │ PostgreSQL (RDS) Kafka (MSK) Redis (Elasticache)│ │
|
|
299
|
+
│ └──────────────────────────────────────────────────────┘ │
|
|
300
|
+
└─────────────────────────────────────────────────────────────┘
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Scaling Strategy
|
|
304
|
+
|
|
305
|
+
| Service | Min Pods | Max Pods | Scaling Metric |
|
|
306
|
+
|---------|----------|----------|----------------|
|
|
307
|
+
| Service A | 3 | 10 | CPU > 70% |
|
|
308
|
+
| Service B | 3 | 8 | RPS > 500 |
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## Risks & Technical Debt
|
|
313
|
+
|
|
314
|
+
| Item | Type | Impact | Mitigation Plan | Owner |
|
|
315
|
+
|------|------|--------|-----------------|-------|
|
|
316
|
+
| [Item 1] | Risk | High | [Plan] | [Name] |
|
|
317
|
+
| [Item 2] | Tech Debt | Medium | [Plan] | [Name] |
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## Diagrams
|
|
322
|
+
|
|
323
|
+
### C4 - Container Diagram
|
|
324
|
+
|
|
325
|
+
[Link to diagram or embedded]
|
|
326
|
+
|
|
327
|
+
### Sequence Diagram - [Flow Name]
|
|
328
|
+
|
|
329
|
+
```
|
|
330
|
+
┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐
|
|
331
|
+
│Client│ │ API │ │Svc A│ │ DB │
|
|
332
|
+
└──┬──┘ └──┬──┘ └──┬──┘ └──┬──┘
|
|
333
|
+
│ request │ │ │
|
|
334
|
+
│──────────>│ │ │
|
|
335
|
+
│ │ forward │ │
|
|
336
|
+
│ │──────────>│ │
|
|
337
|
+
│ │ │ query │
|
|
338
|
+
│ │ │──────────>│
|
|
339
|
+
│ │ │ result │
|
|
340
|
+
│ │ │<──────────│
|
|
341
|
+
│ │ response │ │
|
|
342
|
+
│ │<──────────│ │
|
|
343
|
+
│ response │ │ │
|
|
344
|
+
│<──────────│ │ │
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
## References
|
|
350
|
+
|
|
351
|
+
- CLAUDE.md - Coding standards and patterns
|
|
352
|
+
- PRD - Product requirements
|
|
353
|
+
- docs/architecture/adr/ - All ADRs
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
## Revision History
|
|
358
|
+
|
|
359
|
+
| Version | Date | Author | Changes |
|
|
360
|
+
|---------|------|--------|---------|
|
|
361
|
+
| 0.1 | YYYY-MM-DD | [Name] | Initial draft |
|
|
362
|
+
| 1.0 | YYYY-MM-DD | [Name] | Approved |
|