@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
package/bin/cli.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { init } from "../lib/init.js";
|
|
3
|
+
|
|
4
|
+
const args = process.argv.slice(2);
|
|
5
|
+
const command = args[0] || "init";
|
|
6
|
+
|
|
7
|
+
const flags = {
|
|
8
|
+
force: args.includes("--force") || args.includes("-f"),
|
|
9
|
+
path: getFlagValue(args, "--path") || ".",
|
|
10
|
+
quiet: args.includes("--quiet") || args.includes("-q"),
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
function getFlagValue(argv, name) {
|
|
14
|
+
const i = argv.indexOf(name);
|
|
15
|
+
if (i === -1) return null;
|
|
16
|
+
return argv[i + 1] || null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async function main() {
|
|
20
|
+
if (command === "init") {
|
|
21
|
+
await init(flags);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (command === "help" || command === "--help" || command === "-h") {
|
|
26
|
+
console.log(`
|
|
27
|
+
Usage:
|
|
28
|
+
npx @iamnishankhan/opencode-kit-grok init
|
|
29
|
+
|
|
30
|
+
Options:
|
|
31
|
+
--path <dir> Install into this folder (default: current folder)
|
|
32
|
+
--force, -f Overwrite existing .opencode
|
|
33
|
+
--quiet, -q Less text
|
|
34
|
+
`);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
console.error("Unknown command:", command);
|
|
39
|
+
console.error("Run with: init | help");
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
main().catch((err) => {
|
|
44
|
+
console.error(err.message || err);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
});
|
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
# AGENTS.md โ OpenCode Project Instructions
|
|
2
|
+
|
|
3
|
+
Converted from AG Kit rules for OpenCode. These instructions apply to all agents in this workspace.
|
|
4
|
+
|
|
5
|
+
## Core Operating Principles
|
|
6
|
+
|
|
7
|
+
- Prefer the smallest correct change; avoid unrelated refactors.
|
|
8
|
+
- Validate with tests/lint when behavior changes.
|
|
9
|
+
- Never hardcode secrets; use environment variables.
|
|
10
|
+
- Match the user's language for responses; keep code identifiers in English.
|
|
11
|
+
- For multi-domain work, plan first, then delegate to specialist subagents.
|
|
12
|
+
|
|
13
|
+
## Specialist Routing Hints
|
|
14
|
+
|
|
15
|
+
| Domain | Prefer agent | Prefer skills |
|
|
16
|
+
|--------|--------------|---------------|
|
|
17
|
+
| Backend / API / auth | `@backend-specialist` | `api-patterns`, `nodejs-best-practices`, `python-patterns` |
|
|
18
|
+
| Frontend / UI | `@frontend-specialist` | `frontend-design`, `tailwind-patterns`, `nextjs-react-expert` |
|
|
19
|
+
| Database / schema | `@database-architect` | `database-design` |
|
|
20
|
+
| Debugging | `@debugger` | `systematic-debugging` |
|
|
21
|
+
| Security audit | `@security-auditor` | `vulnerability-scanner` |
|
|
22
|
+
| Penetration testing | `@penetration-tester` | `red-team-tactics` |
|
|
23
|
+
| DevOps / deploy | `@devops-engineer` | `deployment-procedures`, `server-management` |
|
|
24
|
+
| Tests | `@test-engineer` | `testing-patterns`, `tdd-workflow` |
|
|
25
|
+
| QA automation | `@qa-automation-engineer` | `webapp-testing`, `testing-patterns` |
|
|
26
|
+
| Performance | `@performance-optimizer` | `performance-profiling` |
|
|
27
|
+
| SEO | `@seo-specialist` | `seo-fundamentals` |
|
|
28
|
+
| Mobile | `@mobile-developer` | `mobile-design` |
|
|
29
|
+
| Games | `@game-developer` | `game-development` |
|
|
30
|
+
| Planning | `@project-planner` or `/plan` | `plan-writing`, `architecture` |
|
|
31
|
+
| Multi-agent coord | `@orchestrator` or `/orchestrate` | `coordinator-mode`, `parallel-agents` |
|
|
32
|
+
| Legacy / refactor | `@code-archaeologist` | `simplify-code`, `clean-code` |
|
|
33
|
+
| Docs | `@documentation-writer` | `documentation-templates` |
|
|
34
|
+
| Discovery | `@explorer-agent` | โ |
|
|
35
|
+
| Product | `@product-manager` / `@product-owner` | โ |
|
|
36
|
+
|
|
37
|
+
## Commands
|
|
38
|
+
|
|
39
|
+
Custom slash commands live under `.opencode/commands/`. Examples: `/create`, `/debug`, `/plan`, `/test`, `/verify`, `/orchestrate`, `/deploy`.
|
|
40
|
+
|
|
41
|
+
## Skills
|
|
42
|
+
|
|
43
|
+
Domain skills live under `.opencode/skills/*/SKILL.md`. Load with the skill tool when relevant.
|
|
44
|
+
|
|
45
|
+
## Memory
|
|
46
|
+
|
|
47
|
+
Optional durable notes live under `.opencode/memory/`. Use the `memory-system` skill and `/remember` command to save preferences and decisions into `.opencode/memory/`.
|
|
48
|
+
|
|
49
|
+
## Rule: code-rules
|
|
50
|
+
|
|
51
|
+
# Code Rules (TIER 1) - OpenCode kit
|
|
52
|
+
|
|
53
|
+
> Loaded when the request involves writing or modifying code.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## ๐ฑ Project Type Routing
|
|
58
|
+
|
|
59
|
+
| Project Type | Primary Agent | Skills |
|
|
60
|
+
| -------------------------------------- | --------------------- | ----------------------------- |
|
|
61
|
+
| **MOBILE** (iOS, Android, RN, Flutter) | `mobile-developer` | mobile-design |
|
|
62
|
+
| **WEB** (Next.js, React web) | `frontend-specialist` | frontend-design |
|
|
63
|
+
| **BACKEND** (API, server, DB) | `backend-specialist` | api-patterns, database-design |
|
|
64
|
+
|
|
65
|
+
> ๐ด **Mobile + frontend-specialist = WRONG.** Mobile = mobile-developer ONLY.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## ๐ GLOBAL SOCRATIC GATE
|
|
70
|
+
|
|
71
|
+
**MANDATORY: Every user request must pass through the Socratic Gate before ANY tool use or implementation.**
|
|
72
|
+
|
|
73
|
+
| Request Type | Strategy | Required Action |
|
|
74
|
+
| ----------------------- | -------------- | ----------------------------------------------------------------- |
|
|
75
|
+
| **New Feature / Build** | Deep Discovery | ASK minimum 3 strategic questions |
|
|
76
|
+
| **Code Edit / Bug Fix** | Context Check | Confirm understanding + ask impact questions |
|
|
77
|
+
| **Vague / Simple** | Clarification | Ask Purpose, Users, and Scope |
|
|
78
|
+
| **Full Orchestration** | Gatekeeper | **STOP** subagents until user confirms plan details |
|
|
79
|
+
| **Direct "Proceed"** | Validation | **STOP** โ Even if answers are given, ask 2 "Edge Case" questions |
|
|
80
|
+
|
|
81
|
+
**Protocol:**
|
|
82
|
+
|
|
83
|
+
1. **Never Assume:** If even 1% is unclear, ASK.
|
|
84
|
+
2. **Handle Spec-heavy Requests:** When user gives a list (Answers 1, 2, 3...), do NOT skip the gate. Instead, ask about **Trade-offs** or **Edge Cases** (e.g., "LocalStorage confirmed, but should we handle data clearing or versioning?") before starting.
|
|
85
|
+
3. **Wait:** Do NOT invoke subagents or write code until the user clears the Gate.
|
|
86
|
+
4. **Reference:** Full protocol in `@[skills/brainstorming]`.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## ๐ Plan Mode (4-Phase)
|
|
91
|
+
|
|
92
|
+
1. ANALYSIS โ Research, questions
|
|
93
|
+
2. PLANNING โ `{task-slug}.md`, task breakdown
|
|
94
|
+
3. SOLUTIONING โ Architecture, design (NO CODE!)
|
|
95
|
+
4. IMPLEMENTATION โ Code + tests
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## ๐ Final Checklist Protocol
|
|
100
|
+
|
|
101
|
+
**Trigger:** When the user says "run the final checks", "final checks", "run all the tests", or similar phrases.
|
|
102
|
+
|
|
103
|
+
| Task Stage | Command | Purpose |
|
|
104
|
+
| ---------------- | -------------------------------------------------- | ------------------------------ |
|
|
105
|
+
| **Manual Audit** | `python .opencode/scripts/checklist.py .` | Priority-based project audit |
|
|
106
|
+
| **Pre-Deploy** | `python .opencode/scripts/checklist.py . --url <URL>` | Full Suite + Performance + E2E |
|
|
107
|
+
|
|
108
|
+
**Priority Execution Order:**
|
|
109
|
+
|
|
110
|
+
1. **Security** โ 2. **Lint** โ 3. **Schema** โ 4. **Tests** โ 5. **UX** โ 6. **Seo** โ 7. **Lighthouse/E2E**
|
|
111
|
+
|
|
112
|
+
**Rules:**
|
|
113
|
+
|
|
114
|
+
- **Completion:** A task is NOT finished until `checklist.py` returns success.
|
|
115
|
+
- **Reporting:** If it fails, fix the **Critical** blockers first (Security/Lint).
|
|
116
|
+
|
|
117
|
+
**Available Scripts (10 total):**
|
|
118
|
+
|
|
119
|
+
| Script | Skill | When to Use |
|
|
120
|
+
| -------------------------- | --------------------- | ------------------- |
|
|
121
|
+
| `security_scan.py` | vulnerability-scanner | Always on deploy |
|
|
122
|
+
| `lint_runner.py` | lint-and-validate | Every code change |
|
|
123
|
+
| `test_runner.py` | testing-patterns | After logic change |
|
|
124
|
+
| `schema_validator.py` | database-design | After DB change |
|
|
125
|
+
| `ux_audit.py` | frontend-design | After UI change |
|
|
126
|
+
| `accessibility_checker.py` | frontend-design | After UI change |
|
|
127
|
+
| `seo_checker.py` | seo-fundamentals | After page change |
|
|
128
|
+
| `mobile_audit.py` | mobile-design | After mobile change |
|
|
129
|
+
| `lighthouse_audit.py` | performance-profiling | Before deploy |
|
|
130
|
+
| `playwright_runner.py` | webapp-testing | Before deploy |
|
|
131
|
+
|
|
132
|
+
> ๐ด **Agents & Skills can invoke ANY script** via `python .opencode/skills/<skill>/scripts/<script>.py`
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Rule: core-protocol
|
|
137
|
+
|
|
138
|
+
# Core Protocol - OpenCode kit
|
|
139
|
+
|
|
140
|
+
> The highest-priority workspace rules. How the AI loads agents/skills and what it must do before any implementation.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## CRITICAL: AGENT & SKILL PROTOCOL (START HERE)
|
|
145
|
+
|
|
146
|
+
> **MANDATORY:** You MUST read the appropriate agent file and its skills BEFORE performing any implementation. This is the highest priority rule.
|
|
147
|
+
|
|
148
|
+
### 1. Modular Skill Loading Protocol
|
|
149
|
+
|
|
150
|
+
Agent activated โ Check frontmatter "skills:" โ Read SKILL.md (INDEX) โ Read specific sections.
|
|
151
|
+
|
|
152
|
+
- **Selective Reading:** DO NOT read ALL files in a skill folder. Read `SKILL.md` first, then only read sections matching the user's request.
|
|
153
|
+
- **Rule Priority:** P0 (Workspace Rules in `.opencode/rules/`) > P1 (Agent `.md`) > P2 (SKILL.md). All rules are binding.
|
|
154
|
+
|
|
155
|
+
### 1.1 Skill Announcement (MANDATORY)
|
|
156
|
+
|
|
157
|
+
**Every time you load and apply a skill, announce it BEFORE using it** โ so the user can verify which knowledge is active.
|
|
158
|
+
|
|
159
|
+
```markdown
|
|
160
|
+
๐ **Using skill: `@[skill-name]`...**
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
- List multiple skills together: `๐ Using skills: @frontend-design + @design-spec...`
|
|
164
|
+
- Announce on-demand skills too (e.g. a companion skill pulled from a hub, or `app-builder` for a new app), not just frontmatter ones.
|
|
165
|
+
- โ Applying a skill without announcing it = **USER CANNOT VERIFY THE SKILL WAS USED**.
|
|
166
|
+
|
|
167
|
+
### 2. Enforcement Protocol
|
|
168
|
+
|
|
169
|
+
1. **When agent is activated:**
|
|
170
|
+
- โ
Activate: Read Rules โ Check Frontmatter โ Load SKILL.md โ Apply All.
|
|
171
|
+
2. **Forbidden:** Never skip reading agent rules or skill instructions. "Read โ Understand โ Apply" is mandatory.
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## ๐ File Dependency Awareness
|
|
176
|
+
|
|
177
|
+
**Before modifying ANY file:**
|
|
178
|
+
|
|
179
|
+
1. If `CODEBASE.md` exists, check its File Dependencies section.
|
|
180
|
+
2. Otherwise, discover dependencies with targeted search/import analysis; do not block waiting for a missing file.
|
|
181
|
+
3. Identify dependent files and update all affected files together.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## ๐บ๏ธ System Map & Memory Read
|
|
186
|
+
|
|
187
|
+
> ๐ด **MANDATORY:** At session start, you MUST read `.opencode/memory/MEMORY.md` to load persistent project conventions, user preferences, and decisions.
|
|
188
|
+
|
|
189
|
+
> ๐ **Catalog lookup (on-demand, NOT every session):** Need the full list of Agents / Skills / Scripts? The `quick-reference` rule has the essentials. For the complete catalog, read `.opencode/ARCHITECTURE.md` only when you actually need it (e.g. orchestration, or discovering a skill you're unsure exists) โ do NOT load it on every request.
|
|
190
|
+
|
|
191
|
+
**Path Awareness (Note: the project directory name is `.agents` plural):**
|
|
192
|
+
|
|
193
|
+
- Agents: `.opencode/agent/` (Project)
|
|
194
|
+
- Skills: `.opencode/skills/` (Project)
|
|
195
|
+
- Memory: `.opencode/memory/` (Project)
|
|
196
|
+
- Runtime Scripts: `.opencode/skills/<skill>/scripts/`
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## ๐ง Read โ Understand โ Apply
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
โ WRONG: Read agent file โ Start coding
|
|
204
|
+
โ
CORRECT: Read โ Understand WHY โ Apply PRINCIPLES โ Code
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**Before coding, answer:**
|
|
208
|
+
|
|
209
|
+
1. What is the GOAL of this agent/skill?
|
|
210
|
+
2. What PRINCIPLES must I apply?
|
|
211
|
+
3. How does this DIFFER from generic output?
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Rule: design-rules
|
|
216
|
+
|
|
217
|
+
# Design Rules (TIER 2) - OpenCode kit
|
|
218
|
+
|
|
219
|
+
> Loaded when touching UI files. Design rules live in the specialist agents, NOT here.
|
|
220
|
+
|
|
221
|
+
## ๐ GATE: DESIGN.md before any UI code (MANDATORY)
|
|
222
|
+
|
|
223
|
+
Before writing or editing UI (components, pages, styles โ web or mobile), a **`DESIGN.md` must exist at the project root**.
|
|
224
|
+
|
|
225
|
+
1. **Check** for `DESIGN.md` at the project root.
|
|
226
|
+
2. **If missing:** infer the design direction from the brief, then **create `DESIGN.md` first** (tokens + rationale) following the `design-spec` skill. Do not write UI code until it exists.
|
|
227
|
+
3. **If present:** READ it and build strictly against its tokens. Descriptive names in prose map to token names.
|
|
228
|
+
4. **Keep it in sync** when the visual language changes โ it is the single source of truth.
|
|
229
|
+
|
|
230
|
+
> Exception: none for new UI. A genuinely trivial tweak to existing UI (one button color, a spacing nudge) may proceed if a `DESIGN.md` already governs the project. Net-new UI always requires the gate.
|
|
231
|
+
|
|
232
|
+
| Need | Read |
|
|
233
|
+
| ---- | ---- |
|
|
234
|
+
| DESIGN.md format / tokens | `.opencode/skills/design-spec/SKILL.md` |
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
| Task | Read |
|
|
239
|
+
| ------------ | ------------------------------- |
|
|
240
|
+
| Web UI/UX | `.opencode/agent/frontend-specialist.md` |
|
|
241
|
+
| Mobile UI/UX | `.opencode/agent/mobile-developer.md` |
|
|
242
|
+
|
|
243
|
+
**These agents contain:**
|
|
244
|
+
|
|
245
|
+
- Purple Ban (no purple by default โ brand/brief override allowed)
|
|
246
|
+
- Template Ban (no standard layouts)
|
|
247
|
+
- Anti-clichรฉ rules
|
|
248
|
+
- Deep Design Thinking protocol
|
|
249
|
+
|
|
250
|
+
> ๐ด **For design work:** Open and READ the agent file. Rules are there.
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## Rule: quick-reference
|
|
255
|
+
|
|
256
|
+
# Quick Reference - OpenCode kit
|
|
257
|
+
|
|
258
|
+
> A fast index of the most-used agents, skills, and scripts.
|
|
259
|
+
|
|
260
|
+
## Agents & Skills
|
|
261
|
+
|
|
262
|
+
- **Masters**: `orchestrator`, `project-planner`, `security-auditor` (Cyber/Audit), `backend-specialist` (API/DB), `frontend-specialist` (UI/UX), `mobile-developer`, `debugger`, `game-developer`
|
|
263
|
+
- **Key Skills**: `clean-code`, `brainstorming`, `app-builder`, `frontend-design`, `mobile-design`, `plan-writing`, `behavioral-modes`
|
|
264
|
+
|
|
265
|
+
## Key Scripts
|
|
266
|
+
|
|
267
|
+
- **Verify**: `.opencode/scripts/verify_all.py`, `.opencode/scripts/checklist.py`
|
|
268
|
+
- **Scanners**: `security_scan.py`
|
|
269
|
+
- **Audits**: `ux_audit.py`, `mobile_audit.py`, `lighthouse_audit.py`, `seo_checker.py`
|
|
270
|
+
- **Test**: `playwright_runner.py`, `test_runner.py`
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## Rule: request-routing
|
|
275
|
+
|
|
276
|
+
# Request Routing - OpenCode kit
|
|
277
|
+
|
|
278
|
+
> Always-active. Classify every request, then auto-route to the best specialist agent(s) before responding.
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## ๐ฅ REQUEST CLASSIFIER (STEP 1)
|
|
283
|
+
|
|
284
|
+
**Before ANY action, classify the request:**
|
|
285
|
+
|
|
286
|
+
| Request Type | Trigger Keywords | Active Tiers | Result |
|
|
287
|
+
| ---------------- | ------------------------------------------ | ------------------------------ | --------------------------- |
|
|
288
|
+
| **QUESTION** | "what is", "how does", "explain" | TIER 0 only | Text Response |
|
|
289
|
+
| **SURVEY/INTEL** | "analyze", "list files", "overview" | TIER 0 + Explorer | Session Intel (No File) |
|
|
290
|
+
| **SIMPLE CODE** | "fix", "add", "change" (single file) | TIER 0 + TIER 1 (lite) | Inline Edit |
|
|
291
|
+
| **COMPLEX CODE** | "build", "create", "implement", "refactor" | TIER 0 + TIER 1 (full) + Agent | **{task-slug}.md Required** |
|
|
292
|
+
| **NEW APP** | "new app", "from scratch", "build me a/an", multi-page | `project-planner` (loads `app-builder`) โ `orchestrator` | **{task-slug}.md + app-builder** |
|
|
293
|
+
| **DESIGN/UI** | "design", "UI", "page", "dashboard" | TIER 0 + TIER 1 + Agent | **{task-slug}.md Required** |
|
|
294
|
+
| **SLASH CMD** | /create, /orchestrate, /debug | Command-specific flow | Variable |
|
|
295
|
+
|
|
296
|
+
> ๐ด **NEW APP / scaffold from scratch:** route through `project-planner` or `orchestrator` (both load `app-builder`), NOT a lone specialist like `frontend-specialist`. A specialist alone has no project-detection, tech-stack selection, or template knowledge โ `app-builder` does. Or run `/create`.
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## ๐ค INTELLIGENT AGENT ROUTING (STEP 2 - AUTO)
|
|
301
|
+
|
|
302
|
+
**ALWAYS ACTIVE: Before responding to ANY request, automatically analyze and select the best agent(s).**
|
|
303
|
+
|
|
304
|
+
> ๐ด **MANDATORY:** You MUST follow the protocol defined in `@[skills/intelligent-routing]`.
|
|
305
|
+
|
|
306
|
+
### Auto-Selection Protocol
|
|
307
|
+
|
|
308
|
+
1. **Analyze (Silent)**: Detect domains (Frontend, Backend, Security, etc.) from user request.
|
|
309
|
+
2. **Select Agent(s)**: Choose the most appropriate specialist(s).
|
|
310
|
+
3. **Inform User**: Concisely state which expertise is being applied.
|
|
311
|
+
4. **Apply**: Generate response using the selected agent's persona and rules.
|
|
312
|
+
|
|
313
|
+
### Response Format (MANDATORY)
|
|
314
|
+
|
|
315
|
+
When auto-applying an agent, inform the user:
|
|
316
|
+
|
|
317
|
+
```markdown
|
|
318
|
+
๐ค **Applying knowledge of `@[agent-name]`...**
|
|
319
|
+
|
|
320
|
+
[Continue with specialized response]
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
**Rules:**
|
|
324
|
+
|
|
325
|
+
1. **Silent Analysis**: No verbose meta-commentary ("I am analyzing...").
|
|
326
|
+
2. **Respect Overrides**: If user mentions `@agent`, use it.
|
|
327
|
+
3. **Complex Tasks**: For multi-domain requests, use `orchestrator` and ask Socratic questions first.
|
|
328
|
+
|
|
329
|
+
### โ ๏ธ AGENT ROUTING CHECKLIST (MANDATORY BEFORE EVERY CODE/DESIGN RESPONSE)
|
|
330
|
+
|
|
331
|
+
**Before ANY code or design work, you MUST complete this mental checklist:**
|
|
332
|
+
|
|
333
|
+
| Step | Check | If Unchecked |
|
|
334
|
+
|------|-------|--------------|
|
|
335
|
+
| 1 | Did I identify the correct agent for this domain? | โ STOP. Analyze request domain first. |
|
|
336
|
+
| 2 | Did I READ the agent's `.md` file (or recall its rules)? | โ STOP. Open `.opencode/agent/{agent}.md` |
|
|
337
|
+
| 3 | Did I announce `๐ค Applying knowledge of @[agent]...`? | โ STOP. Add announcement before response. |
|
|
338
|
+
| 4 | Did I load required skills from agent's frontmatter? | โ STOP. Check `skills:` field and read them. |
|
|
339
|
+
|
|
340
|
+
**Failure Conditions:**
|
|
341
|
+
|
|
342
|
+
- โ Writing code without identifying an agent = **PROTOCOL VIOLATION**
|
|
343
|
+
- โ Skipping the announcement = **USER CANNOT VERIFY AGENT WAS USED**
|
|
344
|
+
- โ Ignoring agent-specific rules (e.g., Purple Ban) = **QUALITY FAILURE**
|
|
345
|
+
|
|
346
|
+
> ๐ด **Self-Check Trigger:** Every time you are about to write code or create UI, ask yourself:
|
|
347
|
+
> "Have I completed the Agent Routing Checklist?" If NO โ Complete it first.
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
## ๐ญ Gemini Mode Mapping
|
|
352
|
+
|
|
353
|
+
| Mode | Agent | Behavior |
|
|
354
|
+
| -------- | ----------------- | -------------------------------------------- |
|
|
355
|
+
| **plan** | `project-planner` | 4-phase methodology. NO CODE before Phase 4. |
|
|
356
|
+
| **ask** | - | Focus on understanding. Ask questions. |
|
|
357
|
+
| **edit** | `orchestrator` | Execute. Check `{task-slug}.md` first. |
|
|
358
|
+
|
|
359
|
+
> ๐ด **Edit mode:** If multi-file or structural change โ Offer to create `{task-slug}.md`. For single-file fixes โ Proceed directly.
|
|
360
|
+
> Full Plan Mode (4-Phase) protocol lives in `code-rules.md`.
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
## Rule: universal-rules
|
|
365
|
+
|
|
366
|
+
# Universal Rules (TIER 0) - OpenCode kit
|
|
367
|
+
|
|
368
|
+
> Always-active rules that apply to every request, regardless of domain.
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
## ๐ Language Handling
|
|
373
|
+
|
|
374
|
+
When user's prompt is NOT in English:
|
|
375
|
+
|
|
376
|
+
1. **Internally translate** for better comprehension
|
|
377
|
+
2. **Respond in user's language** - match their communication
|
|
378
|
+
3. **Code comments/variables** remain in English
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
382
|
+
## ๐งน Clean Code (Global Mandatory)
|
|
383
|
+
|
|
384
|
+
**ALL code MUST follow `@[skills/clean-code]` rules. No exceptions.**
|
|
385
|
+
|
|
386
|
+
- **Code**: Concise, direct, no over-engineering. Self-documenting.
|
|
387
|
+
- **Testing**: Mandatory. Pyramid (Unit > Int > E2E) + AAA Pattern.
|
|
388
|
+
- **Performance**: Measure first. Adhere to current Core Web Vitals standards.
|
|
389
|
+
- **Infra/Safety**: 5-Phase Deployment. Verify secrets security.
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# OpenCode Kit (from AG Kit)
|
|
2
|
+
|
|
3
|
+
Pure conversion of the AG Kit toolkit for **OpenCode**.
|
|
4
|
+
Everything lives under `.opencode/` so your project root stays clean.
|
|
5
|
+
|
|
6
|
+
## Layout
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
your-project/
|
|
10
|
+
โโโ .opencode/
|
|
11
|
+
โโโ opencode.json # default_agent, instructions
|
|
12
|
+
โโโ AGENTS.md # rules + routing hints
|
|
13
|
+
โโโ USAGE.md # full usage guide
|
|
14
|
+
โโโ README.md # this file
|
|
15
|
+
โโโ agents/ # 20 specialist agents
|
|
16
|
+
โโโ skills/ # 47 domain skills
|
|
17
|
+
โโโ commands/ # 13 slash commands
|
|
18
|
+
โโโ memory/ # durable notes (preferences, decisions)
|
|
19
|
+
โโโ scripts/ # validation helpers
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# From the unzipped kit, copy the folder into any project:
|
|
26
|
+
cp -r .opencode /path/to/your/project/
|
|
27
|
+
|
|
28
|
+
# Or unzip so .opencode lands at project root:
|
|
29
|
+
unzip opencode-kit.zip -d /path/to/your/project
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Open the project in OpenCode. The IDE discovers `.opencode/` automatically.
|
|
33
|
+
|
|
34
|
+
## Defaults
|
|
35
|
+
|
|
36
|
+
- **Primary agent:** `orchestrator`
|
|
37
|
+
- **Also primary:** `project-planner`
|
|
38
|
+
- **Instructions:** `.opencode/AGENTS.md`
|
|
39
|
+
- **Subagents:** all other specialists (`@backend-specialist`, โฆ)
|
|
40
|
+
|
|
41
|
+
## Commands
|
|
42
|
+
|
|
43
|
+
`/plan` `/create` `/enhance` `/debug` `/test` `/verify` `/deploy`
|
|
44
|
+
`/orchestrate` `/coordinate` `/brainstorm` `/preview` `/remember` `/status`
|
|
45
|
+
|
|
46
|
+
## Memory & scripts
|
|
47
|
+
|
|
48
|
+
| Path | Purpose |
|
|
49
|
+
|------|---------|
|
|
50
|
+
| `.opencode/memory/` | Cross-session preferences and decisions (`/remember`) |
|
|
51
|
+
| `.opencode/scripts/` | Checklist / verify helpers |
|
|
52
|
+
|
|
53
|
+
Run helpers from the **project root**:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
python .opencode/scripts/checklist.py .
|
|
57
|
+
python .opencode/scripts/verify_all.py . --url http://localhost:3000
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Skill-bundled scripts:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
python .opencode/skills/vulnerability-scanner/scripts/security_scan.py .
|
|
64
|
+
python .opencode/skills/lint-and-validate/scripts/lint_runner.py .
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Notes
|
|
68
|
+
|
|
69
|
+
- Antigravity hooks/doctor/plugin were not ported.
|
|
70
|
+
- No legacy sample agents (builder/verifier/etc.) โ AG Kit specialists only.
|
|
71
|
+
- See `USAGE.md` for workflows and troubleshooting.
|