sublime_pkg_tools 0.0.13

Package and version management toolkit for Node.js projects with changeset support
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
# sublime_pkg_tools - Implementation Plan

**Status**: 📋 Ready for Implementation  
**Version**: 1.0  
**Based on**: CONCEPT.md v1.0  
**Last Updated**: 2024-01-15

---

## Table of Contents

1. [Executive Summary]#executive-summary
2. [Priority Analysis]#priority-analysis
3. [Dependency Graph]#dependency-graph
4. [Implementation Phases]#implementation-phases
5. [Module Structure]#module-structure
6. [Quality Standards]#quality-standards
7. [Testing Strategy]#testing-strategy
8. [Documentation Requirements]#documentation-requirements
9. [Milestones & Timeline]#milestones--timeline
10. [Risk Assessment]#risk-assessment

---

## Executive Summary

### Project Overview

`sublime_pkg_tools` is a comprehensive library for changeset-based package version management in Node.js projects. The implementation is divided into **4 major phases** across **6 core modules**, following strict quality standards (100% test coverage, 100% clippy compliance, 100% documentation).

### Key Success Criteria

- ✅ All modules pass clippy without warnings
- ✅ 100% test coverage (unit + integration)
- ✅ 100% API documentation with examples
- ✅ Zero `unwrap()`, `expect()`, `todo!()`, `panic!()`, `unimplemented!()`
- ✅ All errors implement `AsRef<str>`
- ✅ Internal visibility uses `pub(crate)` consistently
- ✅ Follows patterns from `sublime_standard_tools`

### Estimated Timeline

- **Phase 1**: 2-3 weeks (Foundation)
- **Phase 2**: 3-4 weeks (Core Functionality)
- **Phase 3**: 2-3 weeks (Advanced Features)
- **Phase 4**: 1-2 weeks (Integration & Polish)
- **Total**: 8-12 weeks

---

## Priority Analysis

### Critical Path (Must Have - Phase 1 & 2)

1. **Configuration System** - Foundation for all modules
2. **Error Handling** - Required by everything
3. **Core Types** - Data structures used across modules
4. **Versioning** - Core business logic
5. **Changesets** - Core workflow management

### High Priority (Phase 2 & 3)

6. **Changes Analysis** - Required for intelligent versioning
7. **Dependency Graph** - Required for propagation
8. **Changelog Generation** - Release workflow completion

### Medium Priority (Phase 3 & 4)

9. **Dependency Upgrades** - Enhancement feature
10. **Audit** - Aggregation and reporting

### Priority Rationale

```
Configuration & Errors (P0)
Core Types & Version Resolution (P1)
Changesets + Changes Analysis (P1-P2)
Changelog Generation (P2)
Upgrades + Audit (P3)
```

**Why this order:**
- **Config first**: Everything needs configuration
- **Errors early**: Required by all modules for proper error handling
- **Types & Versioning**: Core business logic that others depend on
- **Changesets**: Central to the workflow
- **Changes**: Provides intelligence for versioning decisions
- **Changelog**: Completes the release workflow
- **Upgrades & Audit**: Enhancement features that aggregate others

---

## Dependency Graph

### Module Dependencies

```mermaid
graph TD
    Config[Configuration]
    Error[Error Handling]
    Types[Core Types]
    
    Version[Versioning]
    Changeset[Changesets]
    Changes[Changes Analysis]
    Changelog[Changelog Generation]
    Upgrades[Dependency Upgrades]
    Audit[Audit & Health]
    
    Config --> Error
    Config --> Types
    
    Error --> Version
    Error --> Changeset
    Error --> Changes
    Error --> Changelog
    Error --> Upgrades
    Error --> Audit
    
    Types --> Version
    Types --> Changeset
    Types --> Changes
    
    Version --> Changelog
    Version --> Audit
    
    Changeset --> Changes
    Changeset --> Changelog
    Changeset --> Audit
    
    Changes --> Changelog
    Changes --> Audit
    
    Changelog --> Audit
    
    Upgrades --> Changeset
    Upgrades --> Audit
    
    Version -.-> Upgrades
    Changes -.-> Upgrades
```

### External Dependencies

```
sublime_pkg_tools
├─ sublime_standard_tools (filesystem, monorepo, config)
├─ sublime_git_tools (git operations)
├─ package-json (parsing)
├─ semver (version comparison)
├─ regex (conventional commits)
└─ tokio, serde, chrono, thiserror (standard)
```

---

## Implementation Phases

## Phase 1: Foundation (Weeks 1-3)

### Objective
Establish the foundational infrastructure that all other modules depend on.

### Deliverables

#### 1.1 Project Setup & Structure
- [ ] Initialize crate structure following `sublime_standard_tools` patterns
- [ ] Configure `Cargo.toml` with dependencies
- [ ] Setup `lib.rs` with crate-level documentation and clippy rules
- [ ] Create `mod.rs` files for each module (export-only, no implementation)

**Files to create:**
```
crates/pkg/
├── Cargo.toml
├── src/
│   ├── lib.rs                    # Crate root with version()
│   ├── config/
│   │   └── mod.rs               # Export only
│   ├── error/
│   │   └── mod.rs               # Export only
│   └── types/
│       └── mod.rs               # Export only
```

#### 1.2 Error Handling Module
- [ ] Define `Error` enum with all error variants
- [ ] Implement `AsRef<str>` for all error types
- [ ] Create domain-specific error types:
  - [ ] `ConfigError`
  - [ ] `VersionError`
  - [ ] `ChangesetError`
  - [ ] `ChangesError`
  - [ ] `ChangelogError`
  - [ ] `UpgradeError`
  - [ ] `AuditError`
