Developer Tooling
Mantle ships a full CI and convention-enforcement suite in the CLI.
Quick Start
mantle generate hooks # Husky hooks + worktree provisioning
mantle generate ci-templates # GitHub Actions workflows
mantle generate knip-config # Dead code detection config
mantle generate agents # AGENTS.md for AI assistants
pnpm add -D husky && npx husky # Install hook runtime
mantle ci # Run full pipeline locallyLocal CI
mantle ci mirrors what GitHub Actions runs.
mantle ci # lint, build, typecheck, test, conventions
mantle ci --full # adds integration tests and extended checksPhases: setup → build → validate → test → quality → integration. Tools that aren't installed (ShellCheck, knip, tofu) are skipped gracefully.
CI blocks on any CRITICAL or HIGH violation, test failure, build error, or dependency architecture violation.
Convention Checks
mantle check runs 20 ts-morph rules against your code.
mantle check # all rules
mantle check --fast # CRITICAL only (~2s)
mantle check --severity HIGH # CRITICAL + HIGHSeverity levels:
| Severity | Count | Examples |
|---|---|---|
| CRITICAL | 3 | Handler pattern, handler export, defineLambda required |
| HIGH | 11 | No raw process.env, no raw AWS SDK, entity decorators, response validation |
| MEDIUM | 6 | Permission gaps, metrics, batch retry, mocking |
Dependency Architecture
mantle check depsEnforces: no handler→handler imports, no circular deps, entity queries can't import handler code, no deep @j0nathan-ll0yd/* internal imports.
Git Hooks
mantle generate hooksCreates three Husky hooks:
- pre-commit: secrets scan + dependency architecture (~2–5s)
- pre-push: full
mantle cipipeline - post-checkout: on a fresh linked worktree only, runs
scripts/worktree-setup.sh
The setup script seeds only explicitly listed, missing local files from the primary checkout—such as .claude/settings.local.json, .env, .envrc, and local Terraform var files. It deliberately never copies a directory or overwrites a local file. Add instance-specific files to that script's list.
It also installs dependencies for a fresh pnpm worktree. To skip that step:
WORKTREE_SKIP_INSTALL=1 git worktree add ../my-feature -b feat/my-featuremantle generate hooks preserves existing hooks and setup scripts, so it is safe to use when adopting the feature in an existing instance. Commit the generated files before adding a worktree; the post-checkout hook must be in the new checkout to run.
MANTLE_SKIP_HOOKS=1 git commit # bypass temporarilyESLint Rules
The custom Mantle rules ship inside @j0nathan-ll0yd/eslint-config (they are wired up automatically by createMantleEslintConfig()). To register the rule plugin on its own:
pnpm add -D @j0nathan-ll0yd/eslint-config// eslint.config.mjs
import mantleRules from "@j0nathan-ll0yd/eslint-config/local-rules";
export default [mantleRules.configs.recommended];Provides 9 rules covering handler patterns, imports, and naming.
Bundle Analysis
mantle check bundles # default 5 MB threshold
mantle check bundles --json # JSON output for CIReports per-Lambda sizes, top dependencies, and tree-shaking ratio.
Dead Code Detection
mantle generate knip-config
pnpm add -D knip
mantle check dead-codeMCP Server
mantle mcp-serverExposes 19 tools for AI assistants: validation, infra queries, package reference, deployment workflows, entity queries, dependency analysis, and performance estimation.
Context Generation
mantle generate agents # AGENTS.md project overview
mantle generate graph # build/graph.json dependency graph
mantle generate repomix # AI context packing configConfiguration
// mantle.config.ts
import { defineToolingConfig } from "@j0nathan-ll0yd/cli/config";
export default defineToolingConfig({
name: "my-api",
database: { provider: "aurora-dsql" },
ci: {
formatter: "dprint",
conventions: { severity: "HIGH" },
},
hooks: {
preCommit: { secretsScan: true, depArchitecture: true },
prePush: { ci: true },
},
});