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
package/bin/kb ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env bash
2
+ # Knowledge Base CLI - Cross-platform entry point
3
+ # Works on Linux, macOS, and Windows (Git Bash/WSL)
4
+
5
+ # Detect OS
6
+ if [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "win32" ]]; then
7
+ # Windows (Git Bash)
8
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
+ PLATFORM="windows"
10
+ elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
11
+ # Linux
12
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
13
+ PLATFORM="linux"
14
+ elif [[ "$OSTYPE" == "darwin"* ]]; then
15
+ # macOS
16
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
17
+ PLATFORM="macos"
18
+ else
19
+ echo "Unsupported OS: $OSTYPE"
20
+ exit 1
21
+ fi
22
+
23
+ # Check if Python is available
24
+ if command -v python3 &> /dev/null; then
25
+ PYTHON_CMD="python3"
26
+ elif command -v python &> /dev/null; then
27
+ PYTHON_CMD="python"
28
+ else
29
+ echo "Error: Python not found. Please install Python 3.7+"
30
+ exit 1
31
+ fi
32
+
33
+ # Run the Python CLI
34
+ exec "$PYTHON_CMD" "$SCRIPT_DIR/kb_cli.py" "$@"
package/bin/kb.bat ADDED
@@ -0,0 +1,28 @@
1
+ @echo off
2
+ REM Knowledge Base CLI - Windows batch entry point
3
+ REM Usage: kb.bat [command] [args]
4
+
5
+ setlocal enabledelayedexpansion
6
+
7
+ REM Get script directory
8
+ set "SCRIPT_DIR=%~dp0"
9
+
10
+ REM Check for Python
11
+ where python >nul 2>nul
12
+ if %ERRORLEVEL% EQU 0 (
13
+ set "PYTHON_CMD=python"
14
+ goto :run
15
+ )
16
+
17
+ where python3 >nul 2>nul
18
+ if %ERRORLEVEL% EQU 0 (
19
+ set "PYTHON_CMD=python3"
20
+ goto :run
21
+ )
22
+
23
+ echo Error: Python not found. Please install Python 3.7+
24
+ exit /b 1
25
+
26
+ :run
27
+ REM Run the Python CLI
28
+ "%PYTHON_CMD%" "%SCRIPT_DIR%kb_cli.py" %*
package/bin/kb_cli.py ADDED
@@ -0,0 +1,226 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ """
4
+ Knowledge Base CLI - Cross-platform
5
+ Supports Windows, Linux, and macOS
6
+
7
+ Usage:
8
+ kb [command] [args]
9
+ kb.bat [command] [args] (Windows)
10
+ """
11
+
12
+ import sys
13
+ import os
14
+ import platform
15
+ import argparse
16
+ from pathlib import Path
17
+
18
+ # Set UTF-8 encoding for Windows console
19
+ if sys.platform == 'win32':
20
+ try:
21
+ sys.stdout.reconfigure(encoding='utf-8')
22
+ sys.stderr.reconfigure(encoding='utf-8')
23
+ except:
24
+ pass
25
+
26
+ # Add lib directory to path
27
+ SCRIPT_DIR = Path(__file__).parent
28
+ LIB_DIR = SCRIPT_DIR / "lib"
29
+ sys.path.insert(0, str(LIB_DIR))
30
+
31
+ # Import KB modules
32
+ try:
33
+ from kb_search import search_kb
34
+ from kb_add import add_entry
35
+ from kb_index import update_index
36
+ from kb_stats import show_stats
37
+ from kb_list import list_entries
38
+ from kb_compound import compound_operation
39
+ except ImportError as e:
40
+ print(f"Error: Could not import KB modules: {e}")
41
+ print(f"Make sure all required files are in {LIB_DIR}")
42
+ sys.exit(1)
43
+
44
+
45
+ class Colors:
46
+ """ANSI color codes that work cross-platform"""
47
+ RESET = '\033[0m'
48
+ BOLD = '\033[1m'
49
+
50
+ # Foreground colors
51
+ BLACK = '\033[30m'
52
+ RED = '\033[31m'
53
+ GREEN = '\033[32m'
54
+ YELLOW = '\033[33m'
55
+ BLUE = '\033[34m'
56
+ MAGENTA = '\033[35m'
57
+ CYAN = '\033[36m'
58
+ WHITE = '\033[37m'
59
+
60
+ # Background colors
61
+ BG_BLACK = '\033[40m'
62
+ BG_RED = '\033[41m'
63
+ BG_GREEN = '\033[42m'
64
+ BG_YELLOW = '\033[43m'
65
+ BG_BLUE = '\033[44m'
66
+ BG_MAGENTA = '\033[45m'
67
+ BG_CYAN = '\033[46m'
68
+ BG_WHITE = '\033[47m'
69
+
70
+ @staticmethod
71
+ def enable_windows_colors():
72
+ """Enable ANSI colors on Windows"""
73
+ if platform.system() == 'Windows':
74
+ try:
75
+ import ctypes
76
+ kernel32 = ctypes.windll.kernel32
77
+ kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)
78
+ except:
79
+ pass
80
+
81
+
82
+ def print_header():
83
+ """Print CLI header"""
84
+ Colors.enable_windows_colors()
85
+ print(f"{Colors.CYAN}{Colors.BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━{Colors.RESET}")
86
+ print(f"{Colors.CYAN}{Colors.BOLD}📚 Knowledge Base - Command Line Interface{Colors.RESET}")
87
+ print(f"{Colors.MAGENTA} 🧠 Integrated with Neo4j Brain{Colors.RESET}")
88
+ print(f"{Colors.CYAN}{Colors.BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━{Colors.RESET}")
89
+ print()
90
+
91
+
92
+ def print_help():
93
+ """Print help message"""
94
+ print_header()
95
+ print(f"{Colors.WHITE}{Colors.BOLD}Usage:{Colors.RESET} kb [command] [args]")
96
+ print()
97
+ print(f"{Colors.YELLOW}{Colors.BOLD}Commands:{Colors.RESET}")
98
+ print()
99
+ print(f" {Colors.WHITE}search <term>{Colors.RESET} 🔍 Search knowledge base")
100
+ print(f" Example: kb search 'react hydration'")
101
+ print()
102
+ print(f" {Colors.WHITE}add{Colors.RESET} ➕ Add new entry (interactive)")
103
+ print(f" Example: kb add")
104
+ print()
105
+ print(f" {Colors.WHITE}index{Colors.RESET} 📇 Update INDEX.md")
106
+ print(f" Example: kb index")
107
+ print()
108
+ print(f" {Colors.WHITE}stats{Colors.RESET} 📊 Show statistics")
109
+ print(f" Example: kb stats")
110
+ print()
111
+ print(f" {Colors.WHITE}list [category]{Colors.RESET} 📋 List all entries (optional: by category)")
112
+ print(f" Example: kb list bugs")
113
+ print()
114
+ print(f" {Colors.WHITE}recent [n]{Colors.RESET} 📅 Show recent entries (default: 10)")
115
+ print(f" Example: kb recent 5")
116
+ print()
117
+ print(f" {Colors.MAGENTA}{Colors.BOLD}compound <action>{Colors.RESET} 🧠 Compound mode with Neo4j integration")
118
+ print(f" Example: kb compound search 'oauth'")
119
+ print()
120
+ print(f" {Colors.WHITE}help{Colors.RESET} ❓ Show this help")
121
+ print()
122
+ print(f"{Colors.MAGENTA}{Colors.BOLD}Compound Actions:{Colors.RESET}")
123
+ print(f" compound search <term> - Search both file system and Neo4j brain")
124
+ print(f" compound add - Add entry and sync to Neo4j")
125
+ print(f" compound sync - Full sync to Neo4j brain")
126
+ print(f" compound query <term> - Intelligent Neo4j query")
127
+ print(f" compound stats - Show compound system health")
128
+ print()
129
+ print(f"{Colors.YELLOW}{Colors.BOLD}Examples:{Colors.RESET}")
130
+ print(f" kb search oauth")
131
+ print(f" {Colors.MAGENTA}kb compound search oauth{Colors.RESET}")
132
+ print(f" kb add")
133
+ print(f" {Colors.MAGENTA}kb compound add{Colors.RESET}")
134
+ print(f" kb stats")
135
+ print()
136
+ print(f"{Colors.CYAN}{Colors.BOLD}💡 Quick Start:{Colors.RESET}")
137
+ print(f" 1. Search before solving: {Colors.MAGENTA}kb compound search 'your problem'{Colors.RESET}")
138
+ print(f" 2. Add after solving: {Colors.MAGENTA}kb compound add{Colors.RESET}")
139
+ print(f" 3. Sync to brain: {Colors.MAGENTA}kb compound sync{Colors.RESET}")
140
+ print()
141
+ print(f"{Colors.MAGENTA}{Colors.BOLD}🧠 Neo4j Brain:{Colors.RESET}")
142
+ print(f" The compound mode connects KB to Neo4j for intelligent")
143
+ print(f" relationship mapping and contextual queries")
144
+ print()
145
+
146
+
147
+ def main():
148
+ """Main CLI entry point"""
149
+ Colors.enable_windows_colors()
150
+
151
+ # Parse arguments
152
+ parser = argparse.ArgumentParser(
153
+ description='Knowledge Base CLI',
154
+ add_help=False
155
+ )
156
+ parser.add_argument('command', nargs='?', default='help')
157
+ parser.add_argument('args', nargs='*')
158
+
159
+ args = parser.parse_args()
160
+ command = args.command.lower()
161
+ command_args = args.args
162
+
163
+ try:
164
+ # Execute command
165
+ if command == 'help' or command == '-h' or command == '--help':
166
+ print_help()
167
+
168
+ elif command == 'search':
169
+ if not command_args:
170
+ print(f"{Colors.RED}❌ Search term required!{Colors.RESET}")
171
+ print(f"{Colors.YELLOW}Usage: kb search 'term'{Colors.RESET}")
172
+ sys.exit(1)
173
+ search_term = ' '.join(command_args)
174
+ search_kb(search_term)
175
+
176
+ elif command == 'add':
177
+ add_entry()
178
+
179
+ elif command == 'index':
180
+ update_index()
181
+
182
+ elif command == 'stats':
183
+ show_stats()
184
+
185
+ elif command == 'list':
186
+ category = command_args[0] if command_args else None
187
+ list_entries(category)
188
+
189
+ elif command == 'recent':
190
+ count = int(command_args[0]) if command_args else 10
191
+ list_entries(recent=count)
192
+
193
+ elif command == 'compound':
194
+ if not command_args:
195
+ print(f"{Colors.RED}❌ Compound action required!{Colors.RESET}")
196
+ print(f"{Colors.YELLOW}Usage: kb compound [search|add|sync|query|stats]{Colors.RESET}")
197
+ sys.exit(1)
198
+
199
+ action = command_args[0].lower()
200
+ action_args = command_args[1:] if len(command_args) > 1 else []
201
+
202
+ if action in ['search', 'query'] and not action_args:
203
+ print(f"{Colors.RED}❌ Search/Query term required!{Colors.RESET}")
204
+ sys.exit(1)
205
+
206
+ search_term = ' '.join(action_args) if action_args else None
207
+ compound_operation(action, search_term)
208
+
209
+ else:
210
+ print(f"{Colors.RED}❌ Unknown command: {command}{Colors.RESET}")
211
+ print()
212
+ print_help()
213
+ sys.exit(1)
214
+
215
+ except KeyboardInterrupt:
216
+ print(f"\n{Colors.YELLOW}⚠️ Operation cancelled by user{Colors.RESET}")
217
+ sys.exit(0)
218
+ except Exception as e:
219
+ print(f"{Colors.RED}❌ Error: {e}{Colors.RESET}")
220
+ import traceback
221
+ traceback.print_exc()
222
+ sys.exit(1)
223
+
224
+
225
+ if __name__ == '__main__':
226
+ main()
@@ -0,0 +1,411 @@
1
+ # Knowledge Base CLI Library
2
+
3
+ This directory contains the Python library modules for the **Knowledge Base CLI**.
4
+
5
+ ## Overview
6
+
7
+ The KB CLI is a cross-platform command-line tool for managing the TeamLifecycle knowledge base with optional Neo4j brain integration.
8
+
9
+ ## Architecture
10
+
11
+ ```
12
+ kb_cli.py # Main CLI entry point
13
+
14
+ ├── kb_common.py # Common utilities
15
+ ├── kb_search.py # Search functionality
16
+ ├── kb_add.py # Add entries
17
+ ├── kb_index.py # Index generation
18
+ ├── kb_stats.py # Statistics
19
+ ├── kb_list.py # List entries
20
+ └── kb_compound.py # Neo4j integration
21
+ ```
22
+
23
+ ## Modules
24
+
25
+ ### `kb_common.py`
26
+ **Purpose:** Common utilities and shared functions
27
+
28
+ **Exports:**
29
+ - `get_kb_path()` - Get knowledge base directory path
30
+ - `parse_yaml_frontmatter()` - Parse YAML frontmatter from markdown
31
+ - `format_date()` - Format dates consistently
32
+ - `get_editor()` - Get platform-specific default editor
33
+ - `Colors` - ANSI color codes class
34
+
35
+ **Usage:**
36
+ ```python
37
+ from kb_common import get_kb_path, Colors
38
+
39
+ kb_path = get_kb_path()
40
+ print(f"{Colors.GREEN}Success!{Colors.RESET}")
41
+ ```
42
+
43
+ ### `kb_search.py`
44
+ **Purpose:** Search knowledge base entries
45
+
46
+ **Exports:**
47
+ - `search_kb(term: str)` - Search for entries matching term
48
+
49
+ **Features:**
50
+ - Searches INDEX.md first
51
+ - Falls back to full file search
52
+ - Shows context around matches
53
+ - Displays metadata
54
+
55
+ **Usage:**
56
+ ```python
57
+ from kb_search import search_kb
58
+
59
+ search_kb("react hydration")
60
+ ```
61
+
62
+ ### `kb_add.py`
63
+ **Purpose:** Add new knowledge base entries
64
+
65
+ **Exports:**
66
+ - `add_entry()` - Interactive entry creation wizard
67
+
68
+ **Features:**
69
+ - Interactive prompts
70
+ - YAML frontmatter generation
71
+ - Unique filename generation
72
+ - Auto-open in editor
73
+ - Category/priority selection
74
+
75
+ **Usage:**
76
+ ```python
77
+ from kb_add import add_entry
78
+
79
+ add_entry() # Interactive wizard
80
+ ```
81
+
82
+ ### `kb_index.py`
83
+ **Purpose:** Generate and update INDEX.md
84
+
85
+ **Exports:**
86
+ - `update_index()` - Scan entries and regenerate INDEX.md
87
+
88
+ **Features:**
89
+ - Scans all KB entries
90
+ - Extracts metadata
91
+ - Groups by category, priority, date
92
+ - Generates searchable index
93
+ - Shows statistics
94
+
95
+ **Usage:**
96
+ ```python
97
+ from kb_index import update_index
98
+
99
+ update_index()
100
+ ```
101
+
102
+ ### `kb_stats.py`
103
+ **Purpose:** Display knowledge base statistics
104
+
105
+ **Exports:**
106
+ - `show_stats()` - Calculate and display KB metrics
107
+
108
+ **Features:**
109
+ - Total entries count
110
+ - Breakdown by category
111
+ - Breakdown by priority
112
+ - Total attempts
113
+ - Time saved calculations
114
+ - Growth trends
115
+
116
+ **Usage:**
117
+ ```python
118
+ from kb_stats import show_stats
119
+
120
+ show_stats()
121
+ ```
122
+
123
+ ### `kb_list.py`
124
+ **Purpose:** List knowledge base entries
125
+
126
+ **Exports:**
127
+ - `list_entries(category: str = None, recent: int = None)` - List entries
128
+
129
+ **Features:**
130
+ - List all entries
131
+ - Filter by category
132
+ - Show recent entries
133
+ - Display metadata
134
+
135
+ **Usage:**
136
+ ```python
137
+ from kb_list import list_entries
138
+
139
+ list_entries() # All entries
140
+ list_entries("bugs") # Bugs only
141
+ list_entries(recent=10) # Last 10 entries
142
+ ```
143
+
144
+ ### `kb_compound.py`
145
+ **Purpose:** Neo4j brain integration
146
+
147
+ **Exports:**
148
+ - `compound_operation(action: str, term: str = None)` - Execute compound operations
149
+
150
+ **Actions:**
151
+ - `search` - Search file system + Neo4j
152
+ - `add` - Add entry + sync to Neo4j
153
+ - `sync` - Full sync to Neo4j
154
+ - `query` - Intelligent Neo4j queries
155
+ - `stats` - Compound system health
156
+
157
+ **Features:**
158
+ - Neo4j connection management
159
+ - Graceful fallback if Neo4j unavailable
160
+ - Cross-platform subprocess handling
161
+ - Relationship mapping
162
+
163
+ **Usage:**
164
+ ```python
165
+ from kb_compound import compound_operation
166
+
167
+ compound_operation("search", "authentication")
168
+ compound_operation("sync")
169
+ compound_operation("stats")
170
+ ```
171
+
172
+ ## Dependencies
173
+
174
+ ### Required
175
+ - Python 3.7+
176
+ - Standard library modules:
177
+ - `os`, `sys`, `pathlib`
178
+ - `json`, `yaml`
179
+ - `datetime`, `re`
180
+ - `subprocess`
181
+
182
+ ### Optional
183
+ - `neo4j` - For Neo4j brain integration
184
+ - `python-dotenv` - For environment variables
185
+
186
+ Install optional dependencies:
187
+ ```bash
188
+ pip install neo4j python-dotenv
189
+ ```
190
+
191
+ ## Configuration
192
+
193
+ ### Environment Variables
194
+ Create `.env` file in project root:
195
+ ```bash
196
+ # Neo4j Configuration (optional)
197
+ NEO4J_URI=neo4j+s://your-instance.databases.neo4j.io
198
+ NEO4J_USERNAME=neo4j
199
+ NEO4J_PASSWORD=your_password
200
+ NEO4J_DATABASE=neo4j
201
+ ```
202
+
203
+ ### Knowledge Base Path
204
+ Default: `.agent/knowledge-base/`
205
+
206
+ Override with environment variable:
207
+ ```bash
208
+ KB_PATH=/custom/path/to/kb
209
+ ```
210
+
211
+ ## Entry Format
212
+
213
+ All KB entries use YAML frontmatter:
214
+
215
+ ```yaml
216
+ ---
217
+ title: "Entry Title"
218
+ category: bug|feature|architecture|security|performance|platform
219
+ priority: critical|high|medium|low
220
+ sprint: sprint-N
221
+ date: YYYY-MM-DD
222
+ tags: [tag1, tag2, tag3]
223
+ related_files: [path/to/file1, path/to/file2]
224
+ attempts: 3
225
+ time_saved: "2 hours"
226
+ ---
227
+
228
+ ## Problem
229
+ Description of the issue
230
+
231
+ ## Solution
232
+ How it was solved
233
+
234
+ ## Prevention
235
+ How to avoid in future
236
+ ```
237
+
238
+ ## File Naming Convention
239
+
240
+ Format: `KB-YYYY-MM-DD-###-title-slug.md`
241
+
242
+ Example: `KB-2026-01-02-001-react-hydration-error.md`
243
+
244
+ Components:
245
+ - `YYYY-MM-DD` - Creation date
246
+ - `###` - Sequential ID for that day (001, 002, etc.)
247
+ - `title-slug` - URL-friendly title
248
+
249
+ ## Directory Structure
250
+
251
+ ```
252
+ .agent/knowledge-base/
253
+ ├── INDEX.md # Generated index
254
+ ├── bugs/
255
+ │ ├── critical/
256
+ │ ├── high/
257
+ │ ├── medium/
258
+ │ └── low/
259
+ ├── features/
260
+ │ ├── authentication/
261
+ │ ├── performance/
262
+ │ ├── integration/
263
+ │ └── ui-ux/
264
+ ├── architecture/
265
+ ├── security/
266
+ ├── performance/
267
+ └── platform-specific/
268
+ ├── web/
269
+ ├── mobile/
270
+ ├── desktop/
271
+ └── cli/
272
+ ```
273
+
274
+ ## Error Handling
275
+
276
+ All modules use consistent error handling:
277
+
278
+ ```python
279
+ try:
280
+ # Operation
281
+ pass
282
+ except FileNotFoundError:
283
+ print(f"{Colors.RED}❌ File not found{Colors.RESET}")
284
+ except PermissionError:
285
+ print(f"{Colors.RED}❌ Permission denied{Colors.RESET}")
286
+ except Exception as e:
287
+ print(f"{Colors.RED}❌ Error: {e}{Colors.RESET}")
288
+ import traceback
289
+ traceback.print_exc()
290
+ ```
291
+
292
+ ## Color Support
293
+
294
+ Cross-platform ANSI color support:
295
+
296
+ ```python
297
+ from kb_common import Colors
298
+
299
+ print(f"{Colors.GREEN}✅ Success{Colors.RESET}")
300
+ print(f"{Colors.RED}❌ Error{Colors.RESET}")
301
+ print(f"{Colors.YELLOW}⚠️ Warning{Colors.RESET}")
302
+ print(f"{Colors.CYAN}ℹ️ Info{Colors.RESET}")
303
+ ```
304
+
305
+ Colors automatically enabled on Windows 10+.
306
+
307
+ ## Testing
308
+
309
+ ### Unit Tests
310
+ ```bash
311
+ # Test individual modules
312
+ python -c "from kb_search import search_kb; search_kb('test')"
313
+ python -c "from kb_stats import show_stats; show_stats()"
314
+ ```
315
+
316
+ ### Integration Tests
317
+ ```bash
318
+ # Test full workflow
319
+ ./bin/kb search test
320
+ ./bin/kb add
321
+ ./bin/kb index
322
+ ./bin/kb stats
323
+ ```
324
+
325
+ ## Adding New Modules
326
+
327
+ 1. Create new file: `kb_newfeature.py`
328
+ 2. Follow module structure:
329
+ ```python
330
+ #!/usr/bin/env python3
331
+ """
332
+ Module description
333
+ """
334
+ from kb_common import Colors, get_kb_path
335
+
336
+ def new_feature():
337
+ """Feature implementation"""
338
+ pass
339
+ ```
340
+ 3. Import in `kb_cli.py`
341
+ 4. Add command handler
342
+ 5. Update this README
343
+
344
+ ## Platform Support
345
+
346
+ ### Windows
347
+ - ✅ Command Prompt
348
+ - ✅ PowerShell
349
+ - ✅ Git Bash
350
+ - ✅ ANSI colors (Windows 10+)
351
+
352
+ ### Linux
353
+ - ✅ Bash
354
+ - ✅ Zsh
355
+ - ✅ Fish
356
+ - ✅ Full ANSI colors
357
+
358
+ ### macOS
359
+ - ✅ Bash
360
+ - ✅ Zsh
361
+ - ✅ Full ANSI colors
362
+
363
+ ## Performance
364
+
365
+ - **Startup:** ~100-200ms
366
+ - **Search:** ~50-100ms for 100 entries
367
+ - **Index:** ~200-500ms for 100 entries
368
+ - **Neo4j:** +100-300ms for queries
369
+
370
+ ## Troubleshooting
371
+
372
+ ### Import Errors
373
+ ```bash
374
+ # Ensure lib directory is in Python path
375
+ export PYTHONPATH="${PYTHONPATH}:/path/to/bin/lib"
376
+ ```
377
+
378
+ ### Permission Errors
379
+ ```bash
380
+ # Make scripts executable (Linux/macOS)
381
+ chmod +x bin/kb
382
+ chmod +x bin/kb_cli.py
383
+ ```
384
+
385
+ ### Neo4j Connection Issues
386
+ ```bash
387
+ # Test connection
388
+ python -c "from neo4j import GraphDatabase; print('Neo4j available')"
389
+
390
+ # Check .env file
391
+ cat .env | grep NEO4J
392
+ ```
393
+
394
+ ## Related Files
395
+
396
+ - `../kb` - Bash entry point
397
+ - `../kb.bat` - Windows entry point
398
+ - `../kb_cli.py` - Main CLI
399
+ - `../../tools/neo4j/` - Neo4j integration scripts
400
+ - `../../.agent/knowledge-base/` - KB entries
401
+
402
+ ## Documentation
403
+
404
+ - **Main README:** `../README.md`
405
+ - **Cross-Platform Guide:** `../CROSS-PLATFORM-CLI.md`
406
+ - **KB Guide:** `../../docs/KNOWLEDGE-BASE-GUIDE.md`
407
+ - **Neo4j Integration:** `../../docs/NEO4J-COMPOUND-INTEGRATION.md`
408
+
409
+ ---
410
+
411
+ **Note:** This is the **Python KB CLI library**. For the Node.js project CLI, see `../commands/README.md`.
@@ -0,0 +1,7 @@
1
+ """
2
+ Knowledge Base Library
3
+ Cross-platform Python modules for KB operations
4
+ """
5
+
6
+ __version__ = '1.0.0'
7
+ __author__ = 'TeamLifecycle'