- [ ] Implement error context and recovery strategies
- [ ] Write comprehensive error tests

**Files:**
```
src/error/
├── mod.rs                       # Exports and Error enum
├── config.rs                    # ConfigError
├── version.rs                   # VersionError
├── changeset.rs                 # ChangesetError
├── changes.rs                   # ChangesError
├── changelog.rs                 # ChangelogError
├── upgrade.rs                   # UpgradeError
├── audit.rs                     # AuditError
└── tests.rs                     # Error tests
```

**Quality Gates:**
- ✅ All errors implement `Display`, `Debug`, `Error`
- ✅ All errors implement `AsRef<str>`
- ✅ 100% test coverage on error creation and conversion
- ✅ Clippy clean

#### 1.3 Configuration System
- [ ] Define `PackageToolsConfig` struct
- [ ] Implement sub-configs:
  - [ ] `ChangesetConfig`
  - [ ] `VersionConfig`
  - [ ] `DependencyConfig`
  - [ ] `GitConfig`
  - [ ] `ChangelogConfig`
  - [ ] `UpgradeConfig`
  - [ ] `AuditConfig`
- [ ] Implement `Configurable` trait from standard tools
- [ ] TOML/YAML/JSON deserialization
- [ ] Environment variable overrides
- [ ] Default implementations
- [ ] Configuration validation

**Files:**
```
src/config/
├── mod.rs                       # PackageToolsConfig export
├── types.rs                     # Main config structs
├── changeset.rs                 # ChangesetConfig
├── version.rs                   # VersionConfig + DependencyConfig
├── git.rs                       # GitConfig
├── changelog.rs                 # ChangelogConfig
├── upgrade.rs                   # UpgradeConfig
├── audit.rs                     # AuditConfig
├── validation.rs                # Config validation logic
└── tests.rs                     # Config tests
```

**Quality Gates:**
- ✅ All configs have sensible defaults
- ✅ Validation logic prevents invalid configurations
- ✅ Environment variables work correctly
- ✅ Integration with `sublime_standard_tools::config::ConfigManager`
- ✅ 100% test coverage

#### 1.4 Core Types
- [ ] Define `Version` struct with semver parsing
- [ ] Define `VersionBump` enum
- [ ] Define `VersioningStrategy` enum
- [ ] Define `PackageInfo` struct
- [ ] Define `Changeset` struct
- [ ] Implement serialization/deserialization
- [ ] Implement Display traits

**Files:**
```
src/types/
├── mod.rs                       # Export all types
├── version.rs                   # Version, VersionBump, VersioningStrategy
├── package.rs                   # PackageInfo
├── changeset.rs                 # Changeset, ArchivedChangeset
├── dependency.rs                # DependencyType, etc.
└── tests.rs                     # Type tests
```

**Quality Gates:**
- ✅ All types implement required traits (Clone, Debug, Serialize, Deserialize)
- ✅ Version parsing handles all semver cases
- ✅ 100% test coverage

### Phase 1 Exit Criteria
- ✅ All foundation modules compile
- ✅ Clippy passes without warnings
- ✅ 100% test coverage on all Phase 1 modules
- ✅ Documentation complete with examples
- ✅ Integration tests pass with `sublime_standard_tools`

---

## Phase 2: Core Functionality (Weeks 4-7)

### Objective
Implement the core business logic for versioning and changesets.

### Deliverables

#### 2.1 Versioning Module
- [ ] Implement `VersionResolver` with monorepo/single-package detection
- [ ] Version resolution with dry-run support
- [ ] Dependency propagation logic
- [ ] Circular dependency detection
- [ ] Snapshot version generation
- [ ] Package.json reading/writing using `sublime_standard_tools`

**Files:**
```
src/version/
├── mod.rs                       # Export VersionResolver
├── resolver.rs                  # VersionResolver implementation
├── resolution.rs                # VersionResolution types
├── propagation.rs               # Dependency propagation logic
├── graph.rs                     # DependencyGraph
├── snapshot.rs                  # Snapshot version generation
└── tests/
    ├── mod.rs
    ├── resolver_tests.rs
    ├── propagation_tests.rs
    └── snapshot_tests.rs
```

**Key APIs:**
```rust
impl VersionResolver {
    pub async fn new(workspace_root: &Path, config: VersionConfig) -> Result<Self>;
    pub async fn resolve_versions(&self, changeset: &Changeset) -> Result<VersionResolution>;
    pub async fn apply_versions(&self, changeset: &Changeset, dry_run: bool) -> Result<ApplyResult>;
}
```

**Quality Gates:**
- ✅ Handles both monorepo and single-package
- ✅ Circular dependency detection works correctly
- ✅ Propagation follows configured rules
- ✅ Dry-run mode doesn't modify files
- ✅ Rollback on partial failure
- ✅ 100% test coverage with mock filesystem

#### 2.2 Changesets Module
- [ ] Implement `ChangesetManager` for CRUD operations
- [ ] File-based storage with `FileSystemManager`
- [ ] Changeset history and archiving
- [ ] Git integration for commit detection
- [ ] Changeset validation

**Files:**
```
src/changeset/
├── mod.rs                       # Export ChangesetManager
├── manager.rs                   # ChangesetManager implementation
├── storage.rs                   # ChangesetStorage trait + FileBasedStorage
├── history.rs                   # ChangesetHistory
├── git_integration.rs           # Git commit detection
└── tests/
    ├── mod.rs
    ├── manager_tests.rs
    ├── storage_tests.rs
    └── history_tests.rs
```

