luna-agents 2.0.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/.claude-plugin/LICENSE +21 -0
- package/.claude-plugin/README.md +285 -0
- package/.claude-plugin/claude-plugin.json +106 -0
- package/.claude-plugin/index.js +318 -0
- package/.claude-plugin/lib/api-client.js +504 -0
- package/.claude-plugin/lib/rag-utils.js +442 -0
- package/.claude-plugin/package.json +418 -0
- package/LICENSE +21 -0
- package/README.md +350 -0
- package/agents/json/design-architect.json +57 -0
- package/agents/json/luna-auth.json +71 -0
- package/agents/json/luna-brand.json +66 -0
- package/agents/json/luna-cloudflare.json +261 -0
- package/agents/json/luna-code-review.json +63 -0
- package/agents/json/luna-deployment.json +68 -0
- package/agents/json/luna-documentation.json +85 -0
- package/agents/json/luna-hig.json +128 -0
- package/agents/json/luna-layout-designer.json +178 -0
- package/agents/json/luna-monitoring-observability.json +64 -0
- package/agents/json/luna-post-launch-review.json +68 -0
- package/agents/json/luna-requirements-analyzer.json +53 -0
- package/agents/json/luna-task-executor.json +63 -0
- package/agents/json/luna-task-planner.json +62 -0
- package/agents/json/luna-testing-validation.json +66 -0
- package/agents/luna-365-security.md +96 -0
- package/agents/luna-analytics.md +318 -0
- package/agents/luna-api-generator.md +654 -0
- package/agents/luna-auth.md +396 -0
- package/agents/luna-brand.md +248 -0
- package/agents/luna-cloudflare.md +728 -0
- package/agents/luna-code-review.md +487 -0
- package/agents/luna-database.md +453 -0
- package/agents/luna-deployment.md +202 -0
- package/agents/luna-design-architect.md +353 -0
- package/agents/luna-docker.md +615 -0
- package/agents/luna-documentation.md +177 -0
- package/agents/luna-full-test.md +910 -0
- package/agents/luna-glm-vision.md +211 -0
- package/agents/luna-hig.md +430 -0
- package/agents/luna-lemonsqueezy.md +441 -0
- package/agents/luna-monitoring-observability.md +199 -0
- package/agents/luna-openai-app.md +499 -0
- package/agents/luna-post-launch-review.md +191 -0
- package/agents/luna-rag-enhanced.md +1619 -0
- package/agents/luna-rag.md +1733 -0
- package/agents/luna-requirements-analyzer.md +189 -0
- package/agents/luna-run.md +620 -0
- package/agents/luna-seo.md +338 -0
- package/agents/luna-task-executor.md +371 -0
- package/agents/luna-task-planner.md +275 -0
- package/agents/luna-testing-validation.md +681 -0
- package/agents/luna-ui-fix.md +591 -0
- package/agents/luna-ui-test.md +600 -0
- package/agents/luna-user-guide.md +409 -0
- package/agents/site-auditor.md +83 -0
- package/commands/3d-mesh.md +12 -0
- package/commands/3d.md +12 -0
- package/commands/agent-boost.md +13 -0
- package/commands/ai-index.md +16 -0
- package/commands/api.md +12 -0
- package/commands/assert.md +17 -0
- package/commands/audience.md +12 -0
- package/commands/auth.md +17 -0
- package/commands/autopilot.md +12 -0
- package/commands/boost-finsavvy.md +10 -0
- package/commands/boost-org.md +10 -0
- package/commands/boost-project.md +12 -0
- package/commands/brand.md +17 -0
- package/commands/browser-test.md +18 -0
- package/commands/cf.md +26 -0
- package/commands/cfg.md +33 -0
- package/commands/chain.md +12 -0
- package/commands/challenge.md +13 -0
- package/commands/clone.md +12 -0
- package/commands/cmds.md +243 -0
- package/commands/collab.md +12 -0
- package/commands/compete.md +12 -0
- package/commands/config-rules.md +21 -0
- package/commands/connect-infra.md +10 -0
- package/commands/context-pack.md +13 -0
- package/commands/curb.md +12 -0
- package/commands/des.md +38 -0
- package/commands/devto.md +20 -0
- package/commands/dock.md +26 -0
- package/commands/docs.md +33 -0
- package/commands/e2e-flow.md +18 -0
- package/commands/email-routing.md +10 -0
- package/commands/feature.md +12 -0
- package/commands/figma.md +12 -0
- package/commands/fix.md +12 -0
- package/commands/flaky.md +12 -0
- package/commands/flow-record.md +12 -0
- package/commands/gamify.md +12 -0
- package/commands/ghost.md +12 -0
- package/commands/git-insights.md +12 -0
- package/commands/go-viral.md +16 -0
- package/commands/go.md +42 -0
- package/commands/graph-rag.md +13 -0
- package/commands/guard.md +12 -0
- package/commands/heal.md +17 -0
- package/commands/heygen.md +12 -0
- package/commands/hig.md +33 -0
- package/commands/idea.md +12 -0
- package/commands/imagine.md +12 -0
- package/commands/inbox.md +12 -0
- package/commands/lam.md +12 -0
- package/commands/landing.md +12 -0
- package/commands/launch.md +12 -0
- package/commands/learn.md +12 -0
- package/commands/leverage.md +12 -0
- package/commands/ll-365-secure.md +179 -0
- package/commands/ll-3d-mesh.md +94 -0
- package/commands/ll-3d.md +123 -0
- package/commands/ll-a11y-scan.md +143 -0
- package/commands/ll-a11y.md +71 -0
- package/commands/ll-agent-boost.md +92 -0
- package/commands/ll-agent-chain.md +104 -0
- package/commands/ll-ai-index.md +120 -0
- package/commands/ll-api-client.md +77 -0
- package/commands/ll-api.md +99 -0
- package/commands/ll-assert.md +73 -0
- package/commands/ll-audience.md +308 -0
- package/commands/ll-auth.md +145 -0
- package/commands/ll-autopilot.md +113 -0
- package/commands/ll-boost-finsavvy.md +106 -0
- package/commands/ll-boost-org.md +161 -0
- package/commands/ll-boost-project.md +118 -0
- package/commands/ll-brand.md +150 -0
- package/commands/ll-browser-test.md +203 -0
- package/commands/ll-challenge.md +124 -0
- package/commands/ll-changelog.md +80 -0
- package/commands/ll-ci.md +78 -0
- package/commands/ll-claude-instructions.md +80 -0
- package/commands/ll-clone.md +82 -0
- package/commands/ll-cloudflare.md +580 -0
- package/commands/ll-codemap.md +78 -0
- package/commands/ll-collab.md +87 -0
- package/commands/ll-compete.md +67 -0
- package/commands/ll-config-rules.md +255 -0
- package/commands/ll-config.md +434 -0
- package/commands/ll-connect-infra.md +123 -0
- package/commands/ll-context-pack.md +100 -0
- package/commands/ll-curb.md +164 -0
- package/commands/ll-debug.md +76 -0
- package/commands/ll-deploy.md +101 -0
- package/commands/ll-deps.md +70 -0
- package/commands/ll-design.md +86 -0
- package/commands/ll-devto-publish.md +172 -0
- package/commands/ll-dockerize.md +273 -0
- package/commands/ll-docs.md +123 -0
- package/commands/ll-e2e-flow.md +132 -0
- package/commands/ll-e2e-test.md +231 -0
- package/commands/ll-email-routing.md +130 -0
- package/commands/ll-env.md +70 -0
- package/commands/ll-execute.md +98 -0
- package/commands/ll-feature.md +80 -0
- package/commands/ll-figma.md +82 -0
- package/commands/ll-fix.md +76 -0
- package/commands/ll-flaky.md +151 -0
- package/commands/ll-flow-record.md +180 -0
- package/commands/ll-flowdocs.md +83 -0
- package/commands/ll-gamify.md +131 -0
- package/commands/ll-gemma4.md +84 -0
- package/commands/ll-ghost.md +79 -0
- package/commands/ll-git-insights.md +152 -0
- package/commands/ll-go-viral.md +171 -0
- package/commands/ll-graph-rag.md +113 -0
- package/commands/ll-guard.md +92 -0
- package/commands/ll-heal.md +135 -0
- package/commands/ll-heygen.md +203 -0
- package/commands/ll-hig.md +578 -0
- package/commands/ll-hld.md +84 -0
- package/commands/ll-i18n.md +74 -0
- package/commands/ll-idea.md +101 -0
- package/commands/ll-imagine.md +72 -0
- package/commands/ll-inbox.md +116 -0
- package/commands/ll-lam.md +93 -0
- package/commands/ll-landing.md +171 -0
- package/commands/ll-launch.md +100 -0
- package/commands/ll-learn.md +87 -0
- package/commands/ll-leverage.md +137 -0
- package/commands/ll-local-llm.md +131 -0
- package/commands/ll-ls-products.md +160 -0
- package/commands/ll-marketplace.md +130 -0
- package/commands/ll-mcp-publish.md +104 -0
- package/commands/ll-migrate.md +68 -0
- package/commands/ll-mock.md +79 -0
- package/commands/ll-money.md +87 -0
- package/commands/ll-monitor.md +120 -0
- package/commands/ll-morph.md +117 -0
- package/commands/ll-multi-agent.md +170 -0
- package/commands/ll-native.md +93 -0
- package/commands/ll-nexa.md +79 -0
- package/commands/ll-onboarding.md +84 -0
- package/commands/ll-openhands.md +78 -0
- package/commands/ll-organic-promote.md +260 -0
- package/commands/ll-parallel.md +74 -0
- package/commands/ll-payments.md +83 -0
- package/commands/ll-perf-trace.md +147 -0
- package/commands/ll-perf.md +65 -0
- package/commands/ll-persona.md +280 -0
- package/commands/ll-pipe.md +296 -0
- package/commands/ll-plan-impl.js +570 -0
- package/commands/ll-plan-v2.md +297 -0
- package/commands/ll-plan.md +87 -0
- package/commands/ll-postlaunch.md +109 -0
- package/commands/ll-pr.md +84 -0
- package/commands/ll-present.md +110 -0
- package/commands/ll-product-map.md +152 -0
- package/commands/ll-promote.md +352 -0
- package/commands/ll-publish.md +124 -0
- package/commands/ll-pulse.md +96 -0
- package/commands/ll-rag-guided.md +345 -0
- package/commands/ll-rag-upgrade.md +504 -0
- package/commands/ll-rag.md +343 -0
- package/commands/ll-record.md +114 -0
- package/commands/ll-refactor.md +71 -0
- package/commands/ll-requirements.md +71 -0
- package/commands/ll-review.md +92 -0
- package/commands/ll-rollback.md +66 -0
- package/commands/ll-routemap.md +79 -0
- package/commands/ll-rules.md +90 -0
- package/commands/ll-shortcuts.md +229 -0
- package/commands/ll-sing.md +99 -0
- package/commands/ll-site-audit.md +228 -0
- package/commands/ll-smart-route.md +92 -0
- package/commands/ll-smart-search.md +58 -0
- package/commands/ll-storybook.md +86 -0
- package/commands/ll-swarm.md +101 -0
- package/commands/ll-test.md +97 -0
- package/commands/ll-time-machine.md +72 -0
- package/commands/ll-ui-convert.md +433 -0
- package/commands/ll-video.md +108 -0
- package/commands/ll-vision-pipeline.md +247 -0
- package/commands/ll-vision.md +74 -0
- package/commands/ll-visual-diff.md +118 -0
- package/commands/ll-visual-qa.md +204 -0
- package/commands/ll-visual-regression.md +96 -0
- package/commands/ll-voice.md +138 -0
- package/commands/ll-watch.md +65 -0
- package/commands/ll-workflow.md +108 -0
- package/commands/ll-zen.md +98 -0
- package/commands/local-llm.md +12 -0
- package/commands/marketplace.md +13 -0
- package/commands/mcp-publish.md +16 -0
- package/commands/migrate.md +12 -0
- package/commands/money.md +12 -0
- package/commands/morph.md +12 -0
- package/commands/multi-agent.md +12 -0
- package/commands/native.md +12 -0
- package/commands/nexa.md +12 -0
- package/commands/oh.md +12 -0
- package/commands/organic-promote.md +16 -0
- package/commands/perf-trace.md +12 -0
- package/commands/perf.md +12 -0
- package/commands/persona.md +12 -0
- package/commands/pipe.md +21 -0
- package/commands/plan.md +38 -0
- package/commands/pr.md +12 -0
- package/commands/present.md +12 -0
- package/commands/product-map.md +13 -0
- package/commands/promote.md +16 -0
- package/commands/publish.md +12 -0
- package/commands/pulse.md +12 -0
- package/commands/q.md +35 -0
- package/commands/record.md +12 -0
- package/commands/refactor.md +12 -0
- package/commands/req.md +40 -0
- package/commands/retro.md +33 -0
- package/commands/rev.md +39 -0
- package/commands/rules.md +19 -0
- package/commands/search.md +12 -0
- package/commands/sec.md +34 -0
- package/commands/ship.md +39 -0
- package/commands/sing.md +12 -0
- package/commands/site-audit.md +12 -0
- package/commands/smart-route.md +13 -0
- package/commands/swarm.md +12 -0
- package/commands/test.md +39 -0
- package/commands/time-machine.md +12 -0
- package/commands/ui.md +33 -0
- package/commands/video.md +12 -0
- package/commands/vision.md +12 -0
- package/commands/voice.md +12 -0
- package/commands/vr.md +18 -0
- package/commands/watch.md +39 -0
- package/commands/workflow.md +19 -0
- package/commands/zen.md +12 -0
- package/package.json +76 -0
- package/setup.sh +382 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ll-fix
|
|
3
|
+
displayName: Luna Bug Fix
|
|
4
|
+
description: Systematic bug fix — reproduce, failing test, bisect, fix, verify, regression test
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
category: debugging
|
|
7
|
+
agent: luna-code-review
|
|
8
|
+
parameters:
|
|
9
|
+
- name: bug
|
|
10
|
+
type: string
|
|
11
|
+
description: Bug description or error message
|
|
12
|
+
required: true
|
|
13
|
+
prompt: true
|
|
14
|
+
- name: scope
|
|
15
|
+
type: string
|
|
16
|
+
description: Project or feature scope
|
|
17
|
+
required: true
|
|
18
|
+
prompt: true
|
|
19
|
+
workflow:
|
|
20
|
+
- reproduce_bug
|
|
21
|
+
- write_failing_test
|
|
22
|
+
- bisect_root_cause
|
|
23
|
+
- implement_fix
|
|
24
|
+
- verify_fix_passes
|
|
25
|
+
- write_regression_test
|
|
26
|
+
- run_full_suite
|
|
27
|
+
- generate_fix_report
|
|
28
|
+
output:
|
|
29
|
+
- .luna/{current-project}/fix-report.md
|
|
30
|
+
prerequisites: []
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
# Luna Bug Fix
|
|
34
|
+
|
|
35
|
+
Systematic bug fix workflow — no guessing, just science.
|
|
36
|
+
|
|
37
|
+
## What This Command Does
|
|
38
|
+
|
|
39
|
+
1. **Reproduce** — understand the bug, find the exact trigger
|
|
40
|
+
2. **Failing Test** — write a test that fails with the current bug
|
|
41
|
+
3. **Bisect** — trace the root cause through code flow
|
|
42
|
+
4. **Fix** — implement the minimal fix
|
|
43
|
+
5. **Verify** — confirm the failing test now passes
|
|
44
|
+
6. **Regression Test** — add edge case tests to prevent recurrence
|
|
45
|
+
7. **Full Suite** — run all tests to ensure no side effects
|
|
46
|
+
8. **Report** — document what broke, why, and how it was fixed
|
|
47
|
+
|
|
48
|
+
## Fix Protocol
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
Bug report → Reproduce → Write failing test
|
|
52
|
+
↓
|
|
53
|
+
Bisect root cause (read code, add logging, trace flow)
|
|
54
|
+
↓
|
|
55
|
+
Implement minimal fix (smallest change that fixes the bug)
|
|
56
|
+
↓
|
|
57
|
+
Verify: failing test now passes
|
|
58
|
+
↓
|
|
59
|
+
Add regression tests (edge cases, related scenarios)
|
|
60
|
+
↓
|
|
61
|
+
Run full test suite → All green → Done
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Usage
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
/fix "users can't log in after password reset — returns 401"
|
|
68
|
+
/fix "dashboard crashes when org has no team members"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Rules
|
|
72
|
+
|
|
73
|
+
- Never fix without a failing test first
|
|
74
|
+
- Minimal fix — don't refactor while fixing
|
|
75
|
+
- Every fix gets a regression test
|
|
76
|
+
- Document the root cause in the fix report
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ll-flaky
|
|
3
|
+
displayName: Luna Flaky Test Detector
|
|
4
|
+
description: Detect flaky tests by running them under stress — N iterations, failure pattern analysis, timing capture
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
category: testing
|
|
7
|
+
agent: luna-task-executor
|
|
8
|
+
parameters:
|
|
9
|
+
- name: command
|
|
10
|
+
type: string
|
|
11
|
+
description: "Test command to stress-run (e.g. \"npm test\", \"npx vitest\")"
|
|
12
|
+
required: true
|
|
13
|
+
prompt: true
|
|
14
|
+
- name: runs
|
|
15
|
+
type: number
|
|
16
|
+
description: "Number of iterations to run (default: 20)"
|
|
17
|
+
required: false
|
|
18
|
+
default: 20
|
|
19
|
+
- name: parallel
|
|
20
|
+
type: number
|
|
21
|
+
description: "Max parallel test runs (default: 4)"
|
|
22
|
+
required: false
|
|
23
|
+
default: 4
|
|
24
|
+
mcp_servers:
|
|
25
|
+
- memory
|
|
26
|
+
- git
|
|
27
|
+
- sequential-thinking
|
|
28
|
+
prerequisites:
|
|
29
|
+
- name: test-runner
|
|
30
|
+
check: "npm test --help 2>/dev/null || npx vitest --help 2>/dev/null"
|
|
31
|
+
install: "Ensure your test runner is configured (jest, vitest, playwright)"
|
|
32
|
+
optional: false
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
# /flaky — Detect Flaky Tests Under Stress
|
|
36
|
+
|
|
37
|
+
Run your test suite N times (default 20) in parallel and report which tests fail intermittently. Captures failure patterns, timing distributions, and identifies the root causes of flakiness.
|
|
38
|
+
|
|
39
|
+
## What It Does
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
/flaky "npm test"
|
|
43
|
+
│
|
|
44
|
+
├── CONFIGURE
|
|
45
|
+
│ ├── Parse test command
|
|
46
|
+
│ ├── Set iteration count (default: 20)
|
|
47
|
+
│ ├── Set parallelism (default: 4)
|
|
48
|
+
│ └── Isolate test environment per run
|
|
49
|
+
│
|
|
50
|
+
├── EXECUTE (20 runs, 4 parallel)
|
|
51
|
+
│ ├── Run 1: PASS (2.3s)
|
|
52
|
+
│ ├── Run 2: PASS (2.1s)
|
|
53
|
+
│ ├── Run 3: FAIL auth.test.ts:42 (2.8s)
|
|
54
|
+
│ ├── Run 4: PASS (2.2s)
|
|
55
|
+
│ ├── ...
|
|
56
|
+
│ └── Run 20: PASS (2.4s)
|
|
57
|
+
│
|
|
58
|
+
├── ANALYZE
|
|
59
|
+
│ ├── Group failures by test name
|
|
60
|
+
│ ├── Calculate flakiness rate per test
|
|
61
|
+
│ ├── Identify timing patterns (slow = flaky?)
|
|
62
|
+
│ ├── Detect common root causes:
|
|
63
|
+
│ │ ├── Race conditions
|
|
64
|
+
│ │ ├── Timing-dependent assertions
|
|
65
|
+
│ │ ├── Shared mutable state
|
|
66
|
+
│ │ ├── Network dependency
|
|
67
|
+
│ │ └── Port conflicts
|
|
68
|
+
│ └── Rank by impact (frequency x suite size)
|
|
69
|
+
│
|
|
70
|
+
└── REPORT
|
|
71
|
+
├── Flaky test list with failure rates
|
|
72
|
+
├── Suggested fixes per test
|
|
73
|
+
├── Timing distribution graph
|
|
74
|
+
└── Overall suite reliability score
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## How It Works
|
|
78
|
+
|
|
79
|
+
1. **Parallel execution**: Runs your test command N times with M parallelism
|
|
80
|
+
2. **Isolation**: Each run gets a clean environment (temp dirs, ports)
|
|
81
|
+
3. **Pattern matching**: Groups failures by test name and error message
|
|
82
|
+
4. **Root cause analysis**: Classifies flakiness type based on failure patterns
|
|
83
|
+
5. **Scoring**: Calculates reliability score (passes / total runs per test)
|
|
84
|
+
|
|
85
|
+
## Usage
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
/flaky "npm test" # Default: 20 runs, 4 parallel
|
|
89
|
+
/flaky "npm test" --runs 50 # More iterations for confidence
|
|
90
|
+
/flaky "npx vitest run" --parallel 8 # Higher parallelism
|
|
91
|
+
/flaky "npx playwright test" --runs 10 --parallel 2 # E2E tests (heavier)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Use Cases
|
|
95
|
+
|
|
96
|
+
| Use Case | Command |
|
|
97
|
+
|----------|---------|
|
|
98
|
+
| CI reliability | `/flaky "npm test" --runs 50` |
|
|
99
|
+
| Pre-merge validation | `/flaky "npm test -- --changedSince main"` |
|
|
100
|
+
| Test suite health | `/flaky "npm test" --runs 100` |
|
|
101
|
+
| E2E stability | `/flaky "npx playwright test" --runs 10` |
|
|
102
|
+
| Specific file | `/flaky "npx vitest run src/auth.test.ts" --runs 30` |
|
|
103
|
+
|
|
104
|
+
## Output Structure
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
flaky-report/
|
|
108
|
+
├── report.md # Full flaky test report
|
|
109
|
+
├── results.json # Raw run data
|
|
110
|
+
├── summary.json # Flakiness scores
|
|
111
|
+
│ {
|
|
112
|
+
│ "total_runs": 20,
|
|
113
|
+
│ "suite_pass_rate": "95%",
|
|
114
|
+
│ "flaky_tests": [
|
|
115
|
+
│ {
|
|
116
|
+
│ "name": "auth.test.ts > should refresh token",
|
|
117
|
+
│ "pass_rate": "85%",
|
|
118
|
+
│ "failures": 3,
|
|
119
|
+
│ "cause": "race_condition",
|
|
120
|
+
│ "fix": "Add await before token check"
|
|
121
|
+
│ }
|
|
122
|
+
│ ]
|
|
123
|
+
│ }
|
|
124
|
+
└── timing/
|
|
125
|
+
└── distribution.json # Per-test timing data
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Flakiness Classification
|
|
129
|
+
|
|
130
|
+
| Type | Pattern | Fix Strategy |
|
|
131
|
+
|------|---------|-------------|
|
|
132
|
+
| Race condition | Random failures, timing varies | Add proper awaits, locks |
|
|
133
|
+
| Shared state | Fails when run in parallel | Isolate test state |
|
|
134
|
+
| Timing | Fails on slow machines | Use retries, increase timeouts |
|
|
135
|
+
| Network | Fails intermittently | Mock external calls |
|
|
136
|
+
| Port conflict | Fails in parallel | Use random ports |
|
|
137
|
+
|
|
138
|
+
## In Pipes
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
/pipe flaky "npm test" >> fix >> flaky "npm test" >> assert "flaky == 0"
|
|
142
|
+
/pipe flaky "npm test" >> ghost blog "Fixing Flaky Tests"
|
|
143
|
+
/pipe test >> flaky "npm test" --runs 50 >> guard >> ship
|
|
144
|
+
/pipe flaky "npx playwright test" >> heal >> flaky >> ship
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Reference
|
|
148
|
+
|
|
149
|
+
- Inspired by: https://github.com/bradfitz/flakestress
|
|
150
|
+
- Jest: `--forceExit --detectOpenHandles` flags help identify leaks
|
|
151
|
+
- Vitest: `--reporter=json` for machine-readable output
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ll-flow-record
|
|
3
|
+
displayName: Luna Flow Record
|
|
4
|
+
description: Record browser flows as demo videos — navigate any site, capture screenshots + video, generate AI narration
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
category: creative
|
|
7
|
+
agent: luna-task-executor
|
|
8
|
+
parameters:
|
|
9
|
+
- name: url
|
|
10
|
+
type: string
|
|
11
|
+
description: URL to record (e.g., https://lunaos.ai or http://localhost:3000)
|
|
12
|
+
required: true
|
|
13
|
+
prompt: true
|
|
14
|
+
- name: flow
|
|
15
|
+
type: string
|
|
16
|
+
description: "Flow type: tour (full product), landing (marketing pages), auth (login/signup), dashboard, custom"
|
|
17
|
+
required: false
|
|
18
|
+
default: tour
|
|
19
|
+
- name: output
|
|
20
|
+
type: string
|
|
21
|
+
description: "Output format: video (webm), screenshots (png), gif, all"
|
|
22
|
+
required: false
|
|
23
|
+
default: all
|
|
24
|
+
mcp_servers:
|
|
25
|
+
- playwright
|
|
26
|
+
- zai-mcp-server
|
|
27
|
+
prerequisites: []
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
# Luna Flow Record
|
|
31
|
+
|
|
32
|
+
Record any web app's user flows as professional demo videos with AI-generated narration.
|
|
33
|
+
|
|
34
|
+
## What This Command Does
|
|
35
|
+
|
|
36
|
+
1. **Analyze** — reads the target URL, detects pages and navigation
|
|
37
|
+
2. **Plan** — creates a flow of pages to visit with timing
|
|
38
|
+
3. **Record** — opens Playwright browser with video recording enabled
|
|
39
|
+
4. **Navigate** — visits each page, scrolls, waits for animations
|
|
40
|
+
5. **Screenshot** — captures every page state at 1280x720
|
|
41
|
+
6. **Narrate** — uses Claw Gateway AI to generate captions per step
|
|
42
|
+
7. **Output** — saves video (.webm), screenshots (.png), and narration (.srt)
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Record a full product tour
|
|
48
|
+
/flow-record https://lunaos.ai tour
|
|
49
|
+
|
|
50
|
+
# Record just the landing page sections
|
|
51
|
+
/flow-record https://myapp.com landing
|
|
52
|
+
|
|
53
|
+
# Record auth flow
|
|
54
|
+
/flow-record https://myapp.com auth
|
|
55
|
+
|
|
56
|
+
# Record dashboard walkthrough
|
|
57
|
+
/flow-record http://localhost:3000 dashboard
|
|
58
|
+
|
|
59
|
+
# Screenshots only (no video)
|
|
60
|
+
/flow-record https://lunaos.ai tour screenshots
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## How It Works
|
|
64
|
+
|
|
65
|
+
### Step 1: Detect Pages
|
|
66
|
+
The agent scans the target URL for navigation links, routes, and sections:
|
|
67
|
+
- Extracts all `<a href>` links from the page
|
|
68
|
+
- Identifies hash anchors for single-page sections
|
|
69
|
+
- Detects auth pages (login, signup, forgot-password)
|
|
70
|
+
- Finds dashboard/app routes if authenticated
|
|
71
|
+
|
|
72
|
+
### Step 2: Generate Flow Script
|
|
73
|
+
Creates a Playwright script that:
|
|
74
|
+
```javascript
|
|
75
|
+
const pages = [
|
|
76
|
+
{ url: 'https://site.com', wait: 2000, caption: 'Homepage' },
|
|
77
|
+
{ url: 'https://site.com/#features', wait: 1500, caption: 'Features' },
|
|
78
|
+
{ url: 'https://site.com/pricing', wait: 1500, caption: 'Pricing' },
|
|
79
|
+
// ... detected pages
|
|
80
|
+
];
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Step 3: Record with Playwright
|
|
84
|
+
```javascript
|
|
85
|
+
const ctx = await browser.newContext({
|
|
86
|
+
viewport: { width: 1280, height: 720 },
|
|
87
|
+
recordVideo: { dir: outputDir, size: { width: 1280, height: 720 } },
|
|
88
|
+
});
|
|
89
|
+
// Navigate each page, wait for content, capture screenshots
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Step 4: AI Narration
|
|
93
|
+
For each screenshot, the agent calls the Claw Gateway:
|
|
94
|
+
```
|
|
95
|
+
System: You are a product demo narrator. Given a screenshot description,
|
|
96
|
+
write a 1-sentence caption for a demo video.
|
|
97
|
+
|
|
98
|
+
User: Page showing a pricing table with Free ($0), Pro ($29), Team ($79)
|
|
99
|
+
|
|
100
|
+
AI: "Choose the plan that fits — start free and upgrade as you grow."
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Step 5: Output
|
|
104
|
+
```
|
|
105
|
+
.luna/{project}/flow-record/
|
|
106
|
+
video.webm # Full recording (1280x720)
|
|
107
|
+
screenshots/
|
|
108
|
+
01-hero.png
|
|
109
|
+
02-features.png
|
|
110
|
+
03-pricing.png
|
|
111
|
+
...
|
|
112
|
+
narration.srt # Subtitle file with AI captions
|
|
113
|
+
narration.json # Structured narration data
|
|
114
|
+
flow.json # The flow definition (replayable)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Predefined Flows
|
|
118
|
+
|
|
119
|
+
### `tour` — Full Product Tour
|
|
120
|
+
Visits: homepage → features → use cases → demo → pricing → login → dashboard → docs
|
|
121
|
+
|
|
122
|
+
### `landing` — Marketing Pages Only
|
|
123
|
+
Visits: homepage → features → pricing → about → contact → blog
|
|
124
|
+
|
|
125
|
+
### `auth` — Authentication Flow
|
|
126
|
+
Visits: signup → login → forgot password → OAuth buttons
|
|
127
|
+
|
|
128
|
+
### `dashboard` — App Walkthrough
|
|
129
|
+
Requires credentials in `.luna/rules.yaml`:
|
|
130
|
+
```yaml
|
|
131
|
+
flow_record:
|
|
132
|
+
credentials:
|
|
133
|
+
email: demo@example.com
|
|
134
|
+
password: DemoPass123!
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### `custom` — Define Your Own Flow
|
|
138
|
+
Create `.luna/{project}/flow-record/custom-flow.json`:
|
|
139
|
+
```json
|
|
140
|
+
[
|
|
141
|
+
{ "url": "/", "wait": 2000, "caption": "Welcome" },
|
|
142
|
+
{ "url": "/features", "wait": 1500, "scroll": "bottom" },
|
|
143
|
+
{ "url": "/pricing", "wait": 1500, "caption": "Pricing" }
|
|
144
|
+
]
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Integration with CodeRailFlow
|
|
148
|
+
|
|
149
|
+
If your project uses CodeRailFlow (flow.coderail.dev), existing flows can be recorded:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# Record a CodeRailFlow flow definition
|
|
153
|
+
/flow-record https://myapp.com --coderail-flow flow-id-123
|
|
154
|
+
|
|
155
|
+
# Use CodeRailFlow's element mapper for precise interactions
|
|
156
|
+
/flow-record https://myapp.com dashboard --use-elements
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
The agent will fetch the flow definition from CodeRailFlow's API and replay it with video recording enabled.
|
|
160
|
+
|
|
161
|
+
## In Pipes
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Build feature, then record demo
|
|
165
|
+
/pipe go >> flow-record http://localhost:3000 tour >> publish youtube
|
|
166
|
+
|
|
167
|
+
# Record before and after
|
|
168
|
+
/pipe flow-record https://staging.app.com tour >> deploy >> flow-record https://app.com tour
|
|
169
|
+
|
|
170
|
+
# Full launch: test, record, publish
|
|
171
|
+
/pipe browser-test http://localhost:3000 >> flow-record http://localhost:3000 tour >> ship
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Tips
|
|
175
|
+
|
|
176
|
+
- Use `tour` for Product Hunt / investor demos
|
|
177
|
+
- Use `landing` for marketing asset screenshots
|
|
178
|
+
- Use `auth` to verify OAuth buttons look right
|
|
179
|
+
- Videos are 1280x720 (standard HD) — good for embedding
|
|
180
|
+
- Screenshots work as social media cards (OG images)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ll-flowdocs
|
|
3
|
+
displayName: Luna Flow & Skills Documentation
|
|
4
|
+
description: Document all user flows, interaction patterns, and skills with Mermaid diagrams
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
category: documentation
|
|
7
|
+
agent: luna-flow-documenter
|
|
8
|
+
parameters:
|
|
9
|
+
- name: scope
|
|
10
|
+
type: string
|
|
11
|
+
description: Project or feature scope for flow documentation
|
|
12
|
+
required: true
|
|
13
|
+
prompt: true
|
|
14
|
+
workflow:
|
|
15
|
+
- discover_user_flows_and_state_machines
|
|
16
|
+
- trace_interaction_patterns
|
|
17
|
+
- catalogue_skills_and_agents
|
|
18
|
+
- generate_mermaid_diagrams
|
|
19
|
+
- generate_flowdocs_document
|
|
20
|
+
output:
|
|
21
|
+
- .luna/{current-project}/flowdocs.md
|
|
22
|
+
prerequisites:
|
|
23
|
+
- source_code
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
# Luna Flow & Skills Documentation
|
|
27
|
+
|
|
28
|
+
Documents all user flows, interaction patterns, agent skills, and state machines from your codebase with Mermaid sequence and state diagrams.
|
|
29
|
+
|
|
30
|
+
## What This Command Does
|
|
31
|
+
|
|
32
|
+
This command analyses event handlers, state machines, multi-step processes, and agent skills in your code, then produces comprehensive flow documentation with visual diagrams.
|
|
33
|
+
|
|
34
|
+
## Prerequisites
|
|
35
|
+
|
|
36
|
+
Requires in your current project:
|
|
37
|
+
- Source code
|
|
38
|
+
|
|
39
|
+
For richer output, also provide:
|
|
40
|
+
- `.luna/{current-project}/requirements.md`
|
|
41
|
+
- `.luna/{current-project}/design.md`
|
|
42
|
+
|
|
43
|
+
## Usage Instructions
|
|
44
|
+
|
|
45
|
+
When you run this command, you'll be prompted for the scope:
|
|
46
|
+
- Press **ENTER** for full-project flow documentation
|
|
47
|
+
- Type **feature-name** for feature-specific flows
|
|
48
|
+
|
|
49
|
+
## Execution Steps
|
|
50
|
+
|
|
51
|
+
1. **Flow Discovery**: Finds all user-facing workflows and multi-step processes
|
|
52
|
+
2. **Interaction Tracing**: Maps buttons and actions to their effects and API calls
|
|
53
|
+
3. **Skills Catalogue**: Documents each agent skill with trigger, input, and output
|
|
54
|
+
4. **Diagram Generation**: Creates Mermaid sequence and state diagrams
|
|
55
|
+
5. **Document Generation**: Produces `flowdocs.md` with complete flow registry
|
|
56
|
+
|
|
57
|
+
## Output Files
|
|
58
|
+
|
|
59
|
+
Creates in your current project:
|
|
60
|
+
- `.luna/{current-project}/flowdocs.md`
|
|
61
|
+
|
|
62
|
+
Includes:
|
|
63
|
+
- Flow catalogue with entry points, steps, and exit conditions
|
|
64
|
+
- Mermaid sequence diagrams for key interactions
|
|
65
|
+
- State diagrams for multi-step processes
|
|
66
|
+
- Skills registry with examples
|
|
67
|
+
- Interaction matrix (action → effect → API call)
|
|
68
|
+
- Error flow diagrams
|
|
69
|
+
- Permission map (role → allowed flows)
|
|
70
|
+
|
|
71
|
+
## Next Steps in Workflow
|
|
72
|
+
|
|
73
|
+
After flow documentation:
|
|
74
|
+
```
|
|
75
|
+
/luna-onboarding # Generate onboarding guide from flows
|
|
76
|
+
/luna-test # Generate test cases from documented flows
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Tips
|
|
80
|
+
|
|
81
|
+
- Mermaid diagrams render directly in GitHub, Notion, and most documentation tools
|
|
82
|
+
- Flow docs are excellent source material for QA test plans
|
|
83
|
+
- Re-run after adding new features to keep documentation current
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ll-gamify
|
|
3
|
+
displayName: Luna Gamify
|
|
4
|
+
description: Turn your codebase into games — code quizzes, team leaderboards, achievement systems, interactive tutorials, escape rooms
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
category: creative
|
|
7
|
+
agent: luna-task-executor
|
|
8
|
+
parameters:
|
|
9
|
+
- name: mode
|
|
10
|
+
type: string
|
|
11
|
+
description: "Mode: quiz (code quiz), leaderboard (team stats), achievements (badges), escape-room (debug challenge), tutorial (interactive), trivia (fun facts)"
|
|
12
|
+
required: true
|
|
13
|
+
prompt: true
|
|
14
|
+
- name: difficulty
|
|
15
|
+
type: string
|
|
16
|
+
description: "Difficulty: easy, medium, hard, expert"
|
|
17
|
+
required: false
|
|
18
|
+
default: medium
|
|
19
|
+
mcp_servers:
|
|
20
|
+
- git
|
|
21
|
+
- memory
|
|
22
|
+
- sequential-thinking
|
|
23
|
+
- playwright
|
|
24
|
+
- elevenlabs
|
|
25
|
+
- suno
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
# /gamify — Play With Your Code
|
|
29
|
+
|
|
30
|
+
Turn your codebase into interactive games, quizzes, challenges, and team competitions. Learn your codebase while having fun.
|
|
31
|
+
|
|
32
|
+
## Game Modes
|
|
33
|
+
|
|
34
|
+
### /gamify quiz
|
|
35
|
+
```
|
|
36
|
+
Code Knowledge Quiz:
|
|
37
|
+
├── "What does this function return?" (from your actual code)
|
|
38
|
+
├── "Which service handles billing webhooks?"
|
|
39
|
+
├── "What's the correct order of middleware?"
|
|
40
|
+
├── "Find the bug in this snippet" (real past bugs from git)
|
|
41
|
+
├── "What was the last thing deployed?"
|
|
42
|
+
├── Score tracking + streak bonuses
|
|
43
|
+
├── Sound effects (ElevenLabs)
|
|
44
|
+
└── Victory jingle (Suno) when you ace it
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### /gamify leaderboard
|
|
48
|
+
```
|
|
49
|
+
Team Leaderboard (from git activity):
|
|
50
|
+
├── 🏆 Most PRs merged this sprint
|
|
51
|
+
├── 🐛 Most bugs fixed
|
|
52
|
+
├── 📝 Most code reviewed
|
|
53
|
+
├── 🧪 Best test coverage improvement
|
|
54
|
+
├── 🚀 Most features shipped
|
|
55
|
+
├── ⚡ Fastest PR turnaround
|
|
56
|
+
├── 🎯 Longest green CI streak
|
|
57
|
+
├── 🏅 Achievement badges earned
|
|
58
|
+
└── Updated live from git history
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### /gamify achievements
|
|
62
|
+
```
|
|
63
|
+
Unlock badges as you code:
|
|
64
|
+
├── 🎖️ "First Blood" — First commit to the repo
|
|
65
|
+
├── 🌅 "Early Bird" — Commit before 7am
|
|
66
|
+
├── 🦉 "Night Owl" — Commit after midnight
|
|
67
|
+
├── 💯 "Perfectionist" — 100% test coverage on a file
|
|
68
|
+
├── 🔥 "On Fire" — 5 PRs merged in one day
|
|
69
|
+
├── 🛡️ "Guardian" — Fixed a security vulnerability
|
|
70
|
+
├── 🎨 "Pixel Perfect" — Zero visual regression
|
|
71
|
+
├── 📚 "Documenter" — Updated docs with every feature
|
|
72
|
+
├── 🏗️ "Architect" — Refactored > 1000 lines
|
|
73
|
+
├── 🎪 "Full Stack" — Committed to all 10 repos
|
|
74
|
+
└── Custom badges definable per project
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### /gamify escape-room
|
|
78
|
+
```
|
|
79
|
+
Debug Escape Room:
|
|
80
|
+
├── Luna introduces a real bug from your git history
|
|
81
|
+
├── You have 10 minutes to find and fix it
|
|
82
|
+
├── Hints available (costs points)
|
|
83
|
+
├── Difficulty scales with your skill level
|
|
84
|
+
├── Leaderboard of fastest solvers
|
|
85
|
+
├── Background music (tense soundtrack via Suno)
|
|
86
|
+
└── Victory animation when solved
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### /gamify tutorial
|
|
90
|
+
```
|
|
91
|
+
Interactive Codebase Tutorial:
|
|
92
|
+
├── "Welcome to LunaOS! Let's explore..."
|
|
93
|
+
├── Guided tour through architecture
|
|
94
|
+
├── Challenges at each stop (mini quizzes)
|
|
95
|
+
├── Points for correct answers
|
|
96
|
+
├── Narrated by AI voice (ElevenLabs)
|
|
97
|
+
├── Perfect for onboarding new team members
|
|
98
|
+
└── Completion certificate generated
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### /gamify trivia
|
|
102
|
+
```
|
|
103
|
+
Fun Facts About Your Code:
|
|
104
|
+
├── "Did you know? This repo has 47,231 lines of code"
|
|
105
|
+
├── "The oldest file is auth.ts, created 2 years ago"
|
|
106
|
+
├── "Team record: 14 PRs merged in a single day"
|
|
107
|
+
├── "Most edited file: Dashboard.tsx (342 commits)"
|
|
108
|
+
├── "Longest function: processWorkflow (87 lines)"
|
|
109
|
+
├── "Total git commits: 1,847"
|
|
110
|
+
└── Presented as animated cards with sound
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Usage
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
/gamify quiz # Code quiz from your repo
|
|
117
|
+
/gamify quiz --difficulty expert # Hard mode
|
|
118
|
+
/gamify leaderboard # Team rankings
|
|
119
|
+
/gamify achievements # Show badges
|
|
120
|
+
/gamify escape-room # Debug challenge
|
|
121
|
+
/gamify tutorial # Interactive onboarding
|
|
122
|
+
/gamify trivia # Fun code facts
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## In Pipes
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
/pipe collab onboard >> gamify tutorial >> gamify quiz # Onboard with games
|
|
129
|
+
/pipe collab retro >> gamify leaderboard >> present sprint # Retro with rankings
|
|
130
|
+
/pipe gamify escape-room >> if $solved >> sing "victory!" # Debug then celebrate
|
|
131
|
+
```
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Gemma 4 Local AI Setup
|
|
2
|
+
|
|
3
|
+
Set up Google Gemma 4 for free, local AI inference via Ollama. Zero cost, 256K context, multimodal (text+image+audio).
|
|
4
|
+
|
|
5
|
+
## Model Variants
|
|
6
|
+
|
|
7
|
+
| Model | Active Params | Context | Modalities | Best For |
|
|
8
|
+
|-------|--------------|---------|------------|----------|
|
|
9
|
+
| `gemma4:31b` | 30.7B | 256K | Text, Image | Best quality, fine-tuning |
|
|
10
|
+
| `gemma4:26b` | 3.8B (MoE) | 256K | Text, Image | Fastest, low latency |
|
|
11
|
+
| `gemma4:e4b` | 4.5B | 128K | Text, Image, Audio | Edge + voice |
|
|
12
|
+
| `gemma4:e2b` | 2.3B | 128K | Text, Image, Audio | Mobile, IoT |
|
|
13
|
+
|
|
14
|
+
## Quick Setup
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Install Ollama (if not installed)
|
|
18
|
+
curl -fsSL https://ollama.com/install.sh | sh
|
|
19
|
+
|
|
20
|
+
# Pull Gemma 4 (choose one)
|
|
21
|
+
ollama pull gemma4 # Default (31B, ~18GB)
|
|
22
|
+
ollama pull gemma4:26b # MoE, fastest (~15GB)
|
|
23
|
+
ollama pull gemma4:e4b # Edge with audio (~5GB)
|
|
24
|
+
ollama pull gemma4:e2b # Smallest (~3GB)
|
|
25
|
+
|
|
26
|
+
# Verify
|
|
27
|
+
ollama run gemma4 "Hello, are you Gemma 4?"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Integration
|
|
31
|
+
|
|
32
|
+
Gemma 4 is auto-detected by:
|
|
33
|
+
- **AMLiQ**: `ModelRouter` checks Ollama → routes screening LLM calls for free
|
|
34
|
+
- **LunaOS**: `smart-router.ts` uses gemma4 for free-tier users
|
|
35
|
+
- **Local providers**: `checkOllamaGemma4()` in local-providers.ts
|
|
36
|
+
|
|
37
|
+
### Environment Variables
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
OLLAMA_HOST=http://localhost:11434 # Default Ollama endpoint
|
|
41
|
+
GEMMA_MODEL=gemma4 # Model tag (gemma4, gemma4:26b, etc.)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### AMLiQ Cost Savings
|
|
45
|
+
|
|
46
|
+
| Provider | Cost per 1K screenings | Latency |
|
|
47
|
+
|----------|----------------------|---------|
|
|
48
|
+
| Anthropic Claude | ~$3.00 | ~500ms |
|
|
49
|
+
| Claw Gateway | ~$1.00 | ~300ms |
|
|
50
|
+
| **Gemma 4 local** | **$0.00** | **~50ms** |
|
|
51
|
+
|
|
52
|
+
## Benchmarks vs Competitors
|
|
53
|
+
|
|
54
|
+
| Benchmark | Gemma 4 31B | Qwen 3.5 27B | Llama 4 Scout |
|
|
55
|
+
|-----------|-------------|-------------|---------------|
|
|
56
|
+
| AIME 2026 (math) | **89.2%** | 48.7% | — |
|
|
57
|
+
| LiveCodeBench | **80.0%** | — | — |
|
|
58
|
+
| MMMU Pro (vision) | **76.9%** | — | — |
|
|
59
|
+
| Arena AI | **#3 open** | — | — |
|
|
60
|
+
|
|
61
|
+
## Architecture Highlights
|
|
62
|
+
|
|
63
|
+
- **Hybrid Attention**: sliding window (1024) + global attention
|
|
64
|
+
- **Per-Layer Embeddings**: residual signal into every decoder layer
|
|
65
|
+
- **Shared KV Cache**: last N layers reuse earlier KV states (less VRAM)
|
|
66
|
+
- **262K vocabulary**: massive token coverage across 140+ languages
|
|
67
|
+
- **Apache-like license**: permissive for commercial use
|
|
68
|
+
|
|
69
|
+
## Hardware Requirements
|
|
70
|
+
|
|
71
|
+
| Model | VRAM (Q4) | RAM | Disk |
|
|
72
|
+
|-------|-----------|-----|------|
|
|
73
|
+
| 31B | ~18GB | 24GB+ | 18GB |
|
|
74
|
+
| 26B MoE | ~15GB | 20GB+ | 15GB |
|
|
75
|
+
| E4B | ~5GB | 8GB+ | 5GB |
|
|
76
|
+
| E2B | ~3GB | 4GB+ | 3GB |
|
|
77
|
+
|
|
78
|
+
## What This Command Does
|
|
79
|
+
|
|
80
|
+
1. Checks if Ollama is installed
|
|
81
|
+
2. Pulls the appropriate Gemma 4 model based on available VRAM
|
|
82
|
+
3. Verifies the model loads and responds
|
|
83
|
+
4. Tests integration with the current project (AMLiQ screening or LunaOS routing)
|
|
84
|
+
5. Reports cost savings estimate
|