This file tells AI coding agents how to work on the Argus codebase.
Argus is a design intelligence runtime for AI agents. It gives coding agents the ability to see, judge, and learn from visual design quality. The codebase is a TypeScript monorepo using pnpm workspaces.
argus/
├── packages/ ← Core libraries (npm-publishable)
│ ├── protocol/ ← Shared types, constants, interfaces
│ ├── inspector/ ← DOM analysis, CSS extraction, a11y audit
│ ├── scorer/ ← Design quality scoring engine + rules
│ ├── memory/ ← Preference learning, taste profiles, export
│ ├── flux/ ← CSS interpolation engine
│ ├── typo/ ← Typography engine
│ ├── pulse/ ← Animation/visualization engine
│ └── lens/ ← Inline component tweaking
├── apps/ ← Runnable applications
│ ├── cli/ ← `argus` command line tool
│ ├── mcp-server/ ← MCP server for AI agent integration
│ ├── gateway/ ← Local WebSocket server
│ └── browser-ext/ ← Chrome extension
├── skills/ ← Design analysis skills (like plugins)
├── extensions/ ← Third-party tool integrations
├── test/ ← Integration tests, test fixtures
├── docs/ ← Documentation site
└── scripts/ ← Build and release scripts
pnpm install # Install all dependencies
pnpm build # Build all packages
pnpm build:apps # Build all apps
pnpm dev # Watch mode for packages
pnpm test # Run unit tests
pnpm test:integration # Run integration tests
pnpm lint # Lint with oxlint
pnpm typecheck # TypeScript type checking
pnpm argus <command> # Run CLI in dev mode
pnpm gateway:watch # Run gateway with auto-reloadprotocol ← inspector ← scorer ← memory
↑ ↑ ↑
flux typo pulse
↑ ↑ ↑
lens ───────┘ │
│
cli ← mcp-server ← gateway
protocol is the leaf dependency. Everything depends on it. Nothing depends on cli, mcp-server, or gateway — they are entry points.
- TypeScript strict mode. No
any. No@ts-ignore. Useunknownand narrow. - Pure functions first. Side effects live at the edges (CLI, MCP server, gateway). Core packages are pure.
- No classes in protocol. Shared types are interfaces and type aliases only.
- Error handling. Use
Result<T, E>pattern from@argus-design/protocol. No throwing in library code. Apps can throw. - Test co-location. Tests live next to source:
foo.tsandfoo.test.tsin the same directory. - No barrel re-exports in internal modules. Only
index.tsat package root re-exports the public API.
ElementSnapshot— Complete state of a DOM element (selector, box, computed styles, a11y)PageSnapshot— Array of ElementSnapshot + page-level metadataScoringRule— A function that takes inspection data and returns findingsFinding— A single scored observation (element, rule, severity, message, measured/expected values)ScoreReport— Complete scoring output with findings grouped by categoryDesignProfile— User's learned design preferencesSeverity—"error" | "warning" | "info" | "pass"
- Create
packages/scorer/src/rules/your-rule.ts - Export a
ScoringRulefunction - Register it in
packages/scorer/src/rules/index.ts - Add tests in
packages/scorer/src/rules/your-rule.test.ts - Document the rule in
docs/tools/rules.md
import type { ScoringRule } from "@argus-design/protocol";
export const yourRule: ScoringRule = {
id: "your-rule-id",
name: "Your Rule Name",
category: "spacing", // spacing | typography | color | hierarchy | accessibility | consistency
description: "What this rule checks",
evaluate: (snapshot) => {
const findings = [];
// ... analysis logic
return findings;
},
};Skills live in skills/<skill-name>/SKILL.md. Each skill is a markdown file with structured metadata:
---
name: skill-name
description: What this skill checks
category: accessibility | spacing | typography | color | layout | responsive
rules: [rule-id-1, rule-id-2]
---
# Skill instructions for the agent
...All MCP tools use the design. prefix:
design.inspect— Analyze a page or componentdesign.score— Score design qualitydesign.suggest— Get improvement suggestionsdesign.apply— Apply a design fixdesign.compare— Before/after comparisondesign.preferences— Read/write taste profiledesign.audit— Full design + a11y auditdesign.doctor— Check Argus configuration health
- No LLM calls in scoring. All rules are deterministic. Reproducible. Fast.
- Scores are 0–100. Every rule, every category, every aggregate.
- Every finding has provenance. Rule ID, element selector, measured value, expected range.
- Memory is file-based. JSON files in
~/.argus/. No database. - Packages are tree-shakeable. Side-effect-free exports.
- Node 20+ required. We use native
fetch,structuredClone, top-level await.
- The
Result<T, E>pattern in protocol - The scoring scale (0–100)
- The MCP tool names and schemas
- The
~/.argus/directory structure - The pnpm workspace layout