agentic-sdlc 1.6.0 → 1.8.1
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.
- package/.agent/rules/agent-execution.md +55 -0
- package/.agent/rules/ai-enforcement.md +4 -3
- package/.agent/rules/artifacts.md +1 -1
- package/.agent/rules/auto-learning.md +78 -0
- package/.agent/rules/code-quality.md +40 -0
- package/.agent/rules/global.md +2 -2
- package/.agent/rules/naming-conventions.md +55 -0
- package/.agent/skills/role-ba.md +6 -2
- package/.agent/skills/role-brain.md +5 -1
- package/.agent/skills/role-cloud.md +38 -0
- package/.agent/skills/role-dev.md +22 -1
- package/.agent/skills/role-devops.md +4 -0
- package/.agent/skills/role-game.md +35 -0
- package/.agent/skills/role-mobile.md +55 -0
- package/.agent/skills/role-orchestrator.md +4 -0
- package/.agent/skills/role-pm.md +4 -0
- package/.agent/skills/role-po.md +4 -0
- package/.agent/skills/role-reporter.md +4 -0
- package/.agent/skills/role-research.md +78 -0
- package/.agent/skills/role-sa.md +4 -0
- package/.agent/skills/role-seca.md +4 -0
- package/.agent/skills/role-stakeholder.md +4 -0
- package/.agent/skills/role-tester.md +4 -0
- package/.agent/skills/role-uiux.md +4 -0
- package/.agent/templates/Specification-Template.md +38 -0
- package/.agent/templates/ab-comparison-report.md +175 -0
- package/.agent/templates/observer-report.md +131 -0
- package/.agent/templates/quality-score-report.md +197 -0
- package/.agent/templates/self-learning-digest.md +268 -0
- package/.agent/templates/system-health-report.md +330 -0
- package/.agent/workflows/ab.md +101 -0
- package/.agent/workflows/autogen.md +65 -0
- package/.agent/workflows/brain.md +48 -37
- package/.agent/workflows/commit.md +61 -0
- package/.agent/workflows/cycle.md +32 -11
- package/.agent/workflows/debug.md +123 -0
- package/.agent/workflows/deep-search.md +82 -0
- package/.agent/workflows/docs.md +144 -0
- package/.agent/workflows/emergency.md +17 -15
- package/.agent/workflows/explore.md +15 -9
- package/.agent/workflows/housekeeping.md +24 -11
- package/.agent/workflows/metrics.md +14 -12
- package/.agent/workflows/monitor.md +98 -0
- package/.agent/workflows/observe.md +84 -0
- package/.agent/workflows/onboarding.md +135 -0
- package/.agent/workflows/orchestrator.md +12 -5
- package/.agent/workflows/planning.md +126 -0
- package/.agent/workflows/refactor.md +132 -0
- package/.agent/workflows/release.md +19 -12
- package/.agent/workflows/review.md +99 -0
- package/.agent/workflows/score.md +104 -0
- package/.agent/workflows/sprint.md +16 -14
- package/.agent/workflows/validate.md +13 -11
- package/.agent/workflows/worktree.md +154 -0
- package/CHANGELOG.md +71 -0
- package/README.md +12 -4
- package/bin/cli.js +142 -16
- package/docs/.brain-health-history.json +42 -0
- package/docs/.brain-improvements.json +53 -0
- package/docs/.brain-learner-log.json +27 -0
- package/docs/.brain-scores.json +310 -0
- package/docs/architecture/system-flow.mermaid +81 -0
- package/docs/artifacts/2026-01-05-enforcement-gates-plan.md +80 -0
- package/docs/artifacts/2026-01-05-workflow-analysis.md +231 -0
- package/docs/artifacts/README.md +26 -0
- package/docs/guides/MCP-GUIDE.md +1 -0
- package/docs/reports/2026-01-05-autogen-evaluation.md +64 -0
- package/docs/reports/2026-01-05-brain-layer-analysis.md +109 -0
- package/docs/reports/2026-01-05-repository-audit.md +253 -0
- package/docs/reports/Metrics-Dashboard-2026-01-08.md +29 -0
- package/docs/reports/Metrics-Dashboard-Final.md +29 -0
- package/docs/reports/Validation-Report-2026-01-05.md +40 -0
- package/docs/reports/Validation-Report-2026-01-08.md +40 -0
- package/docs/reports/worktrunk-audit.md +94 -0
- package/docs/solutions/README.md +96 -0
- package/docs/walkthroughs/2026-01-05-audit-implementation.md +36 -0
- package/docs/walkthroughs/2026-01-05-autonomy-release.md +54 -0
- package/docs/walkthroughs/2026-01-05-enforcement-gates.md +33 -0
- package/docs/walkthroughs/2026-01-05-judge-enhancement.md +30 -0
- package/docs/walkthroughs/2026-01-05-landing-page-orchestrator.md +52 -0
- package/docs/walkthroughs/2026-01-05-validation.md +32 -0
- package/docs/walkthroughs/2026-01-05-workflow-audit.md +89 -0
- package/docs/walkthroughs/2026-01-05-workflow-refactoring.md +44 -0
- package/docs/walkthroughs/2026-01-06-worktrunk-integration.md +41 -0
- package/docs/walkthroughs/README.md +25 -0
- package/package.json +33 -19
- package/.agent/knowledge-base/AUTO-LEARNING-GUIDE.md +0 -327
- package/.agent/knowledge-base/HOW-IT-WORKS.md +0 -365
- package/.agent/knowledge-base/INDEX.md +0 -43
- package/.agent/knowledge-base/README.md +0 -242
- package/.agent/knowledge-base/architecture/.gitkeep +0 -1
- package/.agent/knowledge-base/architecture/KB-2026-01-01-003-neo4j-graph-database-skills.md +0 -1146
- package/.agent/knowledge-base/architecture/README.md +0 -98
- package/.agent/knowledge-base/bugs/.gitkeep +0 -1
- package/.agent/knowledge-base/bugs/KB-2026-01-02-yaml-special-character-escaping.md +0 -56
- package/.agent/knowledge-base/bugs/medium/KB-2026-01-01-001-example-auto-learned.md +0 -198
- package/.agent/knowledge-base/features/.gitkeep +0 -1
- package/.agent/knowledge-base/features/KB-2026-01-01-001-landing-page-design-trends-2026.md +0 -646
- package/.agent/knowledge-base/features/KB-2026-01-01-004-uiux-design-skills-2026.md +0 -945
- package/.agent/knowledge-base/features/KB-2026-01-01-005-modern-ai-landing-page-ui.md +0 -310
- package/.agent/knowledge-base/features/KB-2026-01-01-006-award-winning-landing-page-patterns.md +0 -324
- package/.agent/knowledge-base/features/KB-2026-01-02-001-cleanup-workflow.md +0 -242
- package/.agent/knowledge-base/features/KB-2026-01-02-002-landing-page-monorepo-architecture.md +0 -148
- package/.agent/knowledge-base/features/KB-2026-01-02-003-premium-glassmorphism-patterns.md +0 -58
- package/.agent/knowledge-base/features/KB-2026-01-04-ai-agent-enforcement.md +0 -46
- package/.agent/knowledge-base/features/README.md +0 -83
- package/.agent/knowledge-base/features/figma-landing-page-workflow.md +0 -311
- package/.agent/knowledge-base/features/figma-mcp-sa-guide.md +0 -673
- package/.agent/knowledge-base/features/figma-mcp-uiux-guide.md +0 -459
- package/.agent/knowledge-base/performance/.gitkeep +0 -1
- package/.agent/knowledge-base/performance/KB-2026-01-02-lazy-loading-optimization.md +0 -80
- package/.agent/knowledge-base/platform-specific/.gitkeep +0 -1
- package/.agent/knowledge-base/platform-specific/KB-2026-01-02-windows-console-encoding.md +0 -56
- package/.agent/knowledge-base/role-guides/DEV-KB-Guide.md +0 -527
- package/.agent/knowledge-base/role-guides/DEVOPS-KB-Guide.md +0 -491
- package/.agent/knowledge-base/role-guides/PM-KB-Guide.md +0 -299
- package/.agent/knowledge-base/role-guides/SECA-KB-Guide.md +0 -555
- package/.agent/knowledge-base/role-guides/TESTER-KB-Guide.md +0 -519
- package/.agent/knowledge-base/security/.gitkeep +0 -1
- package/.agent/knowledge-base/security/KB-2026-01-02-input-validation-sanitization.md +0 -74
- package/.agent/rules/AUTO-LEARNING.md +0 -418
- package/.agent/rules/KNOWLEDGE-BASE.md +0 -45
- package/.agent/workflows/compound.md +0 -51
- package/.agent/workflows/preflight.md +0 -35
- package/.agent/workflows/route.md +0 -160
- package/bin/kb +0 -34
- package/bin/kb.bat +0 -28
- package/bin/kb_cli.py +0 -226
- package/bin/lib/README.md +0 -411
- package/bin/lib/__init__.py +0 -7
- package/bin/lib/__pycache__/kb_add.cpython-313.pyc +0 -0
- package/bin/lib/__pycache__/kb_common.cpython-313.pyc +0 -0
- package/bin/lib/__pycache__/kb_compound.cpython-313.pyc +0 -0
- package/bin/lib/__pycache__/kb_index.cpython-313.pyc +0 -0
- package/bin/lib/__pycache__/kb_list.cpython-313.pyc +0 -0
- package/bin/lib/__pycache__/kb_search.cpython-313.pyc +0 -0
- package/bin/lib/__pycache__/kb_stats.cpython-313.pyc +0 -0
- package/bin/lib/kb_add.py +0 -203
- package/bin/lib/kb_common.py +0 -224
- package/bin/lib/kb_compound.py +0 -250
- package/bin/lib/kb_index.py +0 -193
- package/bin/lib/kb_list.py +0 -144
- package/bin/lib/kb_search.py +0 -121
- package/bin/lib/kb_stats.py +0 -153
package/bin/kb
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,226 +0,0 @@
|
|
|
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()
|
package/bin/lib/README.md
DELETED
|
@@ -1,411 +0,0 @@
|
|
|
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`.
|
package/bin/lib/__init__.py
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|