skillstore-cli 1.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 (231) hide show
  1. package/README.md +95 -0
  2. package/data/bundles/devflow-complete.json +19 -0
  3. package/data/free-skills/devflow-agile/manifest.json +19 -0
  4. package/data/free-skills/devflow-agile/plugin/commands/agile/retro.md +23 -0
  5. package/data/free-skills/devflow-agile/plugin/commands/agile/review.md +21 -0
  6. package/data/free-skills/devflow-agile/plugin/commands/agile/sprint.md +30 -0
  7. package/data/free-skills/devflow-agile/plugin/commands/agile/standup.md +20 -0
  8. package/data/free-skills/devflow-agile/plugin/commands/agile.md +35 -0
  9. package/data/free-skills/devflow-agile/plugin/commands/devflow.md +42 -0
  10. package/data/free-skills/devflow-agile/plugin/skills/developer/SKILL.md +93 -0
  11. package/data/free-skills/devflow-agile/plugin/skills/developer/assets/sample-output.md +182 -0
  12. package/data/free-skills/devflow-agile/plugin/skills/developer/references/clean-architecture.md +361 -0
  13. package/data/free-skills/devflow-agile/plugin/skills/developer/references/clean-code-guide.md +207 -0
  14. package/data/free-skills/devflow-agile/plugin/skills/developer/references/debugging-methodology.md +191 -0
  15. package/data/free-skills/devflow-agile/template/agents/agile-coach.md +76 -0
  16. package/data/free-skills/devflow-agile/template/workflows/agile-sprint-workflow.md +81 -0
  17. package/data/free-skills/devflow-bootstrap/manifest.json +8 -0
  18. package/data/free-skills/devflow-bootstrap/plugin/commands/bootstrap/auto.md +31 -0
  19. package/data/free-skills/devflow-bootstrap/plugin/commands/bootstrap.md +38 -0
  20. package/data/free-skills/devflow-bootstrap/plugin/commands/devflow.md +20 -0
  21. package/data/free-skills/devflow-bootstrap/plugin/skills/project-scaffold/SKILL.md +56 -0
  22. package/data/free-skills/devflow-bootstrap/plugin/skills/project-scaffold/assets/sample-output.md +216 -0
  23. package/data/free-skills/devflow-bootstrap/plugin/skills/project-scaffold/references/architecture-decisions.md +254 -0
  24. package/data/free-skills/devflow-bootstrap/plugin/skills/project-scaffold/references/stack-templates.md +400 -0
  25. package/data/free-skills/devflow-bootstrap/template/agents/bootstrap-specialist.md +56 -0
  26. package/data/free-skills/devflow-bootstrap/template/workflows/bootstrap-workflow.md +70 -0
  27. package/data/free-skills/devflow-docs/manifest.json +8 -0
  28. package/data/free-skills/devflow-docs/plugin/commands/devflow.md +20 -0
  29. package/data/free-skills/devflow-docs/plugin/commands/docs/generate.md +17 -0
  30. package/data/free-skills/devflow-docs/plugin/commands/docs/parse.md +19 -0
  31. package/data/free-skills/devflow-docs/plugin/commands/docs.md +26 -0
  32. package/data/free-skills/devflow-docs/plugin/skills/pdf-processor/SKILL.md +59 -0
  33. package/data/free-skills/devflow-docs/plugin/skills/pdf-processor/assets/sample-output.md +114 -0
  34. package/data/free-skills/devflow-docs/plugin/skills/pdf-processor/references/extraction-techniques.md +115 -0
  35. package/data/free-skills/devflow-docs/plugin/skills/pdf-processor/references/ocr-strategies.md +167 -0
  36. package/data/free-skills/devflow-docs/template/agents/docs-specialist.md +35 -0
  37. package/data/free-skills/devflow-docs/template/workflows/docs-workflow.md +70 -0
  38. package/data/free-skills/devflow-postproject/manifest.json +13 -0
  39. package/data/free-skills/devflow-postproject/plugin/commands/devflow.md +34 -0
  40. package/data/free-skills/devflow-postproject/plugin/commands/postproject/handover.md +21 -0
  41. package/data/free-skills/devflow-postproject/plugin/commands/postproject/retro.md +21 -0
  42. package/data/free-skills/devflow-postproject/plugin/commands/postproject/support.md +21 -0
  43. package/data/free-skills/devflow-postproject/plugin/commands/postproject.md +32 -0
  44. package/data/free-skills/devflow-postproject/plugin/skills/retrospective/SKILL.md +70 -0
  45. package/data/free-skills/devflow-postproject/plugin/skills/retrospective/assets/sample-output.md +79 -0
  46. package/data/free-skills/devflow-postproject/plugin/skills/retrospective/references/facilitation-techniques.md +178 -0
  47. package/data/free-skills/devflow-postproject/plugin/skills/retrospective/references/lessons-learned-template.md +118 -0
  48. package/data/free-skills/devflow-postproject/plugin/skills/retrospective/references/retro-techniques.md +100 -0
  49. package/data/free-skills/devflow-postproject/template/agents/transition-manager.md +71 -0
  50. package/data/free-skills/devflow-postproject/template/workflows/transition-workflow.md +72 -0
  51. package/data/free-skills/devflow-presale/manifest.json +15 -0
  52. package/data/free-skills/devflow-presale/plugin/commands/devflow.md +47 -0
  53. package/data/free-skills/devflow-presale/plugin/commands/presale/analyze.md +30 -0
  54. package/data/free-skills/devflow-presale/plugin/commands/presale/estimate.md +30 -0
  55. package/data/free-skills/devflow-presale/plugin/commands/presale/price.md +30 -0
  56. package/data/free-skills/devflow-presale/plugin/commands/presale/propose.md +30 -0
  57. package/data/free-skills/devflow-presale/plugin/commands/presale.md +42 -0
  58. package/data/free-skills/devflow-presale/plugin/skills/requirement-analysis/SKILL.md +63 -0
  59. package/data/free-skills/devflow-presale/plugin/skills/requirement-analysis/assets/sample-output.md +129 -0
  60. package/data/free-skills/devflow-presale/plugin/skills/requirement-analysis/references/extraction-framework.md +140 -0
  61. package/data/free-skills/devflow-presale/plugin/skills/requirement-analysis/references/output-template.md +132 -0
  62. package/data/free-skills/devflow-presale/template/agents/presale-lead.md +83 -0
  63. package/data/free-skills/devflow-presale/template/agents/proposal-reviewer.md +63 -0
  64. package/data/free-skills/devflow-presale/template/workflows/presale-workflow.md +70 -0
  65. package/data/registry/categories.json +7 -0
  66. package/data/registry/packages.json +184 -0
  67. package/data/shared/framework/agents/brainstormer.md +74 -0
  68. package/data/shared/framework/agents/code-reviewer.md +87 -0
  69. package/data/shared/framework/agents/debugger.md +84 -0
  70. package/data/shared/framework/agents/docs-manager.md +55 -0
  71. package/data/shared/framework/agents/git-manager.md +59 -0
  72. package/data/shared/framework/agents/planner.md +68 -0
  73. package/data/shared/framework/agents/researcher.md +66 -0
  74. package/data/shared/framework/agents/tester.md +65 -0
  75. package/data/shared/framework/commands/cook/auto.md +27 -0
  76. package/data/shared/framework/commands/cook.md +45 -0
  77. package/data/shared/framework/commands/fix/ci.md +21 -0
  78. package/data/shared/framework/commands/fix/test.md +26 -0
  79. package/data/shared/framework/commands/fix/types.md +29 -0
  80. package/data/shared/framework/commands/fix.md +26 -0
  81. package/data/shared/framework/commands/git/cm.md +37 -0
  82. package/data/shared/framework/commands/git/pr.md +40 -0
  83. package/data/shared/framework/config/CLAUDE.md.template +26 -0
  84. package/data/shared/framework/config/settings.json +41 -0
  85. package/data/shared/framework/config/skillstore.config.json +29 -0
  86. package/data/shared/framework/hooks/discord-notify.sh +85 -0
  87. package/data/shared/framework/hooks/docs-sync.sh +53 -0
  88. package/data/shared/framework/hooks/modularization-hook.js +103 -0
  89. package/data/shared/framework/hooks/notification.js +94 -0
  90. package/data/shared/framework/hooks/quality-gate.js +109 -0
  91. package/data/shared/framework/hooks/scout-block.js +77 -0
  92. package/data/shared/framework/hooks/telegram-notify.sh +77 -0
  93. package/data/shared/framework/protocols/error-recovery.md +80 -0
  94. package/data/shared/framework/protocols/orchestration-protocol.md +112 -0
  95. package/data/shared/framework/quality/review-protocol.md +76 -0
  96. package/data/shared/framework/quality/verification-protocol.md +66 -0
  97. package/data/shared/framework/rules/development-rules.md +75 -0
  98. package/data/shared/framework/skills/backend-development/SKILL.md +77 -0
  99. package/data/shared/framework/skills/backend-development/assets/sample-output.md +175 -0
  100. package/data/shared/framework/skills/backend-development/references/advanced-patterns.md +180 -0
  101. package/data/shared/framework/skills/backend-development/references/api-design-guide.md +160 -0
  102. package/data/shared/framework/skills/backend-development/references/architecture-patterns.md +183 -0
  103. package/data/shared/framework/skills/backend-development/references/observability-resilience.md +155 -0
  104. package/data/shared/framework/skills/backend-development/references/troubleshooting.md +199 -0
  105. package/data/shared/framework/skills/codebase-analysis/SKILL.md +72 -0
  106. package/data/shared/framework/skills/codebase-analysis/assets/sample-output.md +263 -0
  107. package/data/shared/framework/skills/codebase-analysis/references/analysis-techniques.md +241 -0
  108. package/data/shared/framework/skills/codebase-analysis/references/dependency-mapping.md +280 -0
  109. package/data/shared/framework/skills/codebase-analysis/references/tech-debt-assessment.md +208 -0
  110. package/data/shared/framework/skills/databases/SKILL.md +72 -0
  111. package/data/shared/framework/skills/databases/assets/sample-output.md +212 -0
  112. package/data/shared/framework/skills/databases/references/advanced-data-patterns.md +259 -0
  113. package/data/shared/framework/skills/databases/references/query-optimization.md +214 -0
  114. package/data/shared/framework/skills/databases/references/schema-design.md +159 -0
  115. package/data/shared/framework/skills/databases/references/troubleshooting.md +214 -0
  116. package/data/shared/framework/skills/debugging-investigation/SKILL.md +84 -0
  117. package/data/shared/framework/skills/debugging-investigation/assets/sample-output.md +314 -0
  118. package/data/shared/framework/skills/debugging-investigation/references/systematic-debugging.md +197 -0
  119. package/data/shared/framework/skills/debugging-investigation/references/tool-specific-guides.md +202 -0
  120. package/data/shared/framework/skills/debugging-investigation/references/troubleshooting-patterns.md +196 -0
  121. package/data/shared/framework/skills/frontend-development/SKILL.md +67 -0
  122. package/data/shared/framework/skills/frontend-development/assets/sample-output.md +110 -0
  123. package/data/shared/framework/skills/frontend-development/references/component-patterns.md +112 -0
  124. package/data/shared/framework/skills/frontend-development/references/performance-guide.md +169 -0
  125. package/data/shared/framework/skills/frontend-development/references/routing-forms-realtime.md +374 -0
  126. package/data/shared/framework/skills/frontend-development/references/ssr-rsc-patterns.md +284 -0
  127. package/data/shared/framework/skills/frontend-development/references/troubleshooting.md +154 -0
  128. package/data/shared/framework/skills/mobile-development/SKILL.md +67 -0
  129. package/data/shared/framework/skills/mobile-development/assets/sample-output.md +382 -0
  130. package/data/shared/framework/skills/mobile-development/references/mobile-patterns.md +681 -0
  131. package/data/shared/framework/skills/mobile-development/references/mobile-performance.md +524 -0
  132. package/data/shared/framework/skills/mobile-development/references/troubleshooting.md +158 -0
  133. package/data/shared/framework/skills/security-audit/SKILL.md +83 -0
  134. package/data/shared/framework/skills/security-audit/assets/sample-output.md +451 -0
  135. package/data/shared/framework/skills/security-audit/references/owasp-checklist.md +580 -0
  136. package/data/shared/framework/skills/security-audit/references/secure-coding-patterns.md +433 -0
  137. package/data/shared/framework/skills/security-audit/references/vulnerability-remediation.md +331 -0
  138. package/data/shared/framework/skills/ui-generation/SKILL.md +70 -0
  139. package/data/shared/framework/skills/ui-generation/assets/sample-output.md +139 -0
  140. package/data/shared/framework/skills/ui-generation/references/accessibility-responsive.md +127 -0
  141. package/data/shared/framework/skills/ui-generation/references/compound-components.md +252 -0
  142. package/data/shared/framework/skills/ui-generation/references/generation-patterns.md +110 -0
  143. package/data/shared/framework/skills/ui-generation/references/storybook-design-system.md +278 -0
  144. package/data/shared/framework/skills/ui-generation/references/troubleshooting.md +198 -0
  145. package/data/shared/framework/workflows/documentation-management.md +58 -0
  146. package/data/shared/framework/workflows/primary-workflow.md +88 -0
  147. package/dist/commands/activate.d.ts +3 -0
  148. package/dist/commands/activate.d.ts.map +1 -0
  149. package/dist/commands/activate.js +34 -0
  150. package/dist/commands/activate.js.map +1 -0
  151. package/dist/commands/bundle.d.ts +3 -0
  152. package/dist/commands/bundle.d.ts.map +1 -0
  153. package/dist/commands/bundle.js +64 -0
  154. package/dist/commands/bundle.js.map +1 -0
  155. package/dist/commands/install.d.ts +3 -0
  156. package/dist/commands/install.d.ts.map +1 -0
  157. package/dist/commands/install.js +99 -0
  158. package/dist/commands/install.js.map +1 -0
  159. package/dist/commands/list.d.ts +3 -0
  160. package/dist/commands/list.d.ts.map +1 -0
  161. package/dist/commands/list.js +37 -0
  162. package/dist/commands/list.js.map +1 -0
  163. package/dist/commands/search.d.ts +3 -0
  164. package/dist/commands/search.d.ts.map +1 -0
  165. package/dist/commands/search.js +30 -0
  166. package/dist/commands/search.js.map +1 -0
  167. package/dist/commands/status.d.ts +3 -0
  168. package/dist/commands/status.d.ts.map +1 -0
  169. package/dist/commands/status.js +35 -0
  170. package/dist/commands/status.js.map +1 -0
  171. package/dist/commands/update.d.ts +3 -0
  172. package/dist/commands/update.d.ts.map +1 -0
  173. package/dist/commands/update.js +68 -0
  174. package/dist/commands/update.js.map +1 -0
  175. package/dist/download/cache.d.ts +3 -0
  176. package/dist/download/cache.d.ts.map +1 -0
  177. package/dist/download/cache.js +18 -0
  178. package/dist/download/cache.js.map +1 -0
  179. package/dist/download/client.d.ts +2 -0
  180. package/dist/download/client.d.ts.map +1 -0
  181. package/dist/download/client.js +58 -0
  182. package/dist/download/client.js.map +1 -0
  183. package/dist/index.d.ts +3 -0
  184. package/dist/index.d.ts.map +1 -0
  185. package/dist/index.js +23 -0
  186. package/dist/index.js.map +1 -0
  187. package/dist/installer/file-copier.d.ts +6 -0
  188. package/dist/installer/file-copier.d.ts.map +1 -0
  189. package/dist/installer/file-copier.js +32 -0
  190. package/dist/installer/file-copier.js.map +1 -0
  191. package/dist/installer/plugin-installer.d.ts +12 -0
  192. package/dist/installer/plugin-installer.d.ts.map +1 -0
  193. package/dist/installer/plugin-installer.js +33 -0
  194. package/dist/installer/plugin-installer.js.map +1 -0
  195. package/dist/installer/template-installer.d.ts +12 -0
  196. package/dist/installer/template-installer.d.ts.map +1 -0
  197. package/dist/installer/template-installer.js +45 -0
  198. package/dist/installer/template-installer.js.map +1 -0
  199. package/dist/license/crypto.d.ts +16 -0
  200. package/dist/license/crypto.d.ts.map +1 -0
  201. package/dist/license/crypto.js +50 -0
  202. package/dist/license/crypto.js.map +1 -0
  203. package/dist/license/license-store.d.ts +19 -0
  204. package/dist/license/license-store.d.ts.map +1 -0
  205. package/dist/license/license-store.js +99 -0
  206. package/dist/license/license-store.js.map +1 -0
  207. package/dist/license/validator.d.ts +32 -0
  208. package/dist/license/validator.d.ts.map +1 -0
  209. package/dist/license/validator.js +81 -0
  210. package/dist/license/validator.js.map +1 -0
  211. package/dist/registry/loader.d.ts +30 -0
  212. package/dist/registry/loader.d.ts.map +1 -0
  213. package/dist/registry/loader.js +22 -0
  214. package/dist/registry/loader.js.map +1 -0
  215. package/dist/registry/search-engine.d.ts +9 -0
  216. package/dist/registry/search-engine.d.ts.map +1 -0
  217. package/dist/registry/search-engine.js +30 -0
  218. package/dist/registry/search-engine.js.map +1 -0
  219. package/dist/utils/config.d.ts +14 -0
  220. package/dist/utils/config.d.ts.map +1 -0
  221. package/dist/utils/config.js +28 -0
  222. package/dist/utils/config.js.map +1 -0
  223. package/dist/utils/logger.d.ts +9 -0
  224. package/dist/utils/logger.d.ts.map +1 -0
  225. package/dist/utils/logger.js +22 -0
  226. package/dist/utils/logger.js.map +1 -0
  227. package/dist/utils/paths.d.ts +20 -0
  228. package/dist/utils/paths.d.ts.map +1 -0
  229. package/dist/utils/paths.js +79 -0
  230. package/dist/utils/paths.js.map +1 -0
  231. package/package.json +54 -0
