proagents 1.6.10 → 1.6.12

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.
@@ -0,0 +1,516 @@
1
+ # Session Tracking & Cross-AI Continuity
2
+
3
+ Commands for maintaining context across AI platforms.
4
+
5
+ ---
6
+
7
+ ## CRITICAL: Auto-Log Every Code Change
8
+
9
+ **AI MUST automatically log EVERY code change IMMEDIATELY after making it.**
10
+
11
+ This is NOT optional. Do NOT wait for user to ask.
12
+
13
+ ### After EVERY file edit/create/delete, AI does:
14
+
15
+ ```
16
+ 1. Prepend to .proagents/changelog/_recent.md
17
+ 2. Update .proagents/worklog/_context.md
18
+ 3. Update .proagents/changelog/modules/[module].md
19
+ 4. Update .proagents/changelog/features/[feature].md (if on feature)
20
+ ```
21
+
22
+ ### Auto-Detect Module from File Path:
23
+
24
+ | File Path | Module |
25
+ |-----------|--------|
26
+ | `src/api/*`, `routes/*` | api |
27
+ | `src/auth/*` | auth |
28
+ | `src/components/*` | ui |
29
+ | `src/services/*` | services |
30
+ | `src/utils/*`, `lib/*` | utils |
31
+ | `tests/*` | tests |
32
+ | `src/database/*` | database |
33
+
34
+ ### Example Flow:
35
+
36
+ ```
37
+ User: Fix the login bug
38
+
39
+ AI: [Reads src/auth/login.ts]
40
+ AI: [Edits file - fixes bug]
41
+ AI: [IMMEDIATELY updates changelogs:]
42
+ - Prepends to changelog/_recent.md
43
+ - Updates changelog/modules/auth.md
44
+ - Updates worklog/_context.md
45
+ AI: "Fixed the login bug in src/auth/login.ts"
46
+ ```
47
+
48
+ ### _recent.md Entry Format:
49
+
50
+ ```markdown
51
+ ### YYYY-MM-DD - [Change Type]
52
+ **Module:** [auto-detected]
53
+ **AI:** [Platform] ([model])
54
+ **Files:** path/file.ts (+lines, -lines)
55
+ **Summary:** Brief description
56
+
57
+ ---
58
+ ```
59
+
60
+ ### Module Changelog Entry Format:
61
+
62
+ ```markdown
63
+ ### YYYY-MM-DD - [AI Platform]
64
+ **Context:** [Feature name or "Bug fix" or "Enhancement"]
65
+ **Files:** path/file.ts (+lines, -lines)
66
+ **Changes:** What was changed
67
+ ```
68
+
69
+ ---
70
+
71
+ ## Commands
72
+
73
+ | Command | Action |
74
+ |---------|--------|
75
+ | `pa:sync` | Load context (AUTO on first command) |
76
+ | `pa:session-start` | Begin work session (AUTO) |
77
+ | `pa:session-end` | End session (AUTO - logs on each change) |
78
+ | `pa:handoff` | Create detailed handoff |
79
+
80
+ ---
81
+
82
+ ## AUTOMATIC Context Loading
83
+
84
+ **User does NOT need to run pa:sync manually.**
85
+
86
+ On FIRST pa: command of any session, AI automatically loads context.
87
+
88
+ ## pa:sync - Load Project Context (AUTOMATIC)
89
+
90
+ **This runs AUTOMATICALLY on first pa: command. User can also run manually.**
91
+
92
+ ### AI Workflow:
93
+
94
+ ```bash
95
+ # 1. Read context summary
96
+ cat .proagents/worklog/_context.md
97
+
98
+ # 2. Read recent changes
99
+ cat .proagents/changelog/_recent.md
100
+
101
+ # 3. Read latest session logs (last 2)
102
+ ls -t .proagents/worklog/*.md | head -3 | xargs cat
103
+
104
+ # 4. Check active features
105
+ cat .proagents/active-features/_index.json
106
+
107
+ # 5. Read activity log
108
+ tail -20 .proagents/activity.log
109
+ ```
110
+
111
+ ### AI Response Format:
112
+
113
+ ```
114
+ ## Project Context Loaded
115
+
116
+ ### Active Work
117
+ - Feature: user-auth (70% complete)
118
+ - Last worked: 2024-03-11 by Claude
119
+
120
+ ### Recent Changes
121
+ 1. Added JWT validation (Claude, Mar 11)
122
+ 2. Fixed login bug (Gemini, Mar 10)
123
+
124
+ ### Pending Tasks
125
+ - [ ] Complete email verification
126
+ - [ ] Add unit tests
127
+
128
+ ### Ready to Continue
129
+ What would you like me to work on?
130
+ ```
131
+
132
+ ---
133
+
134
+ ## pa:session-start - Begin Work Session
135
+
136
+ Creates a new session log file.
137
+
138
+ ### AI Workflow:
139
+
140
+ ```bash
141
+ # Generate session filename
142
+ DATE=$(date '+%Y-%m-%d')
143
+ AI_NAME="claude" # or gemini, chatgpt, etc.
144
+ SESSION_NUM="001" # increment if exists
145
+
146
+ # Create session file
147
+ FILENAME=".proagents/worklog/${DATE}-${AI_NAME}-${SESSION_NUM}.md"
148
+ ```
149
+
150
+ ### Session File Template:
151
+
152
+ ```markdown
153
+ # Work Session: [DATE]-[AI]-[SESSION]
154
+
155
+ **AI Platform:** [Platform] ([Model])
156
+ **Started:** [Timestamp]
157
+ **Duration:** [In progress]
158
+
159
+ ---
160
+
161
+ ## Summary
162
+
163
+ [To be filled at session end]
164
+
165
+ ---
166
+
167
+ ## Tasks Completed
168
+
169
+ [Log each task as completed]
170
+
171
+ ---
172
+
173
+ ## Decisions Made
174
+
175
+ | Decision | Reason |
176
+ |----------|--------|
177
+
178
+ ---
179
+
180
+ ## Files Changed
181
+
182
+ | File | Action | Lines |
183
+ |------|--------|-------|
184
+
185
+ ---
186
+
187
+ ## Next Steps (For Next AI)
188
+
189
+ [To be filled at session end]
190
+ ```
191
+
192
+ ---
193
+
194
+ ## pa:session-end - Finalize Session
195
+
196
+ Updates all tracking files.
197
+
198
+ ### AI Workflow:
199
+
200
+ 1. **Update session log** with summary and next steps
201
+ 2. **Update `_context.md`** with current state
202
+ 3. **Update `_recent.md`** with changes
203
+ 4. **Update feature changelog** if working on feature
204
+ 5. **Update module changelog** for each module touched
205
+ 6. **Log to activity.log**
206
+
207
+ ### Context Update Template:
208
+
209
+ ```markdown
210
+ # Current Project Context
211
+
212
+ Last Updated: [NOW]
213
+ Last AI: [Platform] ([Model])
214
+
215
+ ---
216
+
217
+ ## Active Work
218
+
219
+ - **Feature:** [name] ([phase], [%] complete)
220
+ - Last: [what was done]
221
+ - Next: [what needs doing]
222
+
223
+ ---
224
+
225
+ ## Recent Changes
226
+
227
+ ### [TODAY]
228
+ - [Change 1] - [AI]
229
+ - [Change 2] - [AI]
230
+
231
+ ### [YESTERDAY]
232
+ - [Change 3] - [AI]
233
+
234
+ ---
235
+
236
+ ## Pending Items
237
+
238
+ 1. [ ] [Item from last session's "Next Steps"]
239
+ 2. [ ] [Item 2]
240
+ ```
241
+
242
+ ---
243
+
244
+ ## pa:handoff - Detailed Handoff Notes
245
+
246
+ For major context switches or end of feature.
247
+
248
+ ### Creates: `.proagents/handoff.md`
249
+
250
+ ```markdown
251
+ # Project Handoff
252
+
253
+ Date: [NOW]
254
+ From: [Current AI Platform]
255
+ To: Any AI
256
+
257
+ ---
258
+
259
+ ## Current State
260
+
261
+ ### Completed
262
+ - [List all completed work]
263
+
264
+ ### In Progress
265
+ - [Current work with exact state]
266
+
267
+ ### Not Started
268
+ - [Planned but not begun]
269
+
270
+ ---
271
+
272
+ ## Key Decisions Made
273
+
274
+ | Decision | Reason | Date |
275
+ |----------|--------|------|
276
+ | [Decision] | [Why] | [When] |
277
+
278
+ ---
279
+
280
+ ## Known Issues
281
+
282
+ 1. [Issue description]
283
+ - Status: [open/investigating]
284
+ - Notes: [Any context]
285
+
286
+ ---
287
+
288
+ ## Architecture Notes
289
+
290
+ [Any important architecture decisions or patterns]
291
+
292
+ ---
293
+
294
+ ## File Map
295
+
296
+ Key files and their purposes:
297
+ - `src/auth/` - Authentication logic
298
+ - `src/api/` - API endpoints
299
+
300
+ ---
301
+
302
+ ## How to Continue
303
+
304
+ 1. Run `pa:sync` to load context
305
+ 2. Check `worklog/_context.md` for current state
306
+ 3. Review recent session logs
307
+ 4. Continue from "In Progress" items
308
+
309
+ ---
310
+
311
+ ## Commands History
312
+
313
+ Last 10 commands:
314
+ [From activity.log]
315
+ ```
316
+
317
+ ---
318
+
319
+ ## pa:resume - Quick Resume
320
+
321
+ Fast context loading for returning AI:
322
+
323
+ ```bash
324
+ # AI executes:
325
+ cat .proagents/worklog/_context.md
326
+ cat .proagents/changelog/_recent.md
327
+ ls -t .proagents/worklog/*.md 2>/dev/null | head -2 | tail -1 | xargs cat
328
+ tail -10 .proagents/activity.log
329
+ ```
330
+
331
+ Output:
332
+ ```
333
+ Resume Context
334
+ ══════════════
335
+ Last Session: 2024-03-11 by Claude
336
+ Duration: 45 min
337
+
338
+ What Was Done:
339
+ - Added JWT validation
340
+ - Fixed login bug
341
+
342
+ Pending Tasks:
343
+ 1. [ ] Complete email verification
344
+
345
+ Suggested Next Action:
346
+ → Continue with email verification
347
+ ```
348
+
349
+ ---
350
+
351
+ ## pa:conflict-check - Check File Conflicts
352
+
353
+ Before editing files, check if another AI modified them:
354
+
355
+ ```bash
356
+ grep "Files:.*login.ts" .proagents/changelog/_recent.md
357
+ ```
358
+
359
+ If conflict:
360
+ ```
361
+ ⚠️ CONFLICT WARNING
362
+ File: src/auth/login.ts
363
+ Last modified: 2 hours ago by Gemini
364
+
365
+ Review changes first? [Y/n]
366
+ ```
367
+
368
+ ---
369
+
370
+ ## pa:changelog --from-git
371
+
372
+ Auto-populate changelog from git commits:
373
+
374
+ ```bash
375
+ git log --oneline --since="24 hours ago"
376
+ ```
377
+
378
+ AI parses each commit, detects module from files, extracts issue numbers, and prepends to `_recent.md`.
379
+
380
+ ---
381
+
382
+ ## Issue Linking
383
+
384
+ Auto-detect issue numbers from:
385
+ - User message: "fix #123"
386
+ - Branch: `fix/123-bug`
387
+ - Commit: `Fixes #123`
388
+
389
+ Include in changelog:
390
+ ```markdown
391
+ ### 2024-03-11 - Bug Fix
392
+ **Issue:** #123
393
+ **Closes:** #123
394
+ ```
395
+
396
+ ---
397
+
398
+ ## File-Level Lock
399
+
400
+ Track files being edited:
401
+
402
+ ```bash
403
+ # On edit:
404
+ echo "file.ts|Claude|$(date)" >> .proagents/.active-files
405
+
406
+ # On session end:
407
+ grep -v "|Claude|" .proagents/.active-files > /tmp/af && mv /tmp/af .proagents/.active-files
408
+ ```
409
+
410
+ ---
411
+
412
+ ## Validation Reminder
413
+
414
+ On pa:sync, check if previous session logged properly:
415
+
416
+ ```bash
417
+ # If git shows more changes than changelog:
418
+ echo "⚠️ Previous session may have unlogged changes"
419
+ ```
420
+
421
+ ---
422
+
423
+ ## Automatic Tracking Rules
424
+
425
+ ### After pa:feature "name":
426
+ ```bash
427
+ # Create feature changelog
428
+ touch .proagents/changelog/features/[name].md
429
+
430
+ # Create feature tracking
431
+ mkdir -p .proagents/active-features/feature-[name]
432
+
433
+ # Update _index.json
434
+ # Update _context.md
435
+ ```
436
+
437
+ ### After pa:fix "issue":
438
+ ```bash
439
+ # Log to _recent.md
440
+ # Update relevant module changelog
441
+ # Update _context.md
442
+ ```
443
+
444
+ ### After ANY code change:
445
+ ```bash
446
+ # 1. Identify module from file path
447
+ # 2. Update module changelog
448
+ # 3. Update session log
449
+ # 4. Update _context.md (if significant)
450
+ ```
451
+
452
+ ---
453
+
454
+ ## Module Auto-Detection
455
+
456
+ | File Path Pattern | Module |
457
+ |------------------|--------|
458
+ | `src/api/*`, `routes/*` | api |
459
+ | `src/auth/*`, `**/auth/**` | auth |
460
+ | `src/components/*`, `**/ui/**` | ui |
461
+ | `src/services/*` | services |
462
+ | `src/utils/*`, `lib/*` | utils |
463
+ | `src/database/*`, `**/models/**` | database |
464
+ | `tests/*`, `**/*.test.*` | tests |
465
+
466
+ ---
467
+
468
+ ## Example Session Flow
469
+
470
+ ```
471
+ User: pa:sync
472
+
473
+ AI: [Reads context files]
474
+ Project Context Loaded!
475
+ - Active: user-auth feature (70%)
476
+ - Last: JWT validation added
477
+ - Next: Email verification
478
+
479
+ User: Continue with email verification
480
+
481
+ AI: [Works on task]
482
+ [Creates/updates code]
483
+ [Updates session log]
484
+ [Updates feature changelog]
485
+
486
+ User: pa:session-end
487
+
488
+ AI: [Finalizes session]
489
+ Session Complete!
490
+ - Duration: 45 min
491
+ - Tasks: 2 completed
492
+ - Files: 4 modified
493
+ - Next AI can continue from: [next steps]
494
+
495
+ Updated:
496
+ ✓ worklog/_context.md
497
+ ✓ worklog/2024-03-11-claude-001.md
498
+ ✓ changelog/features/user-auth.md
499
+ ✓ changelog/_recent.md
500
+ ✓ activity.log
501
+ ```
502
+
503
+ ---
504
+
505
+ ## File Locations
506
+
507
+ | File | Purpose |
508
+ |------|---------|
509
+ | `worklog/_context.md` | Quick context for any AI |
510
+ | `worklog/[session].md` | Detailed session logs |
511
+ | `changelog/_recent.md` | Last 10 changes |
512
+ | `changelog/features/*.md` | Per-feature history |
513
+ | `changelog/modules/*.md` | Per-module history |
514
+ | `active-features/_index.json` | Feature status |
515
+ | `activity.log` | Command history |
516
+ | `handoff.md` | Major handoff notes |
@@ -0,0 +1,114 @@
1
+ # Work Session Logs
2
+
3
+ Cross-AI continuity through session-based tracking.
4
+
5
+ ---
6
+
7
+ ## Purpose
8
+
9
+ When multiple AI platforms work on the same project, they need shared context. This directory maintains:
10
+
11
+ 1. **`_context.md`** - Quick summary for any AI starting fresh
12
+ 2. **Session logs** - Detailed record of each work session
13
+ 3. **Continuity** - Next AI knows exactly where to continue
14
+
15
+ ---
16
+
17
+ ## Session Log Format
18
+
19
+ Each session creates: `YYYY-MM-DD-[ai]-[session].md`
20
+
21
+ Example: `2024-03-11-claude-001.md`
22
+
23
+ ```markdown
24
+ # Work Session: 2024-03-11-claude-001
25
+
26
+ **AI Platform:** Claude (opus-4)
27
+ **Started:** 2024-03-11 10:30
28
+ **Duration:** 45 minutes
29
+
30
+ ---
31
+
32
+ ## Summary
33
+
34
+ Brief description of what was accomplished.
35
+
36
+ ---
37
+
38
+ ## Tasks Completed
39
+
40
+ ### 1. [Task Name]
41
+ - **Status:** Completed
42
+ - **Files Modified:**
43
+ - `src/auth/login.ts` - Added validation
44
+ - `src/components/LoginForm.tsx` - UI update
45
+ - **Changes:** Description of changes
46
+ - **Tests:** Added 3 unit tests
47
+
48
+ ### 2. [Task Name]
49
+ ...
50
+
51
+ ---
52
+
53
+ ## Decisions Made
54
+
55
+ | Decision | Reason | Alternatives Considered |
56
+ |----------|--------|------------------------|
57
+ | Used JWT | Industry standard | Session cookies |
58
+ | zxcvbn lib | Lightweight, accurate | custom regex |
59
+
60
+ ---
61
+
62
+ ## Issues Encountered
63
+
64
+ - Issue: API rate limiting
65
+ - Resolution: Added retry logic with backoff
66
+
67
+ ---
68
+
69
+ ## Next Steps (For Next AI)
70
+
71
+ 1. [ ] Connect password meter to signup form
72
+ 2. [ ] Add unit tests for validation
73
+ 3. [ ] Update API documentation
74
+
75
+ ---
76
+
77
+ ## Files Changed Summary
78
+
79
+ | File | Action | Lines |
80
+ |------|--------|-------|
81
+ | src/auth/login.ts | Modified | +25, -5 |
82
+ | src/components/LoginForm.tsx | Modified | +40, -10 |
83
+ | tests/auth.test.ts | Created | +80 |
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Auto-Update Rules
89
+
90
+ After EVERY pa: command that modifies code, AI must:
91
+
92
+ 1. **Update `_context.md`** with current state
93
+ 2. **Create/update session log** for the day
94
+ 3. **Log to `activity.log`** (command only)
95
+
96
+ ---
97
+
98
+ ## Commands
99
+
100
+ | Command | Action |
101
+ |---------|--------|
102
+ | `pa:sync` | Load context, read recent worklogs |
103
+ | `pa:session-start` | Begin new work session |
104
+ | `pa:session-end` | Finalize session, update context |
105
+ | `pa:handoff` | Create detailed handoff notes |
106
+
107
+ ---
108
+
109
+ ## Best Practices
110
+
111
+ 1. **Always run `pa:sync` first** when starting work
112
+ 2. **Log decisions** - Future AI needs to know WHY
113
+ 3. **List next steps** - Make continuation easy
114
+ 4. **Be specific** - File names, line numbers, exact changes
@@ -0,0 +1,43 @@
1
+ # Current Project Context
2
+
3
+ > **For AI Assistants:** Read this file first to understand current state.
4
+ > **Auto-updated** after each code change.
5
+
6
+ Last Updated: [Not yet initialized]
7
+ Last AI: [None]
8
+
9
+ ---
10
+
11
+ ## Active Work
12
+
13
+ No active features yet. Start with `pa:feature "name"` or `pa:fix "issue"`.
14
+
15
+ ---
16
+
17
+ ## Recent Changes
18
+
19
+ No changes recorded yet.
20
+
21
+ ---
22
+
23
+ ## Pending Items
24
+
25
+ None.
26
+
27
+ ---
28
+
29
+ ## Quick Stats
30
+
31
+ | Metric | Value |
32
+ |--------|-------|
33
+ | Active Features | 0 |
34
+ | Completed Today | 0 |
35
+ | Open Issues | 0 |
36
+
37
+ ---
38
+
39
+ ## How to Use
40
+
41
+ 1. **Starting work:** Run `pa:sync` to load this context
42
+ 2. **After code changes:** AI auto-updates this file
43
+ 3. **Check history:** See `./worklog/` for detailed session logs