**Key APIs:**
```rust
impl ChangesetManager {
    pub async fn create(&self, branch: &str, bump: VersionBump) -> Result<Changeset>;
    pub async fn load(&self, branch: &str) -> Result<Changeset>;
    pub async fn update(&self, branch: &str, updates: ChangesetUpdate) -> Result<UpdateSummary>;
    pub async fn add_commits_from_git(&self, branch: &str, commit_range: &str) -> Result<UpdateSummary>;
    pub async fn archive(&self, branch: &str, release_info: ReleaseInfo) -> Result<()>;
}
```

**Quality Gates:**
- ✅ Atomic file operations
- ✅ Concurrent access handling
- ✅ Git integration works correctly
- ✅ Archive/history queryable
- ✅ 100% test coverage

#### 2.3 Changes Analysis Module
- [ ] Implement `ChangesAnalyzer` with git integration
- [ ] File-to-package mapping
- [ ] Commit-to-package association
- [ ] Working directory analysis
- [ ] Commit range analysis
- [ ] Version preview calculation

**Files:**
```
src/changes/
├── mod.rs                       # Export ChangesAnalyzer
├── analyzer.rs                  # ChangesAnalyzer implementation
├── report.rs                    # ChangesReport types
├── package_changes.rs           # PackageChanges
├── file_change.rs               # FileChange types
├── commit_info.rs               # CommitInfo
├── mapping.rs                   # File-to-package mapping
├── stats.rs                     # Statistics calculation
└── tests/
    ├── mod.rs
    ├── analyzer_tests.rs
    └── mapping_tests.rs
```

**Key APIs:**
```rust
impl ChangesAnalyzer {
    pub async fn new(workspace_root: PathBuf) -> Result<Self>;
    pub async fn analyze_working_directory(&self) -> Result<ChangesReport>;
    pub async fn analyze_commit_range(&self, base: &str, head: &str) -> Result<ChangesReport>;
    pub async fn analyze_with_versions(&self, base: &str, head: &str, changeset: &Changeset) -> Result<ChangesReport>;
}
```

**Quality Gates:**
- ✅ Correctly maps files to packages in monorepo
- ✅ Handles multi-package commits
- ✅ Version calculation accurate
- ✅ Works with both staged and unstaged changes
- ✅ 100% test coverage with mock git repo

### Phase 2 Exit Criteria
- ✅ Core versioning workflow complete
- ✅ Changesets create, update, archive correctly
- ✅ Changes analysis provides accurate package information
- ✅ Integration between modules works
- ✅ All quality gates passed
- ✅ Documentation complete

---

## Phase 3: Advanced Features (Weeks 8-10)

### Objective
Implement changelog generation and dependency upgrades.

### Deliverables

#### 3.1 Changelog Generation Module
- [ ] Implement `ChangelogGenerator`
- [ ] Conventional commits parser
- [ ] Keep a Changelog formatter
- [ ] Custom template support
- [ ] Existing changelog parser
- [ ] Git tag detection and version comparison
- [ ] Merge commit message generation

**Files:**
```
src/changelog/
├── mod.rs                       # Export ChangelogGenerator
├── generator.rs                 # ChangelogGenerator implementation
├── changelog.rs                 # Changelog types
├── section.rs                   # ChangelogSection
├── entry.rs                     # ChangelogEntry
├── conventional.rs              # ConventionalCommit parser
├── parser.rs                    # Existing changelog parser
├── formatter/
│   ├── mod.rs
│   ├── keep_a_changelog.rs
│   ├── conventional.rs
│   └── custom.rs
└── tests/
    ├── mod.rs
    ├── generator_tests.rs
    ├── conventional_tests.rs
    └── formatter_tests.rs
```

**Key APIs:**
```rust
impl ChangelogGenerator {
    pub async fn new(workspace_root: PathBuf, config: ChangelogConfig) -> Result<Self>;
    pub async fn generate_for_version(&self, package: Option<&str>, version: &str, prev: Option<&str>) -> Result<Changelog>;
    pub async fn generate_from_changeset(&self, changeset: &Changeset, resolution: &VersionResolution) -> Result<Vec<GeneratedChangelog>>;
    pub async fn update_changelog(&self, path: &Path, changelog: &Changelog, dry_run: bool) -> Result<String>;
}

impl ConventionalCommit {
    pub fn parse(message: &str) -> Result<Self, ParseError>;
    pub fn section_type(&self) -> SectionType;
    pub fn extract_references(&self) -> Vec<String>;
}
```

**Quality Gates:**
- ✅ Conventional commit parsing handles all cases
- ✅ Breaking change detection accurate
- ✅ Multiple formats supported
- ✅ Merge commit messages generated correctly
- ✅ 100% test coverage

#### 3.2 Dependency Upgrades Module
- [ ] Implement `UpgradeManager`
- [ ] Registry client with .npmrc support
- [ ] Upgrade detection with version classification
- [ ] Dry-run and apply with rollback
- [ ] Automatic changeset creation
- [ ] Concurrent registry queries

**Files:**
```
src/upgrade/
├── mod.rs                       # Export UpgradeManager
├── manager.rs                   # UpgradeManager implementation
├── registry/
│   ├── mod.rs
│   ├── client.rs               # RegistryClient
│   ├── npmrc.rs                # .npmrc parsing
│   └── metadata.rs             # PackageMetadata types
├── detection.rs                 # Upgrade detection
├── apply.rs                     # Apply upgrades
├── backup.rs                    # Backup and rollback
├── types.rs                     # UpgradePreview, etc.
└── tests/
    ├── mod.rs
    ├── manager_tests.rs
    ├── registry_tests.rs
    └── apply_tests.rs
```

