Lexis-Two

LEXIS-TWO

The simple way to obtain the best code.

Portable rules, skills, and slash commands for AI agents. The simple way to get the best code. With lowest tokens usage.

Benchmark with your OpenCode Go models, then publish results -- View benchmarks · OpenCode Go harness (npm run benchmark:opencode-go).

The ladder

Before writing any code, stop at the first rung that holds.

  1. Does this need to exist at all? (YAGNI)
  2. Does the standard library already do this?
  3. Does a native platform feature cover it?
  4. Does an already-installed dependency solve it?
  5. Can it be one line?
  6. Only then: write the minimum code that works.

One example

Sort an array. From examples/sorting.md in the repo.

Without Lexis-Two
function quickSort(arr, compareFn = (a, b) => a - b) {
  if (arr.length <= 1) return arr;
  const pivot = arr[Math.floor(arr.length / 2)];
  const left = [], right = [], equal = [];
  for (const item of arr) {
    const cmp = compareFn(item, pivot);
    if (cmp < 0) left.push(item);
    else if (cmp > 0) right.push(item);
    else equal.push(item);
  }
  return [...quickSort(left), ...equal, ...quickSort(right)];
}

Hand-rolled quicksort. Homework energy.

With Lexis-Two
// lexis: this exists
numbers.sort((a, b) => a - b)

24 lines -> 1. Every runtime ships a sort tuned by pros.

Works where you code

Thin adapters. One skill source. skills/ is the core.

Host Level Entry point
OpenCode Full .opencode/plugins/lexis-two.mjs
Claude Code Coming soon .claude-plugin/ + hooks/ (v0.3)
GitHub Copilot (plugin) Coming soon .github/plugin/plugin.json (v0.3)
Gemini CLI Full gemini-extension.json
pi Full pi-extension/
Codex Full .codex-plugin/ + AGENTS.md
Cursor Rules .cursor/rules/lexis-two.mdc
Windsurf / Cline / Kiro Rules lexis-two.md in host rules folder
Any agent Rules AGENTS.md or skills/*/SKILL.md

Slash commands

On hosts with command adapters today: OpenCode, Gemini CLI, and pi. Claude Code and Copilot plugin land in v0.3.

/lexis-two

Mode: lite, full, ultra, off

/lexis-two-review

Review the diff for over-engineering

/lexis-two-audit

Full repo audit -- what to delete

/lexis-two-debt

Harvest // lexis: comments

/lexis-two-plan

Plan before writing code

/lexis-two-security

Security audit (Node/TS stack default)

/lexis-two-help

Quick reference card

Install

Clone once. Point your host at the adapter files.

git clone https://github.com/nitdraig/lexis-two.git ~/lexis-two

# opencode.json
{
  "plugin": ["~/lexis-two/.opencode/plugins/lexis-two.mjs"],
  "instructions": ["~/lexis-two/AGENTS.md"]
}

Adapt to any stack

Three files to touch. No new framework required.

1. AGENTS.md

Replace stack shortcuts (Python stdlib, Rust crates, Go stdlib). Run node scripts/check-rule-copies.js.

2. skills/

Point audit commands at your tools -- cargo audit, pip-audit, golangci-lint.

3. commands/

Update TOML and OpenCode command descriptions if skill behavior changes.

Focused stacks

Optimized patterns for the most common production stacks.

TypeScript / Node.js

Next.js, React, Express, Fastify, strict types

MongoDB / Mongoose

Schemas, indexes, aggregation, transactions

Tailwind CSS

Utility-first, dark mode, responsive

Python

FastAPI, Django, dataclasses, type hints

PostgreSQL / Prisma

Relations, migrations, N+1 prevention

Redis

Caching, sessions, rate limiting, pub/sub

OpenCode Go benchmark

baseline vs lexis-two — median LOC across 5 coding tasks.

Run date: 2026-06-16 · 3 runs per cell · source: opencode-go-2026-06-16.json

Total code LOC (median, 5 tasks)

LOC reduction vs baseline

Wall time (median total seconds)

LOC by task — lexis-two arm

Summary table

Model Baseline LOC Lexis-Two LOC Reduction Correct (lexis)

Regenerate: npm run benchmark:opencode-go && npm run benchmark:report

Ecosystem

Lexis-Two is the public portable package. Lexis-One is private. Lexis-Zero is future.

Lexis-One (private) ──extracts the best──▶ Lexis-Two (public)
     │                                           │
     │ personal configuration                    │ portable rules + skills
     │ providers & API keys                      │ multi-host adapters
     └───────────────────────────────────────────┘
                          │
                    Lexis-Core (future)
                    public orchestrator