add-skill-kit 3.2.4 → 3.2.6

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 (78) hide show
  1. package/README.md +179 -119
  2. package/bin/lib/commands/help.js +0 -4
  3. package/bin/lib/commands/install.js +129 -9
  4. package/bin/lib/ui.js +1 -1
  5. package/lib/agent-cli/__tests__/adaptive_engine.test.js +190 -0
  6. package/lib/agent-cli/__tests__/integration/cross_script.test.js +222 -0
  7. package/lib/agent-cli/__tests__/integration/full_cycle.test.js +230 -0
  8. package/lib/agent-cli/__tests__/pattern_analyzer.test.js +173 -0
  9. package/lib/agent-cli/__tests__/pre_execution_check.test.js +167 -0
  10. package/lib/agent-cli/__tests__/skill_injector.test.js +191 -0
  11. package/lib/agent-cli/bin/{ag-smart.js → agent.js} +48 -15
  12. package/lib/agent-cli/dashboard/dashboard_server.js +340 -0
  13. package/lib/agent-cli/dashboard/index.html +538 -0
  14. package/lib/agent-cli/lib/audit.js +2 -2
  15. package/lib/agent-cli/lib/auto-learn.js +8 -8
  16. package/lib/agent-cli/lib/eslint-fix.js +1 -1
  17. package/lib/agent-cli/lib/fix.js +5 -5
  18. package/lib/agent-cli/lib/hooks/install-hooks.js +4 -4
  19. package/lib/agent-cli/lib/hooks/lint-learn.js +4 -4
  20. package/lib/agent-cli/lib/learn.js +10 -10
  21. package/lib/agent-cli/lib/recall.js +1 -1
  22. package/lib/agent-cli/lib/settings.js +24 -0
  23. package/lib/agent-cli/lib/skill-learn.js +2 -2
  24. package/lib/agent-cli/lib/stats.js +3 -3
  25. package/lib/agent-cli/lib/ui/dashboard-ui.js +103 -4
  26. package/lib/agent-cli/lib/ui/index.js +36 -6
  27. package/lib/agent-cli/lib/watcher.js +2 -2
  28. package/lib/agent-cli/package.json +4 -4
  29. package/lib/agent-cli/scripts/adaptive_engine.js +381 -0
  30. package/lib/agent-cli/scripts/dashboard_server.js +224 -0
  31. package/lib/agent-cli/scripts/error_sensor.js +565 -0
  32. package/lib/agent-cli/scripts/learn_from_failure.js +225 -0
  33. package/lib/agent-cli/scripts/pattern_analyzer.js +781 -0
  34. package/lib/agent-cli/scripts/pre_execution_check.js +623 -0
  35. package/lib/agent-cli/scripts/rule_sharing.js +374 -0
  36. package/lib/agent-cli/scripts/skill_injector.js +387 -0
  37. package/lib/agent-cli/scripts/success_sensor.js +500 -0
  38. package/lib/agent-cli/scripts/user_correction_sensor.js +426 -0
  39. package/lib/agent-cli/services/auto-learn-service.js +247 -0
  40. package/lib/agent-cli/src/MIGRATION.md +418 -0
  41. package/lib/agent-cli/src/README.md +367 -0
  42. package/lib/agent-cli/src/core/evolution/evolution-signal.js +42 -0
  43. package/lib/agent-cli/src/core/evolution/index.js +17 -0
  44. package/lib/agent-cli/src/core/evolution/review-gate.js +40 -0
  45. package/lib/agent-cli/src/core/evolution/signal-detector.js +137 -0
  46. package/lib/agent-cli/src/core/evolution/signal-queue.js +79 -0
  47. package/lib/agent-cli/src/core/evolution/threshold-checker.js +79 -0
  48. package/lib/agent-cli/src/core/index.js +15 -0
  49. package/lib/agent-cli/src/core/learning/cognitive-enhancer.js +282 -0
  50. package/lib/agent-cli/src/core/learning/index.js +12 -0
  51. package/lib/agent-cli/src/core/learning/lesson-synthesizer.js +83 -0
  52. package/lib/agent-cli/src/core/scanning/index.js +14 -0
  53. package/lib/agent-cli/src/data/index.js +13 -0
  54. package/lib/agent-cli/src/data/repositories/index.js +8 -0
  55. package/lib/agent-cli/src/data/repositories/lesson-repository.js +130 -0
  56. package/lib/agent-cli/src/data/repositories/signal-repository.js +119 -0
  57. package/lib/agent-cli/src/data/storage/index.js +8 -0
  58. package/lib/agent-cli/src/data/storage/json-storage.js +64 -0
  59. package/lib/agent-cli/src/data/storage/yaml-storage.js +66 -0
  60. package/lib/agent-cli/src/infrastructure/index.js +13 -0
  61. package/lib/agent-cli/src/presentation/formatters/skill-formatter.js +232 -0
  62. package/lib/agent-cli/src/services/export-service.js +162 -0
  63. package/lib/agent-cli/src/services/index.js +13 -0
  64. package/lib/agent-cli/src/services/learning-service.js +99 -0
  65. package/lib/agent-cli/types/index.d.ts +343 -0
  66. package/lib/agent-cli/utils/benchmark.js +269 -0
  67. package/lib/agent-cli/utils/logger.js +303 -0
  68. package/lib/agent-cli/utils/ml_patterns.js +300 -0
  69. package/lib/agent-cli/utils/recovery.js +312 -0
  70. package/lib/agent-cli/utils/telemetry.js +290 -0
  71. package/lib/agentskillskit-cli/ag-smart.js +15 -15
  72. package/lib/agentskillskit-cli/package.json +3 -3
  73. package/package.json +12 -6
  74. package/lib/agent-cli/lib/auto_preview.py +0 -148
  75. package/lib/agent-cli/lib/checklist.py +0 -222
  76. package/lib/agent-cli/lib/session_manager.py +0 -120
  77. package/lib/agent-cli/lib/verify_all.py +0 -327
  78. /package/bin/{cli.js → kit.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "add-skill-kit",
3
- "version": "3.2.4",
3
+ "version": "3.2.6",
4
4
  "description": "Enterprise-grade Agent Skill Manager with Antigravity Skills support, Progressive Disclosure detection, and semantic routing validation",
5
5
  "license": "MIT",
6
6
  "author": "agentskillkit <agentskillkit@gmail.com>",
@@ -14,8 +14,8 @@
14
14
  },
