context-first-cli 1.8.2 → 2.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.
Files changed (85) hide show
  1. package/dist/commands/create-orchestrator.d.ts.map +1 -1
  2. package/dist/commands/create-orchestrator.js +15 -3
  3. package/dist/commands/create-orchestrator.js.map +1 -1
  4. package/dist/commands/feature.d.ts.map +1 -1
  5. package/dist/commands/feature.js +33 -2
  6. package/dist/commands/feature.js.map +1 -1
  7. package/dist/commands/update-commands.d.ts.map +1 -1
  8. package/dist/commands/update-commands.js +42 -2
  9. package/dist/commands/update-commands.js.map +1 -1
  10. package/dist/templates/commands/en/engineer/plan.md +297 -0
  11. package/dist/templates/commands/en/engineer/pr.md +167 -0
  12. package/dist/templates/commands/en/engineer/pre-pr.md +262 -0
  13. package/dist/templates/commands/en/engineer/start.md +281 -0
  14. package/dist/templates/commands/en/engineer/work.md +197 -0
  15. package/dist/templates/commands/en/products/check.md +233 -0
  16. package/dist/templates/commands/en/products/collect.md +156 -0
  17. package/dist/templates/commands/en/products/refine.md +222 -0
  18. package/dist/templates/commands/en/products/spec.md +267 -0
  19. package/dist/templates/commands/en/quality/metrics.md +240 -0
  20. package/dist/templates/commands/en/quality/observe.md +168 -0
  21. package/dist/templates/commands/en/warm-up.md +78 -0
  22. package/dist/templates/commands/es/engineer/plan.md +297 -0
  23. package/dist/templates/commands/es/engineer/pr.md +167 -0
  24. package/dist/templates/commands/es/engineer/pre-pr.md +262 -0
  25. package/dist/templates/commands/es/engineer/start.md +281 -0
  26. package/dist/templates/commands/es/engineer/work.md +197 -0
  27. package/dist/templates/commands/es/products/check.md +233 -0
  28. package/dist/templates/commands/es/products/collect.md +156 -0
  29. package/dist/templates/commands/es/products/refine.md +222 -0
  30. package/dist/templates/commands/es/products/spec.md +267 -0
  31. package/dist/templates/commands/es/quality/metrics.md +240 -0
  32. package/dist/templates/commands/es/quality/observe.md +168 -0
  33. package/dist/templates/commands/es/warm-up.md +78 -0
  34. package/dist/utils/config.d.ts +1 -0
  35. package/dist/utils/config.d.ts.map +1 -1
  36. package/dist/utils/config.js.map +1 -1
  37. package/package.json +1 -1
  38. package/templates/commands/en/engineer/plan.md +297 -0
  39. package/templates/commands/en/engineer/pr.md +167 -0
  40. package/templates/commands/en/engineer/pre-pr.md +262 -0
  41. package/templates/commands/en/engineer/start.md +281 -0
  42. package/templates/commands/en/engineer/work.md +197 -0
  43. package/templates/commands/en/products/check.md +233 -0
  44. package/templates/commands/en/products/collect.md +156 -0
  45. package/templates/commands/en/products/refine.md +222 -0
  46. package/templates/commands/en/products/spec.md +267 -0
  47. package/templates/commands/en/quality/metrics.md +240 -0
  48. package/templates/commands/en/quality/observe.md +168 -0
  49. package/templates/commands/en/warm-up.md +78 -0
  50. package/templates/commands/es/engineer/plan.md +297 -0
  51. package/templates/commands/es/engineer/pr.md +167 -0
  52. package/templates/commands/es/engineer/pre-pr.md +262 -0
  53. package/templates/commands/es/engineer/start.md +281 -0
  54. package/templates/commands/es/engineer/work.md +197 -0
  55. package/templates/commands/es/products/check.md +233 -0
  56. package/templates/commands/es/products/collect.md +156 -0
  57. package/templates/commands/es/products/refine.md +222 -0
  58. package/templates/commands/es/products/spec.md +267 -0
  59. package/templates/commands/es/quality/metrics.md +240 -0
  60. package/templates/commands/es/quality/observe.md +168 -0
  61. package/templates/commands/es/warm-up.md +78 -0
  62. package/templates/commands/pt-BR/engineer/plan.md +297 -0
  63. package/templates/commands/pt-BR/engineer/pr.md +167 -0
  64. package/templates/commands/pt-BR/engineer/pre-pr.md +262 -0
  65. package/templates/commands/pt-BR/engineer/start.md +281 -0
  66. package/templates/commands/pt-BR/engineer/work.md +197 -0
  67. package/templates/commands/pt-BR/products/check.md +233 -0
  68. package/templates/commands/pt-BR/products/collect.md +156 -0
  69. package/templates/commands/pt-BR/products/refine.md +222 -0
  70. package/templates/commands/pt-BR/products/spec.md +267 -0
  71. package/templates/commands/pt-BR/quality/metrics.md +240 -0
  72. package/templates/commands/pt-BR/quality/observe.md +168 -0
  73. package/templates/commands/pt-BR/warm-up.md +78 -0
  74. /package/{templates/commands → dist/templates/commands/pt-BR}/engineer/plan.md +0 -0
  75. /package/{templates/commands → dist/templates/commands/pt-BR}/engineer/pr.md +0 -0
  76. /package/{templates/commands → dist/templates/commands/pt-BR}/engineer/pre-pr.md +0 -0
  77. /package/{templates/commands → dist/templates/commands/pt-BR}/engineer/start.md +0 -0
  78. /package/{templates/commands → dist/templates/commands/pt-BR}/engineer/work.md +0 -0
  79. /package/{templates/commands → dist/templates/commands/pt-BR}/products/check.md +0 -0
  80. /package/{templates/commands → dist/templates/commands/pt-BR}/products/collect.md +0 -0
  81. /package/{templates/commands → dist/templates/commands/pt-BR}/products/refine.md +0 -0
  82. /package/{templates/commands → dist/templates/commands/pt-BR}/products/spec.md +0 -0
  83. /package/{templates/commands → dist/templates/commands/pt-BR}/quality/metrics.md +0 -0
  84. /package/{templates/commands → dist/templates/commands/pt-BR}/quality/observe.md +0 -0
  85. /package/{templates/commands → dist/templates/commands/pt-BR}/warm-up.md +0 -0
