Skip to main content
Back to Core
Focused guide, not a fantasy roadmap

Lattice Core Guide

This guide sticks to the current public Core CLI surface and the output it actually writes today. Use it when you want the truth about what Core is good at, how to run it, and how to keep it useful in mixed-agent teams.

Best fit
Existing JS/TS repos
Strongest fresh-install surfaces
AGENTS.md + Cursor + Claude + Copilot
Core job
Guardrails + verification

What Core Is For

Core is the right Lattice product when a repo already exists and the real problem is agent drift, not project planning.

Pin the AI to the live stack

Lattice uses the current repo as the truth source instead of letting the model invent versions and APIs.

Make the rules reusable

Rules should survive across sessions and tools, not live only inside one chat history.

Keep the loop tight

Verification, drift, and security checks need to be quick enough to run constantly.

Setup Paths

1. Existing repo

Run `npx latticeai` in the repo root. This is the default Core story.

2. Supported bundle path

Use `npx latticeai setup --bundle <id>` if you want a supported opinionated starting point rather than only a rules pack.

3. Inspect-first path

Use `init`, `generate --output`, and `apply --preview` when you want to see everything before it touches the project.

Command Map

These are the commands worth teaching on the site because they are part of the current public help surface and fit the real Core workflow.

Start and generate

npx latticeai

Interactive setup for the current repo.

npx latticeai setup --projectType nextjs --preset pro

Explicit setup when you do not want prompts.

npx latticeai init --detect

Config only. Good when you want to inspect first.

npx latticeai generate --output ./lattice-pack

Generate the pack into a folder without applying it.

npx latticeai apply --preview

Preview changes from a generated pack.

Verify and protect

npx latticeai verify

Run the preset verification path.

npx latticeai verify --full

Force lint, typecheck, test, and build.

npx latticeai verify-rules

Make sure the generated rules still match the repo.

npx latticeai release-check --fix

Run the pre-release checklist and auto-fix what is safe.

npx latticeai security-scan --fix

Find exposed secrets and repair the obvious cases.

Inspect and maintain

npx latticeai status

See config state and compliance at a glance.

npx latticeai drift

Detect repo drift from the generated baseline.

npx latticeai diff

Show what changed since the last generation pass.

npx latticeai update --preview

Preview a generated rules refresh before writing it.

npx latticeai check

Ask if a newer Lattice update is available.

Bundles and helpers

npx latticeai setup --bundle nextjs-saas

Use a supported opinionated bundle.

npx latticeai bundle diff

Preview bundle regeneration changes.

npx latticeai bundle rollback

Revert to the previous bundle version.

npx latticeai ci --dry-run

Preview the generated CI workflow.

npx latticeai doctor --agents

Inspect whether AGENTS, Cursor, Claude, and Copilot surfaces are present and valid.

Generated Files

The file story depends on whether you are hardening an active repo or using a supported clean-start path. Keeping those separate is the easiest way to stay honest.

Fresh public Core output for active repos

AGENTS.md
docs/rules/codex.md
.cursor/rules.md
.cursor/rules/lattice-core.mdc
CLAUDE.md
.claude/settings.json
.github/copilot-instructions.md
.github/instructions/lattice-core.instructions.md
.lattice/prompts/01-feature.md
.lattice/prompts/02-bugfix.md
.lattice/prompts/03-refactor.md
.lattice/prompts/04-test.md
.lattice/prompts/05-polish.md
.lattice/prompts/06-security.md
.gitmessage
.github/PULL_REQUEST_TEMPLATE.md
package.json script updates

Extra output in bundle or clean-start flows

app/layout.tsx
app/page.tsx
app/page.test.tsx
tsconfig.json
eslint.config.mjs
jest.config.js
next.config.js
other supported starter files depending on the chosen path

Assistant Workflows

Cursor

Cursor's current docs center `.cursor/rules` and also allow a root `AGENTS.md` alternative. Core now writes both the modern `.cursor/rules/lattice-core.mdc` project rule and the legacy `.cursor/rules.md` compatibility file.

Claude Code

Claude Code officially recognizes `CLAUDE.md` and project settings files. Core now writes both `CLAUDE.md` and `.claude/settings.json`, which makes it a strong fit for Claude-first repos.

GitHub Copilot

GitHub Copilot supports repository-wide instructions, path-specific instruction files, and `AGENTS.md`. Core now writes both Copilot files so GitHub-native agent workflows start from the same baseline.

Codex and mixed-agent teams

Codex workflows increasingly benefit from root-level instructions and repeatable verification. Core now writes `AGENTS.md`, `docs/rules/codex.md`, and Copilot companion files, so mixed-agent teams can start from one generated instruction baseline instead of hand-rolling it.

Practical mixed-agent recommendation

Let Core own the version-aware rules and the verification loop. If your team also spends a lot of time in Codex or Cursor CLI, start from the generated `AGENTS.md`, then route people to `.cursor/rules/lattice-core.mdc`, `.github/copilot-instructions.md`, `docs/rules/codex.md`, and `npm run verify`.

Read AGENTS.md first.
Follow docs/rules/codex.md for the deep workflow.
Use .github/copilot-instructions.md in Copilot.
Run npm run verify before marking work complete.
Use status or drift if generated files look out of date.

Daily Use

Existing repo hardening

  • Run `npx latticeai` in the repo.
  • Inspect `AGENTS.md`, `docs/rules/codex.md`, `.cursor/rules.md`, `.cursor/rules/lattice-core.mdc`, `CLAUDE.md`, `.claude/settings.json`, and the Copilot files in `.github/`.
  • Use `npx latticeai verify --watch` while iterating.
  • Run `npx latticeai doctor --agents` when you want to confirm the generated surfaces are still intact.
  • Run `npx latticeai security-scan` before pushing.

Mixed-agent default

  • Keep Core as the version-aware rule generator.
  • Review the generated `AGENTS.md` first, then use `docs/rules/codex.md` for the deeper workflow, `.cursor/rules/lattice-core.mdc` inside Cursor, and `.github/copilot-instructions.md` for Copilot.
  • Use `status`, `drift`, `diff`, and `doctor --agents` to make agent-made changes visible before review.

Bundle or clean-start flow

  • Use `setup --bundle <id>` when you want a supported opinionated start instead of only a rules pack.
  • Use `generate --output` plus `apply --preview` when you want to inspect everything first.
  • Switch to Project Builder when you want the plan plus a generated startup repo for a brand-new build.

Troubleshooting

No config found

Run `npx latticeai` or `npx latticeai setup ...` in the repo root.

Verify keeps failing

Run `npx latticeai doctor --agents` to confirm the generated surfaces are intact, then `npx latticeai verify --full` so you see the full failing path.

You want to inspect changes before writing them

Use `generate --output` and `apply --preview`, or `update --preview` for refreshes.

You need Codex-specific files generated by Lattice

Fresh Core installs now generate them. If your repo predates this pack, run `npx latticeai update --preview` and then apply the refresh.

You want to confirm what each agent will load

Run `npx latticeai doctor --agents` to verify AGENTS, Cursor, Claude, and Copilot surfaces before you start editing.

When to use Project Builder

Use Project Builder when the repo itself is the thing you need generated

Core is for hardening and maintaining an existing repo. Project Builder is for getting the plan, supported starter output, and a generated startup repo for a brand-new build.