15
15
  "type": "module",
16
16
  "bin": {
17
- "kit": "./bin/cli.js",
18
- "agent": "./lib/agent-cli/bin/ag-smart.js"
17
+ "kit": "./bin/kit.js",
18
+ "agent": "./lib/agent-cli/bin/agent.js"
19
19
  },
20
20
  "files": [
21
21
  "bin/",
@@ -24,6 +24,7 @@
24
24
  "README.md",
25
25
  "LICENSE"
26
26
  ],
27
+ "types": "./lib/agent-cli/types/index.d.ts",
27
28
  "engines": {
28
29
  "node": ">=18.0.0"
29
30
  },
@@ -45,7 +46,7 @@
45
46
  "format": "prettier --write bin/",
46
47
  "test": "vitest run",
47
48
  "test:watch": "vitest",
48
- "ci": "npm run lint && npm test && node bin/cli.js verify --strict && node bin/cli.js doctor --strict",
49
+ "ci": "npm run lint && npm test && node bin/kit.js verify --strict && node bin/kit.js doctor --strict",
49
50
  "agent": "agent"
50
51
  },
51
52
  "publishConfig": {
@@ -54,9 +55,13 @@
54
55
  "dependencies": {
55
56
  "@clack/core": "^0.5.0",
56
57
  "@clack/prompts": "^0.11.0",
58
+ "@google/generative-ai": "^0.21.0",
57
59
  "boxen": "^8.0.1",
58
60
  "chalk": "^5.4.1",
59
61
  "clipboardy": "^5.1.0",
62
+ "csv-parse": "^6.1.0",
63
+ "css-tree": "^3.1.0",
64
+ "dotenv": "^16.4.5",
60
65
  "gradient-string": "^2.0.2",
61
66
  "js-yaml": "^4.1.0",
62
67
  "kleur": "^4.1.5",
@@ -65,8 +70,9 @@
65
70
  "prompts": "^2.4.2"
66
71
  },
67
72
  "devDependencies": {
73
+ "agentskillskit-cli": "^3.2.0",
68
74
  "eslint": "^8.57.0",
69
75
  "prettier": "^3.2.5",
70
- "vitest": "^1.6.0"
76
+ "vitest": "^4.0.18"
71
77
  }
72
- }
78
+ }
@@ -1,148 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- Auto Preview - Agent Skill Kit
4
- ==============================
5
- Manages (start/stop/status) the local development server for previewing the application.
6
-
7
- Usage:
8
- python .agent/scripts/auto_preview.py start [port]
9
- python .agent/scripts/auto_preview.py stop
10
- python .agent/scripts/auto_preview.py status
11
- """
12
-
13
- import os
14
- import sys
15
- import time
16
- import json
17
- import signal
18
- import argparse
19
- import subprocess
20
- from pathlib import Path
21
-
22
- AGENT_DIR = Path(".agent")
23
- PID_FILE = AGENT_DIR / "preview.pid"
24
- LOG_FILE = AGENT_DIR / "preview.log"
25
-
26
- def get_project_root():
27
- return Path(".").resolve()
28
-
29
- def is_running(pid):
30
- try:
31
- os.kill(pid, 0)
32
- return True
33
- except OSError:
34
- return False
35
-
36
- def get_start_command(root):
37
- pkg_file = root / "package.json"
38
- if not pkg_file.exists():
39
- return None
40
-
41
- with open(pkg_file, 'r') as f:
42
- data = json.load(f)
43
-
44
- scripts = data.get("scripts", {})
45
- if "dev" in scripts:
46
- return ["npm", "run", "dev"]
47
- elif "start" in scripts:
48
- return ["npm", "start"]
49
- return None
50
-
51
- def start_server(port=3000):
52
- if PID_FILE.exists():
53
- try:
54
- pid = int(PID_FILE.read_text().strip())
55
- if is_running(pid):
56
- print(f"⚠️ Preview already running (PID: {pid})")
57
- return
58
- except:
59
- pass # Invalid PID file
60
-
61
- root = get_project_root()
62
- cmd = get_start_command(root)
63
-
64
- if not cmd:
65
- print("❌ No 'dev' or 'start' script found in package.json")
66
- sys.exit(1)
67
-
68
- # Add port env var if needed (simple heuristic)
69
- env = os.environ.copy()
70
- env["PORT"] = str(port)
71
-
72
- print(f"🚀 Starting preview on port {port}...")
73
-
74
- with open(LOG_FILE, "w") as log:
75
- process = subprocess.Popen(
76
- cmd,
77
- cwd=str(root),
78
- stdout=log,
79
- stderr=log,
80
- env=env,
81
- shell=True # Required for npm on windows often, or consistent path handling
82
- )
83
-
84
- PID_FILE.write_text(str(process.pid))
85
- print(f"✅ Preview started! (PID: {process.pid})")
86
- print(f" Logs: {LOG_FILE}")
87
- print(f" URL: http://localhost:{port}")
88
-
89
- def stop_server():
90
- if not PID_FILE.exists():
91
- print("ℹ️ No preview server found.")
92
- return
93
-
94
- try:
95
- pid = int(PID_FILE.read_text().strip())
96
- if is_running(pid):
97
- # Try gentle kill first
98
- os.kill(pid, signal.SIGTERM) if sys.platform != 'win32' else subprocess.call(['taskkill', '/F', '/T', '/PID', str(pid)])
99
- print(f"🛑 Preview stopped (PID: {pid})")
100
- else:
101
- print("ℹ️ Process was not running.")
102
- except Exception as e:
103
- print(f"❌ Error stopping server: {e}")
104
- finally:
105
- if PID_FILE.exists():
106
- PID_FILE.unlink()
107
-
108
- def status_server():
109
- running = False
110
- pid = None
111
- url = "Unknown"
112
-
113
- if PID_FILE.exists():
114
- try:
115
- pid = int(PID_FILE.read_text().strip())
116
- if is_running(pid):
117
- running = True
118
- # Heuristic for URL, strictly we should save it
119
- url = "http://localhost:3000"
120
- except:
121
- pass
122
-
123
- print("\n=== Preview Status ===")
124
- if running:
125
- print(f"✅ Status: Running")
126
- print(f"🔢 PID: {pid}")
127
- print(f"🌐 URL: {url} (Likely)")
128
- print(f"📝 Logs: {LOG_FILE}")
129
- else:
130
- print("⚪ Status: Stopped")
131
- print("===================\n")
132
-
133
- def main():
134
- parser = argparse.ArgumentParser()
135
- parser.add_argument("action", choices=["start", "stop", "status"])
136
- parser.add_argument("port", nargs="?", default="3000")
137
-
138
- args = parser.parse_args()
139
-
140
- if args.action == "start":
141
- start_server(int(args.port))
142
- elif args.action == "stop":
143
- stop_server()
144
- elif args.action == "status":
145
- status_server()
146
-
147
- if __name__ == "__main__":
148
- main()
@@ -1,222 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- Master Checklist Runner - Agent Skill Kit
4
- ==========================================
5
-
6
- Orchestrates all validation scripts in priority order.
7
- Use this for incremental validation during development.
8
-
9
- Usage:
10
- python scripts/checklist.py . # Run core checks
11
- python scripts/checklist.py . --url <URL> # Include performance checks
12
-
13
- Priority Order:
14
- P0: Security Scan (vulnerabilities, secrets)
15
- P1: Lint & Type Check (code quality)
16
- P2: Schema Validation (if database exists)
17
- P3: Test Runner (unit/integration tests)
18
- P4: UX Audit (psychology laws, accessibility)
19
- P5: SEO Check (meta tags, structure)
20
- P6: Performance (lighthouse - requires URL)
21
- """
22
-
23
- import sys
24
- import subprocess
25
- import argparse
26
- from pathlib import Path
27
- from typing import List, Tuple, Optional
28
-
29
- # ANSI colors for terminal output
30
- class Colors:
31
- HEADER = '\033[95m'
32
- BLUE = '\033[94m'
33
- CYAN = '\033[96m'
34
- GREEN = '\033[92m'
35
- YELLOW = '\033[93m'
36
- RED = '\033[91m'
37
- ENDC = '\033[0m'
38
- BOLD = '\033[1m'
39
-
40
- def print_header(text: str):
41
- print(f"\n{Colors.BOLD}{Colors.CYAN}{'='*60}{Colors.ENDC}")
42
- print(f"{Colors.BOLD}{Colors.CYAN}{text.center(60)}{Colors.ENDC}")
43
- print(f"{Colors.BOLD}{Colors.CYAN}{'='*60}{Colors.ENDC}\n")
44
-
45
- def print_step(text: str):
46
- print(f"{Colors.BOLD}{Colors.BLUE}🔄 {text}{Colors.ENDC}")
47
-
48
- def print_success(text: str):
49
- print(f"{Colors.GREEN}✅ {text}{Colors.ENDC}")
50
-
51
- def print_warning(text: str):
52
- print(f"{Colors.YELLOW}⚠️ {text}{Colors.ENDC}")
53
-
54
- def print_error(text: str):
55
- print(f"{Colors.RED}❌ {text}{Colors.ENDC}")
56
-
57
- # Define priority-ordered checks
58
- CORE_CHECKS = [
59
- ("Security Scan", ".agent/skills/vulnerability-scanner/scripts/security_scan.py", True),
60
- ("Smart Audit", ".agent/scripts/audit.js", True),
61
- ("Lint Check", ".agent/skills/lint-and-validate/scripts/lint_runner.py", True),
62
- ("Schema Validation", ".agent/skills/database-design/scripts/schema_validator.py", False),
63
- ("Test Runner", ".agent/skills/testing-patterns/scripts/test_runner.py", False),
64
- ("UX Audit", ".agent/skills/frontend-design/scripts/ux_audit.py", False),
65
- ("SEO Check", ".agent/skills/seo-fundamentals/scripts/seo_checker.py", False),
66
- ]
67
-
68
- PERFORMANCE_CHECKS = [
69
- ("Lighthouse Audit", ".agent/skills/performance-profiling/scripts/lighthouse_audit.py", True),
70
- ("Playwright E2E", ".agent/skills/webapp-testing/scripts/playwright_runner.py", False),
71
- ]
72
-
73
- def check_script_exists(script_path: Path) -> bool:
74
- """Check if script file exists"""
75
- return script_path.exists() and script_path.is_file()
76
-
77
- def run_script(name: str, script_path: Path, project_path: str, url: Optional[str] = None) -> dict:
78
- """
79
- Run a validation script and capture results
80
-
81
- Returns:
82
- dict with keys: name, passed, output, skipped
83
- """
84
- if not check_script_exists(script_path):
85
- print_warning(f"{name}: Script not found, skipping")
86
- return {"name": name, "passed": True, "output": "", "skipped": True}
87
-
88
- print_step(f"Running: {name}")
89
-
90
- # Build command
91
- if str(script_path).endswith('.js'):
92
- cmd = ["node", str(script_path), project_path]
93
- else:
94
- cmd = ["python", str(script_path), project_path]
95
-
96
- if url and ("lighthouse" in script_path.name.lower() or "playwright" in script_path.name.lower()):
97
- cmd.append(url)
98
-
99
- # Run script
100
- try:
101
- result = subprocess.run(
102
- cmd,
103
- capture_output=True,
104
- text=True,
105
- timeout=300 # 5 minute timeout
106
- )
107
-
108
- passed = result.returncode == 0
109
-
110
- if passed:
111
- print_success(f"{name}: PASSED")
112
- else:
113
- print_error(f"{name}: FAILED")
114
- if result.stderr:
115
- print(f" Error: {result.stderr[:200]}")
116
-
117
- return {
118
- "name": name,
119
- "passed": passed,
120
- "output": result.stdout,
121
- "error": result.stderr,
122
- "skipped": False
123
- }
124
-
125
- except subprocess.TimeoutExpired:
126
- print_error(f"{name}: TIMEOUT (>5 minutes)")
127
- return {"name": name, "passed": False, "output": "", "error": "Timeout", "skipped": False}
128
-
129
- except Exception as e:
130
- print_error(f"{name}: ERROR - {str(e)}")
131
- return {"name": name, "passed": False, "output": "", "error": str(e), "skipped": False}
132
-
133
- def print_summary(results: List[dict]):
134
- """Print final summary report"""
135
- print_header("📊 CHECKLIST SUMMARY")
136
-
137
- passed_count = sum(1 for r in results if r["passed"] and not r.get("skipped"))
138
- failed_count = sum(1 for r in results if not r["passed"] and not r.get("skipped"))
139
- skipped_count = sum(1 for r in results if r.get("skipped"))
140
-
141
- print(f"Total Checks: {len(results)}")
142
- print(f"{Colors.GREEN}✅ Passed: {passed_count}{Colors.ENDC}")
143
- print(f"{Colors.RED}❌ Failed: {failed_count}{Colors.ENDC}")
144
- print(f"{Colors.YELLOW}⏭️ Skipped: {skipped_count}{Colors.ENDC}")
145
- print()
146
-
147
- # Detailed results
148
- for r in results:
149
- if r.get("skipped"):
150
- status = f"{Colors.YELLOW}⏭️ {Colors.ENDC}"
151
- elif r["passed"]:
152
- status = f"{Colors.GREEN}✅{Colors.ENDC}"
153
- else:
154
- status = f"{Colors.RED}❌{Colors.ENDC}"
155
-
156
- print(f"{status} {r['name']}")
157
-
158
- print()
159
-
160
- if failed_count > 0:
161
- print_error(f"{failed_count} check(s) FAILED - Please fix before proceeding")
162
- return False
163
- else:
164
- print_success("All checks PASSED ✨")
165
- return True
166
-
167
- def main():
168
- parser = argparse.ArgumentParser(
169
- description="Run Agent Skill Kit validation checklist",
170
- formatter_class=argparse.RawDescriptionHelpFormatter,
171
- epilog="""
172
- Examples:
173
- python scripts/checklist.py . # Core checks only
174
- python scripts/checklist.py . --url http://localhost:3000 # Include performance
175
- """
176
- )
177
- parser.add_argument("project", help="Project path to validate")
178
- parser.add_argument("--url", help="URL for performance checks (lighthouse, playwright)")
179
- parser.add_argument("--skip-performance", action="store_true", help="Skip performance checks even if URL provided")
180
-
181
- args = parser.parse_args()
182
-
183
- project_path = Path(args.project).resolve()
184
-
185
- if not project_path.exists():
186
- print_error(f"Project path does not exist: {project_path}")
187
- sys.exit(1)
188
-
189
- print_header("🚀 AGENT SKILLS KIT - MASTER CHECKLIST")
190
- print(f"Project: {project_path}")
191
- print(f"URL: {args.url if args.url else 'Not provided (performance checks skipped)'}")
192
-
193
- results = []
194
-
195
- # Run core checks
196
- print_header("📋 CORE CHECKS")
197
- for name, script_path, required in CORE_CHECKS:
198
- script = project_path / script_path
199
- result = run_script(name, script, str(project_path))
200
- results.append(result)
201
-
202
- # If required check fails, stop
203
- if required and not result["passed"] and not result.get("skipped"):
204
- print_error(f"CRITICAL: {name} failed. Stopping checklist.")
205
- print_summary(results)
206
- sys.exit(1)
207
-
208
- # Run performance checks if URL provided
209
- if args.url and not args.skip_performance:
210
- print_header("⚡ PERFORMANCE CHECKS")
211
- for name, script_path, required in PERFORMANCE_CHECKS:
212
- script = project_path / script_path
213
- result = run_script(name, script, str(project_path), args.url)
214
- results.append(result)
215
-
216
- # Print summary
217
- all_passed = print_summary(results)
218
-
219
- sys.exit(0 if all_passed else 1)
220
-
221
- if __name__ == "__main__":
222
- main()
@@ -1,120 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- Session Manager - Agent Skill Kit
4
- =================================
5
- Analyzes project state, detects tech stack, tracks file statistics, and provides
6
- a summary of the current session.
7
-
8
- Usage:
9
- python .agent/scripts/session_manager.py status [path]
10
- python .agent/scripts/session_manager.py info [path]
11
- """
12
-
13
- import os
14
- import json
15
- import argparse
16
- from pathlib import Path
17
- from typing import Dict, Any, List
18
-
19
- def get_project_root(path: str) -> Path:
20
- return Path(path).resolve()
21
-
22
- def analyze_package_json(root: Path) -> Dict[str, Any]:
23
- pkg_file = root / "package.json"
24
- if not pkg_file.exists():
25
- return {"type": "unknown", "dependencies": {}}
26
-
27
- try:
28
- with open(pkg_file, 'r', encoding='utf-8') as f:
29
- data = json.load(f)
30
-
31
- deps = data.get("dependencies", {})
32
- dev_deps = data.get("devDependencies", {})
33
- all_deps = {**deps, **dev_deps}
34
-
35
- stack = []
36
- if "next" in all_deps: stack.append("Next.js")
37
- elif "react" in all_deps: stack.append("React")
38
- elif "vue" in all_deps: stack.append("Vue")
39
- elif "svelte" in all_deps: stack.append("Svelte")
40
- elif "express" in all_deps: stack.append("Express")
41
- elif "nestjs" in all_deps or "@nestjs/core" in all_deps: stack.append("NestJS")
42
-
43
- if "tailwindcss" in all_deps: stack.append("Tailwind CSS")
44
- if "prisma" in all_deps: stack.append("Prisma")
45
- if "typescript" in all_deps: stack.append("TypeScript")
46
-
47
- return {
48
- "name": data.get("name", "unnamed"),
49
- "version": data.get("version", "0.0.0"),
50
- "stack": stack,
51
- "scripts": list(data.get("scripts", {}).keys())
52
- }
53
- except Exception as e:
54
- return {"error": str(e)}
55
-
56
- def count_files(root: Path) -> Dict[str, int]:
57
- stats = {"created": 0, "modified": 0, "total": 0}
58
- # Simple count for now, comprehensive tracking would require git diff or extensive history
59
- exclude = {".git", "node_modules", ".next", "dist", "build", ".agent", ".gemini", "__pycache__"}
60
-
61
- for root_dir, dirs, files in os.walk(root):
62
- dirs[:] = [d for d in dirs if d not in exclude]
63
- stats["total"] += len(files)
64
-
65
- return stats
66
-
67
- def detect_features(root: Path) -> List[str]:
68
- # Heuristic: look at folder names in src/
69
- features = []
70
- src = root / "src"
71
- if src.exists():
72
- possible_dirs = ["components", "modules", "features", "app", "pages", "services"]
73
- for d in possible_dirs:
74
- p = src / d
75
- if p.exists() and p.is_dir():
76
- # List subdirectories as likely features
77
- for child in p.iterdir():
78
- if child.is_dir():
79
- features.append(child.name)
80
- return features[:10] # Limit to top 10
81
-
82
- def print_status(root: Path):
83
- info = analyze_package_json(root)
84
- stats = count_files(root)
85
- features = detect_features(root)
86
-
87
- print("\n=== Project Status ===")
88
- print(f"\n📁 Project: {info.get('name', root.name)}")
89
- print(f"📂 Path: {root}")
90
- print(f"🏷️ Type: {', '.join(info.get('stack', ['Generic']))}")
91
- print(f"📊 Status: Active")
92
-
93
- print("\n🔧 Tech Stack:")
94
- for tech in info.get('stack', []):
95
- print(f" • {tech}")
96
-
97
- print(f"\n✅ Detected Modules/Features ({len(features)}):")
98
- for feat in features:
99
- print(f" • {feat}")
100
- if not features:
101
- print(" (No distinct feature modules detected)")
102
-
103
- print(f"\n📄 Files: {stats['total']} total files tracked")
104
- print("\n====================\n")
105
-
106
- def main():
107
- parser = argparse.ArgumentParser(description="Session Manager")
108
- parser.add_argument("command", choices=["status", "info"], help="Command to run")
109
- parser.add_argument("path", nargs="?", default=".", help="Project path")
110
-
111
- args = parser.parse_args()
112
- root = get_project_root(args.path)
113
-
114
- if args.command == "status":
115
- print_status(root)
116
- elif args.command == "info":
117
- print(json.dumps(analyze_package_json(root), indent=2))
118
-
119
- if __name__ == "__main__":
120
- main()