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.
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 latticeaiInteractive setup for the current repo.
npx latticeai setup --projectType nextjs --preset proExplicit setup when you do not want prompts.
npx latticeai init --detectConfig only. Good when you want to inspect first.
npx latticeai generate --output ./lattice-packGenerate the pack into a folder without applying it.
npx latticeai apply --previewPreview changes from a generated pack.
Verify and protect
npx latticeai verifyRun the preset verification path.
npx latticeai verify --fullForce lint, typecheck, test, and build.
npx latticeai verify-rulesMake sure the generated rules still match the repo.
npx latticeai release-check --fixRun the pre-release checklist and auto-fix what is safe.
npx latticeai security-scan --fixFind exposed secrets and repair the obvious cases.
Inspect and maintain
npx latticeai statusSee config state and compliance at a glance.
npx latticeai driftDetect repo drift from the generated baseline.
npx latticeai diffShow what changed since the last generation pass.
npx latticeai update --previewPreview a generated rules refresh before writing it.
npx latticeai checkAsk if a newer Lattice update is available.
Bundles and helpers
npx latticeai setup --bundle nextjs-saasUse a supported opinionated bundle.
npx latticeai bundle diffPreview bundle regeneration changes.
npx latticeai bundle rollbackRevert to the previous bundle version.
npx latticeai ci --dry-runPreview the generated CI workflow.
npx latticeai doctor --agentsInspect 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
Extra output in bundle or clean-start flows
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.
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`.
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
Run `npx latticeai` or `npx latticeai setup ...` in the repo root.
Run `npx latticeai doctor --agents` to confirm the generated surfaces are intact, then `npx latticeai verify --full` so you see the full failing path.
Use `generate --output` and `apply --preview`, or `update --preview` for refreshes.
Fresh Core installs now generate them. If your repo predates this pack, run `npx latticeai update --preview` and then apply the refresh.
Run `npx latticeai doctor --agents` to verify AGENTS, Cursor, Claude, and Copilot surfaces before you start editing.
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.