@paulojalowyj/openkit 0.1.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/.opencode/ARCHITECTURE.md +150 -0
- package/.opencode/LICENSE +21 -0
- package/.opencode/bin/cli.js +213 -0
- package/.opencode/commands/README.md +273 -0
- package/.opencode/commands/analyze.md +64 -0
- package/.opencode/commands/brainstorm.md +186 -0
- package/.opencode/commands/checklist.md +62 -0
- package/.opencode/commands/clarify.md +40 -0
- package/.opencode/commands/context.md +68 -0
- package/.opencode/commands/create.md +70 -0
- package/.opencode/commands/debug.md +160 -0
- package/.opencode/commands/deploy.md +244 -0
- package/.opencode/commands/doc.md +45 -0
- package/.opencode/commands/engineer.md +483 -0
- package/.opencode/commands/impl.md +242 -0
- package/.opencode/commands/plan.md +250 -0
- package/.opencode/commands/preview.md +87 -0
- package/.opencode/commands/specify.md +66 -0
- package/.opencode/commands/status.md +103 -0
- package/.opencode/commands/tasks.md +58 -0
- package/.opencode/commands/test.md +104 -0
- package/.opencode/commands/ui-ux.md +216 -0
- package/.opencode/prompts/backend-specialist.md +315 -0
- package/.opencode/prompts/chat.md +36 -0
- package/.opencode/prompts/database-architect.md +244 -0
- package/.opencode/prompts/debugger.md +244 -0
- package/.opencode/prompts/devops-engineer.md +259 -0
- package/.opencode/prompts/documentation-writer.md +121 -0
- package/.opencode/prompts/explorer-agent.md +92 -0
- package/.opencode/prompts/frontend-specialist.md +608 -0
- package/.opencode/prompts/mobile-developer.md +393 -0
- package/.opencode/prompts/orchestrator.md +472 -0
- package/.opencode/prompts/penetration-tester.md +205 -0
- package/.opencode/prompts/performance-optimizer.md +204 -0
- package/.opencode/prompts/product-owner.md +113 -0
- package/.opencode/prompts/project-planner.md +413 -0
- package/.opencode/prompts/security-auditor.md +187 -0
- package/.opencode/prompts/seo-specialist.md +128 -0
- package/.opencode/prompts/test-engineer.md +190 -0
- package/.opencode/rules/AGENT_TEMPLATE.md +391 -0
- package/.opencode/rules/MASTER.md +272 -0
- package/.opencode/rules/README.md +266 -0
- package/.opencode/rules/TODOLIST_EXAMPLES.md +675 -0
- package/.opencode/rules/TODOLIST_PROTOCOL.md +495 -0
- package/.opencode/rules/TOOL_USAGE.md +731 -0
- package/.opencode/scripts/auto_preview.py +100 -0
- package/.opencode/scripts/checklist.py +217 -0
- package/.opencode/scripts/session_manager.py +225 -0
- package/.opencode/scripts/verify_all.py +403 -0
- package/.opencode/skills/api-patterns/SKILL.md +80 -0
- package/.opencode/skills/api-patterns/api-style.md +42 -0
- package/.opencode/skills/api-patterns/auth.md +24 -0
- package/.opencode/skills/api-patterns/documentation.md +26 -0
- package/.opencode/skills/api-patterns/graphql.md +41 -0
- package/.opencode/skills/api-patterns/rate-limiting.md +31 -0
- package/.opencode/skills/api-patterns/response.md +37 -0
- package/.opencode/skills/api-patterns/rest.md +40 -0
- package/.opencode/skills/api-patterns/scripts/api_validator.py +211 -0
- package/.opencode/skills/api-patterns/security-testing.md +122 -0
- package/.opencode/skills/api-patterns/trpc.md +41 -0
- package/.opencode/skills/api-patterns/versioning.md +22 -0
- package/.opencode/skills/app-builder/SKILL.md +101 -0
- package/.opencode/skills/app-builder/agent-coordination.md +71 -0
- package/.opencode/skills/app-builder/feature-building.md +53 -0
- package/.opencode/skills/app-builder/project-detection.md +34 -0
- package/.opencode/skills/app-builder/scaffolding.md +116 -0
- package/.opencode/skills/app-builder/tech-stack.md +40 -0
- package/.opencode/skills/app-builder/templates/SKILL.md +39 -0
- package/.opencode/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/.opencode/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/.opencode/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/.opencode/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/.opencode/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/.opencode/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/.opencode/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/.opencode/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +81 -0
- package/.opencode/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +100 -0
- package/.opencode/skills/app-builder/templates/nextjs-static/TEMPLATE.md +106 -0
- package/.opencode/skills/app-builder/templates/nuxt-app/TEMPLATE.md +100 -0
- package/.opencode/skills/app-builder/templates/python-fastapi/TEMPLATE.md +82 -0
- package/.opencode/skills/app-builder/templates/react-native-app/TEMPLATE.md +93 -0
- package/.opencode/skills/architecture/SKILL.md +55 -0
- package/.opencode/skills/architecture/context-discovery.md +43 -0
- package/.opencode/skills/architecture/examples.md +94 -0
- package/.opencode/skills/architecture/pattern-selection.md +68 -0
- package/.opencode/skills/architecture/patterns-reference.md +50 -0
- package/.opencode/skills/architecture/trade-off-analysis.md +77 -0
- package/.opencode/skills/bash-linux/SKILL.md +199 -0
- package/.opencode/skills/behavioral-modes/SKILL.md +242 -0
- package/.opencode/skills/brainstorming/SKILL.md +163 -0
- package/.opencode/skills/brainstorming/dynamic-questioning.md +350 -0
- package/.opencode/skills/clean-code/SKILL.md +201 -0
- package/.opencode/skills/code-review-checklist/SKILL.md +109 -0
- package/.opencode/skills/database-design/SKILL.md +73 -0
- package/.opencode/skills/database-design/database-selection.md +43 -0
- package/.opencode/skills/database-design/indexing.md +39 -0
- package/.opencode/skills/database-design/migrations.md +48 -0
- package/.opencode/skills/database-design/optimization.md +36 -0
- package/.opencode/skills/database-design/orm-selection.md +30 -0
- package/.opencode/skills/database-design/schema-design.md +56 -0
- package/.opencode/skills/database-design/scripts/schema_validator.py +172 -0
- package/.opencode/skills/deployment-procedures/SKILL.md +241 -0
- package/.opencode/skills/documentation-templates/SKILL.md +279 -0
- package/.opencode/skills/frontend-design/SKILL.md +446 -0
- package/.opencode/skills/frontend-design/animation-guide.md +331 -0
- package/.opencode/skills/frontend-design/color-system.md +311 -0
- package/.opencode/skills/frontend-design/data/charts.csv +26 -0
- package/.opencode/skills/frontend-design/data/colors.csv +97 -0
- package/.opencode/skills/frontend-design/data/icons.csv +101 -0
- package/.opencode/skills/frontend-design/data/landing.csv +31 -0
- package/.opencode/skills/frontend-design/data/products.csv +97 -0
- package/.opencode/skills/frontend-design/data/prompts.csv +24 -0
- package/.opencode/skills/frontend-design/data/react-performance.csv +45 -0
- package/.opencode/skills/frontend-design/data/stacks/flutter.csv +53 -0
- package/.opencode/skills/frontend-design/data/stacks/html-tailwind.csv +56 -0
- package/.opencode/skills/frontend-design/data/stacks/jetpack-compose.csv +53 -0
- package/.opencode/skills/frontend-design/data/stacks/nextjs.csv +53 -0
- package/.opencode/skills/frontend-design/data/stacks/nuxt-ui.csv +51 -0
- package/.opencode/skills/frontend-design/data/stacks/nuxtjs.csv +59 -0
- package/.opencode/skills/frontend-design/data/stacks/react-native.csv +52 -0
- package/.opencode/skills/frontend-design/data/stacks/react.csv +54 -0
- package/.opencode/skills/frontend-design/data/stacks/shadcn.csv +61 -0
- package/.opencode/skills/frontend-design/data/stacks/svelte.csv +54 -0
- package/.opencode/skills/frontend-design/data/stacks/swiftui.csv +51 -0
- package/.opencode/skills/frontend-design/data/stacks/vue.csv +50 -0
- package/.opencode/skills/frontend-design/data/styles.csv +59 -0
- package/.opencode/skills/frontend-design/data/typography.csv +58 -0
- package/.opencode/skills/frontend-design/data/ui-reasoning.csv +101 -0
- package/.opencode/skills/frontend-design/data/ux-guidelines.csv +100 -0
- package/.opencode/skills/frontend-design/data/web-interface.csv +31 -0
- package/.opencode/skills/frontend-design/decision-trees.md +418 -0
- package/.opencode/skills/frontend-design/motion-graphics.md +306 -0
- package/.opencode/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/.opencode/skills/frontend-design/scripts/core.py +258 -0
- package/.opencode/skills/frontend-design/scripts/design_system.py +1067 -0
- package/.opencode/skills/frontend-design/scripts/search.py +106 -0
- package/.opencode/skills/frontend-design/scripts/ux_audit.py +735 -0
- package/.opencode/skills/frontend-design/typography-system.md +345 -0
- package/.opencode/skills/frontend-design/ux-psychology.md +541 -0
- package/.opencode/skills/frontend-design/visual-effects.md +383 -0
- package/.opencode/skills/geo-fundamentals/SKILL.md +156 -0
- package/.opencode/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/.opencode/skills/i18n-localization/SKILL.md +154 -0
- package/.opencode/skills/i18n-localization/scripts/i18n_checker.py +241 -0
- package/.opencode/skills/intelligent-routing/SKILL.md +335 -0
- package/.opencode/skills/lint-and-validate/SKILL.md +45 -0
- package/.opencode/skills/lint-and-validate/scripts/lint_runner.py +172 -0
- package/.opencode/skills/lint-and-validate/scripts/type_coverage.py +173 -0
- package/.opencode/skills/mobile-design/SKILL.md +394 -0
- package/.opencode/skills/mobile-design/decision-trees.md +516 -0
- package/.opencode/skills/mobile-design/mobile-backend.md +491 -0
- package/.opencode/skills/mobile-design/mobile-color-system.md +420 -0
- package/.opencode/skills/mobile-design/mobile-debugging.md +122 -0
- package/.opencode/skills/mobile-design/mobile-design-thinking.md +357 -0
- package/.opencode/skills/mobile-design/mobile-navigation.md +458 -0
- package/.opencode/skills/mobile-design/mobile-performance.md +767 -0
- package/.opencode/skills/mobile-design/mobile-testing.md +356 -0
- package/.opencode/skills/mobile-design/mobile-typography.md +433 -0
- package/.opencode/skills/mobile-design/platform-android.md +666 -0
- package/.opencode/skills/mobile-design/platform-ios.md +561 -0
- package/.opencode/skills/mobile-design/scripts/mobile_audit.py +670 -0
- package/.opencode/skills/mobile-design/touch-psychology.md +537 -0
- package/.opencode/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +312 -0
- package/.opencode/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
- package/.opencode/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
- package/.opencode/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
- package/.opencode/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
- package/.opencode/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
- package/.opencode/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
- package/.opencode/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
- package/.opencode/skills/nextjs-react-expert/SKILL.md +267 -0
- package/.opencode/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
- package/.opencode/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
- package/.opencode/skills/parallel-agents/SKILL.md +175 -0
- package/.opencode/skills/performance-profiling/SKILL.md +143 -0
- package/.opencode/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/.opencode/skills/plan-writing/SKILL.md +176 -0
- package/.opencode/skills/python-patterns/SKILL.md +462 -0
- package/.opencode/skills/red-team-tactics/SKILL.md +199 -0
- package/.opencode/skills/seo-fundamentals/SKILL.md +129 -0
- package/.opencode/skills/seo-fundamentals/scripts/seo_checker.py +222 -0
- package/.opencode/skills/server-management/SKILL.md +161 -0
- package/.opencode/skills/stack-selection/SKILL.md +448 -0
- package/.opencode/skills/systematic-debugging/SKILL.md +109 -0
- package/.opencode/skills/tailwind-patterns/SKILL.md +269 -0
- package/.opencode/skills/tdd-workflow/SKILL.md +149 -0
- package/.opencode/skills/testing-patterns/SKILL.md +178 -0
- package/.opencode/skills/testing-patterns/scripts/test_runner.py +219 -0
- package/.opencode/skills/vulnerability-scanner/SKILL.md +276 -0
- package/.opencode/skills/vulnerability-scanner/checklists.md +121 -0
- package/.opencode/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/.opencode/skills/web-design-guidelines/SKILL.md +57 -0
- package/.opencode/skills/webapp-testing/SKILL.md +187 -0
- package/.opencode/skills/webapp-testing/scripts/playwright_runner.py +173 -0
- package/.opencode/templates/DOCS-ACTION_ITEMS.md +5 -0
- package/.opencode/templates/DOCS-API.md +11 -0
- package/.opencode/templates/DOCS-BACKEND.md +10 -0
- package/.opencode/templates/DOCS-CONTEXT.md +25 -0
- package/.opencode/templates/DOCS-DATABASE.md +10 -0
- package/.opencode/templates/DOCS-FRONTEND.md +11 -0
- package/.opencode/templates/DOCS-QUALITY_GATES.md +20 -0
- package/.opencode/templates/DOCS-SECURITY.md +17 -0
- package/.opencode/templates/SDD-AcceptanceCriteria.md +21 -0
- package/.opencode/templates/SDD-Checklist.md +27 -0
- package/.opencode/templates/SDD-Contracts.md +21 -0
- package/.opencode/templates/SDD-Plan.md +45 -0
- package/.opencode/templates/SDD-ProblemStatement.md +25 -0
- package/.opencode/templates/SDD-Quickstart.md +23 -0
- package/.opencode/templates/SDD-Research.md +24 -0
- package/.opencode/templates/SDD-Risks.md +16 -0
- package/.opencode/templates/SDD-Tasks.md +41 -0
- package/.opencode/templates/SDD-UserStories.md +45 -0
- package/.opencode/templates/TechStack.md +111 -0
- package/LICENSE +21 -0
- package/PACKAGE_STATUS.md +97 -0
- package/README.md +251 -0
- package/README.pt-BR.md +192 -0
- package/bin/cli.js +505 -0
- package/blueprints/fullstack/.env.example +15 -0
- package/blueprints/fullstack/AGENTS.md +3 -0
- package/blueprints/fullstack/README.md +65 -0
- package/blueprints/fullstack/backend/.dockerignore +10 -0
- package/blueprints/fullstack/backend/.python-version +1 -0
- package/blueprints/fullstack/backend/Dockerfile +33 -0
- package/blueprints/fullstack/backend/alembic.ini +40 -0
- package/blueprints/fullstack/backend/app/__init__.py +0 -0
- package/blueprints/fullstack/backend/app/api/README.md +3 -0
- package/blueprints/fullstack/backend/app/api/__init__.py +0 -0
- package/blueprints/fullstack/backend/app/celery_app.py +5 -0
- package/blueprints/fullstack/backend/app/core/README.md +3 -0
- package/blueprints/fullstack/backend/app/core/__init__.py +0 -0
- package/blueprints/fullstack/backend/app/database.py +14 -0
- package/blueprints/fullstack/backend/app/main.py +16 -0
- package/blueprints/fullstack/backend/app/models/README.md +3 -0
- package/blueprints/fullstack/backend/app/models/__init__.py +3 -0
- package/blueprints/fullstack/backend/app/models/item.py +10 -0
- package/blueprints/fullstack/backend/app/routers/__init__.py +0 -0
- package/blueprints/fullstack/backend/app/routers/items.py +20 -0
- package/blueprints/fullstack/backend/app/schemas/README.md +3 -0
- package/blueprints/fullstack/backend/app/schemas/__init__.py +0 -0
- package/blueprints/fullstack/backend/app/schemas/item.py +15 -0
- package/blueprints/fullstack/backend/app/services/item_service.py +23 -0
- package/blueprints/fullstack/backend/app/settings.py +36 -0
- package/blueprints/fullstack/backend/app/tasks/README.md +3 -0
- package/blueprints/fullstack/backend/app/tasks/__init__.py +0 -0
- package/blueprints/fullstack/backend/migrations/env.py +47 -0
- package/blueprints/fullstack/backend/migrations/versions/0001_initial_sample_data.py +31 -0
- package/blueprints/fullstack/backend/pyproject.toml +45 -0
- package/blueprints/fullstack/docker-compose.dev.yml +114 -0
- package/blueprints/fullstack/docker-compose.prod.yml +90 -0
- package/blueprints/fullstack/docs/README.md +29 -0
- package/blueprints/fullstack/docs/engineering/api/README.md +3 -0
- package/blueprints/fullstack/docs/engineering/architecture/README.md +3 -0
- package/blueprints/fullstack/docs/engineering/backend/README.md +3 -0
- package/blueprints/fullstack/docs/engineering/frontend/README.md +3 -0
- package/blueprints/fullstack/docs/engineering/security/README.md +3 -0
- package/blueprints/fullstack/docs/engineering/standards/README.md +3 -0
- package/blueprints/fullstack/frontend/.dockerignore +4 -0
- package/blueprints/fullstack/frontend/Dockerfile +23 -0
- package/blueprints/fullstack/frontend/components.json +17 -0
- package/blueprints/fullstack/frontend/index.html +12 -0
- package/blueprints/fullstack/frontend/package.json +28 -0
- package/blueprints/fullstack/frontend/src/components/README.md +3 -0
- package/blueprints/fullstack/frontend/src/components/ui/.keep +4 -0
- package/blueprints/fullstack/frontend/src/index.css +57 -0
- package/blueprints/fullstack/frontend/src/lib/README.md +3 -0
- package/blueprints/fullstack/frontend/src/lib/api.ts +1 -0
- package/blueprints/fullstack/frontend/src/lib/utils.ts +6 -0
- package/blueprints/fullstack/frontend/src/main.tsx +66 -0
- package/blueprints/fullstack/frontend/src/routes/README.md +3 -0
- package/blueprints/fullstack/frontend/src/routes/root.tsx +7 -0
- package/blueprints/fullstack/frontend/src/vite-env.d.ts +1 -0
- package/blueprints/fullstack/frontend/tailwind.config.ts +12 -0
- package/blueprints/fullstack/frontend/tsconfig.json +13 -0
- package/blueprints/fullstack/frontend/tsconfig.node.json +12 -0
- package/blueprints/fullstack/frontend/vite.config.ts +12 -0
- package/index.js +14 -0
- package/opencode.json +306 -0
- package/package.json +57 -0
- package/scripts/prepare.js +65 -0
- package/scripts/update-version.js +29 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Auto Preview - OpenKit
|
|
4
|
+
==============================
|
|
5
|
+
Manages (start/stop/status) the local development environment using Docker Compose.
|
|
6
|
+
|
|
7
|
+
Usage:
|
|
8
|
+
python .opencode/scripts/auto_preview.py start
|
|
9
|
+
python .opencode/scripts/auto_preview.py stop
|
|
10
|
+
python .opencode/scripts/auto_preview.py status
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
import argparse
|
|
14
|
+
import os
|
|
15
|
+
import subprocess
|
|
16
|
+
import sys
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def get_project_root():
|
|
21
|
+
return Path(".").resolve()
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def get_docker_compose_file(root):
|
|
25
|
+
# Prefer dev config
|
|
26
|
+
dev_config = root / "docker-compose.dev.yml"
|
|
27
|
+
if dev_config.exists():
|
|
28
|
+
return "docker-compose.dev.yml"
|
|
29
|
+
|
|
30
|
+
# Fallback to standard
|
|
31
|
+
std_config = root / "docker-compose.yml"
|
|
32
|
+
if std_config.exists():
|
|
33
|
+
return "docker-compose.yml"
|
|
34
|
+
|
|
35
|
+
return None
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def run_docker_command(cmd_args, root_path):
|
|
39
|
+
compose_file = get_docker_compose_file(root_path)
|
|
40
|
+
if not compose_file:
|
|
41
|
+
print(" No docker-compose.dev.yml or docker-compose.yml found in root.")
|
|
42
|
+
sys.exit(1)
|
|
43
|
+
|
|
44
|
+
base_cmd = ["docker", "compose", "-f", compose_file]
|
|
45
|
+
full_cmd = base_cmd + cmd_args
|
|
46
|
+
|
|
47
|
+
try:
|
|
48
|
+
subprocess.run(full_cmd, cwd=str(root_path), check=True)
|
|
49
|
+
except subprocess.CalledProcessError as e:
|
|
50
|
+
print(f" Docker command failed: {e}")
|
|
51
|
+
sys.exit(1)
|
|
52
|
+
except FileNotFoundError:
|
|
53
|
+
print(" Docker not found. Please verify it is installed and in your PATH.")
|
|
54
|
+
sys.exit(1)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def start_server():
|
|
58
|
+
root = get_project_root()
|
|
59
|
+
print(" Starting development environment (detached)...")
|
|
60
|
+
# Up detached
|
|
61
|
+
run_docker_command(["up", "-d"], root)
|
|
62
|
+
print(" Environment started.")
|
|
63
|
+
print(" Frontend: http://localhost:5173 (likely)")
|
|
64
|
+
print(" Backend: http://localhost:8000 (likely)")
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def stop_server():
|
|
68
|
+
root = get_project_root()
|
|
69
|
+
print(" Stopping development environment...")
|
|
70
|
+
run_docker_command(["stop"], root) # Just stop, don't remove containers usually
|
|
71
|
+
print(" Environment stopped.")
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def status_server():
|
|
75
|
+
root = get_project_root()
|
|
76
|
+
print("\n=== Docker Compose Status ===")
|
|
77
|
+
run_docker_command(["ps"], root)
|
|
78
|
+
print("=============================\n")
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def main():
|
|
82
|
+
parser = argparse.ArgumentParser()
|
|
83
|
+
parser.add_argument("action", choices=["start", "stop", "status"])
|
|
84
|
+
# Port argument is ignored in Docker mode as ports are defined in compose
|
|
85
|
+
parser.add_argument(
|
|
86
|
+
"port", nargs="?", default="3000", help="Ignored in Docker mode"
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
args = parser.parse_args()
|
|
90
|
+
|
|
91
|
+
if args.action == "start":
|
|
92
|
+
start_server()
|
|
93
|
+
elif args.action == "stop":
|
|
94
|
+
stop_server()
|
|
95
|
+
elif args.action == "status":
|
|
96
|
+
status_server()
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
if __name__ == "__main__":
|
|
100
|
+
main()
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Master Checklist Runner - OpenKit
|
|
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", ".opencode/skills/vulnerability-scanner/scripts/security_scan.py", True),
|
|
60
|
+
("Lint Check", ".opencode/skills/lint-and-validate/scripts/lint_runner.py", True),
|
|
61
|
+
("Schema Validation", ".opencode/skills/database-design/scripts/schema_validator.py", False),
|
|
62
|
+
("Test Runner", ".opencode/skills/testing-patterns/scripts/test_runner.py", False),
|
|
63
|
+
("UX Audit", ".opencode/skills/frontend-design/scripts/ux_audit.py", False),
|
|
64
|
+
("SEO Check", ".opencode/skills/seo-fundamentals/scripts/seo_checker.py", False),
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
PERFORMANCE_CHECKS = [
|
|
68
|
+
("Lighthouse Audit", ".opencode/skills/performance-profiling/scripts/lighthouse_audit.py", True),
|
|
69
|
+
("Playwright E2E", ".opencode/skills/webapp-testing/scripts/playwright_runner.py", False),
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
def check_script_exists(script_path: Path) -> bool:
|
|
73
|
+
"""Check if script file exists"""
|
|
74
|
+
return script_path.exists() and script_path.is_file()
|
|
75
|
+
|
|
76
|
+
def run_script(name: str, script_path: Path, project_path: str, url: Optional[str] = None) -> dict:
|
|
77
|
+
"""
|
|
78
|
+
Run a validation script and capture results
|
|
79
|
+
|
|
80
|
+
Returns:
|
|
81
|
+
dict with keys: name, passed, output, skipped
|
|
82
|
+
"""
|
|
83
|
+
if not check_script_exists(script_path):
|
|
84
|
+
print_warning(f"{name}: Script not found, skipping")
|
|
85
|
+
return {"name": name, "passed": True, "output": "", "skipped": True}
|
|
86
|
+
|
|
87
|
+
print_step(f"Running: {name}")
|
|
88
|
+
|
|
89
|
+
# Build command
|
|
90
|
+
cmd = [sys.executable, str(script_path), project_path]
|
|
91
|
+
if url and ("lighthouse" in script_path.name.lower() or "playwright" in script_path.name.lower()):
|
|
92
|
+
cmd.append(url)
|
|
93
|
+
|
|
94
|
+
# Run script
|
|
95
|
+
try:
|
|
96
|
+
result = subprocess.run(
|
|
97
|
+
cmd,
|
|
98
|
+
capture_output=True,
|
|
99
|
+
text=True,
|
|
100
|
+
timeout=300 # 5 minute timeout
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
passed = result.returncode == 0
|
|
104
|
+
|
|
105
|
+
if passed:
|
|
106
|
+
print_success(f"{name}: PASSED")
|
|
107
|
+
else:
|
|
108
|
+
print_error(f"{name}: FAILED")
|
|
109
|
+
if result.stderr:
|
|
110
|
+
print(f" Error: {result.stderr[:200]}")
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
"name": name,
|
|
114
|
+
"passed": passed,
|
|
115
|
+
"output": result.stdout,
|
|
116
|
+
"error": result.stderr,
|
|
117
|
+
"skipped": False
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
except subprocess.TimeoutExpired:
|
|
121
|
+
print_error(f"{name}: TIMEOUT (>5 minutes)")
|
|
122
|
+
return {"name": name, "passed": False, "output": "", "error": "Timeout", "skipped": False}
|
|
123
|
+
|
|
124
|
+
except Exception as e:
|
|
125
|
+
print_error(f"{name}: ERROR - {str(e)}")
|
|
126
|
+
return {"name": name, "passed": False, "output": "", "error": str(e), "skipped": False}
|
|
127
|
+
|
|
128
|
+
def print_summary(results: List[dict]):
|
|
129
|
+
"""Print final summary report"""
|
|
130
|
+
print_header(" CHECKLIST SUMMARY")
|
|
131
|
+
|
|
132
|
+
passed_count = sum(1 for r in results if r["passed"] and not r.get("skipped"))
|
|
133
|
+
failed_count = sum(1 for r in results if not r["passed"] and not r.get("skipped"))
|
|
134
|
+
skipped_count = sum(1 for r in results if r.get("skipped"))
|
|
135
|
+
|
|
136
|
+
print(f"Total Checks: {len(results)}")
|
|
137
|
+
print(f"{Colors.GREEN} Passed: {passed_count}{Colors.ENDC}")
|
|
138
|
+
print(f"{Colors.RED} Failed: {failed_count}{Colors.ENDC}")
|
|
139
|
+
print(f"{Colors.YELLOW}⏭ Skipped: {skipped_count}{Colors.ENDC}")
|
|
140
|
+
print()
|
|
141
|
+
|
|
142
|
+
# Detailed results
|
|
143
|
+
for r in results:
|
|
144
|
+
if r.get("skipped"):
|
|
145
|
+
status = f"{Colors.YELLOW}⏭ {Colors.ENDC}"
|
|
146
|
+
elif r["passed"]:
|
|
147
|
+
status = f"{Colors.GREEN}{Colors.ENDC}"
|
|
148
|
+
else:
|
|
149
|
+
status = f"{Colors.RED}{Colors.ENDC}"
|
|
150
|
+
|
|
151
|
+
print(f"{status} {r['name']}")
|
|
152
|
+
|
|
153
|
+
print()
|
|
154
|
+
|
|
155
|
+
if failed_count > 0:
|
|
156
|
+
print_error(f"{failed_count} check(s) FAILED - Please fix before proceeding")
|
|
157
|
+
return False
|
|
158
|
+
else:
|
|
159
|
+
print_success("All checks PASSED ")
|
|
160
|
+
return True
|
|
161
|
+
|
|
162
|
+
def main():
|
|
163
|
+
parser = argparse.ArgumentParser(
|
|
164
|
+
description="Run OpenKit validation checklist",
|
|
165
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
166
|
+
epilog="""
|
|
167
|
+
Examples:
|
|
168
|
+
python scripts/checklist.py . # Core checks only
|
|
169
|
+
python scripts/checklist.py . --url http://localhost:3000 # Include performance
|
|
170
|
+
"""
|
|
171
|
+
)
|
|
172
|
+
parser.add_argument("project", help="Project path to validate")
|
|
173
|
+
parser.add_argument("--url", help="URL for performance checks (lighthouse, playwright)")
|
|
174
|
+
parser.add_argument("--skip-performance", action="store_true", help="Skip performance checks even if URL provided")
|
|
175
|
+
|
|
176
|
+
args = parser.parse_args()
|
|
177
|
+
|
|
178
|
+
project_path = Path(args.project).resolve()
|
|
179
|
+
|
|
180
|
+
if not project_path.exists():
|
|
181
|
+
print_error(f"Project path does not exist: {project_path}")
|
|
182
|
+
sys.exit(1)
|
|
183
|
+
|
|
184
|
+
print_header(" OPENKIT - MASTER CHECKLIST")
|
|
185
|
+
print(f"Project: {project_path}")
|
|
186
|
+
print(f"URL: {args.url if args.url else 'Not provided (performance checks skipped)'}")
|
|
187
|
+
|
|
188
|
+
results = []
|
|
189
|
+
|
|
190
|
+
# Run core checks
|
|
191
|
+
print_header(" CORE CHECKS")
|
|
192
|
+
for name, script_path, required in CORE_CHECKS:
|
|
193
|
+
script = project_path / script_path
|
|
194
|
+
result = run_script(name, script, str(project_path))
|
|
195
|
+
results.append(result)
|
|
196
|
+
|
|
197
|
+
# If required check fails, stop
|
|
198
|
+
if required and not result["passed"] and not result.get("skipped"):
|
|
199
|
+
print_error(f"CRITICAL: {name} failed. Stopping checklist.")
|
|
200
|
+
print_summary(results)
|
|
201
|
+
sys.exit(1)
|
|
202
|
+
|
|
203
|
+
# Run performance checks if URL provided
|
|
204
|
+
if args.url and not args.skip_performance:
|
|
205
|
+
print_header(" PERFORMANCE CHECKS")
|
|
206
|
+
for name, script_path, required in PERFORMANCE_CHECKS:
|
|
207
|
+
script = project_path / script_path
|
|
208
|
+
result = run_script(name, script, str(project_path), args.url)
|
|
209
|
+
results.append(result)
|
|
210
|
+
|
|
211
|
+
# Print summary
|
|
212
|
+
all_passed = print_summary(results)
|
|
213
|
+
|
|
214
|
+
sys.exit(0 if all_passed else 1)
|
|
215
|
+
|
|
216
|
+
if __name__ == "__main__":
|
|
217
|
+
main()
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Session Manager - OpenKit
|
|
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 .opencode/scripts/session_manager.py status [path]
|
|
10
|
+
python .opencode/scripts/session_manager.py info [path]
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
import argparse
|
|
14
|
+
import json
|
|
15
|
+
import os
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
from typing import Any, Dict, List
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def get_project_root(path: str) -> Path:
|
|
21
|
+
return Path(path).resolve()
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# Since I cannot easily add dependencies, I will use a simple efficient line parser for toml/json if needed,
|
|
25
|
+
# but for robust python parsing, let's assume standard checks or simple text parsing if toml lib is missing.
|
|
26
|
+
# Actually, let's keep it simple and robust with standard library.
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def analyze_package_json(path: Path) -> Dict[str, Any]:
|
|
30
|
+
if not path.exists():
|
|
31
|
+
return {}
|
|
32
|
+
|
|
33
|
+
try:
|
|
34
|
+
with open(path, "r", encoding="utf-8") as f:
|
|
35
|
+
data = json.load(f)
|
|
36
|
+
|
|
37
|
+
deps = data.get("dependencies", {})
|
|
38
|
+
dev_deps = data.get("devDependencies", {})
|
|
39
|
+
all_deps = {**deps, **dev_deps}
|
|
40
|
+
|
|
41
|
+
stack = []
|
|
42
|
+
if "next" in all_deps:
|
|
43
|
+
stack.append("Next.js")
|
|
44
|
+
elif "react" in all_deps and "vite" in all_deps:
|
|
45
|
+
stack.append("React (Vite)")
|
|
46
|
+
elif "react" in all_deps:
|
|
47
|
+
stack.append("React")
|
|
48
|
+
elif "vue" in all_deps:
|
|
49
|
+
stack.append("Vue")
|
|
50
|
+
elif "svelte" in all_deps:
|
|
51
|
+
stack.append("Svelte")
|
|
52
|
+
elif "express" in all_deps:
|
|
53
|
+
stack.append("Express")
|
|
54
|
+
elif "nestjs" in all_deps or "@nestjs/core" in all_deps:
|
|
55
|
+
stack.append("NestJS")
|
|
56
|
+
|
|
57
|
+
if "tailwindcss" in all_deps:
|
|
58
|
+
stack.append("Tailwind CSS")
|
|
59
|
+
if "prisma" in all_deps:
|
|
60
|
+
stack.append("Prisma")
|
|
61
|
+
if "typescript" in all_deps:
|
|
62
|
+
stack.append("TypeScript")
|
|
63
|
+
if "@tanstack/react-query" in all_deps:
|
|
64
|
+
stack.append("TanStack Query")
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
"name": data.get("name", "unnamed"),
|
|
68
|
+
"version": data.get("version", "0.0.0"),
|
|
69
|
+
"stack": stack,
|
|
70
|
+
}
|
|
71
|
+
except Exception as e:
|
|
72
|
+
return {"error": str(e)}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def analyze_pyproject_toml(path: Path) -> Dict[str, Any]:
|
|
76
|
+
if not path.exists():
|
|
77
|
+
return {}
|
|
78
|
+
|
|
79
|
+
try:
|
|
80
|
+
with open(path, "r", encoding="utf-8") as f:
|
|
81
|
+
content = f.read()
|
|
82
|
+
|
|
83
|
+
stack = []
|
|
84
|
+
if "fastapi" in content:
|
|
85
|
+
stack.append("FastAPI")
|
|
86
|
+
if "flask" in content:
|
|
87
|
+
stack.append("Flask")
|
|
88
|
+
if "django" in content:
|
|
89
|
+
stack.append("Django")
|
|
90
|
+
|
|
91
|
+
if "sqlalchemy" in content:
|
|
92
|
+
stack.append("SQLAlchemy")
|
|
93
|
+
if "psycopg" in content or "psycopg2" in content:
|
|
94
|
+
stack.append("PostgreSQL")
|
|
95
|
+
if "redis" in content:
|
|
96
|
+
stack.append("Redis")
|
|
97
|
+
if "celery" in content:
|
|
98
|
+
stack.append("Celery")
|
|
99
|
+
if "alembic" in content:
|
|
100
|
+
stack.append("Alembic")
|
|
101
|
+
if "pydantic" in content:
|
|
102
|
+
stack.append("Pydantic")
|
|
103
|
+
|
|
104
|
+
return {"stack": stack}
|
|
105
|
+
except Exception as e:
|
|
106
|
+
return {"error": str(e)}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def get_full_project_info(root: Path) -> Dict[str, Any]:
|
|
110
|
+
info = {"name": root.name, "path": str(root), "stack": [], "modules": []}
|
|
111
|
+
|
|
112
|
+
# Check Frontend
|
|
113
|
+
fe_pkg = root / "frontend/package.json"
|
|
114
|
+
if fe_pkg.exists():
|
|
115
|
+
fe_info = analyze_package_json(fe_pkg)
|
|
116
|
+
info["stack"].extend(fe_info.get("stack", []))
|
|
117
|
+
else:
|
|
118
|
+
# Fallback to root package.json
|
|
119
|
+
root_pkg = root / "package.json"
|
|
120
|
+
if root_pkg.exists():
|
|
121
|
+
root_info = analyze_package_json(root_pkg)
|
|
122
|
+
info["stack"].extend(root_info.get("stack", []))
|
|
123
|
+
|
|
124
|
+
# Check Backend
|
|
125
|
+
be_toml = root / "backend/pyproject.toml"
|
|
126
|
+
if be_toml.exists():
|
|
127
|
+
be_info = analyze_pyproject_toml(be_toml)
|
|
128
|
+
info["stack"].extend(be_info.get("stack", []))
|
|
129
|
+
|
|
130
|
+
# Remove duplicates and sort
|
|
131
|
+
info["stack"] = sorted(list(set(info["stack"])))
|
|
132
|
+
|
|
133
|
+
return info
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def count_files(root: Path) -> Dict[str, Any]:
|
|
137
|
+
stats = {"created": 0, "modified": 0, "total": 0}
|
|
138
|
+
# Simple count for now, comprehensive tracking would require git diff or extensive history
|
|
139
|
+
exclude = {
|
|
140
|
+
".git",
|
|
141
|
+
"node_modules",
|
|
142
|
+
".next",
|
|
143
|
+
"dist",
|
|
144
|
+
"build",
|
|
145
|
+
".agent",
|
|
146
|
+
"__pycache__",
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
for root_dir, dirs, files in os.walk(root):
|
|
150
|
+
dirs[:] = [d for d in dirs if d not in exclude]
|
|
151
|
+
stats["total"] += len(files)
|
|
152
|
+
|
|
153
|
+
return stats
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def detect_features(root: Path) -> List[str]:
|
|
157
|
+
# Heuristic: look at folder names in src/ or feature directories
|
|
158
|
+
features = []
|
|
159
|
+
|
|
160
|
+
# Check frontend src
|
|
161
|
+
src = root / "frontend/src"
|
|
162
|
+
if src.exists():
|
|
163
|
+
possible_dirs = ["components", "modules", "features", "app", "pages"]
|
|
164
|
+
for d in possible_dirs:
|
|
165
|
+
p = src / d
|
|
166
|
+
if p.exists() and p.is_dir():
|
|
167
|
+
for child in p.iterdir():
|
|
168
|
+
if child.is_dir():
|
|
169
|
+
features.append(f"fe:{child.name}")
|
|
170
|
+
|
|
171
|
+
# Check backend app
|
|
172
|
+
app = root / "backend/app"
|
|
173
|
+
if app.exists():
|
|
174
|
+
# Check for modular structure if exists, typically routers or modules
|
|
175
|
+
for child in app.iterdir():
|
|
176
|
+
if child.is_dir() and child.name not in ["__pycache__", "core", "tests"]:
|
|
177
|
+
features.append(f"be:{child.name}")
|
|
178
|
+
|
|
179
|
+
return features[:15] # Limit
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def print_status(root: Path):
|
|
183
|
+
info = get_full_project_info(root)
|
|
184
|
+
stats = count_files(root)
|
|
185
|
+
features = detect_features(root)
|
|
186
|
+
|
|
187
|
+
print("\n=== Project Status ===")
|
|
188
|
+
print(f"\n Project: {info['name']}")
|
|
189
|
+
print(f" Path: {info['path']}")
|
|
190
|
+
print(" Type: Full Stack")
|
|
191
|
+
print(" Status: Active")
|
|
192
|
+
|
|
193
|
+
print("\n Tech Stack:")
|
|
194
|
+
if info["stack"]:
|
|
195
|
+
for tech in info["stack"]:
|
|
196
|
+
print(f" • {tech}")
|
|
197
|
+
else:
|
|
198
|
+
print(" (No specific stack detected)")
|
|
199
|
+
|
|
200
|
+
print(f"\n Detected Modules/Features ({len(features)}):")
|
|
201
|
+
for feat in features:
|
|
202
|
+
print(f" • {feat}")
|
|
203
|
+
if not features:
|
|
204
|
+
print(" (No distinct feature modules detected)")
|
|
205
|
+
|
|
206
|
+
print(f"\n Files: {stats['total']} total files tracked")
|
|
207
|
+
print("\n====================\n")
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
def main():
|
|
211
|
+
parser = argparse.ArgumentParser(description="Session Manager")
|
|
212
|
+
parser.add_argument("command", choices=["status", "info"], help="Command to run")
|
|
213
|
+
parser.add_argument("path", nargs="?", default=".", help="Project path")
|
|
214
|
+
|
|
215
|
+
args = parser.parse_args()
|
|
216
|
+
root = get_project_root(args.path)
|
|
217
|
+
|
|
218
|
+
if args.command == "status":
|
|
219
|
+
print_status(root)
|
|
220
|
+
elif args.command == "info":
|
|
221
|
+
print(json.dumps(get_full_project_info(root), indent=2))
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
if __name__ == "__main__":
|
|
225
|
+
main()
|