@@ -0,0 +1,167 @@
1
+ # Pull Request Creation
2
+
3
+ This command creates Pull Requests for all modified repositories in the workspace.
4
+
5
+ ## 📋 Prerequisites
6
+
7
+ Before creating PRs, make sure that:
8
+ - You have run `/pre-pr` and all validations passed
9
+ - All commits have been made
10
+ - All tests are passing
11
+ - Documentation is up to date
12
+
13
+ ## 🎯 PR Creation Process
14
+
15
+ ### 1. Identify Modified Repositories
16
+
17
+ For each repository in the workspace, check:
18
+ ```bash
19
+ cd <repositório>
20
+ git status
21
+ git log origin/main..HEAD # View unpushed commits
22
+ ```
23
+
24
+ ### 2. Push Branches
25
+
26
+ For each modified repository:
27
+ ```bash
28
+ cd <repositório>
29
+ git push origin <branch-name>
30
+ ```
31
+
32
+ ### 3. Create Pull Requests
33
+
34
+ For each repository, create a PR using GitHub CLI or the web interface:
35
+
36
+ **Using GitHub CLI**:
37
+ ```bash
38
+ cd <repositório>
39
+ gh pr create --title "[ISSUE-ID] Feature Title" \
40
+ --body "$(cat ../.sessions/<ISSUE-ID>/pr-description.md)" \
41
+ --base main
42
+ ```
43
+
44
+ **PR Description Template**:
45
+
46
+ ```markdown
47
+ ## 🎯 Objective
48
+
49
+ [Brief description of what this PR does]
50
+
51
+ ## 📝 Changes
52
+
53
+ ### Repository: <nome-do-repo>
54
+
55
+ - [Change 1]
56
+ - [Change 2]
57
+ - [Change 3]
58
+
59
+ ## 🔗 Relationships
60
+
61
+ - **Issue**: <ISSUE-ID>
62
+ - **Related PRs**:
63
+ - <repo-1>#<PR-number>
64
+ - <repo-2>#<PR-number>
65
+
66
+ ## ✅ Checklist
67
+
68
+ - [ ] Code implemented and tested
69
+ - [ ] Unit tests added/updated
70
+ - [ ] Integration tests passing
71
+ - [ ] Documentation updated
72
+ - [ ] No breaking changes (or documented)
73
+ - [ ] Peer reviewed (after PR creation)
74
+
75
+ ## 🧪 How to Test
76
+
77
+ 1. [Step 1]
78
+ 2. [Step 2]
79
+ 3. [Expected result]
80
+
81
+ ## 📸 Screenshots/Demos
82
+
83
+ [If applicable, add screenshots or links to demos]
84
+
85
+ ## 🔍 Notes for Reviewers
86
+
87
+ - [Point of attention 1]
88
+ - [Point of attention 2]
89
+ ```
90
+
91
+ ### 4. Link PRs
92
+
93
+ If there are multiple PRs (one per repository):
94
+ - Add cross-links between the PRs
95
+ - Document the recommended merge order
96
+ - Indicate dependencies between PRs
97
+
98
+ ### 5. Update Issue in Task Manager
99
+
100
+ If the task manager is configured:
101
+ - Move the issue to "In Review" or "PR Open"
102
+ - Add PR links in the issue
103
+ - Add a comment summarizing the changes
104
+
105
+ ### 6. Session Documentation
106
+
107
+ Update `./.sessions/<ISSUE-ID>/pr.md`:
108
+
109
+ ```markdown
110
+ # [Feature Title] - Pull Requests
111
+
112
+ ## Created PRs
113
+
114
+ ### <repo-1>
115
+ - **Link**: <PR URL>
116
+ - **Status**: Open
117
+ - **Commits**: X commits
118
+
119
+ ### <repo-2>
120
+ - **Link**: <PR URL>
121
+ - **Status**: Open
122
+ - **Commits**: Y commits
123
+
124
+ ## Recommended Merge Order
125
+
126
+ 1. <repo-1> - [Justification]
127
+ 2. <repo-2> - [Justification]
128
+
129
+ ## Merge Notes
130
+
131
+ - [Important note 1]
132
+ - [Important note 2]
133
+ ```
134
+
135
+ ## 🔍 Final Checklist
136
+
137
+ Before requesting review:
138
+ - [ ] All PRs created
139
+ - [ ] Complete and clear descriptions
140
+ - [ ] PRs linked to each other
141
+ - [ ] Issue updated in task manager
142
+ - [ ] Tests passing in CI/CD
143
+ - [ ] Session documentation complete
144
+
145
+ ## 📢 Communication
146
+
147
+ Notify the team about the PRs:
148
+ - Mention relevant reviewers
149
+ - Highlight critical changes or breaking changes
150
+ - Indicate urgency if applicable
151
+
152
+ ---
153
+
154
+ **Provided arguments**:
155
+
156
+ ```
157
+ #$ARGUMENTS
158
+ ```
159
+
160
+ ---
161
+
162
+ ## 🎯 Next Steps
163
+
164
+ 1. Await PR review
165
+ 2. Respond to comments and make adjustments
166
+ 3. After approval, merge in the recommended order
167
+ 4. Run `context-cli feature:end <ISSUE-ID>` to clean the workspace
@@ -0,0 +1,262 @@
1
+ # Preparation for Pull Request
2
+
3
+ This command validates that everything is ready to create Pull Requests.
4
+
5
+ ## 📋 Prerequisites
6
+
7
+ - Complete implementation (all `/plan` tasks executed)
8
+ - All commits made
9
+ - Clean and organized workspace
10
+
11
+ ## 🎯 Objective
12
+
13
+ Ensure that the implementation is complete, tested, and ready for review before creating the PRs.
14
+
15
+ ## ✅ Validation Checklist
16
+
17
+ ### 1. Implementation Completeness
18
+
19
+ ```markdown
20
+ ## Completeness Check
21
+
22
+ - [ ] All plan tasks have been executed
23
+ - [ ] All functional requirements from the PRD have been implemented
24
+ - [ ] All acceptance criteria have been met
25
+ - [ ] No functionality is left half-done
26
+ ```
27
+
28
+ ### 2. Code Quality
29
+
30
+ For each modified repository:
31
+
32
+ ```bash
33
+ cd <repositório>
34
+
35
+ # Check status
36
+ git status
37
+
38
+ # Check linting
39
+ npm run lint # or equivalent command
40
+
41
+ # Check formatting
42
+ npm run format:check # or equivalent command
43
+
44
+ # Check build
45
+ npm run build # or equivalent command
46
+ ```
47
+
48
+ Checklist:
49
+ ```markdown
50
+ ## Code Quality
51
+
52
+ ### <repo-1>
53
+ - [ ] Linting without errors
54
+ - [ ] Correct formatting
55
+ - [ ] Build without errors
56
+ - [ ] No critical warnings
57
+
58
+ ### <repo-2>
59
+ - [ ] Linting without errors
60
+ - [ ] Correct formatting
61
+ - [ ] Build without errors
62
+ - [ ] No critical warnings
63
+ ```
64
+
65
+ ### 3. Tests
66
+
67
+ For each repository:
68
+
69
+ ```bash
70
+ cd <repositório>
71
+
72
+ # Run unit tests
73
+ npm run test:unit # or equivalent command
74
+
75
+ # Run integration tests
76
+ npm run test:integration # or equivalent command
77
+
78
+ # Check coverage
79
+ npm run test:coverage # or equivalent command
80
+ ```
81
+
82
+ Checklist:
83
+ ```markdown
84
+ ## Tests
85
+
86
+ ### <repo-1>
87
+ - [ ] All unit tests passing
88
+ - [ ] All integration tests passing
89
+ - [ ] Adequate test coverage (>= X%)
90
+ - [ ] New tests added for new features
91
+
92
+ ### <repo-2>
93
+ - [ ] All unit tests passing
94
+ - [ ] All integration tests passing
95
+ - [ ] Adequate test coverage (>= X%)
96
+ - [ ] New tests added for new features
97
+ ```
98
+
99
+ ### 4. Documentation
100
+
101
+ ```markdown
102
+ ## Documentation
103
+
104
+ - [ ] README updated (if necessary)
105
+ - [ ] Appropriate code comments
106
+ - [ ] API documentation updated (if there are changes)
107
+ - [ ] Changelog updated
108
+ - [ ] Technical documentation updated in metaspecs (if applicable)
109
+ ```
110
+
111
+ ### 5. Commits
112
+
113
+ ```markdown
114
+ ## Commits
115
+
116
+ - [ ] All commits have clear and descriptive messages
117
+ - [ ] Commits follow the project standard (conventional commits, etc.)
118
+ - [ ] No commits with generic messages ("fix", "update", etc.)
119
+ - [ ] Commits are logically organized
120
+ - [ ] No debug or temporary commits
121
+ ```
122
+
123
+ ### 6. Synchronization
124
+
125
+ ```markdown
126
+ ## Synchronization
127
+
128
+ - [ ] Branches are up to date with the base branch (main/develop)
129
+ - [ ] No merge conflicts
130
+ - [ ] Changes between repositories are synchronized
131
+ - [ ] Dependencies between repos have been tested
132
+ ```
133
+
134
+ ### 7. Security
135
+
136
+ ```markdown
137
+ ## Security
138
+
139
+ - [ ] No credentials or secrets in the code
140
+ - [ ] No sensitive data in logs
141
+ - [ ] Security dependencies have been checked
142
+ - [ ] No known vulnerabilities introduced
143
+ ```
144
+
145
+ ### 8. Performance
146
+
147
+ ```markdown
148
+ ## Performance
149
+
150
+ - [ ] No obvious performance regressions
151
+ - [ ] Costly queries/operations have been optimized
152
+ - [ ] No memory leaks introduced
153
+ - [ ] PRD performance requirements have been met
154
+ ```
155
+
156
+ ## 🔍 Cross Validation
157
+
158
+ If multiple repositories were modified:
159
+
160
+ ```markdown
161
+ ## Cross Validation
162
+
163
+ - [ ] Tested integration between repositories locally
164
+ - [ ] APIs/contracts between repos are consistent
165
+ - [ ] No undocumented breaking changes
166
+ - [ ] Deployment/merge order is clear
167
+ ```
168
+
169
+ ## 📄 PR Description Preparation
170
+
171
+ Create `./.sessions/<ISSUE-ID>/pr-description.md`:
172
+
173
+ ```markdown
174
+ ## 🎯 Objective
175
+ [Brief description of what this feature does]
176
+
177
+ ## 📝 Main Changes
178
+ - [Change 1]
179
+ - [Change 2]
180
+ - [Change 3]
181
+
182
+ ## 🔗 Links
183
+ - **Issue**: [ISSUE-ID]
184
+ - **PRD**: [link or path]
185
+ - **Technical Plan**: [link or path]
186
+
187
+ ## ✅ Checklist
188
+ - [x] Code implemented and tested
189
+ - [x] Unit tests added/updated
190
+ - [x] Integration tests passing
191
+ - [x] Documentation updated
192
+ - [x] Linting and formatting OK
193
+ - [x] Build without errors
194
+
195
+ ## 🧪 How to Test
196
+ 1. [Step 1]
197
+ 2. [Step 2]
198
+ 3. [Expected result]
199
+
200
+ ## 🔍 Notes for Reviewers
201
+ - [Attention point 1]
202
+ - [Attention point 2]
203
+ ```
204
+
205
+ ## 🚨 Issues Found
206
+
207
+ If any validation fails:
208
+ 1. 🛑 **STOP** the PR creation process
209
+ 2. 📝 **DOCUMENT** the issue
210
+ 3. 🔧 **FIX** the issue
211
+ 4. 🔄 **RUN** `/pre-pr` again
212
+
213
+ ## 📊 Validation Report
214
+
215
+ Create `./.sessions/<ISSUE-ID>/pre-pr-report.md`:
216
+
217
+ ```markdown
218
+ # Pre-PR Validation Report
219
+
220
+ **Date**: [date/time]
221
+ **Issue**: [ISSUE-ID]
222
+
223
+ ## Overall Status
224
+ ✅ Ready for PR / ⚠️ Pending / ❌ Blocked
225
+
226
+ ## Validated Repositories
227
+ - **<repo-1>**: ✅ OK
228
+ - **<repo-2>**: ✅ OK
229
+
230
+ ## Test Summary
231
+ - **Unit Tests**: X/X passing
232
+ - **Integration Tests**: Y/Y passing
233
+ - **Coverage**: Z%
234
+
235
+ ## Pending Items (if any)
236
+ - [Pending item 1]
237
+ - [Pending item 2]
238
+
239
+ ## Next Steps
240
+ - [x] All validations passed
241
+ - [ ] Run `/pr` to create Pull Requests
242
+ ```
243
+
244
+ ---
245
+
246
+ **Provided arguments**:
247
+
248
+ ```
249
+ #$ARGUMENTS
250
+ ```
251
+
252
+ ---
253
+
254
+ ## 🎯 Next Step
255
+
256
+ If all validations passed:
257
+
258
+ ```bash
259
+ /pr
260
+ ```
261
+
262
+ This command will create the Pull Requests for all modified repositories.
@@ -0,0 +1,281 @@
1
+ # Start of Development
2
+
3
+ This command starts the development of a feature in the current workspace.
4
+
5
+ ## 📍 IMPORTANT: Understand the Structure
6
+
7
+ **Workspace** (where you will work):
8
+ ```
9
+ <orchestrator>/.sessions/<ISSUE-ID>/
10
+ ├── repo-1/ # worktree with branch feature/<ISSUE-ID>
11
+ ├── repo-2/ # worktree with branch feature/<ISSUE-ID>
12
+ ├── context.md # context (immutable - created by this command)
13
+ ├── architecture.md # architecture (immutable - created by this command)
14
+ └── plan.md # plan (mutable - created by /plan)
15
+ ```
16
+
17
+ **Main repositories** (read-only):
18
+ ```
19
+ {base_path}/repo-1/ # main repo (branch main/master)
20
+ {base_path}/repo-2/ # main repo (branch main/master)
21
+ ```
22
+
23
+ **GOLDEN RULE**:
24
+ - ✅ Read metaspecs and code from main repositories (read-only)
25
+ - ✅ Create `context.md` and `architecture.md` in `.sessions/<ISSUE-ID>/`
26
+ - ❌ NEVER checkout main repositories
27
+ - ❌ NEVER modify code in this command (use `/work` afterwards)
28
+
29
+ ## 📚 Load MetaSpecs
30
+
31
+ **Automatically locate MetaSpecs**:
32
+ 1. Read `context-manifest.json` from the orchestrator
33
+ 2. Find the repository with `"role": "metaspecs"`
34
+ 3. Read `ai.properties.md` to get the `base_path`
35
+ 4. The metaspecs are at: `{base_path}/{metaspecs-repo-id}/`
36
+ 5. Read the relevant `index.md` files:
37
+ - Business context
38
+ - Stack, architecture, and technical patterns
39
+ - Project conventions
40
+ - ADRs (Architecture Decision Records)
41
+
42
+ ## 🎯 Project Context
43
+
44
+ Before starting, load the context by consulting:
45
+ - `context-manifest.json` - Repository structure
46
+ - MetaSpecs (located above) - Architecture and patterns
47
+ - `workspace directory` - Current workspace information
48
+
49
+ ## ⚙️ Initial Setup
50
+
51
+ 1. **Verify Workspace**:
52
+ - Confirm you are in the correct workspace (check `workspace directory`)
53
+ - List repositories available in the workspace
54
+
55
+ 2. **Verify Branches**:
56
+ - For each repository in the workspace, check the current branch
57
+ - Confirm all branches are synchronized
58
+
59
+ 3. **Load Specification**:
60
+ - **If task manager configured**: Read the issue using the appropriate MCP
61
+ - **Otherwise**: Ask the user for the specification file or feature description
62
+
63
+ 4. **Update Status** (if task manager configured):
64
+ - Move the issue to "In Progress"
65
+
66
+ ## 📋 Analysis and Understanding
67
+
68
+ Analyze the specification and build a complete understanding by answering:
69
+
70
+ ### Business
71
+ - **Why** is this being built?
72
+ - **Who** benefits?
73
+ - **Which** metric do we want to impact?
74
+
75
+ ### Functional
76
+ - **What is the expected outcome**? (user behavior, system output)
77
+ - **Which components** will be created/modified in each repository?
78
+ - **Which integrations** between repositories are necessary?
79
+
80
+ ### Technical
81
+ - **Approved stack**? Check against technical specifications
82
+ - **Architectural patterns**? Check ADRs (if available)
83
+ - **New dependencies**? Justify and document
84
+ - **How to test**? (according to project standards)
85
+
86
+ ### Validation against MetaSpecs
87
+
88
+ If metaspecs are available, validate:
89
+ - Aligned with strategy and roadmap?
90
+ - Uses approved technology stack?
91
+ - Respects Architecture Decision Records?
92
+ - Follows documented business rules?
93
+
94
+ ## 🤔 Clarification Questions
95
+
96
+ After initial analysis, formulate **3-5 most important clarifications**:
97
+
98
+ **Examples of relevant questions**:
99
+ - Which repository should contain the main logic?
100
+ - How should the repositories communicate?
101
+ - Are there dependencies between changes in different repos?
102
+ - What is the recommended implementation order?
103
+ - Is there any impact on APIs or contracts between services?
104
+
105
+ ## 💾 Creation of Context.md
106
+
107
+ **IMPORTANT**: This file is **IMMUTABLE** after approval. It must not be modified by subsequent commands.
108
+
109
+ Create the file `./.sessions/<ISSUE-ID>/context.md` with:
110
+
111
+ ```markdown
112
+ # Context: [Feature Name]
113
+
114
+ ## Why
115
+ [Business value, persona served, impacted metric]
116
+
117
+ ## What
118
+ [Main functionalities, expected behavior]
119
+
120
+ ## How
121
+ [Technical approach, components, affected repositories]
122
+
123
+ ## Validation against MetaSpecs
124
+ - [x] Aligned with product strategy
125
+ - [x] Serves correct persona
126
+ - [x] Impacted metric documented
127
+ - [x] Uses approved stack
128
+ - [x] Respects ADRs
129
+ - [x] No conflicts with known limitations
130
+
131
+ ## Dependencies
132
+ [Libraries, APIs, existing components]
133
+
134
+ ## Constraints
135
+ [Technical limitations, performance targets, budget]
136
+
137
+ ## Tests
138
+ [Critical E2E, required unit tests, expected coverage]
139
+ ```
140
+
141
+ **After creating `context.md`, request user review and approval before proceeding.**
142
+
143
+ ---
144
+
145
+ ## 🏗️ Creation of Architecture.md
146
+
147
+ **IMPORTANT**: This file is **IMMUTABLE** after approval. It must not be modified by subsequent commands.
148
+
149
+ ### Architectural Principles (MANDATORY)
150
+
151
+ **BEFORE creating the architecture, you MUST:**
152
+
153
+ 1. **Read ADRs (Architecture Decision Records)**:
154
+ - List ADRs in metaspecs
155
+ - Read ALL ADRs relevant to the feature
156
+ - Identify constraints and mandatory patterns
157
+
158
+ 2. **Consult architectural patterns**:
159
+ - Read project structure guides in metaspecs
160
+ - Read code patterns in metaspecs
161
+ - Identify existing patterns in code (use Glob/Grep to find similar examples)
162
+
163
+ 3. **Validate compliance with ADRs**:
164
+ - For each relevant ADR, verify if the proposed solution respects the decisions
165
+ - Document compliance in architecture.md
166
+ - If there is violation, justify or propose correction
167
+
168
+ 4. **Analyze existing code**:
169
+ - Use Glob/Grep to find similar components/modules
170
+ - Understand existing patterns and structures
171
+ - Align new implementation with project standards
172
+
173
+ ### Architecture Document Structure
174
+
175
+ Create the file `./.sessions/<ISSUE-ID>/architecture.md` with:
176
+
177
+ ```markdown
178
+ # Architecture: [Feature Name]
179
+
180
+ ## Overview
181
+ [High-level view of the system before and after the change]
182
+
183
+ ## Affected Components
184
+ [List of components and their relationships, dependencies]
185
+
186
+ ### Component Diagram
187
+ [Textual description or Mermaid diagram of components]
188
+
189
+ ### Data Flow
190
+ 1. [Step 1 of the flow]
191
+ 2. [Step 2 of the flow]
192
+ 3. [Step 3 of the flow]
193
+
194
+ ## Proposed Directory Structure
195
+ [Based on project patterns]
196
+
197
+ ```
198
+ repo-1/
199
+ ├── src/
200
+ │ ├── components/
201
+ │ │ └── NewComponent.tsx (CREATE)
202
+ │ └── services/
203
+ │ └── NewService.ts (CREATE)
204
+ ```
205
+
206
+ ## Patterns and Best Practices
207
+ [Patterns that will be maintained or introduced]
208
+
209
+ ## ADR Validation
210
+ [List of consulted ADRs and compliance]
211
+
212
+ - [x] ADR-001: [Name] - Compliant
213
+ - [x] ADR-002: [Name] - Compliant
214
+
215
+ ## External Dependencies
216
+ [Libraries that will be used or added]
217
+
218
+ ## Technical Decisions
219
+
220
+ ### Decision 1: [Title]
221
+ **Context**: [Why we need to decide this]
222
+ **Options considered**:
223
+ - Option A: [Pros and cons]
224
+ - Option B: [Pros and cons]
225
+ **Decision**: [Chosen option]
226
+ **Justification**: [Why we chose this option]
227
+
228
+ ## Constraints and Assumptions
229
+ [Technical limitations and assumptions]
230
+
231
+ ## Trade-offs
232
+ [Alternatives considered and why they were not chosen]
233
+
234
+ ## Consequences
235
+ **Positive**:
236
+ - [Benefit 1]
237
+ - [Benefit 2]
238
+
239
+ **Negative**:
240
+ - [Cost/limitation 1]
241
+ - [Cost/limitation 2]
242
+
243
+ ## Main Files
244
+ [List of main files to be edited/created]
245
+
246
+ - `repo-1/src/components/NewComponent.tsx` (CREATE)
247
+ - `repo-1/src/services/NewService.ts` (CREATE)
248
+ - `repo-2/src/controllers/NewController.ts` (CREATE)
249
+ ```
250
+
251
+ **After creating `architecture.md`, request user review and approval before proceeding.**
252
+
253
+ ---
254
+
255
+ **Provided arguments**:
256
+
257
+ ```
258
+ #$ARGUMENTS
259
+ ```
260
+
261
+ ---
262
+
263
+ ## 🎯 Next Step
264
+
265
+ **After user approval of the files `context.md` and `architecture.md`**:
266
+
267
+ ```bash
268
+ /plan
269
+ ```
270
+
271
+ This command will create the detailed technical implementation plan.
272
+
273
+ ---
274
+
275
+ ## ⚠️ IMPORTANT: Immutable Files
276
+
277
+ **`context.md` and `architecture.md` are IMMUTABLE after approval.**
278
+
279
+ - ✅ They can be READ by subsequent commands (`/plan`, `/work`)
280
+ - ❌ They MUST NOT be MODIFIED by any command
281
+ - ❌ If changes are needed, discuss with the user and create new files or update the issue in the task manager