@iamnishankhan/opencode-kit-grok 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +46 -0
- package/kit/.opencode/AGENTS.md +392 -0
- package/kit/.opencode/README.md +71 -0
- package/kit/.opencode/USAGE.md +405 -0
- package/kit/.opencode/agents/backend-specialist.md +278 -0
- package/kit/.opencode/agents/code-archaeologist.md +114 -0
- package/kit/.opencode/agents/database-architect.md +233 -0
- package/kit/.opencode/agents/debugger.md +234 -0
- package/kit/.opencode/agents/devops-engineer.md +252 -0
- package/kit/.opencode/agents/documentation-writer.md +111 -0
- package/kit/.opencode/agents/explorer-agent.md +83 -0
- package/kit/.opencode/agents/frontend-specialist.md +606 -0
- package/kit/.opencode/agents/game-developer.md +169 -0
- package/kit/.opencode/agents/mobile-developer.md +385 -0
- package/kit/.opencode/agents/orchestrator.md +213 -0
- package/kit/.opencode/agents/penetration-tester.md +197 -0
- package/kit/.opencode/agents/performance-optimizer.md +194 -0
- package/kit/.opencode/agents/product-manager.md +120 -0
- package/kit/.opencode/agents/product-owner.md +103 -0
- package/kit/.opencode/agents/project-planner.md +418 -0
- package/kit/.opencode/agents/qa-automation-engineer.md +113 -0
- package/kit/.opencode/agents/security-auditor.md +179 -0
- package/kit/.opencode/agents/seo-specialist.md +119 -0
- package/kit/.opencode/agents/test-engineer.md +169 -0
- package/kit/.opencode/commands/brainstorm.md +113 -0
- package/kit/.opencode/commands/coordinate.md +72 -0
- package/kit/.opencode/commands/create.md +63 -0
- package/kit/.opencode/commands/debug.md +102 -0
- package/kit/.opencode/commands/deploy.md +175 -0
- package/kit/.opencode/commands/enhance.md +62 -0
- package/kit/.opencode/commands/orchestrate.md +241 -0
- package/kit/.opencode/commands/plan.md +89 -0
- package/kit/.opencode/commands/preview.md +80 -0
- package/kit/.opencode/commands/remember.md +67 -0
- package/kit/.opencode/commands/status.md +86 -0
- package/kit/.opencode/commands/test.md +143 -0
- package/kit/.opencode/commands/verify.md +71 -0
- package/kit/.opencode/memory/MEMORY.md +6 -0
- package/kit/.opencode/memory/feedback-history.md +9 -0
- package/kit/.opencode/memory/project-conventions.md +16 -0
- package/kit/.opencode/memory/tech-decisions.md +10 -0
- package/kit/.opencode/memory/user-preferences.md +9 -0
- package/kit/.opencode/opencode.json +15 -0
- package/kit/.opencode/scripts/README.md +95 -0
- package/kit/.opencode/scripts/auto_preview.py +149 -0
- package/kit/.opencode/scripts/checklist.py +75 -0
- package/kit/.opencode/scripts/component_registry.py +238 -0
- package/kit/.opencode/scripts/dependency_graph.py +73 -0
- package/kit/.opencode/scripts/generate_manifest.py +44 -0
- package/kit/.opencode/scripts/session_manager.py +120 -0
- package/kit/.opencode/scripts/tests/test_toolkit.py +238 -0
- package/kit/.opencode/scripts/validate_kit.py +397 -0
- package/kit/.opencode/scripts/validation_runner.py +216 -0
- package/kit/.opencode/scripts/verify_all.py +85 -0
- package/kit/.opencode/skills/api-patterns/SKILL.md +83 -0
- package/kit/.opencode/skills/api-patterns/api-style.md +42 -0
- package/kit/.opencode/skills/api-patterns/auth.md +24 -0
- package/kit/.opencode/skills/api-patterns/documentation.md +26 -0
- package/kit/.opencode/skills/api-patterns/graphql.md +41 -0
- package/kit/.opencode/skills/api-patterns/rate-limiting.md +31 -0
- package/kit/.opencode/skills/api-patterns/response.md +37 -0
- package/kit/.opencode/skills/api-patterns/rest.md +40 -0
- package/kit/.opencode/skills/api-patterns/scripts/api_validator.py +211 -0
- package/kit/.opencode/skills/api-patterns/security-testing.md +122 -0
- package/kit/.opencode/skills/api-patterns/trpc.md +41 -0
- package/kit/.opencode/skills/api-patterns/versioning.md +22 -0
- package/kit/.opencode/skills/app-builder/SKILL.md +78 -0
- package/kit/.opencode/skills/app-builder/agent-coordination.md +71 -0
- package/kit/.opencode/skills/app-builder/feature-building.md +53 -0
- package/kit/.opencode/skills/app-builder/project-detection.md +45 -0
- package/kit/.opencode/skills/app-builder/scaffolding.md +110 -0
- package/kit/.opencode/skills/app-builder/tech-stack.md +41 -0
- package/kit/.opencode/skills/app-builder/templates/SKILL.md +39 -0
- package/kit/.opencode/skills/app-builder/templates/astro-static/TEMPLATE.md +78 -0
- package/kit/.opencode/skills/app-builder/templates/chrome-extension/TEMPLATE.md +96 -0
- package/kit/.opencode/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/kit/.opencode/skills/app-builder/templates/electron-desktop/TEMPLATE.md +97 -0
- package/kit/.opencode/skills/app-builder/templates/express-api/TEMPLATE.md +89 -0
- package/kit/.opencode/skills/app-builder/templates/flutter-app/TEMPLATE.md +93 -0
- package/kit/.opencode/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +97 -0
- package/kit/.opencode/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +126 -0
- package/kit/.opencode/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +125 -0
- package/kit/.opencode/skills/app-builder/templates/nextjs-static/TEMPLATE.md +174 -0
- package/kit/.opencode/skills/app-builder/templates/nuxt-app/TEMPLATE.md +127 -0
- package/kit/.opencode/skills/app-builder/templates/python-fastapi/TEMPLATE.md +94 -0
- package/kit/.opencode/skills/app-builder/templates/react-native-app/TEMPLATE.md +121 -0
- package/kit/.opencode/skills/architecture/SKILL.md +57 -0
- package/kit/.opencode/skills/architecture/context-discovery.md +43 -0
- package/kit/.opencode/skills/architecture/examples.md +94 -0
- package/kit/.opencode/skills/architecture/pattern-selection.md +68 -0
- package/kit/.opencode/skills/architecture/patterns-reference.md +50 -0
- package/kit/.opencode/skills/architecture/trade-off-analysis.md +77 -0
- package/kit/.opencode/skills/bash-linux/SKILL.md +201 -0
- package/kit/.opencode/skills/batch-operations/SKILL.md +105 -0
- package/kit/.opencode/skills/behavioral-modes/SKILL.md +253 -0
- package/kit/.opencode/skills/brainstorming/SKILL.md +178 -0
- package/kit/.opencode/skills/brainstorming/dynamic-questioning.md +350 -0
- package/kit/.opencode/skills/clean-code/SKILL.md +201 -0
- package/kit/.opencode/skills/code-review-checklist/SKILL.md +111 -0
- package/kit/.opencode/skills/code-review-graph/SKILL.md +305 -0
- package/kit/.opencode/skills/context-compression/SKILL.md +145 -0
- package/kit/.opencode/skills/coordinator-mode/SKILL.md +208 -0
- package/kit/.opencode/skills/database-design/SKILL.md +54 -0
- package/kit/.opencode/skills/database-design/database-selection.md +43 -0
- package/kit/.opencode/skills/database-design/indexing.md +39 -0
- package/kit/.opencode/skills/database-design/migrations.md +48 -0
- package/kit/.opencode/skills/database-design/optimization.md +36 -0
- package/kit/.opencode/skills/database-design/orm-selection.md +30 -0
- package/kit/.opencode/skills/database-design/schema-design.md +56 -0
- package/kit/.opencode/skills/database-design/scripts/schema_validator.py +172 -0
- package/kit/.opencode/skills/deployment-procedures/SKILL.md +243 -0
- package/kit/.opencode/skills/design-spec/SKILL.md +185 -0
- package/kit/.opencode/skills/design-spec/collection.md +106 -0
- package/kit/.opencode/skills/documentation-templates/SKILL.md +196 -0
- package/kit/.opencode/skills/frontend-architecture/SKILL.md +245 -0
- package/kit/.opencode/skills/frontend-design/SKILL.md +1222 -0
- package/kit/.opencode/skills/frontend-design/redesign.md +178 -0
- package/kit/.opencode/skills/frontend-design/scripts/accessibility_checker.py +145 -0
- package/kit/.opencode/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/kit/.opencode/skills/frontend-design/style-brutalist.md +92 -0
- package/kit/.opencode/skills/frontend-design/style-minimalist.md +85 -0
- package/kit/.opencode/skills/game-development/2d-games/SKILL.md +118 -0
- package/kit/.opencode/skills/game-development/3d-games/SKILL.md +134 -0
- package/kit/.opencode/skills/game-development/SKILL.md +169 -0
- package/kit/.opencode/skills/game-development/game-art/SKILL.md +184 -0
- package/kit/.opencode/skills/game-development/game-audio/SKILL.md +189 -0
- package/kit/.opencode/skills/game-development/game-design/SKILL.md +128 -0
- package/kit/.opencode/skills/game-development/mobile-games/SKILL.md +107 -0
- package/kit/.opencode/skills/game-development/multiplayer/SKILL.md +131 -0
- package/kit/.opencode/skills/game-development/pc-games/SKILL.md +143 -0
- package/kit/.opencode/skills/game-development/vr-ar/SKILL.md +122 -0
- package/kit/.opencode/skills/game-development/web-games/SKILL.md +149 -0
- package/kit/.opencode/skills/geo-fundamentals/SKILL.md +158 -0
- package/kit/.opencode/skills/geo-fundamentals/scripts/geo_checker.py +273 -0
- package/kit/.opencode/skills/i18n-localization/SKILL.md +156 -0
- package/kit/.opencode/skills/i18n-localization/scripts/i18n_checker.py +223 -0
- package/kit/.opencode/skills/intelligent-routing/SKILL.md +337 -0
- package/kit/.opencode/skills/lint-and-validate/SKILL.md +47 -0
- package/kit/.opencode/skills/lint-and-validate/scripts/lint_runner.py +184 -0
- package/kit/.opencode/skills/lint-and-validate/scripts/type_coverage.py +245 -0
- package/kit/.opencode/skills/mcp-builder/SKILL.md +205 -0
- package/kit/.opencode/skills/memory-system/SKILL.md +181 -0
- package/kit/.opencode/skills/mobile-design/SKILL.md +396 -0
- package/kit/.opencode/skills/mobile-design/decision-trees.md +516 -0
- package/kit/.opencode/skills/mobile-design/mobile-backend.md +491 -0
- package/kit/.opencode/skills/mobile-design/mobile-color-system.md +420 -0
- package/kit/.opencode/skills/mobile-design/mobile-debugging.md +122 -0
- package/kit/.opencode/skills/mobile-design/mobile-design-thinking.md +357 -0
- package/kit/.opencode/skills/mobile-design/mobile-navigation.md +458 -0
- package/kit/.opencode/skills/mobile-design/mobile-performance.md +767 -0
- package/kit/.opencode/skills/mobile-design/mobile-testing.md +356 -0
- package/kit/.opencode/skills/mobile-design/mobile-typography.md +433 -0
- package/kit/.opencode/skills/mobile-design/platform-android.md +666 -0
- package/kit/.opencode/skills/mobile-design/platform-ios.md +561 -0
- package/kit/.opencode/skills/mobile-design/scripts/mobile_audit.py +670 -0
- package/kit/.opencode/skills/mobile-design/touch-psychology.md +537 -0
- package/kit/.opencode/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +351 -0
- package/kit/.opencode/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
- package/kit/.opencode/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
- package/kit/.opencode/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
- package/kit/.opencode/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
- package/kit/.opencode/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
- package/kit/.opencode/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
- package/kit/.opencode/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
- package/kit/.opencode/skills/nextjs-react-expert/9-cache-components.md +103 -0
- package/kit/.opencode/skills/nextjs-react-expert/SKILL.md +293 -0
- package/kit/.opencode/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
- package/kit/.opencode/skills/nextjs-react-expert/scripts/react_performance_checker.py +281 -0
- package/kit/.opencode/skills/nodejs-best-practices/SKILL.md +336 -0
- package/kit/.opencode/skills/parallel-agents/SKILL.md +192 -0
- package/kit/.opencode/skills/performance-profiling/SKILL.md +145 -0
- package/kit/.opencode/skills/performance-profiling/scripts/bundle_analyzer.py +120 -0
- package/kit/.opencode/skills/performance-profiling/scripts/lighthouse_audit.py +108 -0
- package/kit/.opencode/skills/plan-writing/SKILL.md +153 -0
- package/kit/.opencode/skills/powershell-windows/SKILL.md +169 -0
- package/kit/.opencode/skills/python-patterns/SKILL.md +443 -0
- package/kit/.opencode/skills/red-team-tactics/SKILL.md +201 -0
- package/kit/.opencode/skills/rust-pro/SKILL.md +177 -0
- package/kit/.opencode/skills/seo-fundamentals/SKILL.md +131 -0
- package/kit/.opencode/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/kit/.opencode/skills/server-management/SKILL.md +163 -0
- package/kit/.opencode/skills/simplify-code/SKILL.md +131 -0
- package/kit/.opencode/skills/skillify/SKILL.md +115 -0
- package/kit/.opencode/skills/systematic-debugging/SKILL.md +111 -0
- package/kit/.opencode/skills/tailwind-patterns/SKILL.md +271 -0
- package/kit/.opencode/skills/tdd-workflow/SKILL.md +151 -0
- package/kit/.opencode/skills/testing-patterns/SKILL.md +180 -0
- package/kit/.opencode/skills/testing-patterns/scripts/test_runner.py +219 -0
- package/kit/.opencode/skills/verify-changes/SKILL.md +127 -0
- package/kit/.opencode/skills/vulnerability-scanner/SKILL.md +278 -0
- package/kit/.opencode/skills/vulnerability-scanner/checklists.md +124 -0
- package/kit/.opencode/skills/vulnerability-scanner/scripts/dependency_analyzer.py +144 -0
- package/kit/.opencode/skills/vulnerability-scanner/scripts/security_scan.py +410 -0
- package/kit/.opencode/skills/web-design-guidelines/SKILL.md +56 -0
- package/kit/.opencode/skills/webapp-testing/SKILL.md +189 -0
- package/kit/.opencode/skills/webapp-testing/scripts/playwright_runner.py +123 -0
- package/lib/init.js +61 -0
- package/package.json +21 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: astro-static
|
|
3
|
+
description: Astro static site template principles. Content-focused websites, blogs, documentation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Astro Static Site Template
|
|
7
|
+
|
|
8
|
+
> Versions reflect the latest stable line verified 2026-05. Pin to the current stable when scaffolding.
|
|
9
|
+
|
|
10
|
+
## Tech Stack
|
|
11
|
+
|
|
12
|
+
| Component | Technology |
|
|
13
|
+
|-----------|------------|
|
|
14
|
+
| Framework | Astro 6.x |
|
|
15
|
+
| Content | MDX + Content Collections (Content Layer API) |
|
|
16
|
+
| Styling | Tailwind CSS v4 (@tailwindcss/vite) |
|
|
17
|
+
| Integrations | Sitemap, RSS, SEO |
|
|
18
|
+
| Output | Static/SSG |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Directory Structure
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
project-name/
|
|
26
|
+
├── src/
|
|
27
|
+
│ ├── components/ # .astro components
|
|
28
|
+
│ ├── content/ # Collection entries (blog/, docs/ .md/.mdx)
|
|
29
|
+
│ ├── layouts/ # Page layouts
|
|
30
|
+
│ ├── pages/ # File-based routing (only reserved dir)
|
|
31
|
+
│ ├── styles/
|
|
32
|
+
│ │ └── global.css # @import "tailwindcss";
|
|
33
|
+
│ └── content.config.ts # Collection definitions (Content Layer, in src/ root)
|
|
34
|
+
├── public/ # Static assets
|
|
35
|
+
├── astro.config.mjs
|
|
36
|
+
└── package.json
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Key Concepts
|
|
42
|
+
|
|
43
|
+
| Concept | Description |
|
|
44
|
+
|---------|-------------|
|
|
45
|
+
| Content Layer API | Collections defined in `src/content.config.ts` with `loader`s (glob/file) + Zod schemas |
|
|
46
|
+
| Islands Architecture | Partial hydration for interactivity |
|
|
47
|
+
| Zero JS by default | Static HTML unless needed |
|
|
48
|
+
| MDX Support | Markdown with components |
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Setup Steps
|
|
53
|
+
|
|
54
|
+
1. `npm create astro@latest {{name}}`
|
|
55
|
+
2. Add integrations: `npx astro add mdx sitemap`
|
|
56
|
+
3. Add Tailwind v4: `npx astro add tailwind` (installs @tailwindcss/vite, not the legacy @astrojs/tailwind)
|
|
57
|
+
4. Define collections in `src/content.config.ts` using `loader`s + Zod schemas
|
|
58
|
+
5. `npm run dev`
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Deployment
|
|
63
|
+
|
|
64
|
+
| Platform | Method |
|
|
65
|
+
|----------|--------|
|
|
66
|
+
| Vercel | Auto-detected |
|
|
67
|
+
| Netlify | Auto-detected |
|
|
68
|
+
| Cloudflare Pages | Auto-detected |
|
|
69
|
+
| GitHub Pages | Build + deploy action |
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Best Practices
|
|
74
|
+
|
|
75
|
+
- Use Content Collections for type safety
|
|
76
|
+
- Leverage static generation
|
|
77
|
+
- Add islands only where needed
|
|
78
|
+
- Optimize images with Astro Image
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: chrome-extension
|
|
3
|
+
description: Chrome Extension template principles. Manifest V3, React, TypeScript.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Chrome Extension Template
|
|
7
|
+
|
|
8
|
+
> Versions reflect the latest stable line verified 2026-05. Pin to the current stable when scaffolding.
|
|
9
|
+
|
|
10
|
+
## Tech Stack
|
|
11
|
+
|
|
12
|
+
| Component | Technology |
|
|
13
|
+
|-----------|------------|
|
|
14
|
+
| Manifest | V3 |
|
|
15
|
+
| UI | React 19 |
|
|
16
|
+
| Language | TypeScript |
|
|
17
|
+
| Styling | Tailwind CSS v4 |
|
|
18
|
+
| Bundler | Vite + CRXJS (@crxjs/vite-plugin v2) |
|
|
19
|
+
| Storage | Chrome Storage API |
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Directory Structure
|
|
24
|
+
|
|
25
|
+
> CRXJS + Vite: `manifest.config.ts` is the source of truth, Vite resolves entries.
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
project-name/
|
|
29
|
+
├── src/
|
|
30
|
+
│ ├── popup/ # { index.html, main.tsx, Popup.tsx }
|
|
31
|
+
│ ├── options/ # { index.html, main.tsx, Options.tsx }
|
|
32
|
+
│ ├── background/ # service-worker.ts (MV3 service worker)
|
|
33
|
+
│ ├── content/ # { content-script.ts, content.css }
|
|
34
|
+
│ ├── components/ # Shared React
|
|
35
|
+
│ └── lib/
|
|
36
|
+
│ ├── storage.ts # Chrome storage helpers
|
|
37
|
+
│ └── messaging.ts # Message passing
|
|
38
|
+
├── public/ # Static assets (icons)
|
|
39
|
+
├── manifest.config.ts # defineManifest() — typed manifest
|
|
40
|
+
├── vite.config.ts # crx({ manifest }) + react + tailwind
|
|
41
|
+
└── package.json
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Manifest V3 Concepts
|
|
47
|
+
|
|
48
|
+
| Component | Purpose |
|
|
49
|
+
|-----------|---------|
|
|
50
|
+
| Service Worker | Background processing |
|
|
51
|
+
| Content Scripts | Page injection |
|
|
52
|
+
| Popup | User interface |
|
|
53
|
+
| Options Page | Settings |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Permissions
|
|
58
|
+
|
|
59
|
+
| Permission | Use |
|
|
60
|
+
|------------|-----|
|
|
61
|
+
| storage | Save user data |
|
|
62
|
+
| activeTab | Current tab access |
|
|
63
|
+
| scripting | Inject scripts |
|
|
64
|
+
| host_permissions | Site access |
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Setup Steps
|
|
69
|
+
|
|
70
|
+
1. `npm create vite@latest {{name}} -- --template react-ts`
|
|
71
|
+
2. Install CRXJS: `npm install -D @crxjs/vite-plugin@latest`
|
|
72
|
+
3. Add Chrome types: `npm install -D @types/chrome`
|
|
73
|
+
4. Create `manifest.config.ts` with `defineManifest`, wire `crx({ manifest })` in `vite.config.ts`
|
|
74
|
+
5. `npm run dev` (HMR for popup/options/content)
|
|
75
|
+
6. Load in Chrome: `chrome://extensions` → Load unpacked → select `dist/`
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Development Tips
|
|
80
|
+
|
|
81
|
+
| Task | Method |
|
|
82
|
+
|------|--------|
|
|
83
|
+
| Debug Popup | Right-click icon → Inspect |
|
|
84
|
+
| Debug Background | Extensions page → Service worker |
|
|
85
|
+
| Debug Content | DevTools console on page |
|
|
86
|
+
| Hot Reload | `npm run dev` (CRXJS HMR) |
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Best Practices
|
|
91
|
+
|
|
92
|
+
- Use type-safe messaging
|
|
93
|
+
- Wrap Chrome APIs in promises
|
|
94
|
+
- MV3 background is an ephemeral service worker — persist state in `chrome.storage`, not module globals; use event listeners + alarms, not long-lived timers
|
|
95
|
+
- Minimize permissions
|
|
96
|
+
- Scope content-script styles to avoid host-page bleed
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cli-tool
|
|
3
|
+
description: Node.js CLI tool template principles. Commander.js, interactive prompts.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# CLI Tool Template
|
|
7
|
+
|
|
8
|
+
> Versions reflect the latest stable line verified 2026-05. Pin to the current stable when scaffolding.
|
|
9
|
+
|
|
10
|
+
## Tech Stack
|
|
11
|
+
|
|
12
|
+
| Component | Technology |
|
|
13
|
+
|-----------|------------|
|
|
14
|
+
| Runtime | Node.js 24 (Krypton LTS) |
|
|
15
|
+
| Language | TypeScript (ESM) |
|
|
16
|
+
| CLI Framework | Commander.js (v15, needs Node ≥22.12) |
|
|
17
|
+
| Prompts | @inquirer/prompts (modular) |
|
|
18
|
+
| Output | chalk + ora |
|
|
19
|
+
| Config | cosmiconfig |
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Directory Structure
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
project-name/
|
|
27
|
+
├── src/
|
|
28
|
+
│ ├── index.ts # Entry: #!/usr/bin/env node shebang, wires Commander
|
|
29
|
+
│ ├── commands/ # One file per command (factory functions)
|
|
30
|
+
│ ├── lib/ # Core logic (framework-agnostic, testable)
|
|
31
|
+
│ ├── utils/ # logger (chalk/ora), prompt wrappers
|
|
32
|
+
│ └── config.ts # cosmiconfig loader
|
|
33
|
+
├── dist/ # Build output (tsup/tsc)
|
|
34
|
+
└── package.json # "type":"module", "bin":{...}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## CLI Design Principles
|
|
40
|
+
|
|
41
|
+
| Principle | Description |
|
|
42
|
+
|-----------|-------------|
|
|
43
|
+
| Subcommands | Group related actions |
|
|
44
|
+
| Options | Flags with defaults |
|
|
45
|
+
| Interactive | Prompts when needed |
|
|
46
|
+
| Non-interactive | Support --yes flags |
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Key Components
|
|
51
|
+
|
|
52
|
+
| Component | Purpose |
|
|
53
|
+
|-----------|---------|
|
|
54
|
+
| Commander | Command parsing (use a local `new Command()` for testability) |
|
|
55
|
+
| @inquirer/prompts | Modular interactive prompts (`input`, `select`, `confirm`) |
|
|
56
|
+
| Chalk | Colored output |
|
|
57
|
+
| Ora | Spinners/loading |
|
|
58
|
+
| Cosmiconfig | Config file discovery |
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Setup Steps
|
|
63
|
+
|
|
64
|
+
1. Create project directory
|
|
65
|
+
2. `npm init -y` then set `"type": "module"`
|
|
66
|
+
3. Install deps: `npm install commander @inquirer/prompts chalk ora cosmiconfig`
|
|
67
|
+
4. Point `bin` at compiled `./dist/index.js`, keep `#!/usr/bin/env node` shebang
|
|
68
|
+
5. `npm link` for local testing
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Publishing
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npm login
|
|
76
|
+
npm publish
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Best Practices
|
|
82
|
+
|
|
83
|
+
- Keep `src/index.ts` thin; attach commands via `.addCommand()` factories in `src/commands/`
|
|
84
|
+
- Put business logic in `lib/`/`utils/` so commands stay testable wrappers
|
|
85
|
+
- ESM by default; build with tsup/esbuild
|
|
86
|
+
- Support both interactive and non-interactive (`--yes`) modes
|
|
87
|
+
- Validate inputs with Zod; exit with proper codes (0 success, 1 error)
|
|
88
|
+
- Alternatives worth knowing: @clack/prompts (polished prompts), citty (lightweight ESM command framework)
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: electron-desktop
|
|
3
|
+
description: Electron desktop app template principles. Cross-platform, React, TypeScript.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Electron Desktop App Template
|
|
7
|
+
|
|
8
|
+
> Versions reflect the latest stable line verified 2026-05. Pin to the current stable when scaffolding.
|
|
9
|
+
|
|
10
|
+
## Tech Stack
|
|
11
|
+
|
|
12
|
+
| Component | Technology |
|
|
13
|
+
|-----------|------------|
|
|
14
|
+
| Framework | Electron 42+ |
|
|
15
|
+
| UI | React 19 |
|
|
16
|
+
| Language | TypeScript |
|
|
17
|
+
| Styling | Tailwind CSS v4 |
|
|
18
|
+
| Bundler | electron-vite + electron-builder |
|
|
19
|
+
| IPC | Type-safe communication (contextBridge) |
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Directory Structure
|
|
24
|
+
|
|
25
|
+
> electron-vite layout: main / preload / renderer separation is the 2026 standard.
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
project-name/
|
|
29
|
+
├── src/
|
|
30
|
+
│ ├── main/ # Main process (lifecycle, windows, IPC handlers)
|
|
31
|
+
│ │ └── index.ts
|
|
32
|
+
│ ├── preload/ # contextBridge — type-safe IPC surface
|
|
33
|
+
│ │ ├── index.ts
|
|
34
|
+
│ │ └── index.d.ts # Ambient types shared with renderer
|
|
35
|
+
│ └── renderer/ # React app
|
|
36
|
+
│ ├── index.html
|
|
37
|
+
│ └── src/
|
|
38
|
+
│ ├── main.tsx
|
|
39
|
+
│ ├── App.tsx
|
|
40
|
+
│ └── components/
|
|
41
|
+
├── resources/ # App icons / static (build-time)
|
|
42
|
+
├── build/ # Builder assets (entitlements, icons)
|
|
43
|
+
├── electron.vite.config.ts
|
|
44
|
+
├── electron-builder.yml
|
|
45
|
+
└── package.json # scripts: electron-vite dev | build | preview
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Process Model
|
|
51
|
+
|
|
52
|
+
| Process | Role |
|
|
53
|
+
|---------|------|
|
|
54
|
+
| Main | Node.js, system access |
|
|
55
|
+
| Renderer | Chromium, React UI |
|
|
56
|
+
| Preload | Bridge, context isolation |
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Key Concepts
|
|
61
|
+
|
|
62
|
+
| Concept | Purpose |
|
|
63
|
+
|---------|---------|
|
|
64
|
+
| contextBridge | Safe API exposure |
|
|
65
|
+
| ipcMain/ipcRenderer | Process communication |
|
|
66
|
+
| nodeIntegration: false | Security |
|
|
67
|
+
| contextIsolation: true | Security |
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Setup Steps
|
|
72
|
+
|
|
73
|
+
1. `npm create @quick-start/electron@latest {{name}} -- --template react-ts`
|
|
74
|
+
2. `cd {{name}} && npm install`
|
|
75
|
+
3. Add Tailwind v4: `npm install tailwindcss @tailwindcss/vite`
|
|
76
|
+
4. Define IPC types in `src/preload/index.d.ts`
|
|
77
|
+
5. `npm run dev`
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Build Targets
|
|
82
|
+
|
|
83
|
+
| Platform | Output |
|
|
84
|
+
|----------|--------|
|
|
85
|
+
| Windows | NSIS, Portable |
|
|
86
|
+
| macOS | DMG, ZIP |
|
|
87
|
+
| Linux | AppImage, DEB |
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Best Practices
|
|
92
|
+
|
|
93
|
+
- `contextIsolation: true` (default v12+), `sandbox: true` (default v20+), `nodeIntegration: false` (default v5+) — never enable Node for remote content
|
|
94
|
+
- Expose a narrow API via `contextBridge.exposeInMainWorld`, never raw `ipcRenderer`
|
|
95
|
+
- Validate IPC `sender` against an allowlist; set a restrictive CSP (`script-src 'self'`)
|
|
96
|
+
- Type-safe IPC: share types from `preload/index.d.ts` into the renderer
|
|
97
|
+
- Auto-updates with electron-updater
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: express-api
|
|
3
|
+
description: Express.js REST API template principles. TypeScript, Prisma, JWT.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Express.js API Template
|
|
7
|
+
|
|
8
|
+
> Versions reflect the latest stable line verified 2026-05. Pin to the current stable when scaffolding.
|
|
9
|
+
|
|
10
|
+
## Tech Stack
|
|
11
|
+
|
|
12
|
+
| Component | Technology |
|
|
13
|
+
|-----------|------------|
|
|
14
|
+
| Runtime | Node.js 24 (Krypton LTS) |
|
|
15
|
+
| Framework | Express 5 (stable, default on npm) |
|
|
16
|
+
| Language | TypeScript |
|
|
17
|
+
| Database | PostgreSQL + Prisma |
|
|
18
|
+
| Validation | Zod |
|
|
19
|
+
| Auth | JWT + bcrypt |
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Directory Structure
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
project-name/
|
|
27
|
+
├── prisma/
|
|
28
|
+
│ └── schema.prisma
|
|
29
|
+
├── src/
|
|
30
|
+
│ ├── app.ts # Express app + middleware wiring (no listen)
|
|
31
|
+
│ ├── server.ts # Bootstrap: listen() — split for testability
|
|
32
|
+
│ ├── config/ # Environment
|
|
33
|
+
│ ├── routes/ # Route definitions only
|
|
34
|
+
│ ├── controllers/ # HTTP layer (req/res, calls services)
|
|
35
|
+
│ ├── services/ # Business logic
|
|
36
|
+
│ ├── middlewares/
|
|
37
|
+
│ │ ├── auth.ts # JWT verify
|
|
38
|
+
│ │ ├── error.ts # Error handler
|
|
39
|
+
│ │ └── validate.ts # Zod validation
|
|
40
|
+
│ ├── schemas/ # Zod schemas
|
|
41
|
+
│ └── utils/
|
|
42
|
+
├── tests/
|
|
43
|
+
└── package.json
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Middleware Stack
|
|
49
|
+
|
|
50
|
+
| Order | Middleware |
|
|
51
|
+
|-------|------------|
|
|
52
|
+
| 1 | helmet (security) |
|
|
53
|
+
| 2 | cors |
|
|
54
|
+
| 3 | compression |
|
|
55
|
+
| 4 | body parsing |
|
|
56
|
+
| 5 | morgan (logging) |
|
|
57
|
+
| 6 | routes |
|
|
58
|
+
| 7 | error handler (last, 4-arg signature) |
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## API Response Format
|
|
63
|
+
|
|
64
|
+
| Type | Structure |
|
|
65
|
+
|------|-----------|
|
|
66
|
+
| Success | `{ success: true, data: {...} }` |
|
|
67
|
+
| Error | `{ error: "message", details: [...] }` |
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Setup Steps
|
|
72
|
+
|
|
73
|
+
1. Create project directory
|
|
74
|
+
2. `npm init -y`
|
|
75
|
+
3. Install deps: `npm install express prisma zod bcrypt jsonwebtoken`
|
|
76
|
+
4. Configure Prisma
|
|
77
|
+
5. `npm run db:push`
|
|
78
|
+
6. `npm run dev`
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Best Practices
|
|
83
|
+
|
|
84
|
+
- Split `app.ts` (wiring) from `server.ts` (`listen`) so the app imports cleanly into tests
|
|
85
|
+
- Layer architecture (routes → controllers → services)
|
|
86
|
+
- Validate all inputs with Zod at the route boundary
|
|
87
|
+
- Centralized error handler last (Express 5 auto-forwards rejected promises — no manual catch wrapper needed)
|
|
88
|
+
- Environment-based config
|
|
89
|
+
- Use Prisma for type-safe DB access
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flutter-app
|
|
3
|
+
description: Flutter mobile app template principles. Riverpod, Go Router, clean architecture.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Flutter App Template
|
|
7
|
+
|
|
8
|
+
> Versions reflect the latest stable line verified 2026-05. Pin to the current stable when scaffolding.
|
|
9
|
+
|
|
10
|
+
## Tech Stack
|
|
11
|
+
|
|
12
|
+
| Component | Technology |
|
|
13
|
+
|-----------|------------|
|
|
14
|
+
| Framework | Flutter 3.x |
|
|
15
|
+
| Language | Dart 3.x |
|
|
16
|
+
| State | Riverpod 3 (codegen) |
|
|
17
|
+
| Navigation | Go Router |
|
|
18
|
+
| HTTP | Dio |
|
|
19
|
+
| Storage | Hive |
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Directory Structure
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
project_name/
|
|
27
|
+
├── lib/
|
|
28
|
+
│ ├── main.dart
|
|
29
|
+
│ ├── app.dart
|
|
30
|
+
│ ├── core/
|
|
31
|
+
│ │ ├── constants/
|
|
32
|
+
│ │ ├── theme/
|
|
33
|
+
│ │ ├── router/
|
|
34
|
+
│ │ └── utils/
|
|
35
|
+
│ ├── features/
|
|
36
|
+
│ │ ├── auth/
|
|
37
|
+
│ │ │ ├── data/
|
|
38
|
+
│ │ │ ├── domain/
|
|
39
|
+
│ │ │ └── presentation/
|
|
40
|
+
│ │ └── home/
|
|
41
|
+
│ ├── shared/
|
|
42
|
+
│ │ ├── widgets/
|
|
43
|
+
│ │ └── providers/
|
|
44
|
+
│ └── services/
|
|
45
|
+
│ ├── api/
|
|
46
|
+
│ └── storage/
|
|
47
|
+
├── test/
|
|
48
|
+
└── pubspec.yaml
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Architecture Layers
|
|
54
|
+
|
|
55
|
+
| Layer | Contents |
|
|
56
|
+
|-------|----------|
|
|
57
|
+
| Presentation | Screens, Widgets, Providers |
|
|
58
|
+
| Domain | Entities, Use Cases |
|
|
59
|
+
| Data | Repositories, Models |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Key Packages
|
|
64
|
+
|
|
65
|
+
| Package | Purpose |
|
|
66
|
+
|---------|---------|
|
|
67
|
+
| flutter_riverpod | State management |
|
|
68
|
+
| riverpod_annotation | Code generation |
|
|
69
|
+
| go_router | Navigation |
|
|
70
|
+
| dio | HTTP client |
|
|
71
|
+
| freezed | Immutable models |
|
|
72
|
+
| hive | Local storage |
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Setup Steps
|
|
77
|
+
|
|
78
|
+
1. `flutter create {{name}} --org com.{{bundle}}`
|
|
79
|
+
2. Update `pubspec.yaml`
|
|
80
|
+
3. `flutter pub get`
|
|
81
|
+
4. Run code generation: `dart run build_runner build`
|
|
82
|
+
5. `flutter run`
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Best Practices
|
|
87
|
+
|
|
88
|
+
- Feature-first folder structure (data / domain / presentation per feature)
|
|
89
|
+
- Riverpod 3 with `riverpod_annotation` codegen (generated ref is just `Ref`; plain `Notifier`, no `AutoDisposeNotifier`)
|
|
90
|
+
- Legacy `StateProvider`/`StateNotifierProvider` moved to `package:riverpod/legacy.dart`
|
|
91
|
+
- Freezed for immutable data classes
|
|
92
|
+
- Go Router for declarative navigation
|
|
93
|
+
- Material 3 theming
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: monorepo-turborepo
|
|
3
|
+
description: Turborepo monorepo template principles. pnpm workspaces, shared packages.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Turborepo Monorepo Template
|
|
7
|
+
|
|
8
|
+
> Versions reflect the latest stable line verified 2026-05. Pin to the current stable when scaffolding.
|
|
9
|
+
|
|
10
|
+
## Tech Stack
|
|
11
|
+
|
|
12
|
+
| Component | Technology |
|
|
13
|
+
|-----------|------------|
|
|
14
|
+
| Build System | Turborepo 2.x |
|
|
15
|
+
| Package Manager | pnpm |
|
|
16
|
+
| Apps | Next.js, Express |
|
|
17
|
+
| Packages | Shared UI, Config, Types, Utils |
|
|
18
|
+
| Language | TypeScript |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Directory Structure
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
project-name/
|
|
26
|
+
├── apps/
|
|
27
|
+
│ ├── web/ # Next.js app
|
|
28
|
+
│ ├── api/ # Express API
|
|
29
|
+
│ └── docs/ # Documentation
|
|
30
|
+
├── packages/
|
|
31
|
+
│ ├── ui/ # Shared components (@repo/ui)
|
|
32
|
+
│ ├── config/ # ESLint, TS, Tailwind presets (@repo/config)
|
|
33
|
+
│ ├── types/ # Shared types (@repo/types)
|
|
34
|
+
│ └── utils/ # Shared utilities (@repo/utils)
|
|
35
|
+
├── turbo.json # "tasks" key (renamed from "pipeline" in v2)
|
|
36
|
+
├── pnpm-workspace.yaml
|
|
37
|
+
└── package.json # requires "packageManager" field
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Key Concepts
|
|
43
|
+
|
|
44
|
+
| Concept | Description |
|
|
45
|
+
|---------|-------------|
|
|
46
|
+
| Workspaces | Globs declared in `pnpm-workspace.yaml` |
|
|
47
|
+
| Pipeline | `turbo.json` `tasks` graph (NOT `pipeline` — renamed in v2) |
|
|
48
|
+
| Caching | Remote/local task caching |
|
|
49
|
+
| Dependencies | `workspace:*` protocol, `@repo/*` namespace |
|
|
50
|
+
| Env mode | v2 is strict — declare task `env`/`globalEnv` or caching breaks |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Turbo Tasks (turbo.json)
|
|
55
|
+
|
|
56
|
+
> `tasks` is the v2 key. The `pipeline` key was renamed — migrate with `npx @turbo/codemod rename-pipeline`.
|
|
57
|
+
|
|
58
|
+
| Task | Depends On |
|
|
59
|
+
|------|------------|
|
|
60
|
+
| build | ^build (dependencies first) |
|
|
61
|
+
| dev | cache: false, persistent |
|
|
62
|
+
| lint | ^build |
|
|
63
|
+
| test | ^build |
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Setup Steps
|
|
68
|
+
|
|
69
|
+
1. Create root directory
|
|
70
|
+
2. `pnpm init`
|
|
71
|
+
3. Create pnpm-workspace.yaml
|
|
72
|
+
4. Create turbo.json
|
|
73
|
+
5. Add apps and packages
|
|
74
|
+
6. `pnpm install`
|
|
75
|
+
7. `pnpm dev`
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Common Commands
|
|
80
|
+
|
|
81
|
+
| Command | Description |
|
|
82
|
+
|---------|-------------|
|
|
83
|
+
| `pnpm dev` | Run all apps |
|
|
84
|
+
| `pnpm build` | Build all |
|
|
85
|
+
| `pnpm --filter @name/web dev` | Run specific app |
|
|
86
|
+
| `pnpm --filter @name/web add axios` | Add dep to app |
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Best Practices
|
|
91
|
+
|
|
92
|
+
- Split `apps/` (deployable) from `packages/` (libraries, shared config)
|
|
93
|
+
- Namespace internal packages with `@repo/*`; reference via `workspace:*`
|
|
94
|
+
- Define entrypoints with the `exports` field (better tree-shaking than barrel files)
|
|
95
|
+
- Share tsconfig/eslint from `packages/config`
|
|
96
|
+
- Declare task `env`/`globalEnv` explicitly (v2 strict env mode)
|
|
97
|
+
- Use Turbo remote caching for CI
|