**Key APIs:**
```rust
impl UpgradeManager {
    pub async fn new(workspace_root: PathBuf, config: UpgradeConfig) -> Result<Self>;
    pub async fn detect_upgrades(&self, options: DetectionOptions) -> Result<UpgradePreview>;
    pub async fn apply_upgrades(&self, selection: UpgradeSelection, dry_run: bool) -> Result<UpgradeResult>;
    pub async fn rollback_last(&self) -> Result<Vec<PathBuf>>;
}
```

**Quality Gates:**
- ✅ Registry queries work (with mock server for tests)
- ✅ .npmrc parsing correct
- ✅ Backup/rollback reliable
- ✅ Automatic changeset creation
- ✅ 100% test coverage

### Phase 3 Exit Criteria
- ✅ Changelog generation works for all formats
- ✅ Dependency upgrades detect and apply correctly
- ✅ Integration with changesets works
- ✅ All quality gates passed

---

## Phase 4: Integration & Polish (Weeks 11-12)

### Objective
Complete the audit module, integration testing, and final polish.

### Deliverables

#### 4.1 Audit Module
- [ ] Implement `AuditManager` aggregating all modules
- [ ] Upgrade audit section
- [ ] Dependency audit section
- [ ] Breaking changes audit section
- [ ] Categorization section
- [ ] Version consistency section
- [ ] Health score calculation
- [ ] Report formatting (Markdown, JSON)

**Files:**
```
src/audit/
├── mod.rs                       # Export AuditManager
├── manager.rs                   # AuditManager implementation
├── report.rs                    # AuditReport types
├── sections/
│   ├── mod.rs
│   ├── upgrades.rs
│   ├── dependencies.rs
│   ├── breaking_changes.rs
│   ├── categorization.rs
│   └── version_consistency.rs
├── issue.rs                     # AuditIssue types
├── formatter.rs                 # Report formatters
├── health_score.rs              # Health score calculation
└── tests/
    ├── mod.rs
    ├── manager_tests.rs
    └── sections_tests.rs
```

**Key APIs:**
```rust
impl AuditManager {
    pub async fn new(workspace_root: PathBuf, config: AuditConfig) -> Result<Self>;
    pub async fn run_audit(&self) -> Result<AuditReport>;
    pub async fn audit_upgrades(&self) -> Result<UpgradeAuditSection>;
    pub async fn audit_dependencies(&self) -> Result<DependencyAuditSection>;
    pub async fn categorize_dependencies(&self) -> Result<DependencyCategorization>;
}
```

**Quality Gates:**
- ✅ Aggregates data from all modules correctly
- ✅ Health score calculation accurate
- ✅ Report formats valid (Markdown, JSON)
- ✅ 100% test coverage

#### 4.2 Integration Testing
- [ ] End-to-end workflow tests
- [ ] Monorepo integration tests
- [ ] Single-package integration tests
- [ ] Cross-module integration tests
- [ ] Performance benchmarks

**Files:**
```
tests/
├── integration/
│   ├── mod.rs
│   ├── workflow_tests.rs       # Full release workflow
│   ├── monorepo_tests.rs       # Monorepo scenarios
│   ├── single_package_tests.rs # Single package scenarios
│   └── upgrade_workflow_tests.rs
├── fixtures/
│   ├── monorepo_sample/
│   └── single_package_sample/
└── common/
    ├── mod.rs
    └── test_helpers.rs
```

#### 4.3 Documentation & Examples
- [ ] Complete API documentation
- [ ] Usage examples for each module
- [ ] Integration examples
- [ ] Migration guides
- [ ] Performance notes

**Files:**
```
examples/
├── 01_basic_changeset.rs
├── 02_version_resolution.rs
├── 03_changelog_generation.rs
├── 04_dependency_upgrades.rs
├── 05_audit_report.rs
└── 06_full_release_workflow.rs

docs/
├── guides/
│   ├── getting-started.md
│   ├── monorepo-guide.md
│   └── ci-cd-integration.md
└── architecture/
    ├── overview.md
    └── module-interactions.md
```

### Phase 4 Exit Criteria
- ✅ Audit module complete
- ✅ All integration tests pass
- ✅ Documentation complete
- ✅ Examples working
- ✅ Performance acceptable
- ✅ Ready for production use

---

## Module Structure

### File Organization Pattern

Following `sublime_standard_tools` conventions:

```
src/
├── lib.rs                          # Crate root, version(), clippy rules
├── config/
│   ├── mod.rs                      # Exports only
│   ├── types.rs                    # Core config types
│   ├── [domain].rs                 # Domain configs
│   ├── validation.rs               # Validation logic
│   └── tests.rs                    # Tests
├── error/
│   ├── mod.rs                      # Error enum + exports
│   ├── [domain].rs                 # Domain errors
│   └── tests.rs                    # Error tests
├── types/
│   ├── mod.rs                      # Type exports
│   ├── [type_group].rs             # Related types
│   └── tests.rs                    # Type tests
├── [module]/
│   ├── mod.rs                      # Module exports
│   ├── [main_struct].rs            # Primary implementation
│   ├── [supporting].rs             # Supporting types/logic
│   └── tests/                      # Module tests
│       ├── mod.rs
│       └── [test_category].rs
└── tests/                          # Integration tests (separate)
```

### Visibility Rules

