@schneiderjoseph/devia 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +149 -0
- package/CHANGELOG.md +78 -0
- package/GOVERNANCE.md +51 -0
- package/LEVELS.md +78 -0
- package/LICENSE +21 -0
- package/MATURITY.md +79 -0
- package/MEMORY.md +122 -0
- package/MIGRATION.md +62 -0
- package/PRINCIPLES.md +110 -0
- package/README.md +125 -0
- package/REFERENCES.md +30 -0
- package/VERSION +5 -0
- package/bin/devia.mjs +13 -0
- package/checklists/README.md +39 -0
- package/checklists/design/accessibility-review.md +11 -0
- package/checklists/design/design-to-code-review.md +10 -0
- package/checklists/design/responsive-review.md +7 -0
- package/checklists/design/ui-review.md +8 -0
- package/checklists/design/ux-review.md +10 -0
- package/checklists/engineering/accessibility.md +8 -0
- package/checklists/engineering/api.md +12 -0
- package/checklists/engineering/architecture.md +8 -0
- package/checklists/engineering/database.md +11 -0
- package/checklists/engineering/devops.md +9 -0
- package/checklists/engineering/disaster-recovery.md +9 -0
- package/checklists/engineering/frontend.md +9 -0
- package/checklists/engineering/incident.md +9 -0
- package/checklists/engineering/performance.md +7 -0
- package/checklists/engineering/production.md +26 -0
- package/checklists/engineering/release.md +17 -0
- package/checklists/engineering/security.md +33 -0
- package/checklists/engineering/testing.md +8 -0
- package/compliance/COVERAGE.md +46 -0
- package/compliance/REQUIREMENTS.md +8 -0
- package/compliance/TRACEABILITY.md +160 -0
- package/compliance/WAIVERS.md +13 -0
- package/package.json +74 -0
- package/rules/LIFECYCLE.md +16 -0
- package/rules/README.md +166 -0
- package/rules/accessibility/A11Y-001.md +42 -0
- package/rules/accessibility/A11Y-002.md +41 -0
- package/rules/accessibility/A11Y-003.md +40 -0
- package/rules/accessibility/A11Y-004.md +40 -0
- package/rules/accessibility/A11Y-005.md +39 -0
- package/rules/accessibility/A11Y-006.md +42 -0
- package/rules/accessibility/A11Y-007.md +39 -0
- package/rules/accessibility/A11Y-008.md +40 -0
- package/rules/accessibility/A11Y-009.md +41 -0
- package/rules/accessibility/A11Y-010.md +40 -0
- package/rules/accessibility/A11Y-011.md +39 -0
- package/rules/accessibility/A11Y-012.md +39 -0
- package/rules/agent/AGT-001.md +42 -0
- package/rules/agent/AGT-002.md +39 -0
- package/rules/agent/AGT-003.md +38 -0
- package/rules/agent/AGT-004.md +39 -0
- package/rules/agent/AGT-005.md +38 -0
- package/rules/agent/AGT-006.md +38 -0
- package/rules/agent/AGT-007.md +38 -0
- package/rules/agent/AGT-008.md +38 -0
- package/rules/agent/AGT-009.md +39 -0
- package/rules/agent/AGT-010.md +38 -0
- package/rules/agent/AGT-011.md +38 -0
- package/rules/ai/AI-001.md +44 -0
- package/rules/ai/AI-002.md +39 -0
- package/rules/ai/AI-003.md +40 -0
- package/rules/ai/AI-004.md +39 -0
- package/rules/ai/AI-005.md +38 -0
- package/rules/api/API-001.md +39 -0
- package/rules/api/API-002.md +39 -0
- package/rules/api/API-003.md +39 -0
- package/rules/api/API-004.md +38 -0
- package/rules/api/API-005.md +39 -0
- package/rules/api/API-006.md +40 -0
- package/rules/architecture/ARC-001.md +41 -0
- package/rules/architecture/ARC-002.md +43 -0
- package/rules/architecture/ARC-003.md +43 -0
- package/rules/architecture/ARC-004.md +40 -0
- package/rules/architecture/ARC-005.md +39 -0
- package/rules/architecture/ARC-006.md +39 -0
- package/rules/components/CMP-001.md +39 -0
- package/rules/components/CMP-002.md +38 -0
- package/rules/components/CMP-003.md +39 -0
- package/rules/components/CMP-004.md +40 -0
- package/rules/components/CMP-005.md +39 -0
- package/rules/content/CNT-001.md +39 -0
- package/rules/data-display/DATA-001.md +39 -0
- package/rules/data-display/DATA-002.md +39 -0
- package/rules/data-display/DATA-003.md +40 -0
- package/rules/data-display/DATA-004.md +40 -0
- package/rules/database/DB-001.md +43 -0
- package/rules/database/DB-002.md +38 -0
- package/rules/database/DB-003.md +40 -0
- package/rules/database/DB-004.md +44 -0
- package/rules/database/DB-005.md +39 -0
- package/rules/database/DB-006.md +38 -0
- package/rules/database/DB-007.md +40 -0
- package/rules/database/DB-008.md +40 -0
- package/rules/design-system/DS-001.md +39 -0
- package/rules/design-system/DS-002.md +40 -0
- package/rules/design-system/DS-003.md +38 -0
- package/rules/devops/OPS-001.md +43 -0
- package/rules/devops/OPS-002.md +39 -0
- package/rules/devops/OPS-003.md +38 -0
- package/rules/devops/OPS-004.md +40 -0
- package/rules/devops/OPS-005.md +43 -0
- package/rules/devops/OPS-006.md +38 -0
- package/rules/devops/OPS-007.md +40 -0
- package/rules/interaction/INT-001.md +39 -0
- package/rules/interaction/INT-002.md +39 -0
- package/rules/localization/I18N-001.md +38 -0
- package/rules/localization/I18N-002.md +40 -0
- package/rules/localization/I18N-003.md +39 -0
- package/rules/memory/MEM-001.md +44 -0
- package/rules/memory/MEM-002.md +39 -0
- package/rules/memory/MEM-003.md +38 -0
- package/rules/memory/MEM-004.md +38 -0
- package/rules/memory/MEM-005.md +38 -0
- package/rules/memory/MEM-006.md +38 -0
- package/rules/memory/MEM-007.md +38 -0
- package/rules/memory/MEM-008.md +38 -0
- package/rules/memory/MEM-009.md +39 -0
- package/rules/memory/MEM-010.md +38 -0
- package/rules/memory/MEM-011.md +38 -0
- package/rules/motion/MOT-001.md +38 -0
- package/rules/observability/OBS-001.md +40 -0
- package/rules/observability/OBS-002.md +40 -0
- package/rules/observability/OBS-003.md +38 -0
- package/rules/observability/OBS-004.md +38 -0
- package/rules/privacy/PRIV-001.md +38 -0
- package/rules/privacy/PRIV-002.md +44 -0
- package/rules/privacy/PRIV-003.md +40 -0
- package/rules/privacy/PRIV-004.md +41 -0
- package/rules/responsive/RWD-001.md +40 -0
- package/rules/responsive/RWD-002.md +39 -0
- package/rules/responsive/RWD-003.md +39 -0
- package/rules/security/SEC-001.md +44 -0
- package/rules/security/SEC-002.md +44 -0
- package/rules/security/SEC-003.md +41 -0
- package/rules/security/SEC-004.md +40 -0
- package/rules/security/SEC-005.md +42 -0
- package/rules/security/SEC-006.md +40 -0
- package/rules/security/SEC-007.md +44 -0
- package/rules/security/SEC-008.md +39 -0
- package/rules/security/SEC-009.md +40 -0
- package/rules/security/SEC-010.md +40 -0
- package/rules/security/SEC-011.md +40 -0
- package/rules/security/SEC-012.md +40 -0
- package/rules/states/STATE-001.md +38 -0
- package/rules/states/STATE-002.md +39 -0
- package/rules/states/STATE-003.md +39 -0
- package/rules/states/STATE-004.md +38 -0
- package/rules/testing/TST-001.md +39 -0
- package/rules/testing/TST-002.md +39 -0
- package/rules/testing/TST-003.md +39 -0
- package/rules/testing/TST-004.md +38 -0
- package/rules/testing/TST-005.md +40 -0
- package/rules/testing/TST-006.md +39 -0
- package/rules/ui/UI-001.md +40 -0
- package/rules/ui/UI-002.md +38 -0
- package/rules/ui/UI-003.md +41 -0
- package/rules/ui/UI-004.md +41 -0
- package/rules/ui/UI-005.md +41 -0
- package/rules/ui/UI-006.md +40 -0
- package/rules/ui/UI-007.md +41 -0
- package/rules/ux/UX-001.md +41 -0
- package/rules/ux/UX-002.md +41 -0
- package/rules/ux/UX-003.md +39 -0
- package/rules/ux/UX-004.md +39 -0
- package/rules/ux/UX-005.md +40 -0
- package/rules/ux/UX-006.md +40 -0
- package/rules/ux/UX-007.md +44 -0
- package/rules/ux/UX-008.md +41 -0
- package/rules/ux/UX-009.md +39 -0
- package/rules/ux/UX-010.md +40 -0
- package/rules/ux/UX-011.md +40 -0
- package/rules/ux/UX-012.md +40 -0
- package/rules/ux/UX-013.md +39 -0
- package/schema/README.md +19 -0
- package/schema/checklist.schema.json +34 -0
- package/schema/component.schema.json +37 -0
- package/schema/project-config.schema.json +70 -0
- package/schema/rule.schema.json +104 -0
- package/schema/token.schema.json +15 -0
- package/schema/waiver.schema.json +33 -0
- package/scripts/build-index.mjs +178 -0
- package/scripts/validate-links.mjs +43 -0
- package/scripts/validate-rules.mjs +42 -0
- package/skills/devia/SKILL.md +114 -0
- package/src/cli.mjs +107 -0
- package/src/commands/check.mjs +483 -0
- package/src/commands/doctor.mjs +139 -0
- package/src/commands/init.mjs +186 -0
- package/src/commands/registry.mjs +154 -0
- package/src/commands/rules.mjs +101 -0
- package/src/commands/skills.mjs +97 -0
- package/src/commands/sync.mjs +83 -0
- package/src/commands/validate.mjs +194 -0
- package/src/lib/fs.mjs +89 -0
- package/src/lib/git.mjs +31 -0
- package/src/lib/rules.mjs +85 -0
- package/src/lib/ui.mjs +52 -0
- package/src/lib/vendor.mjs +74 -0
- package/src/lib/version.mjs +19 -0
- package/src/lib/yaml.mjs +152 -0
- package/standard/README.md +31 -0
- package/standard/design/README.md +51 -0
- package/standard/design/REFERENCES.md +39 -0
- package/standard/design/accessibility/aria.md +7 -0
- package/standard/design/accessibility/contrast.md +6 -0
- package/standard/design/accessibility/focus.md +6 -0
- package/standard/design/accessibility/forms.md +3 -0
- package/standard/design/accessibility/keyboard.md +6 -0
- package/standard/design/accessibility/reduced-motion.md +3 -0
- package/standard/design/accessibility/reflow.md +3 -0
- package/standard/design/accessibility/screen-readers.md +3 -0
- package/standard/design/accessibility/target-size.md +3 -0
- package/standard/design/accessibility/testing.md +3 -0
- package/standard/design/accessibility/wcag-2.2.md +16 -0
- package/standard/design/accessibility/zoom.md +3 -0
- package/standard/design/ai/ai-design-rules.md +8 -0
- package/standard/design/ai/anti-patterns.md +1 -0
- package/standard/design/ai/compliance-format.md +22 -0
- package/standard/design/ai/design-review.md +10 -0
- package/standard/design/ai/evals/README.md +1 -0
- package/standard/design/ai/instructions.md +7 -0
- package/standard/design/ai/prompts/accessibility-review.md +5 -0
- package/standard/design/ai/prompts/design-system-review.md +5 -0
- package/standard/design/ai/prompts/ui-review.md +5 -0
- package/standard/design/ai/prompts/ux-review.md +5 -0
- package/standard/design/ai/review-protocol.md +11 -0
- package/standard/design/anti-patterns/accessibility.md +7 -0
- package/standard/design/anti-patterns/ai-generated.md +6 -0
- package/standard/design/anti-patterns/dashboards.md +5 -0
- package/standard/design/anti-patterns/forms.md +5 -0
- package/standard/design/anti-patterns/responsive.md +5 -0
- package/standard/design/anti-patterns/ui.md +6 -0
- package/standard/design/anti-patterns/ux.md +5 -0
- package/standard/design/components/buttons.md +6 -0
- package/standard/design/components/dialogs.md +5 -0
- package/standard/design/components/feedback.md +3 -0
- package/standard/design/components/forms.md +3 -0
- package/standard/design/components/navigation.md +3 -0
- package/standard/design/components/tables.md +6 -0
- package/standard/design/content/error-messages.md +4 -0
- package/standard/design/content/ux-writing.md +5 -0
- package/standard/design/data-display/README.md +5 -0
- package/standard/design/data-display/currency.md +3 -0
- package/standard/design/data-display/dates.md +3 -0
- package/standard/design/data-display/density.md +3 -0
- package/standard/design/data-display/filtering.md +3 -0
- package/standard/design/data-display/localization.md +3 -0
- package/standard/design/data-display/numbers.md +3 -0
- package/standard/design/data-display/pagination.md +3 -0
- package/standard/design/data-display/percentages.md +3 -0
- package/standard/design/data-display/sorting.md +3 -0
- package/standard/design/data-display/tables.md +3 -0
- package/standard/design/data-display/time.md +3 -0
- package/standard/design/decisions/ADR-001-token-naming.md +13 -0
- package/standard/design/decisions/ADR-002-radius-scale.md +9 -0
- package/standard/design/decisions/ADR-003-color-system.md +9 -0
- package/standard/design/decisions/ADR-004-component-versioning.md +9 -0
- package/standard/design/decisions/README.md +3 -0
- package/standard/design/design-system/components.md +9 -0
- package/standard/design/design-system/naming.md +19 -0
- package/standard/design/design-system/tokens.md +7 -0
- package/standard/design/design-system/variants.md +5 -0
- package/standard/design/design-system/versioning.md +5 -0
- package/standard/design/health/coverage.md +1 -0
- package/standard/design/health/dashboard.md +14 -0
- package/standard/design/health/maturity-model.md +9 -0
- package/standard/design/health/score.md +14 -0
- package/standard/design/interaction/README.md +10 -0
- package/standard/design/interaction/keyboard.md +3 -0
- package/standard/design/interaction/mouse.md +2 -0
- package/standard/design/interaction/pen.md +1 -0
- package/standard/design/interaction/touch.md +3 -0
- package/standard/design/interaction/touchscreen.md +6 -0
- package/standard/design/interaction/voice.md +2 -0
- package/standard/design/localization/README.md +5 -0
- package/standard/design/localization/currency.md +3 -0
- package/standard/design/localization/date-time.md +3 -0
- package/standard/design/localization/i18n.md +3 -0
- package/standard/design/localization/locale-testing.md +3 -0
- package/standard/design/localization/number-formatting.md +3 -0
- package/standard/design/localization/pluralization.md +3 -0
- package/standard/design/localization/rtl.md +3 -0
- package/standard/design/localization/text-expansion.md +3 -0
- package/standard/design/motion/animation.md +6 -0
- package/standard/design/penpot/WORKFLOW.md +27 -0
- package/standard/design/platforms/README.md +12 -0
- package/standard/design/platforms/desktop/README.md +5 -0
- package/standard/design/platforms/mobile/android.md +5 -0
- package/standard/design/platforms/mobile/ios.md +5 -0
- package/standard/design/platforms/tablet/README.md +5 -0
- package/standard/design/platforms/web/README.md +1 -0
- package/standard/design/principles/design-principles.md +9 -0
- package/standard/design/principles/ui-principles.md +7 -0
- package/standard/design/principles/ux-principles.md +14 -0
- package/standard/design/references/atlassian.md +3 -0
- package/standard/design/references/carbon.md +3 -0
- package/standard/design/references/figma-sds.md +5 -0
- package/standard/design/references/govuk.md +3 -0
- package/standard/design/references/material.md +3 -0
- package/standard/design/references/nng.md +3 -0
- package/standard/design/references/openui.md +3 -0
- package/standard/design/references/primer.md +5 -0
- package/standard/design/references/storybook.md +3 -0
- package/standard/design/references/uswds.md +3 -0
- package/standard/design/references/w3c.md +3 -0
- package/standard/design/responsive/desktop.md +4 -0
- package/standard/design/responsive/mobile.md +6 -0
- package/standard/design/responsive/tablet.md +3 -0
- package/standard/design/states/async.md +3 -0
- package/standard/design/states/conflict.md +3 -0
- package/standard/design/states/empty.md +3 -0
- package/standard/design/states/error.md +3 -0
- package/standard/design/states/interaction.md +5 -0
- package/standard/design/states/loading.md +3 -0
- package/standard/design/states/offline.md +3 -0
- package/standard/design/states/optimistic.md +3 -0
- package/standard/design/states/partial.md +3 -0
- package/standard/design/states/permission-denied.md +3 -0
- package/standard/design/states/rate-limited.md +3 -0
- package/standard/design/states/read-only.md +3 -0
- package/standard/design/states/retry.md +3 -0
- package/standard/design/states/skeleton.md +3 -0
- package/standard/design/states/stale.md +3 -0
- package/standard/design/states/success.md +3 -0
- package/standard/design/states/timeout.md +3 -0
- package/standard/design/states/unsaved-changes.md +3 -0
- package/standard/design/ui/color.md +6 -0
- package/standard/design/ui/grids.md +5 -0
- package/standard/design/ui/icons.md +5 -0
- package/standard/design/ui/imagery.md +5 -0
- package/standard/design/ui/layout.md +5 -0
- package/standard/design/ui/spacing.md +5 -0
- package/standard/design/ui/typography.md +6 -0
- package/standard/design/ui/visual-design.md +7 -0
- package/standard/design/ux/cognitive-load.md +5 -0
- package/standard/design/ux/errors.md +6 -0
- package/standard/design/ux/feedback.md +5 -0
- package/standard/design/ux/forms.md +7 -0
- package/standard/design/ux/heuristics.md +14 -0
- package/standard/design/ux/information-architecture.md +6 -0
- package/standard/design/ux/navigation.md +6 -0
- package/standard/design/ux/usability.md +6 -0
- package/standard/engineering/README.md +29 -0
- package/standard/engineering/REFERENCES.md +42 -0
- package/standard/engineering/ai/AI_SECURITY.md +15 -0
- package/standard/engineering/ai/PROMPT_SECURITY.md +6 -0
- package/standard/engineering/architecture/ADR.md +11 -0
- package/standard/engineering/architecture/ARCHITECTURE.md +25 -0
- package/standard/engineering/architecture/PRINCIPLES.md +17 -0
- package/standard/engineering/architecture/THREAT_MODEL.md +14 -0
- package/standard/engineering/backend/API.md +29 -0
- package/standard/engineering/backend/BACKGROUND_JOBS.md +12 -0
- package/standard/engineering/backend/ERROR_HANDLING.md +26 -0
- package/standard/engineering/backend/LOGGING.md +12 -0
- package/standard/engineering/compliance/DATA_RETENTION.md +10 -0
- package/standard/engineering/compliance/PRIVACY.md +11 -0
- package/standard/engineering/database/BACKUPS.md +19 -0
- package/standard/engineering/database/DATABASE.md +30 -0
- package/standard/engineering/database/MIGRATIONS.md +12 -0
- package/standard/engineering/devops/BRANCH_PROTECTION.md +17 -0
- package/standard/engineering/devops/CI_CD.md +48 -0
- package/standard/engineering/devops/DEPLOYMENT.md +12 -0
- package/standard/engineering/devops/DOCKER.md +9 -0
- package/standard/engineering/devops/ENVIRONMENTS.md +12 -0
- package/standard/engineering/devops/RELEASE.md +6 -0
- package/standard/engineering/devops/ROLLBACK.md +9 -0
- package/standard/engineering/frontend/ACCESSIBILITY.md +16 -0
- package/standard/engineering/frontend/DESIGN_SYSTEM.md +10 -0
- package/standard/engineering/frontend/FRONTEND.md +17 -0
- package/standard/engineering/frontend/UX.md +15 -0
- package/standard/engineering/observability/ALERTING.md +11 -0
- package/standard/engineering/observability/INCIDENTS.md +10 -0
- package/standard/engineering/observability/MONITORING.md +17 -0
- package/standard/engineering/payments/PAYMENTS.md +15 -0
- package/standard/engineering/performance/PERFORMANCE.md +19 -0
- package/standard/engineering/security/API_SECURITY.md +22 -0
- package/standard/engineering/security/ASVS_5.0/V10_MALICIOUS_CODE.md +31 -0
- package/standard/engineering/security/ASVS_5.0/V11_BUSINESS_LOGIC.md +31 -0
- package/standard/engineering/security/ASVS_5.0/V12_FILES.md +31 -0
- package/standard/engineering/security/ASVS_5.0/V13_API.md +31 -0
- package/standard/engineering/security/ASVS_5.0/V14_CONFIGURATION.md +31 -0
- package/standard/engineering/security/ASVS_5.0/V1_ARCHITECTURE.md +31 -0
- package/standard/engineering/security/ASVS_5.0/V2_AUTHENTICATION.md +31 -0
- package/standard/engineering/security/ASVS_5.0/V3_SESSION.md +31 -0
- package/standard/engineering/security/ASVS_5.0/V4_ACCESS_CONTROL.md +31 -0
- package/standard/engineering/security/ASVS_5.0/V5_VALIDATION.md +31 -0
- package/standard/engineering/security/ASVS_5.0/V6_CRYPTOGRAPHY.md +31 -0
- package/standard/engineering/security/ASVS_5.0/V7_ERROR_HANDLING.md +31 -0
- package/standard/engineering/security/ASVS_5.0/V8_DATA_PROTECTION.md +31 -0
- package/standard/engineering/security/ASVS_5.0/V9_COMMUNICATION.md +31 -0
- package/standard/engineering/security/ASVS_REGISTRY.md +31 -0
- package/standard/engineering/security/AUTHENTICATION.md +28 -0
- package/standard/engineering/security/AUTHORIZATION.md +27 -0
- package/standard/engineering/security/DATA_SECURITY.md +14 -0
- package/standard/engineering/security/OWASP_ASVS.md +31 -0
- package/standard/engineering/security/SECRETS.md +28 -0
- package/standard/engineering/security/SECURITY.md +28 -0
- package/standard/engineering/testing/TESTING.md +27 -0
- package/templates/agents/AGENTS.md +34 -0
- package/templates/agents/CLAUDE.md +33 -0
- package/templates/agents/copilot-instructions.md +15 -0
- package/templates/agents/cursor.mdc +27 -0
- package/templates/agents/windsurfrules.md +17 -0
- package/templates/docs/ADR.md +16 -0
- package/templates/docs/FEATURE.md +19 -0
- package/templates/docs/SECURITY_REPORT.md +15 -0
- package/templates/docs/accessibility-review.md +9 -0
- package/templates/docs/component.md +9 -0
- package/templates/docs/decision-record.md +9 -0
- package/templates/docs/design-review.md +9 -0
- package/templates/docs/exception.md +9 -0
- package/templates/docs/page.md +9 -0
- package/templates/docs/pattern.md +9 -0
- package/templates/docs/user-flow.md +9 -0
- package/templates/github/workflows/app-ci.yml +91 -0
- package/templates/project/00_OVERVIEW.md +51 -0
- package/templates/project/01_ARCHITECTURE.md +37 -0
- package/templates/project/02_SURFACES.md +30 -0
- package/templates/project/03_DATA_MODEL.md +31 -0
- package/templates/project/04_PERMISSIONS.md +32 -0
- package/templates/project/05_FLOWS.md +20 -0
- package/templates/project/06_INTEGRATIONS.md +21 -0
- package/templates/project/07_DESIGN.md +33 -0
- package/templates/project/10_NEVER_ALWAYS.md +26 -0
- package/templates/project/11_GAPS.md +18 -0
- package/templates/project/12_DEBT.md +19 -0
- package/templates/project/13_RECIPES.md +35 -0
- package/templates/project/14_INDEX.md +50 -0
- package/templates/project/AGENTS.md +51 -0
- package/templates/project/README.md +49 -0
- package/templates/project/impact-map.yaml +41 -0
package/src/lib/yaml.mjs
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal YAML subset parser — enough for rule frontmatter, VERSION and impact maps.
|
|
3
|
+
*
|
|
4
|
+
* Supports: nested mappings, lists of scalars, inline empty list `[]`, block scalars
|
|
5
|
+
* (`>` folded, `|` literal), quoted scalars, `#` comments, booleans and numbers.
|
|
6
|
+
*
|
|
7
|
+
* Deliberately not a full YAML implementation: devia ships no runtime dependencies, and the
|
|
8
|
+
* files it parses are files it also writes. Anything this parser cannot read is a file the
|
|
9
|
+
* standard does not ask anyone to write.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
function scalar(raw) {
|
|
13
|
+
const v = raw.trim();
|
|
14
|
+
if (v === "" || v === "~" || v === "null") return null;
|
|
15
|
+
if (v === "true") return true;
|
|
16
|
+
if (v === "false") return false;
|
|
17
|
+
if (/^-?\d+$/.test(v)) return Number(v);
|
|
18
|
+
if (/^-?\d*\.\d+$/.test(v)) return Number(v);
|
|
19
|
+
if (/^"(.*)"$/.test(v)) return v.slice(1, -1).replace(/\\"/g, '"');
|
|
20
|
+
if (/^'(.*)'$/.test(v)) return v.slice(1, -1);
|
|
21
|
+
if (v === "[]") return [];
|
|
22
|
+
if (v === "{}") return {};
|
|
23
|
+
if (/^\[.*\]$/.test(v)) {
|
|
24
|
+
return v
|
|
25
|
+
.slice(1, -1)
|
|
26
|
+
.split(",")
|
|
27
|
+
.map((s) => scalar(s))
|
|
28
|
+
.filter((s) => s !== null);
|
|
29
|
+
}
|
|
30
|
+
return v;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function stripComment(line) {
|
|
34
|
+
// Only strip a comment that starts the line or follows whitespace outside quotes.
|
|
35
|
+
let out = "";
|
|
36
|
+
let quote = null;
|
|
37
|
+
for (let i = 0; i < line.length; i++) {
|
|
38
|
+
const c = line[i];
|
|
39
|
+
if (quote) {
|
|
40
|
+
out += c;
|
|
41
|
+
if (c === quote && line[i - 1] !== "\\") quote = null;
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (c === '"' || c === "'") {
|
|
45
|
+
quote = c;
|
|
46
|
+
out += c;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (c === "#" && (i === 0 || /\s/.test(line[i - 1]))) break;
|
|
50
|
+
out += c;
|
|
51
|
+
}
|
|
52
|
+
return out.replace(/\s+$/, "");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function indentOf(line) {
|
|
56
|
+
return line.length - line.replace(/^\s+/, "").length;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Parse a YAML subset document into a plain object. */
|
|
60
|
+
export function parseYaml(text) {
|
|
61
|
+
const lines = String(text)
|
|
62
|
+
.split(/\r?\n/)
|
|
63
|
+
.map(stripComment)
|
|
64
|
+
.map((l, i) => ({ i, raw: l }))
|
|
65
|
+
.filter((l) => l.raw.trim() !== "");
|
|
66
|
+
|
|
67
|
+
let pos = 0;
|
|
68
|
+
|
|
69
|
+
function parseBlock(minIndent) {
|
|
70
|
+
let result = null;
|
|
71
|
+
while (pos < lines.length) {
|
|
72
|
+
const { raw } = lines[pos];
|
|
73
|
+
const ind = indentOf(raw);
|
|
74
|
+
if (ind < minIndent) break;
|
|
75
|
+
const trimmed = raw.trim();
|
|
76
|
+
|
|
77
|
+
// An empty collection written on its own line: `success_criteria:\n []`
|
|
78
|
+
if (trimmed === "[]" || trimmed === "{}") {
|
|
79
|
+
pos++;
|
|
80
|
+
return trimmed === "[]" ? [] : {};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (trimmed.startsWith("- ") || trimmed === "-") {
|
|
84
|
+
if (result === null) result = [];
|
|
85
|
+
if (!Array.isArray(result)) break;
|
|
86
|
+
pos++;
|
|
87
|
+
const item = trimmed === "-" ? "" : trimmed.slice(2);
|
|
88
|
+
if (item.includes(": ") || /:$/.test(item)) {
|
|
89
|
+
// list of mappings: re-parse the item as a mapping line at a deeper indent
|
|
90
|
+
const sub = { i: -1, raw: " ".repeat(ind + 2) + item };
|
|
91
|
+
lines.splice(pos, 0, sub);
|
|
92
|
+
result.push(parseBlock(ind + 2));
|
|
93
|
+
} else {
|
|
94
|
+
result.push(scalar(item));
|
|
95
|
+
}
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const m = trimmed.match(/^([^:]+):\s*(.*)$/);
|
|
100
|
+
if (!m) {
|
|
101
|
+
pos++;
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
if (result === null) result = {};
|
|
105
|
+
if (Array.isArray(result)) break;
|
|
106
|
+
const key = m[1].trim().replace(/^["']|["']$/g, "");
|
|
107
|
+
const rest = m[2];
|
|
108
|
+
pos++;
|
|
109
|
+
|
|
110
|
+
if (rest === ">" || rest === "|" || rest === ">-" || rest === "|-") {
|
|
111
|
+
const folded = rest.startsWith(">");
|
|
112
|
+
const buf = [];
|
|
113
|
+
while (pos < lines.length && indentOf(lines[pos].raw) > ind) {
|
|
114
|
+
buf.push(lines[pos].raw.trim());
|
|
115
|
+
pos++;
|
|
116
|
+
}
|
|
117
|
+
result[key] = folded ? buf.join(" ").trim() : buf.join("\n");
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (rest === "") {
|
|
122
|
+
const next = lines[pos];
|
|
123
|
+
if (next && indentOf(next.raw) > ind) {
|
|
124
|
+
result[key] = parseBlock(indentOf(next.raw));
|
|
125
|
+
} else {
|
|
126
|
+
result[key] = null;
|
|
127
|
+
}
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
result[key] = scalar(rest);
|
|
132
|
+
}
|
|
133
|
+
return result === null ? {} : result;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return parseBlock(0);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** Split `---` frontmatter from a markdown body. */
|
|
140
|
+
export function parseFrontmatter(text) {
|
|
141
|
+
const src = String(text).replace(/^/, "");
|
|
142
|
+
if (!/^---\r?\n/.test(src)) return { data: null, body: src };
|
|
143
|
+
const end = src.indexOf("\n---", 3);
|
|
144
|
+
if (end < 0) return { data: null, body: src, error: "unclosed frontmatter" };
|
|
145
|
+
const raw = src.slice(src.indexOf("\n") + 1, end);
|
|
146
|
+
const body = src.slice(src.indexOf("\n", end + 1) + 1);
|
|
147
|
+
try {
|
|
148
|
+
return { data: parseYaml(raw), body, raw };
|
|
149
|
+
} catch (e) {
|
|
150
|
+
return { data: null, body, error: e.message };
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# The standard
|
|
2
|
+
|
|
3
|
+
Narrative policy. The enforceable statements live in [`rules/`](../rules/README.md); these pages
|
|
4
|
+
are the reasoning, the detail, and the how.
|
|
5
|
+
|
|
6
|
+
```text
|
|
7
|
+
rules/ what must be true, with an ID you can cite
|
|
8
|
+
standard/ why, and how to do it
|
|
9
|
+
checklists/ what to walk through before calling something done
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
| Area | Where | Covers |
|
|
13
|
+
|---|---|---|
|
|
14
|
+
| Engineering | [`engineering/`](engineering/README.md) | Architecture, security (OWASP ASVS 5.0), database, API, testing, devops, observability, performance, privacy, payments, AI features |
|
|
15
|
+
| Design | [`design/`](design/README.md) | UX, UI, accessibility (WCAG 2.2), states, components, data display, localisation, responsive, interaction, anti-patterns |
|
|
16
|
+
| Memory | [`../MEMORY.md`](../MEMORY.md) | Living project memory: registries, sweep discipline, impact map, freshness |
|
|
17
|
+
| Agent | [`../AGENTS.md`](../AGENTS.md) | The work contract every agent operates under |
|
|
18
|
+
|
|
19
|
+
## Reading order
|
|
20
|
+
|
|
21
|
+
1. [`../AGENTS.md`](../AGENTS.md) — the contract
|
|
22
|
+
2. [`../PRINCIPLES.md`](../PRINCIPLES.md) — what never changes
|
|
23
|
+
3. The domain page for what you are touching
|
|
24
|
+
4. The matching checklist in [`../checklists/`](../checklists/README.md)
|
|
25
|
+
5. The rule IDs you will cite in the report
|
|
26
|
+
|
|
27
|
+
## Adding to the standard
|
|
28
|
+
|
|
29
|
+
A new page here is guidance, not obligation. If it states something a project must do, it needs
|
|
30
|
+
a rule with an ID under [`rules/`](../rules/README.md), a source, and a validation method — see
|
|
31
|
+
[`../GOVERNANCE.md`](../GOVERNANCE.md).
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Design standard
|
|
2
|
+
|
|
3
|
+
UX, UI, accessibility and design-system policy for every user-facing surface. The enforceable
|
|
4
|
+
statements are the `A11Y-*`, `UX-*`, `UI-*`, `CMP-*`, `STATE-*`, `DATA-*`, `RWD-*`, `INT-*`,
|
|
5
|
+
`I18N-*`, `DS-*`, `MOT-*` and `CNT-*` rules in [`../../rules/README.md`](../../rules/README.md).
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
FOUNDATION (tokens, accessibility baseline)
|
|
9
|
+
↓
|
|
10
|
+
UX (jobs, flows, information architecture)
|
|
11
|
+
↓
|
|
12
|
+
UI (visual system)
|
|
13
|
+
↓
|
|
14
|
+
COMPONENTS → PATTERNS → SCREENS
|
|
15
|
+
↓
|
|
16
|
+
VALIDATION (checklists, accessibility, handoff)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
A pretty button does not fix a broken flow.
|
|
20
|
+
|
|
21
|
+
| Area | Pages |
|
|
22
|
+
|---|---|
|
|
23
|
+
| Principles | [`principles/`](principles/design-principles.md), [`ux-principles.md`](principles/ux-principles.md), [`ui-principles.md`](principles/ui-principles.md) |
|
|
24
|
+
| Accessibility | [`accessibility/`](accessibility/wcag-2.2.md) — names, keyboard, focus, contrast, target size, reflow, motion, screen readers, testing |
|
|
25
|
+
| UX | [`ux/`](ux/heuristics.md) — heuristics, forms, errors, feedback, navigation, information architecture, cognitive load |
|
|
26
|
+
| UI | [`ui/`](ui/visual-design.md) — colour, typography, spacing, layout, grids, icons, imagery |
|
|
27
|
+
| Components | [`components/`](components/buttons.md) — buttons, forms, dialogs, tables, navigation, feedback |
|
|
28
|
+
| States | [`states/`](states/loading.md) — loading, empty, error, offline, permission-denied, read-only, stale, optimistic, unsaved changes |
|
|
29
|
+
| Data display | [`data-display/`](data-display/README.md) — tables, currency, dates, numbers, density, sorting, filtering, pagination |
|
|
30
|
+
| Responsive | [`responsive/`](responsive/mobile.md), [`platforms/`](platforms/README.md), [`interaction/`](interaction/README.md) |
|
|
31
|
+
| Localisation | [`localization/`](localization/README.md) — i18n, RTL, pluralisation, text expansion, formats |
|
|
32
|
+
| Design system | [`design-system/`](design-system/tokens.md) — tokens, components, naming, variants, versioning |
|
|
33
|
+
| Anti-patterns | [`anti-patterns/`](anti-patterns/ui.md) — including [`ai-generated.md`](anti-patterns/ai-generated.md) |
|
|
34
|
+
| Content | [`content/`](content/ux-writing.md) — UX writing, error messages |
|
|
35
|
+
| Motion | [`motion/animation.md`](motion/animation.md) |
|
|
36
|
+
| AI review | [`ai/`](ai/instructions.md) — review protocol, compliance format, prompts |
|
|
37
|
+
| Health | [`health/`](health/maturity-model.md) — coverage, score, maturity |
|
|
38
|
+
| Decisions | [`decisions/`](decisions/README.md) — token naming, radius scale, colour system, component versioning |
|
|
39
|
+
|
|
40
|
+
Sources: [`REFERENCES.md`](REFERENCES.md) and [`references/`](references/w3c.md).
|
|
41
|
+
|
|
42
|
+
## Non-negotiable for any UI change
|
|
43
|
+
|
|
44
|
+
1. Prefer existing tokens and components over new one-offs (`DS-001`, `DS-002`, `UI-003`, `UI-005`)
|
|
45
|
+
2. Every interactive control has an accessible name, a keyboard path and visible focus
|
|
46
|
+
(`A11Y-001`, `A11Y-004`, `A11Y-006`)
|
|
47
|
+
3. Labels are persistent, never placeholder-only (`UX-007`)
|
|
48
|
+
4. Meaning is never carried by colour alone (`UI-004`)
|
|
49
|
+
5. States are complete: default, hover, focus, active, disabled, loading, empty, error, success —
|
|
50
|
+
plus permission-denied and offline where they can occur (`STATE-001`, `STATE-002`, `STATE-003`)
|
|
51
|
+
6. Never claim WCAG conformance without contrast, keyboard and accessible-name evidence
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Reference stack for UX/UI, accessibility and design systems
|
|
2
|
+
|
|
3
|
+
There is **no single “OWASP for design”**. This repository defines an **operational standard** derived from normative standards, UX research, established design systems, and web platform guidance. It is **not** itself an international normative body.
|
|
4
|
+
|
|
5
|
+
## Hierarchy
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
LEVEL 1 — NORMATIVE
|
|
9
|
+
W3C WCAG 2.2
|
|
10
|
+
W3C WAI-ARIA + APG
|
|
11
|
+
|
|
12
|
+
LEVEL 2 — UX RESEARCH / GUIDELINES
|
|
13
|
+
Nielsen Norman Group
|
|
14
|
+
|
|
15
|
+
LEVEL 3 — PROVEN DESIGN SYSTEMS
|
|
16
|
+
GOV.UK · USWDS · IBM Carbon · Material · Atlassian · Primer
|
|
17
|
+
|
|
18
|
+
LEVEL 4 — ARCHITECTURE / TOOLING REFERENCES
|
|
19
|
+
OpenUI · W3C Design Tokens (DTCG) · Figma SDS (patterns) · Storybook
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Links
|
|
23
|
+
|
|
24
|
+
- [WCAG 2.2](https://www.w3.org/TR/WCAG22/)
|
|
25
|
+
- [WAI-ARIA](https://www.w3.org/TR/wai-aria/)
|
|
26
|
+
- [ARIA APG](https://www.w3.org/WAI/ARIA/apg/)
|
|
27
|
+
- [NN/g Heuristics](https://www.nngroup.com/articles/ten-usability-heuristics/)
|
|
28
|
+
- [GOV.UK Design System](https://design-system.service.gov.uk/)
|
|
29
|
+
- [USWDS](https://designsystem.digital.gov/)
|
|
30
|
+
- [IBM Carbon](https://carbondesignsystem.com/)
|
|
31
|
+
- [Material Design](https://m3.material.io/)
|
|
32
|
+
- [Atlassian Design](https://atlassian.design/)
|
|
33
|
+
- [Primer](https://primer.style/)
|
|
34
|
+
- [OpenUI](https://open-ui.org/)
|
|
35
|
+
- [Design Tokens](https://www.w3.org/community/design-tokens/)
|
|
36
|
+
- [Figma SDS](https://github.com/figma/sds)
|
|
37
|
+
- [Storybook](https://storybook.js.org/)
|
|
38
|
+
|
|
39
|
+
Details: [`references/`](references/). Traceability: [`compliance/TRACEABILITY.md`](../../compliance/TRACEABILITY.md).
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# WCAG 2.2 baseline
|
|
2
|
+
|
|
3
|
+
Target **WCAG 2.2 Level AA** unless a product explicitly documents a different bar.
|
|
4
|
+
|
|
5
|
+
Primary source: [WCAG 2.2](https://www.w3.org/TR/WCAG22/).
|
|
6
|
+
|
|
7
|
+
This folder translates selected SCs into engineering/design rules. It is **not** a full audit checklist substitute for formal conformance claims.
|
|
8
|
+
|
|
9
|
+
Key themes we enforce as MUST in product UI:
|
|
10
|
+
|
|
11
|
+
- Perceivable: text alternatives, contrast, reflow
|
|
12
|
+
- Operable: keyboard, focus visible, targets, seziures/motion
|
|
13
|
+
- Understandable: labels, errors, consistent nav
|
|
14
|
+
- Robust: name/role/value (ARIA)
|
|
15
|
+
|
|
16
|
+
See also: `contrast.md`, `keyboard.md`, `focus.md`, `aria.md`.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# AI design rules
|
|
2
|
+
|
|
3
|
+
- Never invent a parallel palette when tokens exist
|
|
4
|
+
- Never remove focus outlines
|
|
5
|
+
- Never use placeholder-only labels
|
|
6
|
+
- Prefer system components over new CSS islands
|
|
7
|
+
- When generating UI, include empty/loading/error states
|
|
8
|
+
- Cite rule IDs (e.g. `A11Y-FOCUS-001`) in PR/compliance summaries
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
See [`../anti-patterns/ai-generated.md`](../anti-patterns/ai-generated.md).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Compliance output format
|
|
2
|
+
|
|
3
|
+
```text
|
|
4
|
+
DESIGN REVIEW
|
|
5
|
+
|
|
6
|
+
Status: PASS | FAIL | PASS WITH WARNINGS
|
|
7
|
+
|
|
8
|
+
Violations:
|
|
9
|
+
- RULE-ID — short reason
|
|
10
|
+
|
|
11
|
+
Warnings:
|
|
12
|
+
- RULE-ID — short reason
|
|
13
|
+
|
|
14
|
+
Passed:
|
|
15
|
+
<count>
|
|
16
|
+
|
|
17
|
+
Failed:
|
|
18
|
+
<count>
|
|
19
|
+
|
|
20
|
+
Not verified:
|
|
21
|
+
<count> — list
|
|
22
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Store golden eval cases (fixture descriptions → expected violations) in product repos or future `evals/` datasets.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Review protocol
|
|
2
|
+
|
|
3
|
+
```text
|
|
4
|
+
1. Identify surface (web/mobile/tablet/desktop)
|
|
5
|
+
2. Identify input methods
|
|
6
|
+
3. Collect applicable MUST rules
|
|
7
|
+
4. Check states matrix
|
|
8
|
+
5. Check a11y (name, keyboard, focus, contrast)
|
|
9
|
+
6. Check tokens/components
|
|
10
|
+
7. Emit DESIGN REVIEW report
|
|
11
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# ADR-001: Token naming
|
|
2
|
+
|
|
3
|
+
## Decision
|
|
4
|
+
|
|
5
|
+
Use `{category}.{role}.{variant}.{state?}` semantic names; primitives separate.
|
|
6
|
+
|
|
7
|
+
## Status
|
|
8
|
+
|
|
9
|
+
Accepted
|
|
10
|
+
|
|
11
|
+
## Consequences
|
|
12
|
+
|
|
13
|
+
Components bind to semantic tokens (DS-002). Renames are major versions (DS-003).
|