sdg-agents 1.0.5
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/LICENSE +15 -0
- package/README.md +161 -0
- package/package.json +88 -0
- package/src/assets/dev-guides/agent-deep-flow.md +139 -0
- package/src/assets/dev-guides/prompt-tracks/00-lite-mode/01-project-scope-and-mvp.md +45 -0
- package/src/assets/dev-guides/prompt-tracks/00-lite-mode/02-stack-and-data-model.md +56 -0
- package/src/assets/dev-guides/prompt-tracks/00-lite-mode/03-external-integrations.md +44 -0
- package/src/assets/dev-guides/prompt-tracks/00-lite-mode/04-launch-checklist.md +26 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/00-foundation/01-project-vision.md +77 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/00-foundation/02-problem-definition.md +63 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/00-foundation/03-success-metrics.md +48 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/00-foundation/05-engineering-culture-and-silos.md +41 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/00-foundation/06-foundation-approval.md +57 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/01-setup/01-tech-stack.md +62 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/01-setup/02-local-environment.md +50 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/01-setup/03-version-control-and-tracking.md +65 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/01-setup/04-hello-world-validation.md +37 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/01-setup/05-setup-approval.md +61 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/02-architecture/01-folder-structure.md +49 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/02-architecture/02-design-patterns.md +59 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/02-architecture/03-apis-and-communication.md +55 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/02-architecture/04-security-and-access.md +63 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/02-architecture/05-security-audit.md +64 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/02-architecture/06-design-system-ux.md +72 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/02-architecture/07-ai-strategy.md +72 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/02-architecture/08-observability.md +65 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/02-architecture/09-technical-documentation.md +64 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/02-architecture/10-infrastructure-and-costs.md +40 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/02-architecture/11-data-privacy-compliance.md +41 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/02-architecture/12-performance-and-scale.md +46 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/02-architecture/13-disaster-recovery.md +39 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/02-architecture/14-architecture-approval.md +81 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/03-delivery/01-ci-cd-pipeline.md +49 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/03-delivery/02-quality-standards.md +46 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/03-delivery/03-delivery-approval.md +58 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/04-features/00-feature-template.md +30 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/04-features/01-context-and-scope.md +46 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/04-features/02-business-rules.md +39 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/04-features/03-architecture-and-design.md +50 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/04-features/04-testing-strategy.md +48 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/04-features/05-implementation-plan.md +45 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/04-features/06-feature-approval.md +46 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/05-evolution/01-rfcs-and-changes.md +63 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/05-evolution/02-incident-postmortems.md +64 -0
- package/src/assets/dev-guides/prompt-tracks/01-new-evolution/05-evolution/03-adr-template.md +66 -0
- package/src/assets/dev-guides/prompt-tracks/02-legacy-modernization/00-foundation/01-legacy-vision.md +73 -0
- package/src/assets/dev-guides/prompt-tracks/02-legacy-modernization/00-foundation/02-foundation-approval.md +53 -0
- package/src/assets/dev-guides/prompt-tracks/02-legacy-modernization/01-analysis/01-tech-debt-inventory.md +55 -0
- package/src/assets/dev-guides/prompt-tracks/02-legacy-modernization/01-analysis/02-security-audit.md +63 -0
- package/src/assets/dev-guides/prompt-tracks/02-legacy-modernization/01-analysis/03-regression-baseline.md +49 -0
- package/src/assets/dev-guides/prompt-tracks/02-legacy-modernization/01-analysis/04-analysis-approval.md +65 -0
- package/src/assets/dev-guides/prompt-tracks/02-legacy-modernization/02-strategy/01-modernization-approach.md +60 -0
- package/src/assets/dev-guides/prompt-tracks/02-legacy-modernization/02-strategy/02-versioning-and-coexistence.md +57 -0
- package/src/assets/dev-guides/prompt-tracks/02-legacy-modernization/02-strategy/03-new-demands-triage.md +41 -0
- package/src/assets/dev-guides/prompt-tracks/02-legacy-modernization/02-strategy/04-strategy-approval.md +56 -0
- package/src/assets/dev-guides/prompt-tracks/02-legacy-modernization/03-refactor/01-cleanup-backlog.md +45 -0
- package/src/assets/dev-guides/prompt-tracks/02-legacy-modernization/03-refactor/02-refactor-approval.md +53 -0
- package/src/assets/dev-guides/prompt-tracks/02-legacy-modernization/04-migration/01-migration-roadmap.md +47 -0
- package/src/assets/dev-guides/prompt-tracks/02-legacy-modernization/04-migration/02-data-sync-strategy.md +56 -0
- package/src/assets/dev-guides/prompt-tracks/02-legacy-modernization/04-migration/03-migration-approval.md +55 -0
- package/src/assets/dev-guides/prompt-tracks/02-legacy-modernization/05-sunset/01-decommission-plan.md +47 -0
- package/src/assets/dev-guides/prompt-tracks/02-legacy-modernization/05-sunset/02-sunset-approval.md +60 -0
- package/src/assets/dev-guides/prompt-tracks/README.md +144 -0
- package/src/assets/dev-guides/software-development-lifecycle-sdlc.md +147 -0
- package/src/assets/dev-guides/spec-driven-dev-guide.md +81 -0
- package/src/assets/dev-guides/ui-prompt-guide.md +181 -0
- package/src/assets/img/sdg-agents-icon-dark.svg +55 -0
- package/src/assets/img/sdg-agents-icon-light.svg +55 -0
- package/src/assets/img/sdg-agents-menu-v1.png +0 -0
- package/src/assets/img/sdg-icon.svg +110 -0
- package/src/assets/instructions/commands/sdg-docs.md +69 -0
- package/src/assets/instructions/commands/sdg-feat.md +45 -0
- package/src/assets/instructions/commands/sdg-fix.md +41 -0
- package/src/assets/instructions/commands/sdg-land.md +128 -0
- package/src/assets/instructions/competencies/backend.md +353 -0
- package/src/assets/instructions/competencies/frontend.md +439 -0
- package/src/assets/instructions/core/agent-roles.md +104 -0
- package/src/assets/instructions/core/api-design.md +65 -0
- package/src/assets/instructions/core/ci-cd.md +144 -0
- package/src/assets/instructions/core/cloud.md +63 -0
- package/src/assets/instructions/core/code-style.md +144 -0
- package/src/assets/instructions/core/containers.md +115 -0
- package/src/assets/instructions/core/data-access.md +119 -0
- package/src/assets/instructions/core/engineering-standards.md +502 -0
- package/src/assets/instructions/core/naming.md +136 -0
- package/src/assets/instructions/core/observability.md +73 -0
- package/src/assets/instructions/core/security-pipeline.md +209 -0
- package/src/assets/instructions/core/security.md +45 -0
- package/src/assets/instructions/core/sql-style.md +138 -0
- package/src/assets/instructions/core/staff-dna.md +72 -0
- package/src/assets/instructions/core/testing-principles.md +212 -0
- package/src/assets/instructions/core/ui/architecture.md +171 -0
- package/src/assets/instructions/core/ui/design-thinking.md +319 -0
- package/src/assets/instructions/core/ui/presets.md +200 -0
- package/src/assets/instructions/core/ui/standards.md +144 -0
- package/src/assets/instructions/core/writing-soul.md +82 -0
- package/src/assets/instructions/flavors/legacy/principles.md +64 -0
- package/src/assets/instructions/flavors/lite/principles.md +39 -0
- package/src/assets/instructions/flavors/mvc/principles.md +124 -0
- package/src/assets/instructions/flavors/vertical-slice/principles.md +178 -0
- package/src/assets/instructions/idioms/csharp/patterns.md +367 -0
- package/src/assets/instructions/idioms/flutter/patterns.md +97 -0
- package/src/assets/instructions/idioms/go/patterns.md +193 -0
- package/src/assets/instructions/idioms/java/patterns.md +233 -0
- package/src/assets/instructions/idioms/javascript/patterns.md +223 -0
- package/src/assets/instructions/idioms/kotlin/patterns.md +94 -0
- package/src/assets/instructions/idioms/python/patterns.md +185 -0
- package/src/assets/instructions/idioms/rust/patterns.md +189 -0
- package/src/assets/instructions/idioms/scripts/patterns.md +81 -0
- package/src/assets/instructions/idioms/sql/patterns.md +109 -0
- package/src/assets/instructions/idioms/swift/patterns.md +97 -0
- package/src/assets/instructions/idioms/typescript/patterns.md +304 -0
- package/src/assets/instructions/idioms/vbnet/patterns.md +96 -0
- package/src/assets/instructions/idioms/vbnet-legacy/patterns.md +104 -0
- package/src/assets/instructions/templates/workflow.md +244 -0
- package/src/assets/instructions/workflows/governance.md +162 -0
- package/src/engine/bin/add-idiom.mjs +186 -0
- package/src/engine/bin/index.mjs +226 -0
- package/src/engine/config/stack-display.mjs +75 -0
- package/src/engine/config/stack-versions.mjs +76 -0
- package/src/engine/lib/cli-parser.mjs +80 -0
- package/src/engine/lib/display-utils.mjs +20 -0
- package/src/engine/lib/fs-utils.mjs +99 -0
- package/src/engine/lib/instruction-assembler.mjs +487 -0
- package/src/engine/lib/manifest-utils.mjs +128 -0
- package/src/engine/lib/prompt-utils.mjs +137 -0
- package/src/engine/lib/result-utils.mjs +14 -0
- package/src/engine/lib/ruleset-injector.mjs +183 -0
- package/src/engine/lib/ui-utils.mjs +216 -0
- package/src/engine/lib/wizard.mjs +472 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# 01 - Legacy Vision
|
|
2
|
+
|
|
3
|
+
## Intervention Objective
|
|
4
|
+
|
|
5
|
+
- Why are we touching this legacy system now?
|
|
6
|
+
- What is the desired end state?
|
|
7
|
+
|
|
8
|
+
## Scale and Magnitude
|
|
9
|
+
|
|
10
|
+
- What is the current load (Users/Transactions)?
|
|
11
|
+
- What is the projected load for the new system?
|
|
12
|
+
|
|
13
|
+
## Budget and Resources
|
|
14
|
+
|
|
15
|
+
- What is the monthly maintenance cost of the legacy system (infra + support)?
|
|
16
|
+
- What is the maximum approved budget for the full migration?
|
|
17
|
+
- Will the team be dedicated or manage the legacy in parallel?
|
|
18
|
+
|
|
19
|
+
## Deadlines and Expectations
|
|
20
|
+
|
|
21
|
+
- Final date for legacy decommissioning (Sunset date).
|
|
22
|
+
- Progressive migration milestones.
|
|
23
|
+
|
|
24
|
+
## Constraints
|
|
25
|
+
|
|
26
|
+
- Maximum period for coexistence.
|
|
27
|
+
- Budget or infrastructure limitations.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Learn by Examples
|
|
32
|
+
|
|
33
|
+
### ❌ Bad Example
|
|
34
|
+
|
|
35
|
+
```markdown
|
|
36
|
+
# 01 - Legacy Vision
|
|
37
|
+
|
|
38
|
+
## Objective
|
|
39
|
+
|
|
40
|
+
Improve the old code.
|
|
41
|
+
|
|
42
|
+
## Budget and Resources
|
|
43
|
+
|
|
44
|
+
Whatever IT releases.
|
|
45
|
+
|
|
46
|
+
## Constraints
|
|
47
|
+
|
|
48
|
+
Until it's ready.
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
> **Rationale**: "Improve" is not a technical or business objective. Without a budget or deadline, the risk of failure is extremely high.
|
|
52
|
+
|
|
53
|
+
### ✅ Good Example
|
|
54
|
+
|
|
55
|
+
```markdown
|
|
56
|
+
# 01 - Legacy Vision
|
|
57
|
+
|
|
58
|
+
## Objective
|
|
59
|
+
|
|
60
|
+
Ensure stability in the legacy billing system until full migration in Q4 2026.
|
|
61
|
+
|
|
62
|
+
## Budget and Resources
|
|
63
|
+
|
|
64
|
+
- **Budget**: $200k for stack modernization.
|
|
65
|
+
- **Team**: 1 Architect and 2 Mid-level devs 100% focused on migration.
|
|
66
|
+
|
|
67
|
+
## Deadlines and Expectations
|
|
68
|
+
|
|
69
|
+
- **Decommissioning**: December 2026.
|
|
70
|
+
- **Milestone**: 50% of users migrated by August.
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
> **Rationale**: Defines clear financial and temporal milestones, as well as a team allocation strategy.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# 02 - Foundation Approval (Legacy)
|
|
2
|
+
|
|
3
|
+
## Artifacts Checklist
|
|
4
|
+
|
|
5
|
+
- [ ] 01-legacy-vision.md (Complete)
|
|
6
|
+
|
|
7
|
+
## Stakeholder Approval
|
|
8
|
+
|
|
9
|
+
- **Legacy Manager**: [Signature/Date]
|
|
10
|
+
- **Technical Team**: [Signature/Date]
|
|
11
|
+
|
|
12
|
+
## Definition of Readiness (Ready for Analysis)
|
|
13
|
+
|
|
14
|
+
- [ ] Budget approved for initial audit.
|
|
15
|
+
- [ ] Basic mapping of security risks completed.
|
|
16
|
+
- [ ] Stakeholders agree on the stabilization/migration objective.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Learn by Examples
|
|
21
|
+
|
|
22
|
+
### ❌ Bad Example
|
|
23
|
+
|
|
24
|
+
```markdown
|
|
25
|
+
# 02 - Foundation Approval
|
|
26
|
+
|
|
27
|
+
## Checklist
|
|
28
|
+
|
|
29
|
+
- [x] Filled.
|
|
30
|
+
|
|
31
|
+
## Definition of Readiness
|
|
32
|
+
|
|
33
|
+
- [x] Let's analyze.
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
> **Rationale**: How do you prove that the technical team agrees with the vision?
|
|
37
|
+
|
|
38
|
+
### ✅ Good Example
|
|
39
|
+
|
|
40
|
+
```markdown
|
|
41
|
+
# 02 - Foundation Approval
|
|
42
|
+
|
|
43
|
+
## Stakeholder Approval
|
|
44
|
+
|
|
45
|
+
- **Manager**: Ferdinand Coast (Approved on 2026-06-05)
|
|
46
|
+
|
|
47
|
+
## Definition of Readiness
|
|
48
|
+
|
|
49
|
+
- [x] $50k budget for technical debt analysis approved.
|
|
50
|
+
- [x] GDPR/LGPD risks documented in the vision.
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
> **Rationale**: Ensures formal approval and budget for the next critical stage.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# 01 - Technical Debt Inventory
|
|
2
|
+
|
|
3
|
+
## Risk Mapping
|
|
4
|
+
|
|
5
|
+
- Which modules are the most fragile?
|
|
6
|
+
- Where are the biggest performance bottlenecks?
|
|
7
|
+
|
|
8
|
+
## Obsolete Technologies
|
|
9
|
+
|
|
10
|
+
- Unsupported libraries (e.g., Python 2.7, .NET 4.5).
|
|
11
|
+
- Runtime versions (End-of-Life).
|
|
12
|
+
|
|
13
|
+
## Cost of Inertia (Inertia vs. Migration)
|
|
14
|
+
|
|
15
|
+
- **Financial Risk**: What is the estimated cost of a compliance fine or a data leak?
|
|
16
|
+
- **Operational Cost**: How much time does the team lose "extinguishing fires" in the legacy system?
|
|
17
|
+
- **Opportunity Cost**: Which new features are we failing to launch?
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Learn by Examples
|
|
22
|
+
|
|
23
|
+
### ❌ Bad Example
|
|
24
|
+
|
|
25
|
+
```markdown
|
|
26
|
+
# 01 - Technical Debt Inventory
|
|
27
|
+
|
|
28
|
+
## Risk Mapping
|
|
29
|
+
|
|
30
|
+
The code is confusing and full of if-statements.
|
|
31
|
+
|
|
32
|
+
## Cost of Inertia
|
|
33
|
+
|
|
34
|
+
We're losing time cleaning the code.
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
> **Rationale**: "Confusing" and "losing time" are sentimental metrics, not executive ones. They do not justify the investment of a migration.
|
|
38
|
+
|
|
39
|
+
### ✅ Good Example
|
|
40
|
+
|
|
41
|
+
```markdown
|
|
42
|
+
# 01 - Technical Debt Inventory
|
|
43
|
+
|
|
44
|
+
## Risk Mapping
|
|
45
|
+
|
|
46
|
+
`OrderProcessor` module is highly coupled to `DBContext`, making unit testing impossible.
|
|
47
|
+
|
|
48
|
+
## Cost of Inertia
|
|
49
|
+
|
|
50
|
+
- **Operational**: The team spends 60% of the sprint fixing recurring bugs in the legacy system.
|
|
51
|
+
- **Economic**: Monthly maintenance of the legacy server costs 3x more than a modern serverless instance.
|
|
52
|
+
- **Risk**: Potential $500k fine due to the lack of audit logs required by the new banking regulation.
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
> **Rationale**: Transforms technical debt into **business numbers**. A 60% loss in productivity and real fines are unbeatable arguments for project approval.
|
package/src/assets/dev-guides/prompt-tracks/02-legacy-modernization/01-analysis/02-security-audit.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# 02 - Legacy Security Audit
|
|
2
|
+
|
|
3
|
+
## Current Vulnerabilities Identification
|
|
4
|
+
|
|
5
|
+
- Are there CVEs (known vulnerabilities) in obsolete libraries?
|
|
6
|
+
- Were secrets (passwords, API keys) found hardcoded in the code?
|
|
7
|
+
|
|
8
|
+
## Attack Surface Mapping
|
|
9
|
+
|
|
10
|
+
- Which ports and services are unnecessarily exposed?
|
|
11
|
+
- Which insecure protocols (e.g., HTTP, SSL v2/v3) are still permitted?
|
|
12
|
+
|
|
13
|
+
## Compliance Audit (LGPD/GDPR)
|
|
14
|
+
|
|
15
|
+
- What sensitive data is handled without encryption or anonymization?
|
|
16
|
+
- Does the current system meet the minimum legal privacy requirements?
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Learn by Examples
|
|
21
|
+
|
|
22
|
+
### ❌ Bad Example
|
|
23
|
+
|
|
24
|
+
```markdown
|
|
25
|
+
# 02 - Legacy Security Audit
|
|
26
|
+
|
|
27
|
+
## Current Vulnerabilities
|
|
28
|
+
|
|
29
|
+
The system is old but has never been hacked.
|
|
30
|
+
|
|
31
|
+
## Attack Surface
|
|
32
|
+
|
|
33
|
+
Normal internet.
|
|
34
|
+
|
|
35
|
+
## Compliance Audit
|
|
36
|
+
|
|
37
|
+
I think everything is fine with LGPD.
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
> **Rationale**: "Never been hacked" is not a guarantee of security. "Normal internet" and "I think it's fine" are unacceptable answers for a staff engineer.
|
|
41
|
+
|
|
42
|
+
### ✅ Good Example
|
|
43
|
+
|
|
44
|
+
```markdown
|
|
45
|
+
# 02 - Legacy Security Audit
|
|
46
|
+
|
|
47
|
+
## Current Vulnerabilities
|
|
48
|
+
|
|
49
|
+
- 45 critical vulnerabilities (CVE-2021-xxxx) in the Django 1.8 framework.
|
|
50
|
+
- AWS Production API key found in the `settings.py` file.
|
|
51
|
+
|
|
52
|
+
## Attack Surface
|
|
53
|
+
|
|
54
|
+
- Port 21 (FTP) open on the application server, allowing anonymous access.
|
|
55
|
+
- Support for TLS 1.0 and 1.1 still active (vulnerable to BEAST/POODLE).
|
|
56
|
+
|
|
57
|
+
## Compliance Audit
|
|
58
|
+
|
|
59
|
+
- Patient health data stored in plain text in the database.
|
|
60
|
+
- Absence of user consent logs (LGPD non-compliance).
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
> **Rationale**: Identifies specific vulnerabilities, insecure open ports, and serious legal compliance failures.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# 03 - Regression Baseline (Security Tests)
|
|
2
|
+
|
|
3
|
+
## Critical Flow Coverage
|
|
4
|
+
|
|
5
|
+
- How will we ensure that the refactoring/migration won't break current functionalities?
|
|
6
|
+
- What are the "Golden Paths" (most critical business routes) that must have _End-to-End_ (E2E) tests?
|
|
7
|
+
|
|
8
|
+
## Assertion Tools
|
|
9
|
+
|
|
10
|
+
- Which tool will be used to record the current behavior of the legacy system before altering it (e.g., Playwright, Cypress, Postman Collections)?
|
|
11
|
+
- Is there any load/stress test (e.g., k6) mapped to ensure the new code performs as well as or better than the legacy one?
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Learn by Examples
|
|
16
|
+
|
|
17
|
+
### ❌ Bad Example
|
|
18
|
+
|
|
19
|
+
```markdown
|
|
20
|
+
# 03 - Regression Baseline
|
|
21
|
+
|
|
22
|
+
## Coverage
|
|
23
|
+
|
|
24
|
+
We'll test it manually before uploading.
|
|
25
|
+
|
|
26
|
+
## Tools
|
|
27
|
+
|
|
28
|
+
The QA will use their Postman.
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
> **Rationale**: Refactoring legacy systems without automated regression tests is like jumping out of a plane without a methodological parachute. "Manual testing" creates bias and overlooks _edge cases_.
|
|
32
|
+
|
|
33
|
+
### ✅ Good Example
|
|
34
|
+
|
|
35
|
+
```markdown
|
|
36
|
+
# 03 - Regression Baseline
|
|
37
|
+
|
|
38
|
+
## Critical Flow Coverage
|
|
39
|
+
|
|
40
|
+
- **Mapped Routes**: `POST /checkout` and `GET /invoice/:id`.
|
|
41
|
+
- **Strategy**: 100% success coverage on these two flows via E2E tests running in a mirrored Legacy _Staging_ environment.
|
|
42
|
+
|
|
43
|
+
## Assertion Tools
|
|
44
|
+
|
|
45
|
+
- **Automated E2E**: Playwright (Scripts in the `qa-legacy-suite` repository).
|
|
46
|
+
- **Performance Validation**: k6 script to prove that the new Cart route in Node.js matches the 150ms of the old PHP one.
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
> **Rationale**: Creates a real "electric fence." The developer has the peace of mind to rip out parts of the system knowing that Playwright will immediately notify them if they broke the old business logic.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# 04 - Analysis Approval
|
|
2
|
+
|
|
3
|
+
## Artifacts Checklist
|
|
4
|
+
|
|
5
|
+
- [ ] 01-tech-debt-inventory.md (Complete)
|
|
6
|
+
- [ ] 02-security-audit.md (Mapped)
|
|
7
|
+
- [ ] 03-regression-baseline.md (Approved / "Electric Fence" enabled)
|
|
8
|
+
|
|
9
|
+
## Technical Approval
|
|
10
|
+
|
|
11
|
+
- **Solutions Architect**: [Signature/Date]
|
|
12
|
+
- **Security Lead**: [Signature/Date]
|
|
13
|
+
- **QA Engineer**: [Signature/Date]
|
|
14
|
+
|
|
15
|
+
## Definition of Readiness (Ready for Strategy)
|
|
16
|
+
|
|
17
|
+
- [ ] Legacy critical failure points identified.
|
|
18
|
+
- [ ] Libraries with security CVEs mapped.
|
|
19
|
+
- [ ] Clear understanding of data coupling.
|
|
20
|
+
- [ ] Initial E2E/Regression test suite running green on the current legacy system.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Learn by Examples
|
|
25
|
+
|
|
26
|
+
### ❌ Bad Example
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
# 04 - Analysis Approval
|
|
30
|
+
|
|
31
|
+
## Checklist
|
|
32
|
+
|
|
33
|
+
- [x] Tech debt listed.
|
|
34
|
+
|
|
35
|
+
## Definition of Readiness
|
|
36
|
+
|
|
37
|
+
- [x] Ready to choose the strategy.
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
> **Rationale**: How do you prove that security was involved in the analysis? Where are the tests ensuring the legacy system works before you touch it?
|
|
41
|
+
|
|
42
|
+
### ✅ Good Example
|
|
43
|
+
|
|
44
|
+
```markdown
|
|
45
|
+
# 04 - Analysis Approval
|
|
46
|
+
|
|
47
|
+
## Checklist
|
|
48
|
+
|
|
49
|
+
- [x] 01-tech-debt-inventory.md (Approved)
|
|
50
|
+
- [x] 02-security-audit.md (Approved)
|
|
51
|
+
- [x] 03-regression-baseline.md (Approved: 95% of Cart Flow guaranteed by E2E Playwright)
|
|
52
|
+
|
|
53
|
+
## Technical Approval
|
|
54
|
+
|
|
55
|
+
- **Architect**: Sandra Adams (2026-06-15)
|
|
56
|
+
- **Security**: Paul Mendez (2026-06-16)
|
|
57
|
+
|
|
58
|
+
## Definition of Readiness
|
|
59
|
+
|
|
60
|
+
- [x] OWASP scanner executed on the legacy system with 15 vulnerabilities mapped.
|
|
61
|
+
- [x] `Payment` module identified as the most critical for refactoring.
|
|
62
|
+
- [x] Legacy Purchase Flow E2E test suite ran successfully 3 times in the pipeline.
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
> **Rationale**: Evidence of security scanning, technical hot-spot identification, and, fundamentally, proven regressive protection (_Ready to break_ safely).
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# 01 - Modernization Approach
|
|
2
|
+
|
|
3
|
+
## Chosen Strategy
|
|
4
|
+
|
|
5
|
+
- [ ] Rehost, [ ] Refactor, [ ] Rearchitect, etc.
|
|
6
|
+
|
|
7
|
+
## Coexistence Pattern
|
|
8
|
+
|
|
9
|
+
- How will the legacy system talk to the new one?
|
|
10
|
+
|
|
11
|
+
## Security in Transition
|
|
12
|
+
|
|
13
|
+
- How will credentials be shared (Single Sign-On)?
|
|
14
|
+
- How do we ensure that the weaker system (Legacy) does not compromise the new one?
|
|
15
|
+
|
|
16
|
+
## Interface Modernization (UX/UI)
|
|
17
|
+
|
|
18
|
+
- Will we keep the legacy UI or migrate to a new Design System?
|
|
19
|
+
- How will the visual transition be for the end user?
|
|
20
|
+
|
|
21
|
+
## AI Opportunities in Legacy
|
|
22
|
+
|
|
23
|
+
- How can AI automate manual processes of the old system?
|
|
24
|
+
- Data extraction (OCR/LLM) from legacy documents.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Learn by Examples
|
|
29
|
+
|
|
30
|
+
### ❌ Bad Example
|
|
31
|
+
|
|
32
|
+
```markdown
|
|
33
|
+
# 01 - Modernization Approach
|
|
34
|
+
|
|
35
|
+
## Interface Modernization
|
|
36
|
+
|
|
37
|
+
Make the frontend more modern.
|
|
38
|
+
|
|
39
|
+
## AI Opportunities
|
|
40
|
+
|
|
41
|
+
Put a chat in the old system.
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
> **Rationale**: "Modern" is subjective. "Chat in the old system" might be an error if the backend is not stable enough to provide reliable data to the AI.
|
|
45
|
+
|
|
46
|
+
### ✅ Good Example
|
|
47
|
+
|
|
48
|
+
```markdown
|
|
49
|
+
# 01 - Modernization Approach
|
|
50
|
+
|
|
51
|
+
## Interface Modernization (UX/UI)
|
|
52
|
+
|
|
53
|
+
Migration to the new Design System in React, replacing Delphi screens via controlled iframe (Progressive Isolation).
|
|
54
|
+
|
|
55
|
+
## AI Opportunities
|
|
56
|
+
|
|
57
|
+
Implement an Agent via MCP for automated data extraction from old invoices that do not have an API.
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
> **Rationale**: Defines interface technologies (React, iframe) and a real AI use case (MCP/OCR) to "save" inefficient legacy processes.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# 02 - Versioning and Coexistence Strategy
|
|
2
|
+
|
|
3
|
+
## Versioning and Code Freeze
|
|
4
|
+
|
|
5
|
+
- What will be the repository strategy? (Create a NEW repository from scratch or create a `modernization` branch in the current repository?)
|
|
6
|
+
- Will there be a `Code Freeze` (pause on new features) in the legacy system during modernization? If not, how will new legacy features sync with the new architecture?
|
|
7
|
+
|
|
8
|
+
## Traffic Routing (Strangler Fig)
|
|
9
|
+
|
|
10
|
+
- How will users access the new system? (Gradually via **Feature Flags**, or a overnight **Big Bang** migration)?
|
|
11
|
+
- Will the **API Gateway** or **Load Balancer** be configured to direct specific calls (e.g., `/api/v2/orders`) to the new system and the rest to the legacy one?
|
|
12
|
+
|
|
13
|
+
## User Interface (Micro-frontends / iFrames)
|
|
14
|
+
|
|
15
|
+
- If the interface also changes, will the new interface screen coexist in the legacy window via `<iframe>`, Federated Modules (Webpack), or will the user transition between tabs/domains (e.g., `legacy.app.com` -> `app.com`)?
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Learn by Examples
|
|
20
|
+
|
|
21
|
+
### ❌ Bad Example
|
|
22
|
+
|
|
23
|
+
```markdown
|
|
24
|
+
# 02 - Versioning and Coexistence
|
|
25
|
+
|
|
26
|
+
## Versioning
|
|
27
|
+
|
|
28
|
+
We'll write the code in a separate repository. The maintenance team continues in the other one.
|
|
29
|
+
|
|
30
|
+
## Routing
|
|
31
|
+
|
|
32
|
+
Once finished, we switch the DNS to the new server on a Saturday night.
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
> **Rationale**: The famous "Big Bang." Statistically, the chance of a Big Bang failure is massive, resulting in the classic "Rollback Sunday." Two teams running in parallel without a bridge causes divergence of rules in production.
|
|
36
|
+
|
|
37
|
+
### ✅ Good Example
|
|
38
|
+
|
|
39
|
+
```markdown
|
|
40
|
+
# 02 - Versioning and Coexistence
|
|
41
|
+
|
|
42
|
+
## Versioning and Code Freeze
|
|
43
|
+
|
|
44
|
+
- Separate repositories.
|
|
45
|
+
- **No Code Freeze**: However, the maintenance team _must_ notify the modernization squad if any Legacy DB Model undergoes an `.alter table`.
|
|
46
|
+
|
|
47
|
+
## Routing (Strangler Fig)
|
|
48
|
+
|
|
49
|
+
- **Strangler Fig Pattern** standard with proxy (NGINX/Kong).
|
|
50
|
+
- Traffic will be transferred endpoint-by-endpoint. Once `v2/sales` in the new language is completed, Kong starts routing 15% of that sales traffic to the new server while keeping the rest (85%) of the traffic on PHP.
|
|
51
|
+
|
|
52
|
+
## Coexistence
|
|
53
|
+
|
|
54
|
+
- The user will feel as if they are in the same system. The Legacy portal header will have the "Sales" button pointing to the new micro-frontend via Cloudfront.
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
> **Rationale**: "Thin Slices" approach. Failure risk is isolated to smaller endpoints, allowing modernization to deliver value in the first week of deployment rather than only in 6 months during a single event.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# 03 - New Demands Triage (Triage Matrix)
|
|
2
|
+
|
|
3
|
+
A legacy modernization creates a "Tug of War" between the team migrating the system and the Product (PMs) / Sales area that keeps requesting _new features (New Buttons)_ all the time. The Decision Tree below shields the system to avoid building eternal "trash" on the old platform.
|
|
4
|
+
|
|
5
|
+
## Decision Support Tree (Where to Develop)
|
|
6
|
+
|
|
7
|
+
For each new "Epic" requested during the migration, the Tech Lead must apply the following questionnaire:
|
|
8
|
+
|
|
9
|
+
1. **Does the requested feature touch modules that will be decommissioned in less than 6 months?**
|
|
10
|
+
- **Yes:** Reject in the Legacy system, unless it is Critical/Legal Compliance (Bugfix/Tax). Only perform workarounds or advance the schedule in the New Architecture.
|
|
11
|
+
2. **Is it a functionality completely independent of the current core?** (e.g., A new SMS sending module)
|
|
12
|
+
- **Yes:** Build **100% in the New Ecosystem** (Microservice or V2) and integrate via API Bridge/Strangler Fig so that Legacy screens can call it without cluttering the internal logic.
|
|
13
|
+
3. **Does the Cost x Benefit require it to be in the Legacy system?**
|
|
14
|
+
- Injecting into the spaghetti code will take X hours, but we'll refactor it regardless. How can we deliver quickly _now_ without blocking future database migrations? (e.g., Add-only table extension).
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Learn by Examples
|
|
19
|
+
|
|
20
|
+
### ❌ Bad Example
|
|
21
|
+
|
|
22
|
+
```markdown
|
|
23
|
+
# Matrix
|
|
24
|
+
|
|
25
|
+
Every new button goes into the new system, and the old system only gets bug fixes.
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
> **Rationale**: Too simplistic. How will the user use something in the "new" system if Single Sign-On hasn't been created yet? An automatic "no" will generate unsustainable friction with the PM, who will demand it go into the Legacy system to serve the customer tomorrow.
|
|
29
|
+
|
|
30
|
+
### ✅ Good Example
|
|
31
|
+
|
|
32
|
+
```markdown
|
|
33
|
+
# Feature Triage: "Loyalty and Cashback Module"
|
|
34
|
+
|
|
35
|
+
- **Request:** Massive new module.
|
|
36
|
+
- **Legacy Analysis:** The PHP 5 Legacy system will make complex calls to calculate cashback.
|
|
37
|
+
- **Decision (Strangler Fig):** The Cashback calculation will be built in the NEW architecture (Python V2) as an isolated endpoint (`/api/v2/cashback`).
|
|
38
|
+
- **Integration:** We will add 20 lines in the old PHP just to perform the HTTP request passing `{user_id, sale_total}` to the new API. All computational heavy lifting, New Postgres Database, and logic will remain shielded in the new software!
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
> **Rationale**: Resolves the Product Manager's pain point (delivering Sales tomorrow) while protecting the Staff-level architecture. You delivered the tied value to the end customer using the old screens but built the solid, portable "castle" in the new backend.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# 04 - Strategy Approval
|
|
2
|
+
|
|
3
|
+
## Artifacts Checklist
|
|
4
|
+
|
|
5
|
+
- [ ] 01-modernization-approach.md (Strategy, UX, and AI defined)
|
|
6
|
+
- [ ] 02-versioning-and-coexistence.md (Strangler Fig / Branches / Deploy)
|
|
7
|
+
|
|
8
|
+
## Strategic Approval
|
|
9
|
+
|
|
10
|
+
- **Chief Technology Officer (CTO)**: [Signature/Date]
|
|
11
|
+
- **Technical Lead (Staff)**: [Signature/Date]
|
|
12
|
+
|
|
13
|
+
## Definition of Readiness (Ready for Refactor)
|
|
14
|
+
|
|
15
|
+
- [ ] Decision between Refactoring vs. Replacement formalized.
|
|
16
|
+
- [ ] UX Modernization decision (Maintain vs. New DS) made.
|
|
17
|
+
- [ ] AI Opportunities (Automation/Extraction) evaluated.
|
|
18
|
+
- [ ] Network routing pattern (e.g., Proxy/API Gateway) designed to isolate the new from the old.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Learn by Examples
|
|
23
|
+
|
|
24
|
+
### ❌ Bad Example
|
|
25
|
+
|
|
26
|
+
```markdown
|
|
27
|
+
# 04 - Strategy Approval
|
|
28
|
+
|
|
29
|
+
## Checklist
|
|
30
|
+
|
|
31
|
+
- [x] We're going to rewrite.
|
|
32
|
+
|
|
33
|
+
## Definition of Readiness
|
|
34
|
+
|
|
35
|
+
- [x] Team excited to code.
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
> **Rationale**: How do you ensure that user traffic correctly reaches the refactored version the team is supposedly "excited" to code?
|
|
39
|
+
|
|
40
|
+
### ✅ Good Example
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
# 04 - Strategy Approval
|
|
44
|
+
|
|
45
|
+
## Strategic Approval
|
|
46
|
+
|
|
47
|
+
- **CTO**: Andrew Vanes (Approved on 2026-06-25)
|
|
48
|
+
|
|
49
|
+
## Definition of Readiness
|
|
50
|
+
|
|
51
|
+
- [x] Strangler Fig pattern chosen for the Cart module and AWS API Gateway configured.
|
|
52
|
+
- [x] UX Strategy: New Design System in React (Coexistence via Web Components).
|
|
53
|
+
- [x] Code Freeze: Legacy User tables frozen for any `Migration` involving `DROP`.
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
> **Rationale**: Specific technical decision (Strangler Fig/AWS), interface strategy (Web Components), and clear coexistence rules (Code Freeze) documented at the ecosystem level.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# 01 - Refactoring Backlog
|
|
2
|
+
|
|
3
|
+
## Priority Cleanups
|
|
4
|
+
|
|
5
|
+
- Which files/modules will be cleaned first?
|
|
6
|
+
|
|
7
|
+
## Patterns to Apply
|
|
8
|
+
|
|
9
|
+
- [ ] Interface extraction.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Learn by Examples
|
|
14
|
+
|
|
15
|
+
### ❌ Bad Example
|
|
16
|
+
|
|
17
|
+
```markdown
|
|
18
|
+
# 01 - Refactoring Backlog
|
|
19
|
+
|
|
20
|
+
## Priority Cleanups
|
|
21
|
+
|
|
22
|
+
Sales and Database Module.
|
|
23
|
+
|
|
24
|
+
## Patterns to Apply
|
|
25
|
+
|
|
26
|
+
Clean Code.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
> **Rationale**: "Sales" is too broad. "Clean Code" is not a specific refactoring pattern.
|
|
30
|
+
|
|
31
|
+
### ✅ Good Example
|
|
32
|
+
|
|
33
|
+
```markdown
|
|
34
|
+
# 01 - Refactoring Backlog
|
|
35
|
+
|
|
36
|
+
## Priority Cleanups
|
|
37
|
+
|
|
38
|
+
SQL Repository in `infra/repository/order.sql`.
|
|
39
|
+
|
|
40
|
+
## Patterns to Apply
|
|
41
|
+
|
|
42
|
+
Dependency Injection and Interface Extraction to enable Mocks in tests.
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
> **Rationale**: Focuses on real technical improvements (Mocks/Testing) and components that can be isolated.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# 02 - Refactoring Approval
|
|
2
|
+
|
|
3
|
+
## Artifacts Checklist
|
|
4
|
+
|
|
5
|
+
- [ ] 01-cleanup-backlog.md (Prioritized)
|
|
6
|
+
|
|
7
|
+
## Technical Approval
|
|
8
|
+
|
|
9
|
+
- **Tech Lead**: [Signature/Date]
|
|
10
|
+
- **Development Team**: [Signature/Date]
|
|
11
|
+
|
|
12
|
+
## Definition of Readiness (Ready for Migration)
|
|
13
|
+
|
|
14
|
+
- [ ] Critical code extracted into interfaces.
|
|
15
|
+
- [ ] Regression tests (Unit/Integration) cover 80% of the changes.
|
|
16
|
+
- [ ] The monolith is stable for the final migration.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Learn by Examples
|
|
21
|
+
|
|
22
|
+
### ❌ Bad Example
|
|
23
|
+
|
|
24
|
+
```markdown
|
|
25
|
+
# 02 - Refactoring Approval
|
|
26
|
+
|
|
27
|
+
## Checklist
|
|
28
|
+
|
|
29
|
+
- [x] We ran the linter.
|
|
30
|
+
|
|
31
|
+
## Definition of Readiness
|
|
32
|
+
|
|
33
|
+
- [x] The code is pretty.
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
> **Rationale**: "Pretty code" is not an operational readiness criterion for migration.
|
|
37
|
+
|
|
38
|
+
### ✅ Good Example
|
|
39
|
+
|
|
40
|
+
```markdown
|
|
41
|
+
# 02 - Refactoring Approval
|
|
42
|
+
|
|
43
|
+
## Technical Approval
|
|
44
|
+
|
|
45
|
+
- **Lead**: Mark Oliver (2026-07-10)
|
|
46
|
+
|
|
47
|
+
## Definition of Readiness
|
|
48
|
+
|
|
49
|
+
- [x] SQL Repository isolated under a common interface.
|
|
50
|
+
- [x] Integration test suite via Docker running in the CI.
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
> **Rationale**: Focuses on technical isolation and test automation to ensure the security of the migration.
|