agentic-sdlc 1.0.0 → 1.5.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 (227) hide show
  1. package/.agent/ide-integration/INTEGRATION-SUMMARY.md +309 -0
  2. package/.agent/ide-integration/KIRO-IDE.md +381 -0
  3. package/.agent/ide-integration/README.md +256 -209
  4. package/.agent/knowledge-base/AUTO-LEARNING-GUIDE.md +327 -0
  5. package/.agent/knowledge-base/HOW-IT-WORKS.md +365 -0
  6. package/.agent/knowledge-base/INDEX.md +43 -0
  7. package/.agent/knowledge-base/README.md +47 -7
  8. package/.agent/knowledge-base/architecture/KB-2026-01-01-003-neo4j-graph-database-skills.md +1146 -0
  9. package/.agent/knowledge-base/architecture/README.md +98 -0
  10. package/.agent/knowledge-base/bugs/KB-2026-01-02-yaml-special-character-escaping.md +56 -0
  11. package/.agent/knowledge-base/bugs/medium/KB-2026-01-01-001-example-auto-learned.md +198 -0
  12. package/.agent/knowledge-base/features/KB-2026-01-01-001-landing-page-design-trends-2026.md +646 -0
  13. package/.agent/knowledge-base/features/KB-2026-01-01-004-uiux-design-skills-2026.md +945 -0
  14. package/.agent/knowledge-base/features/KB-2026-01-01-005-modern-ai-landing-page-ui.md +310 -0
  15. package/.agent/knowledge-base/features/KB-2026-01-01-006-award-winning-landing-page-patterns.md +324 -0
  16. package/.agent/knowledge-base/features/KB-2026-01-02-001-cleanup-workflow.md +242 -0
  17. package/.agent/knowledge-base/features/KB-2026-01-02-002-landing-page-monorepo-architecture.md +148 -0
  18. package/.agent/knowledge-base/features/KB-2026-01-02-003-premium-glassmorphism-patterns.md +58 -0
  19. package/.agent/knowledge-base/features/KB-2026-01-04-ai-agent-enforcement.md +46 -0
  20. package/.agent/knowledge-base/features/README.md +83 -0
  21. package/.agent/knowledge-base/features/figma-landing-page-workflow.md +311 -0
  22. package/.agent/knowledge-base/features/figma-mcp-sa-guide.md +673 -0
  23. package/.agent/knowledge-base/features/figma-mcp-uiux-guide.md +459 -0
  24. package/.agent/knowledge-base/performance/KB-2026-01-02-lazy-loading-optimization.md +80 -0
  25. package/.agent/knowledge-base/platform-specific/KB-2026-01-02-windows-console-encoding.md +56 -0
  26. package/.agent/knowledge-base/role-guides/DEV-KB-Guide.md +527 -0
  27. package/.agent/knowledge-base/role-guides/DEVOPS-KB-Guide.md +491 -0
  28. package/.agent/knowledge-base/role-guides/PM-KB-Guide.md +299 -0
  29. package/.agent/knowledge-base/role-guides/SECA-KB-Guide.md +555 -0
  30. package/.agent/knowledge-base/role-guides/TESTER-KB-Guide.md +519 -0
  31. package/.agent/knowledge-base/security/KB-2026-01-02-input-validation-sanitization.md +74 -0
  32. package/.agent/rules/AUTO-LEARNING.md +418 -0
  33. package/.agent/rules/ai-enforcement.md +11 -0
  34. package/.agent/rules/artifacts.md +77 -58
  35. package/.agent/rules/git-workflow.md +25 -65
  36. package/.agent/rules/global.md +18 -13
  37. package/.agent/skills/role-ba.md +76 -0
  38. package/.agent/skills/role-brain.md +470 -0
  39. package/.agent/skills/role-dev.md +338 -0
  40. package/.agent/skills/role-devops.md +122 -0
  41. package/.agent/skills/role-orchestrator.md +223 -0
  42. package/.agent/skills/role-pm.md +258 -0
  43. package/.agent/skills/role-po.md +237 -0
  44. package/.agent/skills/role-qa.md +81 -0
  45. package/.agent/skills/role-reporter.md +117 -0
  46. package/.agent/skills/role-sa.md +277 -0
  47. package/.agent/skills/role-seca.md +294 -0
  48. package/.agent/skills/role-stakeholder.md +105 -0
  49. package/.agent/skills/role-tester.md +294 -0
  50. package/.agent/skills/role-uiux.md +264 -0
  51. package/.agent/templates/CHANGELOG-Template.md +83 -0
  52. package/.agent/templates/Knowledge-Entry-Template.md +3 -0
  53. package/.agent/workflows/brain.md +84 -53
  54. package/.agent/workflows/compound.md +51 -0
  55. package/.agent/workflows/cycle.md +61 -0
  56. package/.agent/workflows/emergency.md +114 -0
  57. package/.agent/workflows/explore.md +147 -0
  58. package/.agent/workflows/housekeeping.md +105 -0
  59. package/.agent/workflows/metrics.md +179 -0
  60. package/.agent/workflows/orchestrator.md +68 -0
  61. package/.agent/workflows/preflight.md +35 -0
  62. package/.agent/workflows/release.md +153 -0
  63. package/.agent/workflows/route.md +160 -0
  64. package/.agent/workflows/sprint.md +125 -0
  65. package/.agent/workflows/validate.md +146 -0
  66. package/CHANGELOG.md +349 -6
  67. package/README.md +171 -86
  68. package/bin/CROSS-PLATFORM-CLI.md +526 -0
  69. package/bin/README.md +525 -0
  70. package/bin/cli.js +65 -90
  71. package/bin/kb +34 -0
  72. package/bin/kb.bat +28 -0
  73. package/bin/kb_cli.py +226 -0
  74. package/bin/lib/README.md +411 -0
  75. package/bin/lib/__init__.py +7 -0
  76. package/bin/lib/__pycache__/kb_add.cpython-313.pyc +0 -0
  77. package/bin/lib/__pycache__/kb_common.cpython-313.pyc +0 -0
  78. package/bin/lib/__pycache__/kb_compound.cpython-313.pyc +0 -0
  79. package/bin/lib/__pycache__/kb_index.cpython-313.pyc +0 -0
  80. package/bin/lib/__pycache__/kb_list.cpython-313.pyc +0 -0
  81. package/bin/lib/__pycache__/kb_search.cpython-313.pyc +0 -0
  82. package/bin/lib/__pycache__/kb_stats.cpython-313.pyc +0 -0
  83. package/bin/lib/kb_add.py +203 -0
  84. package/bin/lib/kb_common.py +224 -0
  85. package/bin/lib/kb_compound.py +250 -0
  86. package/bin/lib/kb_index.py +193 -0
  87. package/bin/lib/kb_list.py +144 -0
  88. package/bin/lib/kb_search.py +121 -0
  89. package/bin/lib/kb_stats.py +153 -0
  90. package/docs/AGENT-MANAGEMENT-GUIDE.md +298 -0
  91. package/docs/ARCHITECTURE-OVERVIEW.md +350 -0
  92. package/docs/BRAIN-ARCHITECTURE.md +396 -0
  93. package/docs/COMPOUND-ENGINEERING-SETUP.md +326 -0
  94. package/docs/KNOWLEDGE-BASE-GUIDE.md +330 -0
  95. package/docs/KNOWLEDGE-BASE-SIMPLE.md +248 -0
  96. package/docs/MONOREPO-ARCHITECTURE.md +492 -0
  97. package/docs/PROJECT-DOCUMENTATION-INDEX.md +540 -0
  98. package/docs/SDLC-Diagram.md +235 -0
  99. package/docs/analysis/Workflow-Optimization-Diagram.md +524 -0
  100. package/docs/analysis/Workflows-Deep-Analysis-2026-01-03.md +604 -0
  101. package/docs/architecture/{brain.md → BRAIN.md} +1 -1
  102. package/docs/global/Master-Documentation.md +307 -0
  103. package/docs/global/reports/Final-Approval-Report.md +257 -0
  104. package/docs/guides/AUTO-LEARNING-COMPLETE-GUIDE.md +519 -0
  105. package/docs/guides/AUTO-LEARNING-SYSTEM.md +322 -0
  106. package/docs/guides/LEARNING-FLOW.md +0 -0
  107. package/docs/guides/MCP-QUICK-REFERENCE.md +104 -0
  108. package/docs/guides/MCP-SETUP.md +139 -0
  109. package/docs/guides/QUICK-START.md +4 -0
  110. package/docs/guides/ROLE-COMMUNICATION-SYSTEM.md +71 -0
  111. package/docs/reports/Metrics-Dashboard-2026-01-02.md +66 -0
  112. package/docs/reports/Metrics-Dashboard-2026-01-04.md +68 -0
  113. package/docs/reports/UIUX-Design-Skills-Research-Report-2026.md +91 -0
  114. package/docs/reports/Validation-Report-2026-01-04.md +23 -0
  115. package/docs/research-reports/research-20260103-101315.json +95 -0
  116. package/docs/research-reports/research-20260103-101315.md +78 -0
  117. package/docs/research-reports/research-20260103-183837.json +95 -0
  118. package/docs/research-reports/research-20260103-183837.md +78 -0
  119. package/docs/research-reports/research-20260103-190346.json +100 -0
  120. package/docs/research-reports/research-20260103-190346.md +83 -0
  121. package/docs/setup/{github-management.md → GITHUB-MANAGEMENT.md} +1 -1
  122. package/docs/setup/RESEARCH-AGENT-SETUP.md +575 -0
  123. package/docs/sprints/{sprint-github-issues.md → SPRINT-GITHUB-ISSUES.md} +1 -1
  124. package/docs/sprints/{sprint-leann-integration.md → SPRINT-LEANN-INTEGRATION.md} +1 -1
  125. package/docs/sprints/sprint-1/designs/Backend-Design-Spec-Sprint-1-v1.md +1206 -0
  126. package/docs/sprints/sprint-1/designs/System-Design-Spec-Sprint-1-v1.md +439 -0
  127. package/docs/sprints/sprint-1/designs/System-Design-Spec-v1.0.md +425 -0
  128. package/docs/sprints/sprint-1/designs/UIUX-Design-Spec-Sprint-1-v1.md +55 -0
  129. package/docs/sprints/sprint-1/designs/UIUX-Design-Spec-v1.0.md +644 -0
  130. package/docs/sprints/sprint-1/logs/DevOps-Plan-and-Log-Sprint-1-v1.md +253 -0
  131. package/docs/sprints/sprint-1/logs/Development-Log-Phase1.md +433 -0
  132. package/docs/sprints/sprint-1/logs/Development-Log-Sprint-1-v1.md +181 -0
  133. package/docs/sprints/sprint-1/logs/Development-Log-Sprint-1.md +548 -0
  134. package/docs/sprints/sprint-1/logs/Orchestration-Log-Sprint-1.md +46 -0
  135. package/docs/sprints/sprint-1/logs/Phase1-Summary.md +84 -0
  136. package/docs/sprints/sprint-1/plans/Product-Backlog-Sprint-1-v1.md +40 -0
  137. package/docs/sprints/sprint-1/plans/Product-Backlog-v1.0.md +613 -0
  138. package/docs/sprints/sprint-1/plans/Project-Plan-Sprint-1-v1.0.md +210 -0
  139. package/docs/sprints/sprint-1/plans/Project-Plan-Sprint-1-v1.md +377 -0
  140. package/docs/sprints/sprint-1/reports/Design-Verification-Report-v1.0.md +220 -0
  141. package/docs/sprints/sprint-1/reports/Phase-Report-Sprint-1-v1.md +238 -0
  142. package/docs/sprints/sprint-1/reports/Security-Review-Report-v1.0.md +285 -0
  143. package/docs/sprints/sprint-1/reports/Sprint-Report-Sprint-1.md +74 -0
  144. package/docs/sprints/sprint-1/reports/Test-Report-v1.0.md +346 -0
  145. package/docs/sprints/sprint-1/reviews/Design-Verification-Report.md +508 -0
  146. package/docs/sprints/sprint-1/reviews/Security-Review-Report.md +589 -0
  147. package/docs/sprints/sprint-1/sprint-current/logs/WORKFLOW-CLEANUP-FINAL.md +121 -0
  148. package/docs/sprints/sprint-1/sprint-current/logs/WORKFLOW-OPTIMIZATION-COMPLETE.md +224 -0
  149. package/docs/sprints/sprint-1/sprint-current/logs/Workflow-Optimization-Progress.md +310 -0
  150. package/docs/sprints/sprint-1/sprint-current/logs/Workflow-Optimization-Session-Summary.md +420 -0
  151. package/docs/sprints/sprint-1/sprint-current/plans/Workflow-Optimization-Implementation-Plan.md +1124 -0
  152. package/docs/sprints/sprint-2/SPRINT-SUMMARY.md +150 -0
  153. package/docs/sprints/sprint-2/designs/UIUX-Design-Spec-Sprint-2-v1.md +352 -0
  154. package/docs/sprints/sprint-2/logs/Development-Log-Sprint-2-v1.md +293 -0
  155. package/docs/sprints/sprint-2/plans/Product-Backlog-Sprint-2-v1.md +62 -0
  156. package/docs/sprints/sprint-2/plans/Project-Plan-Sprint-2-v1.md +228 -0
  157. package/docs/sprints/sprint-2/reports/Phase-Report-Sprint-2-v1.md +303 -0
  158. package/docs/sprints/sprint-3/designs/UIUX-Design-Spec-Sprint-3-v1.md +160 -0
  159. package/docs/sprints/sprint-3/logs/Development-Log-Sprint-3-v1.md +249 -0
  160. package/docs/sprints/sprint-3/logs/Testing-Report-Sprint-3-v1.md +244 -0
  161. package/docs/sprints/sprint-3/plans/Product-Backlog-Sprint-3-v1.md +95 -0
  162. package/docs/sprints/sprint-3/reports/Final-Approval-Report-Sprint-3-v1.md +299 -0
  163. package/docs/sprints/sprint-3/reports/Sprint-Summary-Sprint-3-v1.md +276 -0
  164. package/docs/sprints/sprint-3/reviews/Design-Verification-Report-Sprint-3-v1.md +122 -0
  165. package/docs/sprints/sprint-3/reviews/Security-Review-Report-Sprint-3-v1.md +67 -0
  166. package/docs/sprints/sprint-5/designs/Backend-Design-Spec-Sprint-5-v1.md +1734 -0
  167. package/docs/sprints/sprint-5/designs/Design-Verification-Report.md +101 -0
  168. package/docs/sprints/sprint-5/designs/Security-Review-Report.md +84 -0
  169. package/docs/sprints/sprint-6/.brain-state.json +29 -0
  170. package/package.json +92 -16
  171. package/.agent/ide-integration/aider-commands.md +0 -40
  172. package/.agent/ide-integration/cline-config.json +0 -108
  173. package/.agent/ide-integration/cursor-rules.md +0 -63
  174. package/.agent/ide-integration/github-copilot-instructions.md +0 -75
  175. package/.agent/ide-integration/vscode-commands.json +0 -190
  176. package/.agent/ide-integration/windsurf-cascade.md +0 -125
  177. package/.agent/knowledge-base/index.md +0 -202
  178. package/.agent/legacy/roles/designer.md +0 -311
  179. package/.agent/legacy/roles/dev.md +0 -177
  180. package/.agent/legacy/roles/devops.md +0 -146
  181. package/.agent/legacy/roles/orchestrator.md +0 -339
  182. package/.agent/legacy/roles/pm.md +0 -120
  183. package/.agent/legacy/roles/po.md +0 -89
  184. package/.agent/legacy/roles/qa.md +0 -108
  185. package/.agent/legacy/roles/reporter.md +0 -70
  186. package/.agent/legacy/roles/sa.md +0 -118
  187. package/.agent/legacy/roles/seca.md +0 -112
  188. package/.agent/legacy/roles/stakeholder.md +0 -111
  189. package/.agent/legacy/roles/tester.md +0 -129
  190. package/.agent/rules/global.md.bak +0 -154
  191. package/.agent/usage.md +0 -653
  192. package/.agent/workflows/auto.md +0 -35
  193. package/.agent/workflows/dev.md +0 -30
  194. package/.agent/workflows/devops.md +0 -28
  195. package/.agent/workflows/kb-search.md +0 -22
  196. package/.agent/workflows/pm.md +0 -42
  197. package/.agent/workflows/po.md +0 -21
  198. package/.agent/workflows/qa.md +0 -31
  199. package/.agent/workflows/reporter.md +0 -21
  200. package/.agent/workflows/sa.md +0 -51
  201. package/.agent/workflows/seca.md +0 -21
  202. package/.agent/workflows/stakeholder.md +0 -26
  203. package/.agent/workflows/tester.md +0 -21
  204. package/.agent/workflows/uiux.md +0 -38
  205. package/.cursorrules +0 -49
  206. package/.env.template +0 -10
  207. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -47
  208. package/.github/ISSUE_TEMPLATE/config.yml +0 -8
  209. package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -33
  210. package/.github/ISSUE_TEMPLATE/security_alert.yml +0 -28
  211. package/.github/ISSUE_TEMPLATE/task_implementation.yml +0 -37
  212. package/.github/copilot-instructions.md +0 -60
  213. package/bin/commands/create.js +0 -96
  214. package/bin/commands/help.js +0 -69
  215. package/bin/commands/ide.js +0 -116
  216. package/bin/commands/init-kb.js +0 -74
  217. package/bin/commands/install.js +0 -68
  218. package/bin/commands/list.js +0 -35
  219. package/bin/graph_brain.py +0 -86
  220. package/bin/sync_github.py +0 -75
  221. package/bin/utils/args-parser.js +0 -33
  222. package/bin/utils/colors.js +0 -21
  223. package/bin/verify_neo4j.py +0 -25
  224. /package/.agent/rules/{knowledge-base.md → KNOWLEDGE-BASE.md} +0 -0
  225. /package/docs/architecture/{neo4j-learning-queries.md → NEO4J-LEARNING-QUERIES.md} +0 -0
  226. /package/docs/reports/{comparison-leann-neo4j.md → COMPARISON-LEANN-NEO4J.md} +0 -0
  227. /package/docs/sprints/{sprint-neo4j-brain.md → SPRINT-NEO4J-BRAIN.md} +0 -0