```rust
// Public API - exported from crate
pub struct PublicType { ... }
pub fn public_api() { ... }

// Internal to crate - shared between modules
pub(crate) struct InternalType { ... }
pub(crate) fn internal_helper() { ... }

// Private to module
struct PrivateType { ... }
fn private_helper() { ... }

// Private to struct (if fields need encapsulation)
pub struct TypeWithPrivateFields {
    pub(crate) shared_field: String,  // Accessible within crate
    private_field: String,             // Only within module
}
```

### mod.rs Pattern

```rust
//! # Module Name
//!
//! ## What
//! Brief description of module purpose
//!
//! ## How
//! How the module achieves its purpose
//!
//! ## Why
//! Why this design was chosen

// Internal modules
mod implementation;
mod supporting_types;

#[cfg(test)]
mod tests;

// Re-exports (public API)
pub use implementation::{PublicStruct, PublicTrait};
pub use supporting_types::PublicEnum;

// Internal re-exports (for crate use)
pub(crate) use implementation::InternalHelper;
```

### lib.rs Pattern

```rust
//! # `sublime_pkg_tools`
//!
//! ## What
//! Comprehensive package management toolkit for Node.js projects
//!
//! ## How
//! [Architecture description]
//!
//! ## Why
//! [Rationale]
//!
//! ## Quick Start
//! [Examples]

#![doc = include_str!("../CONCEPT.md")]
#![warn(missing_docs)]
#![warn(rustdoc::missing_crate_level_docs)]
#![deny(unused_must_use)]
#![deny(clippy::unwrap_used)]
#![deny(clippy::expect_used)]
#![deny(clippy::todo)]
#![deny(clippy::unimplemented)]
#![deny(clippy::panic)]

pub mod audit;
pub mod changeset;
pub mod changelog;
pub mod changes;
pub mod config;
pub mod error;
pub mod types;
pub mod upgrade;
pub mod version;

/// Version of the crate
pub const VERSION: &str = env!("CARGO_PKG_VERSION");

/// Returns the version of the crate
#[must_use]
pub fn version() -> &'static str {
    VERSION
}
```

---

## Quality Standards

### Clippy Rules (Mandatory)

All code must pass these clippy rules:

```rust
#![warn(missing_docs)]
#![warn(rustdoc::missing_crate_level_docs)]
#![deny(unused_must_use)]
#![deny(clippy::unwrap_used)]
#![deny(clippy::expect_used)]
#![deny(clippy::todo)]
#![deny(clippy::unimplemented)]
#![deny(clippy::panic)]
```

**Enforcement:**
```bash
cargo clippy --all-targets --all-features -- -D warnings
```

### Code Quality Checklist

For every module/file:

- [ ] Module-level documentation (What, How, Why)
- [ ] All public items documented with examples
- [ ] All functions have doc comments
- [ ] All structs/enums documented with field descriptions
- [ ] Examples in documentation compile and run
- [ ] No `unwrap()` or `expect()` calls
- [ ] No `todo!()`, `unimplemented!()`, `panic!()`
- [ ] All `Result` types used correctly
- [ ] Errors implement `AsRef<str>`
- [ ] Internal types use `pub(crate)`
- [ ] Tests in separate files/modules

### Error Handling Pattern

```rust
/// Domain-specific error type
#[derive(Debug, Clone, thiserror::Error)]
pub enum DomainError {
    #[error("Specific error: {reason}")]
    SpecificError { reason: String },
    
    #[error("Nested error: {0}")]
    Nested(#[from] OtherError),
}

impl AsRef<str> for DomainError {
    fn as_ref(&self) -> &str {
        match self {
            DomainError::SpecificError { .. } => "DomainError::SpecificError",
            DomainError::Nested(_) => "DomainError::Nested",
        }
    }
}

pub type DomainResult<T> = Result<T, DomainError>;
```

### Documentation Pattern

```rust
/// Brief one-line description
///
/// Detailed description explaining:
/// - What this does
/// - When to use it
/// - Important considerations
///
/// # Arguments
///
/// * `arg1` - Description of first argument
/// * `arg2` - Description of second argument
///
/// # Returns
///
/// Description of return value
///
/// # Errors
///
/// This function will return an error if:
/// - Condition 1
/// - Condition 2
///
/// # Examples
///
/// ```
/// use sublime_pkg_tools::module::Function;
///
/// let result = Function::new("value")?;
/// assert_eq!(result.field, "value");
/// ```
///
/// # Panics
///
/// This function will panic if... (only if unavoidable)
pub fn function_name(arg1: &str, arg2: usize) -> Result<Type, Error> {
    // Implementation
}
```

---

## Testing Strategy

### Test Organization

```
src/
└── module/
    ├── mod.rs
    ├── implementation.rs
    └── tests/
        ├── mod.rs              # Test module exports
        ├── unit_tests.rs       # Unit tests
        └── integration_tests.rs # Module integration tests

tests/                          # Crate-level integration tests
├── integration/
│   ├── mod.rs
│   └── workflow_tests.rs
└── fixtures/
    └── test_data/
```

### Test Coverage Requirements

**100% coverage on:**
- All public APIs
- All error paths
- All configuration variations
- All edge cases

**Tools:**
```bash
# Install tarpaulin
cargo install cargo-tarpaulin

# Run coverage
cargo tarpaulin --out Html --output-dir coverage/ --all-features

