Files
dss/packages/dss-rules/schemas/rule.schema.json
DSS 9dbd56271e
Some checks failed
DSS Project Analysis / dss-context-update (push) Has been cancelled
feat: Enterprise DSS architecture implementation
Complete implementation of enterprise design system validation:

Phase 1 - @dss/rules npm package:
- CLI with validate and init commands
- 16 rules across 5 categories (colors, spacing, typography, components, a11y)
- dss-ignore support (inline and next-line)
- Break-glass [dss-skip] for emergency merges
- CI workflow templates (Gitea, GitHub, GitLab)

Phase 2 - Metrics dashboard:
- FastAPI metrics API with SQLite storage
- Portfolio-wide metrics aggregation
- Project drill-down with file:line:column violations
- Trend charts and history tracking

Phase 3 - Local analysis cache:
- LocalAnalysisCache for offline-capable validation
- Mode detection (LOCAL/REMOTE/CI)
- Stale cache warnings with recommendations

Phase 4 - Project onboarding:
- dss-init command for project setup
- Creates ds.config.json, .dss/ folder structure
- Updates .gitignore and package.json scripts
- Optional CI workflow setup

Architecture decisions:
- No commit-back: CI uploads to dashboard, not git
- Three-tier: Dashboard (read-only) → CI (authoritative) → Local (advisory)
- Pull-based rules via npm for version control

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-11 09:41:36 -03:00

74 lines
2.1 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://dss.overbits.luz.uy/schemas/rule.schema.json",
"title": "DSS Rule Definition",
"description": "Schema for defining DSS design system rules",
"type": "object",
"required": ["id", "version", "name", "category", "rules"],
"properties": {
"$schema": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "^[a-z][a-z0-9-]*$"
},
"version": {
"type": "string",
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"category": {
"type": "string",
"enum": ["tokens", "components", "accessibility", "patterns", "naming"]
},
"severity": {
"type": "string",
"enum": ["error", "warning", "info"],
"default": "warning"
},
"rules": {
"type": "array",
"items": {
"$ref": "#/definitions/Rule"
}
},
"tokens": {
"type": "object",
"properties": {
"required": { "type": "array", "items": { "type": "string" } },
"optional": { "type": "array", "items": { "type": "string" } },
"scale": { "type": "object", "additionalProperties": { "type": "string" } }
}
}
},
"definitions": {
"Rule": {
"type": "object",
"required": ["id", "name"],
"properties": {
"id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
"name": { "type": "string" },
"description": { "type": "string" },
"severity": { "type": "string", "enum": ["error", "warning", "info"] },
"wcag": { "type": "string" },
"patterns": {
"type": "object",
"properties": {
"forbidden": { "type": "array", "items": { "type": "string" } },
"allowed": { "type": "array", "items": { "type": "string" } }
}
},
"validation": { "type": "object" },
"exceptions": { "type": "array", "items": { "type": "string" } },
"guidelines": { "type": "array", "items": { "type": "string" } }
}
}
}
}