@@ -0,0 +1,193 @@
1
+ """
2
+ KB Index Module
3
+ Cross-platform INDEX.md generation
4
+ """
5
+
6
+ from pathlib import Path
7
+ from datetime import datetime
8
+ from collections import defaultdict
9
+ from kb_common import (
10
+ KBConfig, Colors, parse_frontmatter, get_kb_entries, get_all_kb_entries,
11
+ print_header, print_success, get_priority_icon, get_category_icon
12
+ )
13
+
14
+
15
+ def update_index():
16
+ """Update INDEX.md"""
17
+ config = KBConfig()
18
+ Colors.enable_windows()
19
+
20
+ print_header("📇 Updating Knowledge Base Index", "Scanning KB + docs directories...")
21
+
22
+ all_paths = config.get_all_kb_paths()
23
+ entries = get_all_kb_entries(all_paths)
24
+
25
+ # Parse all entries
26
+ parsed_entries = []
27
+ for entry_path in entries:
28
+ try:
29
+ content = entry_path.read_text(encoding='utf-8')
30
+ metadata = parse_frontmatter(content)
31
+
32
+ if metadata:
33
+ metadata['path'] = entry_path
34
+ metadata['filename'] = entry_path.name
35
+ parsed_entries.append(metadata)
36
+ except Exception as e:
37
+ continue
38
+
39
+ # Group entries
40
+ by_category = defaultdict(list)
41
+ by_priority = defaultdict(list)
42
+ by_date = defaultdict(list)
43
+
44
+ for entry in parsed_entries:
45
+ category = entry.get('category', 'unknown')
46
+ priority = entry.get('priority', 'unknown')
47
+ date = entry.get('date', 'unknown')
48
+
49
+ by_category[category].append(entry)
50
+ by_priority[priority].append(entry)
51
+ by_date[date].append(entry)
52
+
53
+ # Generate INDEX.md
54
+ index_content = generate_index_content(parsed_entries, by_category, by_priority, by_date)
55
+
56
+ # Write INDEX.md
57
+ index_path = config.get_index_path()
58
+ index_path.write_text(index_content, encoding='utf-8')
59
+
60
+ print_success(f"INDEX.md Updated Successfully!")
61
+ print()
62
+ print(f"{Colors.CYAN}📊 Statistics:{Colors.RESET}")
63
+ print(f" Total Entries: {len(parsed_entries)}")
64
+ print(f" Categories: {len(by_category)}")
65
+ print(f" Priorities: {len(by_priority)}")
66
+ print()
67
+
68
+
69
+ def generate_index_content(entries, by_category, by_priority, by_date):
70
+ """Generate INDEX.md content"""
71
+ content = f"""# Knowledge Base Index
72
+
73
+ **Last Updated:** {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}
74
+ **Total Entries:** {len(entries)}
75
+
76
+ This index provides a searchable overview of all knowledge base entries.
77
+
78
+ ---
79
+
80
+ ## 📊 Quick Stats
81
+
82
+ - **Total Entries:** {len(entries)}
83
+ - **Categories:** {len(by_category)}
84
+ - **Priorities:** {len(by_priority)}
85
+
86
+ ---
87
+
88
+ ## 📁 By Category
89
+
90
+ """
91
+
92
+ # Add entries by category
93
+ for category in sorted(by_category.keys()):
94
+ icon = get_category_icon(category)
95
+ entries_list = by_category[category]
96
+ content += f"\n### {icon} {category.title()} ({len(entries_list)} entries)\n\n"
97
+
98
+ for entry in sorted(entries_list, key=lambda x: x.get('date', ''), reverse=True):
99
+ title = entry.get('title', 'Unknown')
100
+ filename = entry.get('filename', '')
101
+ priority = entry.get('priority', 'unknown')
102
+ date = entry.get('date', 'unknown')
103
+ tags = entry.get('tags', [])
104
+
105
+ priority_icon = get_priority_icon(priority)
106
+ tags_str = ', '.join(tags) if isinstance(tags, list) else tags
107
+
108
+ content += f"- {priority_icon} **{title}**\n"
109
+ content += f" - File: `{filename}`\n"
110
+ content += f" - Date: {date} | Priority: {priority}\n"
111
+ if tags_str:
112
+ content += f" - Tags: {tags_str}\n"
113
+ content += "\n"
114
+
115
+ # Add by priority
116
+ content += "\n---\n\n## ⚠️ By Priority\n\n"
117
+
118
+ priority_order = ['critical', 'high', 'medium', 'low']
119
+ for priority in priority_order:
120
+ if priority in by_priority:
121
+ icon = get_priority_icon(priority)
122
+ entries_list = by_priority[priority]
123
+ content += f"\n### {icon} {priority.title()} ({len(entries_list)} entries)\n\n"
124
+
125
+ for entry in sorted(entries_list, key=lambda x: x.get('date', ''), reverse=True)[:10]:
126
+ title = entry.get('title', 'Unknown')
127
+ filename = entry.get('filename', '')
128
+ category = entry.get('category', 'unknown')
129
+
130
+ content += f"- **{title}** ({category})\n"
131
+ content += f" - `{filename}`\n"
132
+
133
+ # Add recent entries
134
+ content += "\n---\n\n## 📅 Recent Entries (Last 20)\n\n"
135
+
136
+ recent = sorted(entries, key=lambda x: x.get('date', ''), reverse=True)[:20]
137
+ for entry in recent:
138
+ title = entry.get('title', 'Unknown')
139
+ filename = entry.get('filename', '')
140
+ category = entry.get('category', 'unknown')
141
+ priority = entry.get('priority', 'unknown')
142
+ date = entry.get('date', 'unknown')
143
+
144
+ icon = get_priority_icon(priority)
145
+ content += f"- {icon} **{title}**\n"
146
+ content += f" - `{filename}`\n"
147
+ content += f" - {date} | {category} | {priority}\n\n"
148
+
149
+ # Add search tips
150
+ content += """
151
+ ---
152
+
153
+ ## 🔍 How to Search
154
+
155
+ ### Using CLI
156
+ ```bash
157
+ # Search by keyword
158
+ kb search "react hydration"
159
+
160
+ # Compound search (file + Neo4j)
161
+ kb compound search "authentication"
162
+ ```
163
+
164
+ ### Using Scripts
165
+ ```bash
166
+ # PowerShell (Windows)
167
+ .\\bin\\kb.ps1 search "term"
168
+
169
+ # Bash (Linux/Mac)
170
+ ./bin/kb search "term"
171
+ ```
172
+
173
+ ---
174
+
175
+ ## 📝 Adding Entries
176
+
177
+ ```bash
178
+ # Interactive add
179
+ kb add
180
+
181
+ # Compound add (auto-sync to Neo4j)
182
+ kb compound add
183
+ ```
184
+
185
+ ---
186
+
187
+ **Generated by:** Knowledge Base Index Generator
188
+ **Platform:** Cross-platform (Windows/Linux/macOS)
189
+
190
+ #knowledge-base #index #searchable
191
+ """
192
+
193
+ return content
@@ -0,0 +1,144 @@
1
+ """
2
+ KB List Module
3
+ Cross-platform entry listing
4
+ """
5
+
6
+ from pathlib import Path
7
+ from kb_common import (
8
+ KBConfig, Colors, parse_frontmatter, get_kb_entries, format_time_ago,
9
+ print_header, get_priority_icon, get_category_icon
10
+ )
11
+
12
+
13
+ def list_entries(category=None, recent=None):
14
+ """List KB entries"""
15
+ config = KBConfig()
16
+ Colors.enable_windows()
17
+
18
+ if recent:
19
+ list_recent_entries(config, recent)
20
+ elif category:
21
+ list_by_category(config, category)
22
+ else:
23
+ list_all_entries(config)
24
+
25
+
26
+ def list_all_entries(config: KBConfig):
27
+ """List all entries"""
28
+ print_header("📋 Listing All Entries", "All knowledge base entries")
29
+
30
+ kb_path = config.get_kb_path()
31
+ entries = get_kb_entries(kb_path)
32
+
33
+ if not entries:
34
+ print(f"{Colors.YELLOW}No entries found.{Colors.RESET}")
35
+ return
36
+
37
+ print(f"{Colors.GREEN}Found {len(entries)} entries:{Colors.RESET}")
38
+ print()
39
+
40
+ # Sort by date (newest first)
41
+ sorted_entries = sorted(entries, key=lambda x: x.name, reverse=True)
42
+
43
+ for entry_path in sorted_entries:
44
+ try:
45
+ content = entry_path.read_text(encoding='utf-8')
46
+ metadata = parse_frontmatter(content)
47
+
48
+ title = metadata.get('title', 'Unknown')
49
+ priority = metadata.get('priority', 'unknown')
50
+ category = metadata.get('category', 'unknown')
51
+
52
+ priority_icon = get_priority_icon(priority)
53
+ category_icon = get_category_icon(category)
54
+
55
+ rel_path = entry_path.relative_to(config.root_dir)
56
+
57
+ print(f" {priority_icon} {category_icon} {Colors.WHITE}{title}{Colors.RESET}")
58
+ print(f" {Colors.GRAY}{rel_path}{Colors.RESET}")
59
+ print()
60
+ except:
61
+ continue
62
+
63
+
64
+ def list_by_category(config: KBConfig, category: str):
65
+ """List entries by category"""
66
+ print_header(f"📋 Listing Entries in Category: {category}", f"Filtered by {category}")
67
+
68
+ kb_path = config.get_kb_path()
69
+ category_path = kb_path / category
70
+
71
+ if not category_path.exists():
72
+ # Try common category paths
73
+ for cat_dir in ['bugs', 'features', 'architecture', 'security', 'performance', 'platform-specific']:
74
+ if category.lower() in cat_dir:
75
+ category_path = kb_path / cat_dir
76
+ break
77
+
78
+ if not category_path.exists():
79
+ print(f"{Colors.YELLOW}Category not found: {category}{Colors.RESET}")
80
+ print()
81
+ print(f"{Colors.CYAN}Available categories:{Colors.RESET}")
82
+ for cat_dir in kb_path.iterdir():
83
+ if cat_dir.is_dir() and not cat_dir.name.startswith('.'):
84
+ print(f" - {cat_dir.name}")
85
+ return
86
+
87
+ entries = list(category_path.rglob('KB-*.md'))
88
+
89
+ if not entries:
90
+ print(f"{Colors.YELLOW}No entries found in category: {category}{Colors.RESET}")
91
+ return
92
+
93
+ print(f"{Colors.GREEN}Found {len(entries)} entries:{Colors.RESET}")
94
+ print()
95
+
96
+ for entry_path in sorted(entries, key=lambda x: x.name, reverse=True):
97
+ try:
98
+ content = entry_path.read_text(encoding='utf-8')
99
+ metadata = parse_frontmatter(content)
100
+
101
+ title = metadata.get('title', 'Unknown')
102
+ priority = metadata.get('priority', 'unknown')
103
+
104
+ priority_icon = get_priority_icon(priority)
105
+ rel_path = entry_path.relative_to(config.root_dir)
106
+
107
+ print(f" {priority_icon} {Colors.WHITE}{title}{Colors.RESET}")
108
+ print(f" {Colors.GRAY}{rel_path}{Colors.RESET}")
109
+ print()
110
+ except:
111
+ continue
112
+
113
+
114
+ def list_recent_entries(config: KBConfig, count: int):
115
+ """List recent entries"""
116
+ print_header(f"📅 Recent {count} Entries", "Most recently modified")
117
+
118
+ kb_path = config.get_kb_path()
119
+ entries = get_kb_entries(kb_path)
120
+
121
+ if not entries:
122
+ print(f"{Colors.YELLOW}No entries found.{Colors.RESET}")
123
+ return
124
+
125
+ # Sort by modification time
126
+ sorted_entries = sorted(entries, key=lambda x: x.stat().st_mtime, reverse=True)[:count]
127
+
128
+ for entry_path in sorted_entries:
129
+ try:
130
+ content = entry_path.read_text(encoding='utf-8')
131
+ metadata = parse_frontmatter(content)
132
+
133
+ title = metadata.get('title', 'Unknown')
134
+ category = metadata.get('category', 'unknown')
135
+ priority = metadata.get('priority', 'unknown')
136
+
137
+ time_ago = format_time_ago(entry_path)
138
+ category_icon = get_category_icon(category)
139
+
140
+ print(f" {category_icon} {Colors.WHITE}{title}{Colors.RESET}")
141
+ print(f" Category: {category} | {Colors.GRAY}{time_ago}{Colors.RESET}")
142
+ print()
143
+ except:
144
+ continue
@@ -0,0 +1,121 @@
1
+ """
2
+ KB Search Module
3
+ Cross-platform search functionality
4
+ """
5
+
6
+ import re
7
+ from pathlib import Path
8
+ from typing import List, Dict
9
+ from kb_common import (
10
+ KBConfig, Colors, parse_frontmatter, get_kb_entries, get_all_kb_entries,
11
+ print_header, print_success, print_warning, get_priority_icon
12
+ )
13
+
14
+
15
+ def search_kb(search_term: str):
16
+ """Search knowledge base"""
17
+ config = KBConfig()
18
+ Colors.enable_windows()
19
+
20
+ print_header(
21
+ f"🔍 Searching Knowledge Base for: '{search_term}'",
22
+ "File System Search"
23
+ )
24
+
25
+ # Search INDEX.md first
26
+ results_from_index = search_index(config, search_term)
27
+
28
+ # Search all KB files
29
+ results_from_files = search_files(config, search_term)
30
+
31
+ # Display results
32
+ total_results = len(results_from_index) + len(results_from_files)
33
+
34
+ if total_results == 0:
35
+ print_warning(f"No results found for '{search_term}'")
36
+ print()
37
+ print(f"{Colors.CYAN}💡 Tips:{Colors.RESET}")
38
+ print(f" - Try different keywords")
39
+ print(f" - Use broader search terms")
40
+ print(f" - Check spelling")
41
+ print(f" - Try compound search: {Colors.MAGENTA}kb compound search '{search_term}'{Colors.RESET}")
42
+ else:
43
+ print()
44
+ print(f"{Colors.GREEN}📊 Search Results: {total_results} entries found{Colors.RESET}")
45
+
46
+ print()
47
+
48
+
49
+ def search_index(config: KBConfig, search_term: str) -> List[str]:
50
+ """Search INDEX.md"""
51
+ if not config.get_index_path().exists():
52
+ return []
53
+
54
+ content = config.get_index_path().read_text(encoding='utf-8')
55
+ results = []
56
+
57
+ # Search for term in index
58
+ pattern = re.compile(re.escape(search_term), re.IGNORECASE)
59
+
60
+ for line in content.split('\n'):
61
+ if pattern.search(line) and line.strip().startswith('-'):
62
+ results.append(line.strip())
63
+
64
+ if results:
65
+ print(f"{Colors.GREEN}✅ Found in INDEX:{Colors.RESET}")
66
+ for result in results[:5]: # Show first 5
67
+ print(f" {result}")
68
+ print()
69
+
70
+ return results
71
+
72
+
73
+ def search_files(config: KBConfig, search_term: str) -> List[Dict]:
74
+ """Search all KB files (KB + docs)"""
75
+ all_paths = config.get_all_kb_paths()
76
+ entries = get_all_kb_entries(all_paths)
77
+
78
+ results = []
79
+ pattern = re.compile(re.escape(search_term), re.IGNORECASE)
80
+
81
+ for entry_path in entries:
82
+ try:
83
+ content = entry_path.read_text(encoding='utf-8')
84
+
85
+ # Check if term is in content
86
+ if pattern.search(content):
87
+ metadata = parse_frontmatter(content)
88
+
89
+ # Extract context (line with match)
90
+ context_lines = []
91
+ for line in content.split('\n'):
92
+ if pattern.search(line):
93
+ context_lines.append(line.strip())
94
+ if len(context_lines) >= 3:
95
+ break
96
+
97
+ results.append({
98
+ 'path': entry_path,
99
+ 'title': metadata.get('title', 'Unknown'),
100
+ 'category': metadata.get('category', 'unknown'),
101
+ 'priority': metadata.get('priority', 'unknown'),
102
+ 'context': context_lines
103
+ })
104
+ except Exception as e:
105
+ continue
106
+
107
+ # Display file results
108
+ if results:
109
+ for i, result in enumerate(results, 1):
110
+ icon = get_priority_icon(result['priority'])
111
+ print(f"{Colors.GREEN}✅ Found: {result['title']}{Colors.RESET}")
112
+ print(f" {icon} File: {result['path'].relative_to(config.root_dir)}")
113
+ print(f" Category: {result['category']} | Priority: {result['priority']}")
114
+
115
+ if result['context']:
116
+ print(f" {Colors.CYAN}Context:{Colors.RESET}")
117
+ for ctx in result['context'][:2]:
118
+ print(f" {ctx[:80]}...")
119
+ print()
120
+
121
+ return results
@@ -0,0 +1,153 @@
1
+ """
2
+ KB Stats Module
3
+ Cross-platform statistics display
4
+ """
5
+
6
+ from pathlib import Path
7
+ from datetime import datetime
8
+ from collections import defaultdict
9
+ from kb_common import (
10
+ KBConfig, Colors, parse_frontmatter, get_kb_entries, format_time_ago,
11
+ print_header, get_priority_icon, get_category_icon
12
+ )
13
+
14
+
15
+ def show_stats():
16
+ """Show KB statistics"""
17
+ config = KBConfig()
18
+ Colors.enable_windows()
19
+
20
+ print_header("📊 Knowledge Base Statistics", "Analyzing entries...")
21
+
22
+ kb_path = config.get_kb_path()
23
+ entries = get_kb_entries(kb_path)
24
+
25
+ if not entries:
26
+ print(f"{Colors.YELLOW}No entries found in knowledge base.{Colors.RESET}")
27
+ print()
28
+ print(f"{Colors.CYAN}💡 Add your first entry:{Colors.RESET}")
29
+ print(f" kb add")
30
+ return
31
+
32
+ # Parse entries
33
+ parsed = []
34
+ total_attempts = 0
35
+ total_time_saved = 0
36
+
37
+ by_category = defaultdict(int)
38
+ by_priority = defaultdict(int)
39
+ by_month = defaultdict(int)
40
+
41
+ for entry_path in entries:
42
+ try:
43
+ content = entry_path.read_text(encoding='utf-8')
44
+ metadata = parse_frontmatter(content)
45
+
46
+ if metadata:
47
+ metadata['path'] = entry_path
48
+ parsed.append(metadata)
49
+
50
+ # Count stats
51
+ category = metadata.get('category', 'unknown')
52
+ priority = metadata.get('priority', 'unknown')
53
+ date = metadata.get('date', 'unknown')
54
+
55
+ by_category[category] += 1
56
+ by_priority[priority] += 1
57
+
58
+ if date != 'unknown':
59
+ month = date[:7] # YYYY-MM
60
+ by_month[month] += 1
61
+
62
+ # Attempts
63
+ attempts = metadata.get('attempts', '0')
64
+ try:
65
+ total_attempts += int(attempts)
66
+ except:
67
+ pass
68
+
69
+ # Time saved
70
+ time_saved = metadata.get('time_saved', '0')
71
+ if 'hour' in time_saved.lower():
72
+ try:
73
+ hours = float(time_saved.split()[0])
74
+ total_time_saved += hours
75
+ except:
76
+ pass
77
+ except:
78
+ continue
79
+
80
+ # Display stats
81
+ print(f"{Colors.WHITE}{Colors.BOLD}📚 Total Entries: {len(parsed)}{Colors.RESET}")
82
+ print()
83
+
84
+ # By category
85
+ if by_category:
86
+ print(f"{Colors.YELLOW}{Colors.BOLD}📁 By Category:{Colors.RESET}")
87
+ max_count = max(by_category.values())
88
+ for category in sorted(by_category.keys()):
89
+ count = by_category[category]
90
+ percentage = (count / len(parsed)) * 100
91
+ icon = get_category_icon(category)
92
+ bar_length = int((count / max_count) * 30)
93
+ bar = '█' * bar_length
94
+
95
+ print(f" {icon} {category.ljust(15)} : {count} entries ({percentage:.1f}%)")
96
+ print(f" {Colors.CYAN}{bar}{Colors.RESET}")
97
+ print()
98
+
99
+ # By priority
100
+ if by_priority:
101
+ print(f"{Colors.YELLOW}{Colors.BOLD}⚠️ By Priority:{Colors.RESET}")
102
+ priority_order = ['critical', 'high', 'medium', 'low']
103
+ for priority in priority_order:
104
+ if priority in by_priority:
105
+ count = by_priority[priority]
106
+ percentage = (count / len(parsed)) * 100
107
+ icon = get_priority_icon(priority)
108
+ print(f" {icon} {priority.ljust(12)} : {count} entries ({percentage:.1f}%)")
109
+ print()
110
+
111
+ # Compound metrics
112
+ print(f"{Colors.YELLOW}{Colors.BOLD}📈 Compound Learning Metrics:{Colors.RESET}")
113
+ avg_attempts = total_attempts / len(parsed) if parsed else 0
114
+ avg_time_saved = total_time_saved / len(parsed) if parsed else 0
115
+ projected_time = total_time_saved * 2 # Assume 2x reuse
116
+
117
+ print(f" Total Attempts: {total_attempts}")
118
+ print(f" Avg Attempts per Entry: {avg_attempts:.1f}")
119
+ print(f" Total Time Saved: ~{int(total_time_saved)} hours")
120
+ print(f" Avg Time Saved per Entry: ~{avg_time_saved:.1f} hours")
121
+ print(f" Projected Time Saved (2x reuse): ~{int(projected_time)} hours")
122
+ print()
123
+
124
+ # Recent activity
125
+ print(f"{Colors.YELLOW}{Colors.BOLD}📅 Recent Activity:{Colors.RESET}")
126
+ recent = sorted(parsed, key=lambda x: x.get('path').stat().st_mtime, reverse=True)[:5]
127
+
128
+ for entry in recent:
129
+ title = entry.get('title', 'Unknown')
130
+ path = entry.get('path')
131
+ time_ago = format_time_ago(path)
132
+
133
+ print(f" - {title}")
134
+ print(f" {Colors.GRAY}{time_ago}{Colors.RESET}")
135
+ print()
136
+
137
+ # Growth trend
138
+ if by_month:
139
+ print(f"{Colors.YELLOW}{Colors.BOLD}📊 Growth Trend:{Colors.RESET}")
140
+ for month in sorted(by_month.keys(), reverse=True)[:6]:
141
+ count = by_month[month]
142
+ bar = '█' * count
143
+ print(f" {month} : {count} entries")
144
+ print(f" {Colors.CYAN}{bar}{Colors.RESET}")
145
+ print()
146
+
147
+ # Compound effect message
148
+ print(f"{Colors.CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━{Colors.RESET}")
149
+ print(f"{Colors.GREEN}{Colors.BOLD}💡 Compound Effect:{Colors.RESET}")
150
+ print(f" Each entry makes future work easier!")
151
+ print(f" Keep documenting to compound your knowledge! 🚀")
152
+ print(f"{Colors.CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━{Colors.RESET}")
153
+ print()