# Must achieve 100% coverage
```

### Test Categories

#### Unit Tests
- Test individual functions/methods
- Mock external dependencies
- Fast execution (<1ms per test)
- Located in `tests/` submodule

```rust
#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_function_success() {
        let result = function_name("input", 42);
        assert!(result.is_ok());
    }

    #[test]
    fn test_function_error() {
        let result = function_name("", 0);
        assert!(result.is_err());
    }
}
```

#### Integration Tests
- Test module interactions
- Use real filesystem (temp directories)
- Use mock git repositories
- Located in `tests/` directory

```rust
#[tokio::test]
async fn test_full_workflow() {
    let temp_dir = tempfile::tempdir().unwrap();
    // Setup
    // Execute workflow
    // Assert results
}
```

#### Property-Based Tests
- Use `proptest` for property testing
- Test invariants across random inputs
- Especially for versioning and parsing logic

```rust
use proptest::prelude::*;

proptest! {
    #[test]
    fn test_version_parsing(s in "\\d+\\.\\d+\\.\\d+") {
        let version = Version::parse(&s);
        assert!(version.is_ok());
    }
}
```

### Test Data Management

```
tests/fixtures/
├── monorepo/
│   ├── package.json
│   ├── packages/
│   │   ├── pkg1/package.json
│   │   └── pkg2/package.json
│   └── .changesets/
├── single-package/
│   └── package.json
└── configs/
    ├── valid-config.toml
    └── invalid-config.toml
```

### Mock Implementations

Create mock implementations for external dependencies:

```rust
// Mock filesystem for tests
pub(crate) struct MockFileSystem {
    files: HashMap<PathBuf, String>,
}

impl AsyncFileSystem for MockFileSystem {
    async fn read_file_string(&self, path: &Path) -> Result<String> {
        self.files.get(path).cloned()
            .ok_or_else(|| Error::FileNotFound)
    }
    // ... other methods
}

// Mock git repository
pub(crate) struct MockGitRepository {
    commits: Vec<MockCommit>,
}

// Mock registry for upgrade tests
pub(crate) struct MockRegistry {
    packages: HashMap<String, PackageMetadata>,
}
```

---

## Documentation Requirements

### API Documentation (100%)

Every public item must have:
- Summary line
- Detailed description
- Arguments/fields documentation
- Return value description
- Error conditions
- At least one working example
- Links to related items

### Module Documentation

Every module must have:
- What: Purpose and responsibility
- How: Implementation approach
- Why: Design decisions and rationale
- Examples: Usage patterns

### Crate Documentation

`lib.rs` must include:
- Overview of the crate
- Architecture diagram
- Quick start guide
- Links to modules
- Common workflows

### External Documentation

Create in `docs/` directory:
- Getting Started guide
- Architecture overview
- Monorepo guide
- CI/CD integration guide
- Migration guides
- Troubleshooting guide

### Examples

Create runnable examples in `examples/`:
- Basic usage for each module
- Integration patterns
- Full workflows
- Edge cases

Each example must:
- Be self-contained
- Include comments explaining each step
- Show error handling
- Demonstrate best practices

---

## Milestones & Timeline

### Milestone 1: Foundation Complete (End of Week 3)

**Deliverables:**
- [ ] Project structure established
- [ ] Error handling module complete
- [ ] Configuration system complete
- [ ] Core types defined
- [ ] All Phase 1 quality gates passed

**Success Criteria:**
- ✅ Clippy clean
- ✅ 100% test coverage on foundation modules
- ✅ Documentation complete
- ✅ Can load configuration from files
- ✅ All errors implement `AsRef<str>`

### Milestone 2: Core Functionality (End of Week 7)

**Deliverables:**
- [ ] Versioning module complete
- [ ] Changesets module complete
- [ ] Changes analysis module complete
- [ ] Integration between modules working
- [ ] All Phase 2 quality gates passed

**Success Criteria:**
- ✅ Can create and manage changesets
- ✅ Version resolution works for monorepo and single-package
- ✅ Dependency propagation correct
- ✅ Changes analysis accurate
- ✅ Dry-run mode works
- ✅ Integration tests pass

### Milestone 3: Advanced Features (End of Week 10)

**Deliverables:**
- [ ] Changelog generation complete
- [ ] Dependency upgrades complete
- [ ] All Phase 3 quality gates passed

**Success Criteria:**
- ✅ Conventional commits parsed correctly
- ✅ Changelogs generated in multiple formats
- ✅ Dependency upgrades detect and apply
- ✅ Registry integration works
- ✅ Automatic changeset creation

### Milestone 4: Production Ready (End of Week 12)

**Deliverables:**
- [ ] Audit module complete
- [ ] All integration tests pass
- [ ] Documentation complete
- [ ] Examples working
- [ ] Performance benchmarks meet targets
- [ ] All Phase 4 quality gates passed

**Success Criteria:**
- ✅ Health checks comprehensive
- ✅ 100% test coverage overall
- ✅ All clippy rules pass
- ✅ Documentation 100%
- ✅ Ready for v1.0.0 release

---

## Risk Assessment

### High Risk Items

#### 1. Dependency Graph Circular Detection
**Risk**: Complex algorithm, edge cases
**Mitigation**:
- Implement early in Phase 2
- Extensive testing with various graph structures
- Review algorithm with team
- Property-based testing

#### 2. Git Integration Complexity
**Risk**: Different git states, merge conflicts
**Mitigation**:
- Use proven `sublime_git_tools` crate
- Comprehensive test cases
- Handle all git states explicitly
- Clear error messages

#### 3. Registry API Changes
**Risk**: External APIs may change
**Mitigation**:
- Version pinning
- Graceful degradation
- Retry logic with exponential backoff
- Comprehensive error handling

#### 4. Performance in Large Monorepos
**Risk**: Slow operations with many packages
**Mitigation**:
- Early performance testing
- Concurrent operations where possible
- Caching strategies
- Benchmark suite

### Medium Risk Items

#### 1. Configuration Complexity
**Risk**: Too many options, hard to understand
**Mitigation**:
- Sensible defaults
- Configuration validation
- Documentation with examples
- Migration guides

#### 2. Test Coverage
**Risk**: Hard to achieve 100% in some areas
**Mitigation**:
- Mock implementations for external deps
- Property-based testing
- Integration test fixtures
- Regular coverage checks

### Low Risk Items

#### 1. Documentation Maintenance
**Risk**: Docs get outdated
**Mitigation**:
- Doc tests that compile
- Examples as integration tests
- Regular doc reviews

---

## Development Workflow

### Daily Workflow

1. **Pull latest changes**
2. **Create feature branch** from current milestone
3. **Implement feature** following quality standards
4. **Write tests** (aim for 100% coverage)
5. **Run quality checks**:
   ```bash
   cargo fmt
   cargo clippy --all-targets --all-features -- -D warnings
   cargo test --all-features
   cargo tarpaulin --out Html
   cargo doc --no-deps --open
   ```
6. **Commit with conventional commit message**
7. **Push and create PR**

### PR Requirements

Every PR must:
- [ ] Pass all CI checks
- [ ] Have 100% test coverage on changed code
- [ ] Pass clippy without warnings
- [ ] Have complete documentation
- [ ] Include examples if adding new API
- [ ] Update CHANGELOG.md (yes, we eat our own dog food!)
- [ ] Be reviewed by at least one team member

### Conventional Commit Format

```
<type>[optional scope]: <description>