@@ -0,0 +1,241 @@
1
+ # Analysis Techniques
2
+
3
+ ## Directory Structure Analysis
4
+
5
+ ### Identifying Architectural Patterns
6
+
7
+ Examine the top-level directory layout to determine the architectural style:
8
+
9
+ **Layered Architecture** — organized by technical concern:
10
+ ```
11
+ src/
12
+ controllers/ # HTTP handlers
13
+ services/ # Business logic
14
+ repositories/ # Data access
15
+ models/ # Data structures
16
+ middleware/ # Cross-cutting concerns
17
+ ```
18
+
19
+ **Feature-Based Architecture** — organized by domain feature:
20
+ ```
21
+ src/
22
+ auth/ # Login, registration, tokens
23
+ tasks/ # Task CRUD, assignment
24
+ notifications/ # Email, push, in-app
25
+ shared/ # Common utilities
26
+ ```
27
+
28
+ **Domain-Driven Design** — organized by bounded context:
29
+ ```
30
+ src/
31
+ domains/
32
+ identity/ # User, role, permission
33
+ project/ # Project, milestone
34
+ task/ # Task, subtask, comment
35
+ infrastructure/ # DB, messaging, external APIs
36
+ application/ # Use cases, orchestration
37
+ ```
38
+
39
+ ### Structure Scan Commands
40
+
41
+ ```bash
42
+ # Directory overview (3 levels, directories only)
43
+ tree -L 3 -d
44
+
45
+ # Find all entry points
46
+ find . -name 'index.*' -o -name 'main.*' -o -name 'app.*' | grep -v node_modules
47
+
48
+ # List all package.json files in a monorepo
49
+ find . -name 'package.json' -not -path '*/node_modules/*' -maxdepth 3
50
+
51
+ # Count files per directory (identify large modules)
52
+ find src -type f | sed 's|/[^/]*$||' | sort | uniq -c | sort -rn | head -20
53
+
54
+ # Find configuration files
55
+ find . -maxdepth 2 -name '*.config.*' -o -name '.*.rc' -o -name '.*rc.json' | grep -v node_modules
56
+ ```
57
+
58
+ ## Import/Dependency Graph Traversal
59
+
60
+ ### Tools by Language
61
+
62
+ | Language | Tool | Install | Generate Graph |
63
+ |---|---|---|---|
64
+ | JavaScript/TS | madge | `npm i -g madge` | `madge --image graph.svg src/` |
65
+ | Python | pydeps | `pip install pydeps` | `pydeps mypackage --cluster` |
66
+ | Go | go mod graph | built-in | `go mod graph \| dot -Tsvg -o graph.svg` |
67
+ | Java | jdeps | built-in (JDK) | `jdeps -summary -cp . *.jar` |
68
+ | Rust | cargo-depgraph | `cargo install cargo-depgraph` | `cargo depgraph \| dot -Tsvg -o graph.svg` |
69
+
70
+ ### Reading Dependency Graphs
71
+
72
+ - **Hub nodes** (many incoming edges): core modules everyone depends on — change carefully
73
+ - **Leaf nodes** (many outgoing edges): modules with many dependencies — potential coupling issue
74
+ - **Cycles**: circular arrows between nodes — must be broken for maintainability
75
+ - **Clusters**: groups of tightly connected nodes — natural module boundaries
76
+
77
+ ## Dead Code Detection
78
+
79
+ ### Tools
80
+
81
+ | Tool | Language | What It Finds |
82
+ |---|---|---|
83
+ | knip | JS/TS | Unused files, exports, dependencies, types |
84
+ | ts-prune | TypeScript | Unused exports |
85
+ | vulture | Python | Unused code (functions, variables, imports) |
86
+ | deadcode | Go | Unreachable functions |
87
+
88
+ ### Coverage-Based Detection
89
+
90
+ Files and functions with zero test coverage AND zero runtime usage (from logs/APM) are strong candidates for dead code:
91
+
92
+ ```bash
93
+ # Find files never imported by any other file (JS/TS)
94
+ madge --orphans src/
95
+
96
+ # Find exports not imported anywhere (TypeScript)
97
+ npx ts-prune | grep -v '(used in module)'
98
+
99
+ # Comprehensive unused detection (JS/TS monorepo)
100
+ npx knip
101
+ ```
102
+
103
+ ### Manual Heuristics
104
+
105
+ - Files not modified in 12+ months with zero test coverage
106
+ - Feature flags that have been permanently on/off
107
+ - Commented-out code blocks (should be deleted — git has history)
108
+ - API endpoints with zero traffic in monitoring dashboards
109
+
110
+ ## Complexity Metrics
111
+
112
+ ### Cyclomatic Complexity
113
+
114
+ Measures the number of independent paths through code. Higher = harder to test and understand.
115
+
116
+ | Score | Risk Level | Action |
117
+ |---|---|---|
118
+ | 1-5 | Low | Simple, well-testable |
119
+ | 6-10 | Moderate | Consider refactoring |
120
+ | 11-20 | High | Refactor — hard to test thoroughly |
121
+ | 21+ | Critical | Must refactor — untestable |
122
+
123
+ ```bash
124
+ # ESLint complexity rule (JavaScript/TypeScript)
125
+ npx eslint --rule '{"complexity": ["error", 10]}' src/
126
+
127
+ # Radon for Python
128
+ radon cc src/ -a -nc
129
+
130
+ # gocyclo for Go
131
+ gocyclo -over 10 .
132
+ ```
133
+
134
+ ### Cognitive Complexity
135
+
136
+ Measures how difficult code is to understand (SonarSource metric). Unlike cyclomatic complexity, it penalizes nested control flow more heavily.
137
+
138
+ Key penalties:
139
+ - Each nesting level adds to the score
140
+ - `break`/`continue` with labels add extra
141
+ - Recursion adds a penalty
142
+ - Boolean operator sequences (`a && b || c && d`) add per operator
143
+
144
+ ### Halstead Metrics
145
+
146
+ Volume-based metrics from operator/operand counts:
147
+ - **Difficulty**: how error-prone the code is
148
+ - **Volume**: information content of the code
149
+ - **Effort**: estimated mental effort to understand
150
+
151
+ Useful for comparing relative complexity between modules rather than absolute thresholds.
152
+
153
+ ## File Change Frequency Analysis (Hotspot Detection)
154
+
155
+ Files that change frequently are maintenance hotspots. Combined with complexity, they indicate refactoring priority.
156
+
157
+ ```bash
158
+ # Top 20 most frequently changed files (last 6 months)
159
+ git log --since="6 months ago" --format=format: --name-only | sort | uniq -c | sort -rn | head -20
160
+
161
+ # Change frequency for a specific file
162
+ git log --format='%H' --follow src/services/taskService.ts | wc -l
163
+
164
+ # Files changed together (coupling detection)
165
+ git log --format=format: --name-only | awk 'NF' | sort | uniq -c | sort -rn
166
+
167
+ # Correlate with bug-fix commits
168
+ git log --grep='fix\|bug\|hotfix' --format=format: --name-only | sort | uniq -c | sort -rn | head -20
169
+ ```
170
+
171
+ ### Hotspot Matrix
172
+
173
+ | | Low Change Frequency | High Change Frequency |
174
+ |---|---|---|
175
+ | **Low Complexity** | Stable — leave alone | Active development — monitor |
176
+ | **High Complexity** | Legacy risk — document | **Refactoring priority** |
177
+
178
+ ## Test Coverage Mapping
179
+
180
+ ### Coverage by Module
181
+
182
+ Rather than a single coverage number, break down coverage by module to find gaps:
183
+
184
+ ```bash
185
+ # Jest coverage by directory
186
+ npx jest --coverage --coverageReporters=text | grep -E '^[A-Za-z]'
187
+
188
+ # Python coverage by module
189
+ python -m pytest --cov=src --cov-report=term-missing
190
+
191
+ # Go coverage by package
192
+ go test -coverprofile=coverage.out ./...
193
+ go tool cover -func=coverage.out
194
+ ```
195
+
196
+ ### Coverage vs. Risk Matrix
197
+
198
+ | | Low Coverage | High Coverage |
199
+ |---|---|---|
200
+ | **Low Risk** (internal tools, admin) | Acceptable | Over-invested |
201
+ | **High Risk** (payments, auth, data) | **Dangerous gap** | Appropriate |
202
+
203
+ Focus testing investment on high-risk, low-coverage areas.
204
+
205
+ ## API Surface Analysis
206
+
207
+ ### Public Export Inventory
208
+
209
+ ```bash
210
+ # List all exports in a TypeScript project
211
+ npx ts-prune --skip-types | grep -v '(used in module)'
212
+
213
+ # Find all exported functions/classes in Python
214
+ grep -rn 'def \|class ' --include='*.py' src/ | grep -v '_'
215
+
216
+ # Check what a package exposes
217
+ node -e "console.log(Object.keys(require('./src')))"
218
+ ```
219
+
220
+ ### Backward Compatibility Assessment
221
+
222
+ Check for breaking changes before modifying public APIs:
223
+ - Removed or renamed exports
224
+ - Changed function signatures (new required parameters)
225
+ - Modified return types
226
+ - Changed error types/codes
227
+ - Altered side effects
228
+
229
+ ## Entry Point Tracing
230
+
231
+ Follow a request from entry to database to understand a feature's full path:
232
+
233
+ 1. **HTTP Route** — find the route definition (`app.get('/tasks', ...)`)
234
+ 2. **Controller/Handler** — request parsing, validation, response formatting
235
+ 3. **Middleware** — auth checks, rate limiting, logging
236
+ 4. **Service Layer** — business logic, orchestration
237
+ 5. **Repository/Data Access** — database queries, cache reads
238
+ 6. **External Calls** — third-party APIs, message queues
239
+ 7. **Response** — serialization, status code selection
240
+
241
+ Document this path for critical flows (authentication, payment, data export) to understand blast radius before changes.
@@ -0,0 +1,280 @@
1
+ # Dependency Mapping
2
+
3
+ ## Module Dependency Graphs
4
+
5
+ ### Generating Graphs
6
+
7
+ ```bash
8
+ # JavaScript/TypeScript — visual graph
9
+ madge --image graph.svg src/
10
+ madge --image graph.svg --ts-config tsconfig.json src/
11
+
12
+ # JavaScript/TypeScript — text output
13
+ madge src/ --json > dependencies.json
14
+
15
+ # Include only specific extensions
16
+ madge --extensions ts,tsx src/
17
+
18
+ # Python — visual dependency graph
19
+ pydeps mypackage --cluster --max-bacon 3
20
+
21
+ # Go — module dependency graph
22
+ go mod graph | sed 's/@[^ ]*//g' | sort -u
23
+
24
+ # Monorepo — workspace dependency graph
25
+ npx turbo run build --graph=graph.svg
26
+ ```
27
+
28
+ ### Reading the Graph
29
+
30
+ Key patterns to look for:
31
+
32
+ - **Fan-out modules**: A module that imports 10+ other modules may be doing too much. Consider splitting responsibilities.
33
+ - **Fan-in modules**: A module imported by 10+ others is a core dependency. Changes here have wide blast radius — test thoroughly.
34
+ - **Long chains**: A → B → C → D → E means A is transitively coupled to E. Changes in E can break A unexpectedly.
35
+ - **Islands**: Disconnected clusters may indicate dead code or poorly integrated features.
36
+
37
+ ## Circular Dependency Detection
38
+
39
+ ### Finding Cycles
40
+
41
+ ```bash
42
+ # JavaScript/TypeScript
43
+ madge --circular src/
44
+ madge --circular --ts-config tsconfig.json src/
45
+
46
+ # Python
47
+ pydeps mypackage --show-cycles
48
+
49
+ # Go (no built-in — use import analysis)
50
+ go vet ./... # will flag import cycles
51
+ ```
52
+
53
+ ### Why Circular Dependencies Are Problematic
54
+
55
+ - **Build issues**: bundlers and compilers may produce undefined values or crash
56
+ - **Initialization order**: module A depends on module B's value at import time, but B hasn't finished initializing because it's waiting on A
57
+ - **Tight coupling**: changes in either module may break the other, making independent development impossible
58
+ - **Testing difficulty**: cannot test one module without the other
59
+
60
+ ### Breaking Cycles
61
+
62
+ **Strategy 1: Extract shared code** — move the shared dependency into a third module:
63
+ ```
64
+ Before: A → B → A (cycle)
65
+ After: A → C, B → C (shared module C)
66
+ ```
67
+
68
+ **Strategy 2: Dependency inversion** — depend on interfaces, not implementations:
69
+ ```
70
+ Before: Service → Repository → Service (cycle)
71
+ After: Service → IRepository (interface), Repository implements IRepository
72
+ ```
73
+
74
+ **Strategy 3: Event-based decoupling** — replace direct calls with events:
75
+ ```
76
+ Before: OrderService → NotificationService → OrderService
77
+ After: OrderService emits "order.created", NotificationService subscribes
78
+ ```
79
+
80
+ **Strategy 4: Lazy loading** — defer the import to break the initialization cycle:
81
+ ```typescript
82
+ // Instead of top-level import
83
+ // import { helper } from './moduleB';
84
+
85
+ // Use dynamic import where needed
86
+ async function doWork() {
87
+ const { helper } = await import('./moduleB');
88
+ return helper();
89
+ }
90
+ ```
91
+
92
+ ## External Dependency Audit
93
+
94
+ ### Outdated Packages
95
+
96
+ ```bash
97
+ # npm — list outdated with current, wanted, latest
98
+ npm outdated
99
+
100
+ # npm — major version updates only
101
+ npm outdated | awk '$2 != $4'
102
+
103
+ # Python
104
+ pip list --outdated
105
+
106
+ # Go
107
+ go list -m -u all
108
+ ```
109
+
110
+ ### Vulnerability Scanning
111
+
112
+ ```bash
113
+ # npm built-in audit
114
+ npm audit
115
+ npm audit --production # only production deps
116
+
117
+ # Snyk (more comprehensive)
118
+ npx snyk test
119
+
120
+ # Python
121
+ pip-audit
122
+
123
+ # Go
124
+ govulncheck ./...
125
+
126
+ # Multi-language
127
+ trivy fs .
128
+ ```
129
+
130
+ ### Abandoned Package Detection
131
+
132
+ Signs a package may be abandoned:
133
+ - Last publish date > 2 years ago
134
+ - Open issues > 100 with no maintainer response
135
+ - No commits in 12+ months on the default branch
136
+ - Deprecated notice on npm/PyPI
137
+
138
+ ```bash
139
+ # Check last publish date (npm)
140
+ npm view <package> time.modified
141
+
142
+ # Check open issues count (via GitHub API)
143
+ gh api repos/<owner>/<repo> --jq '.open_issues_count'
144
+
145
+ # Check last commit date
146
+ gh api repos/<owner>/<repo>/commits?per_page=1 --jq '.[0].commit.committer.date'
147
+ ```
148
+
149
+ ### License Compliance
150
+
151
+ ```bash
152
+ # List all licenses in the dependency tree
153
+ npx license-checker --summary
154
+ npx license-checker --failOn 'GPL-2.0;GPL-3.0'
155
+
156
+ # Python
157
+ pip-licenses --format=table
158
+
159
+ # Go
160
+ go-licenses check ./...
161
+ ```
162
+
163
+ Common license categories:
164
+ - **Permissive** (MIT, Apache-2.0, BSD): safe for commercial use
165
+ - **Weak copyleft** (LGPL, MPL): safe if used as a library, not modified
166
+ - **Strong copyleft** (GPL, AGPL): may require open-sourcing your code — consult legal
167
+
168
+ ## Dependency Upgrade Strategy
169
+
170
+ ### Automated Minor/Patch Updates
171
+
172
+ - Use Dependabot or Renovate for automated PRs on minor/patch versions
173
+ - Require CI to pass before auto-merge
174
+ - Group related packages (e.g., all `@babel/*` in one PR)
175
+
176
+ ### Major Version Updates
177
+
178
+ - Review changelog and migration guide before upgrading
179
+ - Check for breaking changes in your usage patterns
180
+ - Upgrade in isolation — one major dependency per PR
181
+ - Run full test suite + manual smoke test
182
+
183
+ ### Lock File Hygiene
184
+
185
+ - Always commit lock files (`package-lock.json`, `yarn.lock`, `poetry.lock`, `go.sum`)
186
+ - Never manually edit lock files — use the package manager commands
187
+ - Periodically regenerate: delete lock file, reinstall, verify tests pass
188
+ - In monorepos, ensure hoisted dependencies don't cause version conflicts
189
+
190
+ ## API Dependency Mapping
191
+
192
+ ### Service-to-Service Dependencies
193
+
194
+ Document which services call which endpoints:
195
+
196
+ | Consumer | Provider | Endpoint | Protocol | Auth |
197
+ |---|---|---|---|---|
198
+ | web-app | api-gateway | /api/v1/* | HTTPS | JWT |
199
+ | api-gateway | user-service | /users/* | gRPC | mTLS |
200
+ | api-gateway | task-service | /tasks/* | gRPC | mTLS |
201
+ | task-service | notification-svc | /notify | AMQP | IAM |
202
+ | notification-svc | email-provider | /v3/mail/send | HTTPS | API Key |
203
+
204
+ ### Contract Testing
205
+
206
+ Verify API contracts between services don't break:
207
+
208
+ ```bash
209
+ # Pact (consumer-driven contract testing)
210
+ npx pact-broker can-i-deploy --pacticipant web-app --version $(git rev-parse HEAD)
211
+
212
+ # OpenAPI diff (detect breaking changes)
213
+ npx openapi-diff old-spec.yaml new-spec.yaml
214
+ ```
215
+
216
+ ## Database Schema Dependencies
217
+
218
+ ### What to Map
219
+
220
+ - **Foreign key relationships**: which tables reference which
221
+ - **Triggers**: hidden logic that fires on INSERT/UPDATE/DELETE
222
+ - **Stored procedures**: business logic living in the database
223
+ - **Views**: virtual tables that depend on underlying table structure
224
+ - **Indexes**: which queries depend on which indexes for performance
225
+
226
+ ### Schema Visualization
227
+
228
+ ```bash
229
+ # PostgreSQL — generate ER diagram
230
+ pg_dump --schema-only mydb | sqlt-diagram
231
+
232
+ # MySQL — schema export
233
+ mysqldump --no-data mydb > schema.sql
234
+
235
+ # Use SchemaSpy for HTML-based documentation
236
+ java -jar schemaspy.jar -t pgsql -db mydb -o docs/schema
237
+ ```
238
+
239
+ ### Migration Dependency Chain
240
+
241
+ Review migration files in order to understand how the schema evolved. Look for:
242
+ - Columns added but never used (dead schema)
243
+ - Tables with no foreign keys (orphaned data)
244
+ - Missing indexes on frequently joined columns
245
+
246
+ ## Shared Library Analysis (Monorepo)
247
+
248
+ ### Which Packages Depend on What
249
+
250
+ ```bash
251
+ # Turborepo — show dependency graph
252
+ npx turbo run build --graph
253
+
254
+ # Lerna — list packages and their dependencies
255
+ npx lerna ls --graph --all
256
+
257
+ # pnpm — list why a package is installed
258
+ pnpm why <package>
259
+
260
+ # Yarn — workspace dependency info
261
+ yarn workspaces info
262
+ ```
263
+
264
+ ### Shared Package Impact
265
+
266
+ When modifying a shared package, identify all consumers:
267
+
268
+ ```bash
269
+ # Find all workspace packages that import from @myorg/shared
270
+ grep -rn '@myorg/shared' --include='package.json' packages/
271
+
272
+ # Check which packages would be affected by a change
273
+ npx turbo run build --filter='@myorg/shared...'
274
+ ```
275
+
276
+ ### Versioning Strategy for Shared Packages
277
+
278
+ - **Fixed versioning**: all packages share the same version number — simpler but forces unnecessary releases
279
+ - **Independent versioning**: each package has its own version — more flexible but harder to coordinate
280
+ - **Recommendation**: use fixed versioning for tightly coupled packages, independent for standalone utilities