| name | verification-workflow |
| description | Run maina's full verification pipeline on staged changes before committing code. |
| triggers | ["verify code","check code quality","run verification","before committing"] |
Verification Workflow
When to use
Before committing any code change. The verification pipeline catches syntax errors, security issues, secrets, and code smells on only the lines you changed, so you fix problems before they reach the repository.
Steps
- Stage your changes with
git add as usual.
- Run the pipeline with
maina verify (or call the verify MCP tool). This runs the full verification sequence on staged files only.
- Syntax guard (< 500ms): Biome checks formatting and lint rules first. If this fails, nothing else runs -- fix syntax before proceeding.
- Parallel tool sweep: Once syntax passes, 18+ tools run simultaneously:
- Semgrep -- pattern-based static analysis for bugs and anti-patterns
- Trivy -- vulnerability scanning for dependencies and container configs
- Secretlint -- detects accidentally committed secrets, tokens, and keys
- Slop detector -- catches AI-generated filler text and placeholder code
- Typecheck --
tsc --noEmit for TypeScript projects
- Consistency -- cross-function AST-based consistency check
- Plus SonarQube, Stryker, diff-cover, ZAP, Lighthouse when installed.
- Diff-only filter: Results are filtered to only new or changed lines. Existing issues in untouched code are ignored.
- Review findings: Each finding includes file path, line number, severity, explanation, and a suggested fix.
- Fix and re-run: Address findings, re-stage, and run
maina verify again until clean.
- Commit through maina: Use
maina commit instead of git commit. This ensures the verification pipeline ran and attaches verification metadata to the commit.
- MCP alternative: All verification commands are also available as MCP tools (
verify, checkSlop, reviewCode) when running inside an AI coding tool. Use npx @mainahq/cli if maina is not installed globally.
Example
git add src/auth/login.ts src/auth/__tests__/login.test.ts
maina verify
maina verify
maina commit
Notes
- The pipeline is designed for speed: syntax guard exits early on failure, parallel tools maximize throughput.
- Use
maina verify --focused for a narrower context budget (40%) on small, targeted changes.
- Use
maina verify --explore for a wider budget (80%) when making broad refactors.
- Use
maina verify --deep to add AI semantic review (spec compliance + code quality).
- Use
maina verify --cloud to run the pipeline on Maina Cloud (no local tools needed).
- Use
maina verify --visual to add Playwright screenshot regression testing.