[optional body]

[optional footer(s)]
```

**Types:**
- `feat`: New feature
- `fix`: Bug fix
- `docs`: Documentation only
- `style`: Code style changes
- `refactor`: Code refactoring
- `perf`: Performance improvement
- `test`: Adding tests
- `chore`: Maintenance tasks

**Examples:**
```
feat(version): implement dependency propagation

Add support for propagating version updates through dependency graph.
Handles circular dependencies and respects configuration.

Closes #123
```

---

## CI/CD Pipeline

### GitHub Actions Workflow

```yaml
name: CI

on: [push, pull_request]

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        rust: [stable, nightly]
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.rust }}
      - run: cargo fmt --check
      - run: cargo clippy --all-targets --all-features -- -D warnings
      - run: cargo test --all-features
      - run: cargo doc --no-deps
  
  coverage:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
      - uses: actions-rs/tarpaulin@v0.1
      - name: Upload coverage
        uses: codecov/codecov-action@v1
      - name: Check 100% coverage
        run: |
          COVERAGE=$(cargo tarpaulin --output-format Json | jq '.files[].coverage')
          if [ "$COVERAGE" != "100.0" ]; then
            echo "Coverage is not 100%"
            exit 1
          fi
```

---

## Success Metrics

### Code Metrics
- ✅ 100% test coverage
- ✅ 0 clippy warnings
- ✅ 100% documentation coverage
-<100ms for 95% of operations
-<1s for complex operations (large monorepos)

### Quality Metrics
- ✅ All public APIs documented with examples
- ✅ All errors have clear messages
- ✅ All edge cases tested
- ✅ Cross-platform compatibility verified

### Usability Metrics
- ✅ Getting Started guide takes <15 minutes
- ✅ Common workflows have examples
- ✅ Error messages are actionable
- ✅ Configuration is intuitive

---

## Appendix A: File Checklist

Complete file structure to be created:

```
crates/pkg/
├── Cargo.toml
├── CONCEPT.md (✅ existing)
├── PLAN.md (✅ this file)
├── README.md
├── CHANGELOG.md
│
├── src/
│   ├── lib.rs
│   │
│   ├── config/
│   │   ├── mod.rs
│   │   ├── types.rs
│   │   ├── changeset.rs
│   │   ├── version.rs
│   │   ├── git.rs
│   │   ├── changelog.rs
│   │   ├── upgrade.rs
│   │   ├── audit.rs
│   │   ├── validation.rs
│   │   └── tests.rs
│   │
│   ├── error/
│   │   ├── mod.rs
│   │   ├── config.rs
│   │   ├── version.rs
│   │   ├── changeset.rs
│   │   ├── changes.rs
│   │   ├── changelog.rs
│   │   ├── upgrade.rs
│   │   ├── audit.rs
│   │   └── tests.rs
│   │
│   ├── types/
│   │   ├── mod.rs
│   │   ├── version.rs
│   │   ├── package.rs
│   │   ├── changeset.rs
│   │   ├── dependency.rs
│   │   └── tests.rs
│   │
│   ├── version/
│   │   ├── mod.rs
│   │   ├── resolver.rs
│   │   ├── resolution.rs
│   │   ├── propagation.rs
│   │   ├── graph.rs
│   │   ├── snapshot.rs
│   │   └── tests/
│   │       ├── mod.rs
│   │       ├── resolver_tests.rs
│   │       ├── propagation_tests.rs
│   │       └── snapshot_tests.rs
│   │
│   ├── changeset/
│   │   ├── mod.rs
│   │   ├── manager.rs
│   │   ├── storage.rs
│   │   ├── history.rs
│   │   ├── git_integration.rs
│   │   └── tests/
│   │       ├── mod.rs
│   │       ├── manager_tests.rs
│   │       ├── storage_tests.rs
│   │       └── history_tests.rs
│   │
│   ├── changes/
│   │   ├── mod.rs
│   │   ├── analyzer.rs
│   │   ├── report.rs
│   │   ├── package_changes.rs
│   │   ├── file_change.rs
│   │   ├── commit_info.rs
│   │   ├── mapping.rs
│   │   ├── stats.rs
│   │   └── tests/
│   │       ├── mod.rs
│   │       ├── analyzer_tests.rs
│   │       └── mapping_tests.rs
│   │
│   ├── changelog/
│   │   ├── mod.rs
│   │   ├── generator.rs
│   │   ├── changelog.rs
│   │   ├── section.rs
│   │   ├── entry.rs
│   │   ├── conventional.rs
│   │   ├── parser.rs
│   │   ├── formatter/
│   │   │   ├── mod.rs
│   │   │   ├── keep_a_changelog.rs
│   │   │   ├── conventional.rs
│   │   │   └── custom.rs
│   │   └── tests/
│   │       ├── mod.rs
│   │       ├── generator_tests.rs
│   │       ├── conventional_tests.rs
│   │       └── formatter_tests.rs
│   │
│   ├── upgrade/
│   │   ├── mod.rs
│   │   ├── manager.rs
│   │   ├── registry/
│   │   │   ├── mod.rs
│   │   │   ├── client.rs
│   │   │   ├── npmrc.rs
│   │   │   └── metadata.rs
│   │   ├── detection.rs
│   │   ├── apply.rs
│   │   ├── backup.rs
│   │   ├── types.rs
│   │   └── tests/
│   │       ├── mod.rs
│   │       ├── manager_tests.rs
│   │       ├── registry_tests.rs
│   │       └── apply_tests.rs
│   │
│   └── audit/
│       ├── mod.rs
│       ├── manager.rs
│       ├── report.rs
│       ├── sections/
│       │   ├── mod.rs
│       │   ├── upgrades.rs
│       │   ├── dependencies.rs
│       │   ├── breaking_changes.rs
│       │   ├── categorization.rs
│       │   └── version_consistency.rs
│       ├── issue.rs
│       ├── formatter.rs
│       ├── health_score.rs
│       └── tests/
│           ├── mod.rs
│           ├── manager_tests.rs
│           └── sections_tests.rs
│
├── tests/
│   ├── integration/
│   │   ├── mod.rs
│   │   ├── workflow_tests.rs
│   │   ├── monorepo_tests.rs
│   │   ├── single_package_tests.rs
│   │   └── upgrade_workflow_tests.rs
│   ├── fixtures/
│   │   ├── monorepo_sample/
│   │   └── single_package_sample/
│   └── common/
│       ├── mod.rs
│       └── test_helpers.rs
│
├── examples/
│   ├── 01_basic_changeset.rs
│   ├── 02_version_resolution.rs
│   ├── 03_changelog_generation.rs
│   ├── 04_dependency_upgrades.rs
│   ├── 05_audit_report.rs
│   └── 06_full_release_workflow.rs
│
└── docs/
    ├── guides/
    │   ├── getting-started.md
    │   ├── monorepo-guide.md
    │   └── ci-cd-integration.md
    └── architecture/
        ├── overview.md
        └── module-interactions.md
