Agent and Task Context¶
Home · Top · Table of Contents
Table of Contents¶
- Principal and Staff Engineer
- Solutions Architect
- DevOps Engineer
- Security Engineer
- QA Lead
- UX Engineer
- Technical Writer
This file maps each contributor role to the directories it owns, the commands it runs, and the invariants it must preserve. Read the section matching your task type before making any change. Violating any invariant listed here is a regression.
Referenced by AGENTS.md, CLAUDE.md, and CREDITS.md. Also served by the
MkDocs site at docs/AGENT-CONTEXT.md.
Principal and Staff Engineer¶
Home · Top · Table of Contents
Scope: Cross-cutting design — smart-contract interfaces, API contracts, data-flow decisions, performance budgets, and system-wide refactors.
Directories: contracts/src/, src/app/, src/services/,
src/components/, src/lib/, src/contexts/
Commands before opening a PR:
# Full quality gate: secrets, lint, types, tests, build, doctor, docs
npm run quality:all
# Foundry unit and invariant suite (10 000 fuzz runs per test)
npm run foundry:test
# Hardhat / Mocha integration suite
npm run hardhat:test
# Strict TypeScript check (no emit)
npx tsc --noEmit
Invariants:
- Never commit directly to
main. Branch → PR → CI green → squash merge. - TypeScript is configured at maximum strictness (
@tsconfig/strictest). All new code must type-check cleanly with zeroanyassertions. - Smart-contract changes require a matching Foundry test. No untested storage mutations.
- Solidity is compiled with
deny = "warnings"infoundry.toml— every compiler warning is a hard build error. via_ir = trueandoptimizer_runs = 200in the default Foundry profile must not be changed without an explicit performance justification.- React Doctor must stay at 100/100. No merge may proceed below that score.
Solutions Architect¶
Home · Top · Table of Contents
Scope: System boundaries, integration design, network topology, and scalability decisions.
Directories: docs/, docker/, k8s/, infra/, .github/workflows/
Commands:
# MkDocs strict build — zero warnings required
npm run docs:build
# Verify every docs/*.md is wired into the mkdocs.yml nav
npm run docs:nav:check
# Internal cross-reference checker
npm run docs:links
# Prettier + kubectl kustomize validation
npm run lint:k8s
Invariants:
docs/ARCHITECTURE.mdmust be updated whenever a contract interface, API route, or data-flow boundary changes.- Every file in
docs/must appear in themkdocs.ymlnav. Usenpm run docs:nav:checkto verify. k8s/manifests must passkubectl kustomize k8swith no errors.- Any new environment variable must be added to
.env.exampleanddocs/ENVIRONMENT.mdin the same PR.
DevOps Engineer¶
Home · Top · Table of Contents
Scope: CI/CD pipelines, Docker images, Kubernetes manifests, Vercel deployments, secret rotation, and environment management.
Directories: .github/workflows/, docker/, k8s/, tools/
Commands:
# Gitleaks + sensitive-path scan
npm run secrets:check
# Sync .env defaults to .env.example (no real secrets)
npm run env:sync
# Push local env to Vercel project settings
npm run env:sync:vercel
# docker compose build (storage check before and after)
npm run docker:build
# Contract + frontend container tests
npm run docker:test
# Kubernetes manifest validation
npm run lint:k8s
# Generate base64-encoded Kubernetes Secret manifest
npm run k8s:secret:generate
Invariants:
- Never commit a real secret.
npm run secrets:check(gitleaks +check-sensitive-files.mjs) must pass on every branch before push. - All workflow files in
.github/workflows/must use pinned SHA refs for third-party actions (supply-chain protection). - Docker builds run
npm run docker:storage:checkbefore and after to prevent volume bloat. - Vercel production deployments require the
deploy.ymlworkflow to succeed; do not runvercel --prodmanually unless CI is broken. tools/setup.shis the canonical environment bootstrap. Keep it current whenever a new tool or version joins the stack.
Security Engineer¶
Home · Top · Table of Contents
Scope: Smart-contract auditing, dependency vulnerability management, CSRF defence, input validation, and secret hygiene.
Directories: contracts/src/, src/security/,
.github/workflows/security.yml
Commands:
# GitHub code-scanning + Dependabot alert summary
npm run security
# Gitleaks + sensitive-path scan
npm run secrets:check
# Root and frontend dependency audits
npm audit
cd src && npm audit
# Foundry suite including invariant and fuzz tests
npm run foundry:test
# Gas regression check
forge test --gas-report
External tools (run separately before any contract PR):
# Slither static analysis
slither contracts/src/ \
--solc-remaps "@openzeppelin/=contracts/lib/openzeppelin-contracts/"
# Semgrep (also runs in CI via security.yml)
semgrep --config=auto contracts/src/
Invariants:
- Slither and Semgrep must be clean before any contract PR. Add
# nosemgrep: <rule-id>with a justification comment for confirmed false positives. solhint --max-warnings 0is enforced by CI — zero warnings, zero exceptions.forge lintruns at all severity levels (high,med,low,info,gas) withexclude_lints = []; nothing is silently suppressed.- Contracts use OpenZeppelin audited base classes for access control, reentrancy protection, and pausability. Do not roll custom implementations of those primitives.
- The CSRF layer lives in
src/security/. Changes there must be reviewed againstdocs/SECURITY.mdbefore merge. - Chainlink VRF consumer code must not be altered without re-running the full randomness invariant suite.
QA Lead¶
Home · Top · Table of Contents
Scope: Test coverage, end-to-end scenarios, regression detection, and quality-gate ownership.
Directories: contracts/test/, src/tests/, src/playwright.config.ts
Commands:
# Full suite: Foundry + Hardhat + frontend unit
npm run test
# Jest unit tests only
npm run test:unit
# Playwright E2E suite (headless Chromium)
npm run test:e2e
# Playwright interactive mode
npm run test:e2e:ui
# Jest coverage report
npm run test:coverage
# Locale-message and no-visible-JSX-literal checks
npm run i18n:scan
# React Doctor health check — must be 100/100
npm run doctor
# Foundry gas report (flag unexpected spikes)
npm run foundry:gas
Invariants:
- React Doctor score must not regress below 100/100. Any PR that drops the score is blocked.
- All Playwright tests must pass headless before merge. Use
@axe-core/playwrightassertions for every new page-level test. - Foundry fuzz runs 10 000 iterations per test (
runs = 10000,seed = "0x1"infoundry.toml). Do not reduce the run count. - No test may carry a permanent
.skiporxitwithout a linked tracking issue. npm run i18n:scanmust pass — no visible JSX string literals outside locale message files.
UX Engineer¶
Home · Top · Table of Contents
Scope: UI components, design tokens, accessibility, internationalisation, responsive layout, dark mode, and high-contrast mode.
Directories: src/components/, src/app/, src/styles/, src/hooks/,
src/providers/, messages/
Commands:
# React Doctor — must be 100/100
npm run doctor
# Stylelint for CSS/SCSS
npm run lint:styles
# Locale-message completeness check
npm run i18n:scan
# Playwright + axe-core accessibility assertions
npm run test:e2e
# ESLint + Prettier
npm run lint:frontend
Invariants:
- All user-visible copy must live in
messages/locale files. No hardcoded English strings in JSX. - Every new interactive component must have a keyboard-accessible path. WCAG 2.1 AA compliance is required.
- Dark mode and high-contrast mode are both supported. Test both after any colour or background change.
- Tailwind CSS v4 tokens are the single source of truth for spacing, colour, and typography. Do not add inline styles for values that exist as design tokens.
- React Scan is active in
NODE_ENV=developmentviaReactScanMonitorin the root layout. Use it to catch unnecessary re-renders before opening a PR. - Follow the copy rules in
AGENTS.md: Title Case for labels, buttons, badges, menus, and headings; sentence case for complete explanatory sentences; preserve acronyms (HTML,FAQ,URL,ETH,USDC,IPFS).
Technical Writer¶
Home · Top · Table of Contents
Scope: docs/, README.md, CREDITS.md, AGENT-CONTEXT.md, code
comments, inline TSDoc, and UI copy.
Directories: docs/, README.md, CREDITS.md, AGENT-CONTEXT.md,
AGENTS.md
Commands:
# MkDocs strict build — zero warnings required
npm run docs:build
# Ensure every docs/*.md is in the mkdocs.yml nav
npm run docs:nav:check
# Internal cross-reference checker
npm run docs:links
# External URL checker (slow — run before release)
npm run docs:links:external
# markdownlint-cli2 across all docs (80-char prose limit)
npm run lint:md
# Lint Cursor rule files
npm run lint:cursor
Invariants:
python -m mkdocs build --strictmust pass with zero warnings. The only permitted non-strict output is the vendor INFO about theLICENSElink inCREDITS.md.- All cross-references between docs pages must use paths relative to
docs/(e.g.,ARCHITECTURE.md, not../docs/ARCHITECTURE.md). CREDITS.mdlives at the repo root and atdocs/CREDITS.md.AGENT-CONTEXT.mdlives at the repo root and atdocs/AGENT-CONTEXT.md. Edit both root files and copy todocs/before committing.- The
mkdocs.ymlnav must list every file indocs/. Usenpm run docs:nav:checkto validate. - Apply a grammar, punctuation, and clarity pass to every prose change. Short, unambiguous sentences; consistent terminology; backtick-wrap all code paths and identifiers.
- The
docs/reports/sub-directory contains auto-generated reports. Do not hand-edit those files. - Prose lines must be ≤80 characters (MD013). Code blocks and tables are exempt.