r2pde-ai 0.1.0 → 0.1.2

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 (46) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/ONBOARDING-QUICKSTART.md +332 -0
  3. package/README.md +414 -373
  4. package/dist/cli.js +2 -97
  5. package/dist/scaffold-guide.yaml +95 -0
  6. package/dist/src/cli.js +140 -0
  7. package/dist/src/commands/contract-create.js +137 -0
  8. package/dist/{commands → src/commands}/doctor.js +2 -2
  9. package/dist/{commands → src/commands}/init.js +95 -22
  10. package/dist/src/commands/manifest-create.js +133 -0
  11. package/dist/{commands/manifesto-delete.js → src/commands/manifest-delete.js} +9 -9
  12. package/dist/{commands → src/commands}/requirement-create.js +68 -29
  13. package/dist/{commands → src/commands}/reset.js +1 -1
  14. package/dist/src/commands/scaffold-create.js +139 -0
  15. package/dist/src/commands/score-config.test.js +8 -0
  16. package/dist/{commands → src/commands}/score.js +1 -1
  17. package/dist/{commands → src/commands}/wave-prompt.js +3 -3
  18. package/dist/src/core/ai/adapter-factory.test.js +27 -0
  19. package/dist/{core → src/core}/ai/mock-adapter.js +1 -1
  20. package/dist/src/core/config.test.js +42 -0
  21. package/dist/{core → src/core}/paths.js +1 -1
  22. package/dist/src/core/paths.test.js +30 -0
  23. package/dist/{core → src/core}/scorer.js +5 -5
  24. package/dist/src/core/scorer.test.js +93 -0
  25. package/dist/templates/contract.template.md +9 -0
  26. package/dist/templates/manifest.template.md +24 -0
  27. package/dist/templates/requirement.template.md +9 -0
  28. package/package.json +31 -7
  29. package/readme.txt +49 -0
  30. package/scaffold-guide.yaml +95 -0
  31. package/dist/commands/contract-create.js +0 -101
  32. package/dist/commands/manifesto-create.js +0 -93
  33. package/dist/templates/manifesto.template.md +0 -15
  34. /package/dist/{commands → src/commands}/config-lang.js +0 -0
  35. /package/dist/{commands → src/commands}/config-set.js +0 -0
  36. /package/dist/{commands → src/commands}/contract-delete.js +0 -0
  37. /package/dist/{commands → src/commands}/logs.js +0 -0
  38. /package/dist/{commands → src/commands}/requirement-delete.js +0 -0
  39. /package/dist/{commands → src/commands}/score-config.js +0 -0
  40. /package/dist/{core → src/core}/ai/adapter-factory.js +0 -0
  41. /package/dist/{core → src/core}/ai/ai-adapter.js +0 -0
  42. /package/dist/{core → src/core}/ai/api-adapter.js +0 -0
  43. /package/dist/{core → src/core}/config.js +0 -0
  44. /package/dist/{core → src/core}/git.js +0 -0
  45. /package/dist/{core → src/core}/logger.js +0 -0
  46. /package/dist/{index.js → src/index.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -13,7 +13,7 @@ This project adheres to [Semantic Versioning](https://semver.org).
13
13
  ### Added
14
14
  - `init` command — interactive project initialization with full .r2pde-ai structure
15
15
  - `doctor` command — environment health check
16
- - `manifesto:create` / `manifesto:delete` — manifesto artifact management
16
+ - `manifest:create` / `manifest:delete` — manifest artifact management
17
17
  - `contract:create` / `contract:delete` — contract artifact management
18
18
  - `requirement:create` / `requirement:delete` — requirement artifact management
19
19
  - `score` / `score:config` — quality score engine with traffic light system
@@ -0,0 +1,332 @@
1
+ # Corporate Agenda Quickstart Guide
2
+
3
+ > **Build a Professional Corporate Agenda App with User Management and Calendar Sync (Outlook & Google) using r2pde-ai**
4
+
5
+ This guide simulates a real, detailed journey to create a robust corporate agenda application, with fully filled-out examples, best practices, and step-by-step CLI usage. Use it as a reference, inspiration, or onboarding material for your team.
6
+
7
+ ---
8
+
9
+
10
+ ## 1. Project Initialization
11
+
12
+ ```bash
13
+ mkdir corporate-agenda
14
+ cd corporate-agenda
15
+
16
+ # Initialize npm (creates package.json)
17
+ npm init -y
18
+
19
+ # Initialize git
20
+ git init
21
+
22
+ # Initialize r2pde-ai
23
+ r2pde-ai init
24
+ ```
25
+
26
+ **Recommended answers for prompts:**
27
+ - Project name: `Corporate Agenda`
28
+ - Project type: `Dashboard`
29
+ - Architecture: `Monolith`
30
+ - Code pattern: `Clean Code`
31
+ - Maturity: `Production`
32
+ - Language for artifacts: `English`
33
+
34
+ ---
35
+
36
+ ## 2. Environment Health Check
37
+
38
+ ```bash
39
+ r2pde-ai doctor
40
+ ```
41
+
42
+ ---
43
+
44
+ ## 3. Defining Manifests (Guiding Principles)
45
+
46
+ ### 3.1 UI Principles
47
+ ```bash
48
+ r2pde-ai manifest:create
49
+ ```
50
+ - Name: `UI Principles`
51
+ - Scope: `UI`
52
+ - Description: `All user interfaces must be intuitive, responsive, and accessible. Mobile-first design is mandatory. Consistent color palette and typography across all screens.`
53
+ - Change type: `feat`
54
+
55
+ ### 3.2 Security Philosophy
56
+ ```bash
57
+ r2pde-ai manifest:create
58
+ ```
59
+ - Name: `Security Philosophy`
60
+ - Scope: `Security`
61
+ - Description: `User data privacy is a core value. All authentication and sensitive operations must use secure protocols. No passwords or tokens are ever logged.`
62
+ - Change type: `feat`
63
+
64
+ ### 3.3 Integration Policy
65
+ ```bash
66
+ r2pde-ai manifest:create
67
+ ```
68
+ - Name: `Integration Policy`
69
+ - Scope: `Integration`
70
+ - Description: `All third-party calendar integrations must use OAuth2, respect user consent, and provide clear opt-in/out. No data is shared without explicit permission.`
71
+ - Change type: `feat`
72
+
73
+ ---
74
+
75
+ ## 4. Defining Contracts (Non-negotiable Rules)
76
+
77
+ ### 4.1 API Security
78
+ ```bash
79
+ r2pde-ai contract:create
80
+ ```
81
+ - Name: `API Security`
82
+ - Type: `Security`
83
+ - Enforcement: `Mandatory`
84
+ - Description: `All API endpoints require JWT authentication. Tokens must be validated on every request. No endpoint exposes sensitive data without proper authorization.`
85
+ - Change type: `feat`
86
+
87
+ ### 4.2 Calendar Sync Consistency
88
+ ```bash
89
+ r2pde-ai contract:create
90
+ ```
91
+ - Name: `Calendar Sync Consistency`
92
+ - Type: `Integration`
93
+ - Enforcement: `Mandatory`
94
+ - Description: `All events must be synced bidirectionally with Outlook and Google calendars. Conflicts are resolved using last-write-wins. Sync failures are logged and retried automatically.`
95
+ - Change type: `feat`
96
+
97
+ ### 4.3 User Data Protection
98
+ ```bash
99
+ r2pde-ai contract:create
100
+ ```
101
+ - Name: `User Data Protection`
102
+ - Type: `Security`
103
+ - Enforcement: `Mandatory`
104
+ - Description: `All user data is encrypted at rest and in transit. No sensitive data is stored in logs or analytics. Data retention policies comply with LGPD/GDPR.`
105
+ - Change type: `feat`
106
+
107
+ ---
108
+
109
+ ## 5. Defining Requirements (Functional, Non-functional, Business)
110
+
111
+ ### 5.1 User Registration
112
+ ```bash
113
+ r2pde-ai requirement:create
114
+ ```
115
+ - Name: `User Registration`
116
+ - Type: `Functional`
117
+ - Priority: `High`
118
+ - Description: `Allow new users to register with email, password, and full name. Email verification is required before first login.`
119
+ - Change type: `feat`
120
+ - Acceptance criteria:
121
+ - Registration form with email, password, full name
122
+ - Email format and password strength validation
123
+ - Verification email sent on registration
124
+ - User cannot log in before verifying email
125
+
126
+ ### 5.2 User Login
127
+ ```bash
128
+ r2pde-ai requirement:create
129
+ ```
130
+ - Name: `User Login`
131
+ - Type: `Functional`
132
+ - Priority: `High`
133
+ - Description: `Registered users can log in using email and password. JWT is issued on successful login. Failed attempts are rate-limited.`
134
+ - Change type: `feat`
135
+ - Acceptance criteria:
136
+ - Login form with email and password
137
+ - JWT issued on success
138
+ - 5 failed attempts lock account for 10 minutes
139
+
140
+ ### 5.3 Calendar Event CRUD
141
+ ```bash
142
+ r2pde-ai requirement:create
143
+ ```
144
+ - Name: `Calendar Event CRUD`
145
+ - Type: `Functional`
146
+ - Priority: `High`
147
+ - Description: `Users can create, read, update, and delete calendar events. Events have title, description, start/end time, location, and attendees.`
148
+ - Change type: `feat`
149
+ - Acceptance criteria:
150
+ - Event list and detail views
151
+ - Create/edit/delete event forms
152
+ - Validation for overlapping events
153
+
154
+ ### 5.4 Outlook Calendar Sync
155
+ ```bash
156
+ r2pde-ai requirement:create
157
+ ```
158
+ - Name: `Outlook Calendar Sync`
159
+ - Type: `Integration`
160
+ - Priority: `High`
161
+ - Description: `Users can connect their Outlook account. Events are synced both ways. OAuth2 is used for authentication.`
162
+ - Change type: `feat`
163
+ - Acceptance criteria:
164
+ - Connect Outlook button
165
+ - OAuth2 consent flow
166
+ - Events appear in both systems within 1 minute
167
+
168
+ ### 5.5 Google Calendar Sync
169
+ ```bash
170
+ r2pde-ai requirement:create
171
+ ```
172
+ - Name: `Google Calendar Sync`
173
+ - Type: `Integration`
174
+ - Priority: `High`
175
+ - Description: `Users can connect their Google account. Events are synced both ways. OAuth2 is used for authentication.`
176
+ - Change type: `feat`
177
+ - Acceptance criteria:
178
+ - Connect Google button
179
+ - OAuth2 consent flow
180
+ - Events appear in both systems within 1 minute
181
+
182
+ ### 5.6 Responsive UI
183
+ ```bash
184
+ r2pde-ai requirement:create
185
+ ```
186
+ - Name: `Responsive UI`
187
+ - Type: `Non-functional`
188
+ - Priority: `High`
189
+ - Description: `The application must be fully usable on desktop, tablet, and mobile. All screens adapt to different resolutions.`
190
+ - Change type: `feat`
191
+ - Acceptance criteria:
192
+ - Layout adapts to screen size
193
+ - Touch-friendly controls
194
+ - No horizontal scroll on mobile
195
+
196
+ ### 5.7 Data Encryption at Rest
197
+ ```bash
198
+ r2pde-ai requirement:create
199
+ ```
200
+ - Name: `Data Encryption at Rest`
201
+ - Type: `Non-functional`
202
+ - Priority: `High`
203
+ - Description: `All user and event data is encrypted in the database. Encryption keys are rotated every 90 days.`
204
+ - Change type: `feat`
205
+ - Acceptance criteria:
206
+ - All sensitive fields encrypted
207
+ - Key rotation policy documented
208
+
209
+ ---
210
+
211
+ ## 6. Review and Adjust Artifacts
212
+
213
+ - Edit `.r2pde-ai/manifests/`, `.r2pde-ai/contracts/`, `.r2pde-ai/requirements/` for clarity, completeness, and compliance.
214
+ - Use `changeType: fix` for corrections (e.g. bug, logic adjustment) and `improve` for enhancements (e.g. extra validation, better UX).
215
+ - Example: To add password complexity, run `r2pde-ai requirement:create` and use changeType `improve`.
216
+
217
+ ---
218
+
219
+ ## 7. Generating Project Context and Prompt
220
+
221
+ ```bash
222
+ r2pde-ai wave:prompt
223
+ ```
224
+ - Select the current wave (start with Framework, then Architecture, Core, etc.)
225
+ - Copy the generated prompt and paste it into GitHub Copilot or your AI assistant.
226
+ - The prompt will include all artifacts and their changeType, guiding the AI to generate code aligned with your intent.
227
+
228
+ ---
229
+
230
+ ## 8. Implementation and Iteration
231
+
232
+ - Use the AI-generated code as a starting point.
233
+ - As new needs arise, repeat steps 3–7 to add or refine artifacts.
234
+ - Use `r2pde-ai score` to check project health and resolve warnings or errors.
235
+ - All changes are logged in `.r2pde-ai/logs/` for traceability.
236
+
237
+ ---
238
+
239
+ ## 9. Best Practices
240
+
241
+ - Keep artifacts up to date and versioned in git.
242
+ - Use `changeType` to clarify the intent of each change for both humans and AI.
243
+ - Prefer small, incremental waves for easier review and rollback.
244
+ - Review the audit log regularly.
245
+ - Involve stakeholders in reviewing artifacts.
246
+ - Use API mode for optimized prompts if available.
247
+
248
+ ---
249
+
250
+ ## 10. Going Further
251
+
252
+ - Add contracts for compliance (e.g. LGPD/GDPR, audit logging).
253
+ - Integrate CI/CD to validate artifacts before deploy.
254
+ - Expand requirements for notifications, recurring events, analytics.
255
+ - Consult GUIDE.md and README.md for detailed explanations and examples.
256
+
257
+ ---
258
+
259
+ **Suggested file name:** `CORPORATE-AGENDA-QUICKSTART.md`
260
+
261
+ This guide is your realistic and complete playbook for building a professional corporate agenda with r2pde-ai. Copy, paste, and answer each prompt to get the most out of the framework. Share it with your team to evangelize best practices and accelerate adoption!
262
+
263
+ ---
264
+
265
+ # Onboarding Quickstart Guide: Corporate Agenda Example
266
+
267
+ This guide demonstrates, step by step, how to use `r2pde-ai` to bootstrap a real-world corporate agenda application. All commands are ready to copy and paste.
268
+
269
+ ---
270
+
271
+ ## 1. Create and initialize your project
272
+
273
+ ```bash
274
+ mkdir agenda-app && cd agenda-app
275
+ npm init -y
276
+ ```
277
+
278
+ ## 2. Initialize git
279
+
280
+ ```bash
281
+ git init
282
+ ```
283
+
284
+ ## 3. Initialize r2pde-ai
285
+
286
+ ```bash
287
+ r2pde-ai init
288
+ ```
289
+
290
+ ## 4. Check environment health
291
+
292
+ ```bash
293
+ r2pde-ai doctor
294
+ ```
295
+
296
+ ## 5. Create guiding manifests
297
+
298
+ ```bash
299
+ r2pde-ai manifest:create
300
+ r2pde-ai manifest:create
301
+ r2pde-ai manifest:create
302
+ ```
303
+
304
+ ## 6. Create contracts
305
+
306
+ ```bash
307
+ r2pde-ai contract:create
308
+ r2pde-ai contract:create
309
+ r2pde-ai contract:create
310
+ ```
311
+
312
+ ## 7. Create requirements
313
+
314
+ ```bash
315
+ r2pde-ai requirement:create
316
+ r2pde-ai requirement:create
317
+ r2pde-ai requirement:create
318
+ r2pde-ai requirement:create
319
+ r2pde-ai requirement:create
320
+ r2pde-ai requirement:create
321
+ r2pde-ai requirement:create
322
+ ```
323
+
324
+ ## 8. Evaluate quality score
325
+
326
+ ```bash
327
+ r2pde-ai score
328
+ ```
329
+
330
+ ---
331
+
332
+ > All commands above are non-destructive and can be run multiple times. Artifacts are versioned and tracked in git.