```

---

## Appendix B: Dependencies

### Cargo.toml

```toml
[package]
name = "sublime_pkg_tools"
version = "0.1.0"
edition = "2021"
authors = ["Your Team"]
license = "MIT OR Apache-2.0"
description = "Changeset-based package version management for Node.js projects"
repository = "https://github.com/yourorg/workspace-tools"
keywords = ["nodejs", "package", "version", "monorepo", "changeset"]
categories = ["development-tools"]

[dependencies]
# Internal crates
sublime_standard_tools = { path = "../standard" }
sublime_git_tools = { path = "../git" }

# Async runtime
tokio = { version = "1", features = ["full"] }
futures = "0.3"

# Serialization
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
toml = "0.8"

# Date/time
chrono = { version = "0.4", features = ["serde"] }

# Error handling
thiserror = "1.0"

# Package management
package-json = "0.2"
semver = "1.0"

# Registry/HTTP
reqwest = { version = "0.11", features = ["json", "rustls-tls"] }
reqwest-retry = "0.3"
reqwest-middleware = "0.2"

# Parsing
regex = "1.10"

[dev-dependencies]
# Testing
tempfile = "3"
proptest = "1"
mockito = "1"
pretty_assertions = "1"

# Coverage
cargo-tarpaulin = "0.27"

[features]
default = []
```

---

## Appendix C: Quality Checklist Template

Use this checklist for each module:

### Module: `__________`

#### Code Quality
- [ ] Module documentation (What, How, Why)
- [ ] All public items documented
- [ ] All functions have doc comments
- [ ] Examples in documentation compile
- [ ] No `unwrap()` or `expect()`
- [ ] No `todo!()`, `unimplemented!()`, `panic!()`
- [ ] Errors implement `AsRef<str>`
- [ ] Uses `pub(crate)` for internal items

#### Testing
- [ ] Unit tests cover all functions
- [ ] Edge cases tested
- [ ] Error paths tested
- [ ] Integration tests written
- [ ] 100% coverage achieved
- [ ] Tests pass on all platforms

#### Review
- [ ] Clippy passes without warnings
- [ ] Code reviewed by peer
- [ ] Documentation reviewed
- [ ] Follows project patterns
- [ ] PR approved and merged

---

## Status: Ready for Implementation

This plan is comprehensive and ready for execution. Each phase has clear deliverables, quality gates, and success criteria. The structure follows proven patterns from `sublime_standard_tools`, and all quality requirements are explicit and measurable.

**Next Steps:**
1. Review and approve this plan
2. Set up project structure
3. Begin Phase 1 implementation
4. Regular check-ins at milestone boundaries

---

**PLAN.md STATUS**: ✅ **COMPLETE** - Ready to begin implementation