@jterrats/open-orchestra 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 +151 -0
- package/CLAUDE.md +157 -0
- package/README.md +60 -0
- package/bin/orchestra.js +8 -0
- package/dist/args.d.ts +3 -0
- package/dist/args.js +30 -0
- package/dist/args.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +190 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands.d.ts +44 -0
- package/dist/commands.js +883 -0
- package/dist/commands.js.map +1 -0
- package/dist/constants.d.ts +15 -0
- package/dist/constants.js +69 -0
- package/dist/constants.js.map +1 -0
- package/dist/defaults.d.ts +72 -0
- package/dist/defaults.js +694 -0
- package/dist/defaults.js.map +1 -0
- package/dist/fs-utils.d.ts +8 -0
- package/dist/fs-utils.js +35 -0
- package/dist/fs-utils.js.map +1 -0
- package/dist/model-providers.d.ts +19 -0
- package/dist/model-providers.js +78 -0
- package/dist/model-providers.js.map +1 -0
- package/dist/types.d.ts +550 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/validation.d.ts +10 -0
- package/dist/validation.js +163 -0
- package/dist/validation.js.map +1 -0
- package/dist/web-api.d.ts +16 -0
- package/dist/web-api.js +220 -0
- package/dist/web-api.js.map +1 -0
- package/dist/web-chart-contracts.d.ts +13 -0
- package/dist/web-chart-contracts.js +13 -0
- package/dist/web-chart-contracts.js.map +1 -0
- package/dist/web-console.d.ts +1 -0
- package/dist/web-console.js +232 -0
- package/dist/web-console.js.map +1 -0
- package/dist/web-evidence.d.ts +25 -0
- package/dist/web-evidence.js +67 -0
- package/dist/web-evidence.js.map +1 -0
- package/dist/web-playwright.d.ts +3 -0
- package/dist/web-playwright.js +14 -0
- package/dist/web-playwright.js.map +1 -0
- package/dist/web-roles.d.ts +33 -0
- package/dist/web-roles.js +70 -0
- package/dist/web-roles.js.map +1 -0
- package/dist/workflow-gates.d.ts +7 -0
- package/dist/workflow-gates.js +291 -0
- package/dist/workflow-gates.js.map +1 -0
- package/dist/workflow-services.d.ts +56 -0
- package/dist/workflow-services.js +1240 -0
- package/dist/workflow-services.js.map +1 -0
- package/dist/workspace-validator.d.ts +6 -0
- package/dist/workspace-validator.js +189 -0
- package/dist/workspace-validator.js.map +1 -0
- package/dist/workspace.d.ts +10 -0
- package/dist/workspace.js +72 -0
- package/dist/workspace.js.map +1 -0
- package/docs/multi-agent-orchestrator-backlog.md +445 -0
- package/docs/multi-agent-orchestrator-sprint-1.md +433 -0
- package/docs/orchestra-mvp.md +176 -0
- package/package.json +63 -0
- package/rules/agent-collaboration.mdc +58 -0
- package/rules/agent-roles.mdc +105 -0
- package/rules/ai-assisted-development.mdc +31 -0
- package/rules/api-design.mdc +31 -0
- package/rules/architecture-decisions.mdc +27 -0
- package/rules/code-review-engineering.mdc +34 -0
- package/rules/concurrency-async.mdc +32 -0
- package/rules/configuration-management.mdc +31 -0
- package/rules/data-modeling-domain.mdc +31 -0
- package/rules/delivery-quality-gates.mdc +40 -0
- package/rules/dependency-management.mdc +31 -0
- package/rules/devops-tooling.mdc +55 -0
- package/rules/documentation-standards.mdc +26 -0
- package/rules/dry-clean-code.mdc +30 -0
- package/rules/error-handling.mdc +28 -0
- package/rules/frontend-engineering.mdc +32 -0
- package/rules/git-discipline.mdc +39 -0
- package/rules/infra-data-encryption.mdc +81 -0
- package/rules/performance-reliability.mdc +32 -0
- package/rules/readiness-done.mdc +32 -0
- package/rules/release-rollback.mdc +32 -0
- package/rules/rule-composition.mdc +28 -0
- package/rules/security-guardrails.mdc +37 -0
- package/rules/solid-architecture.mdc +32 -0
- package/rules/static-analysis-githooks.mdc +32 -0
- package/rules/testing-discipline.mdc +42 -0
- package/rules/ux-ui-product-experience.mdc +51 -0
- package/rules/work-intake-sequencing.mdc +39 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Cross-agent collaboration, handoffs, and decision protocol — stack-agnostic
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent Collaboration
|
|
7
|
+
|
|
8
|
+
Agents must collaborate through explicit artifacts and review checkpoints. Parallel work is allowed only when responsibilities, inputs, and outputs are clear.
|
|
9
|
+
|
|
10
|
+
## Shared Context
|
|
11
|
+
- Start with a shared task brief: goal, backlog item, constraints, assumptions, risks, and definition of done.
|
|
12
|
+
- Confirm the GitHub issue exists and has been technically refined before starting each work block.
|
|
13
|
+
- Keep a visible decision log for architecture choices, scope cuts, security exceptions, and release trade-offs.
|
|
14
|
+
- Treat unresolved questions as blockers when they affect user value, data contracts, security, or deployment.
|
|
15
|
+
|
|
16
|
+
## User Alignment Gate
|
|
17
|
+
- Before implementation, discuss the proposed solution and architecture with the user.
|
|
18
|
+
- Present the plan in concrete terms: scope, files or modules likely to change, domain/model changes, service/integration changes, controller/entry-point changes, data flow, risks, trade-offs, test strategy, and expected evidence.
|
|
19
|
+
- Do not start coding when the architecture, acceptance criteria, or user-visible behavior is ambiguous.
|
|
20
|
+
- If the task is a trivial mechanical edit, state that no architecture decision is involved and proceed with the smallest safe change.
|
|
21
|
+
- If new information invalidates the agreed plan, pause and realign with the user before continuing.
|
|
22
|
+
|
|
23
|
+
## Collaboration Flow
|
|
24
|
+
- Product Owner and Analyst define acceptance criteria before Developer or QA treat the task as ready.
|
|
25
|
+
- Architect and Security review designs before implementation when work touches boundaries, data, auth, infra, or external integrations.
|
|
26
|
+
- UX/UI Designer reviews user-facing flows before implementation when the task changes screens, copy, navigation, onboarding, or accessibility.
|
|
27
|
+
- SRE, DBA, Compliance/Privacy, and Release Manager review before release when reliability, database, regulatory, or rollout risk is material.
|
|
28
|
+
- Developer starts implementation only after the user alignment gate and required role reviews are complete.
|
|
29
|
+
- Developer shares implementation notes, unit test evidence, and changed behavior with QA, DevOps, and Security before final verification.
|
|
30
|
+
- QA, DevOps, and Security report release blockers back to Product Owner for go/no-go decisions.
|
|
31
|
+
- Developer work must pass through QA review before release approval.
|
|
32
|
+
|
|
33
|
+
## Handoff Contract
|
|
34
|
+
- Every handoff must include: current status, files or components touched, decisions made, risks, test evidence, and remaining work.
|
|
35
|
+
- Do not hand off vague ownership such as "finish the backend". Name the exact module, behavior, or artifact.
|
|
36
|
+
- If another agent's output is incomplete or contradictory, pause and reconcile before building on it.
|
|
37
|
+
- Developer-to-QA handoff must include unit tests added or updated, exact test commands run, known gaps, and any recommended Playwright coverage.
|
|
38
|
+
|
|
39
|
+
## Parallel Work Rules
|
|
40
|
+
- Split work by stable boundaries: feature slice, module, test suite, infrastructure component, or documentation artifact.
|
|
41
|
+
- Agents working in parallel must publish assumptions early and update them when code or requirements change.
|
|
42
|
+
- Avoid duplicate edits to the same files. If overlap is unavoidable, assign one integration owner.
|
|
43
|
+
|
|
44
|
+
## Review Protocol
|
|
45
|
+
- Review from the role's responsibility, not personal preference.
|
|
46
|
+
- Findings must include severity, affected artifact, expected behavior, actual risk, and a concrete recommendation.
|
|
47
|
+
- Approval means the reviewer accepts the residual risk for their role.
|
|
48
|
+
|
|
49
|
+
## Conflict Resolution
|
|
50
|
+
- Product value conflicts are resolved by Product Owner with Product Manager input.
|
|
51
|
+
- Technical direction conflicts are resolved by Architect with Developer and DevOps input.
|
|
52
|
+
- Verification conflicts are resolved by QA using acceptance criteria and reproducible evidence.
|
|
53
|
+
- Security conflicts are resolved by Security unless the Product Owner records explicit risk acceptance.
|
|
54
|
+
- UX conflicts are resolved by UX/UI Designer with Product Owner input.
|
|
55
|
+
- Reliability conflicts are resolved by SRE with DevOps and Architect input.
|
|
56
|
+
- Data and database conflicts are resolved by Data Engineer or DBA according to ownership.
|
|
57
|
+
- Release timing conflicts are resolved by Release Manager with Product Owner input.
|
|
58
|
+
- Compliance and privacy conflicts are resolved by Compliance/Privacy unless formal risk acceptance is recorded.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Role-based agent responsibilities for software delivery — stack-agnostic
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent Roles
|
|
7
|
+
|
|
8
|
+
Use roles to force complete thinking, not to create silos. A single agent may cover multiple roles, but it must state which role is active when making a decision.
|
|
9
|
+
|
|
10
|
+
## Role Selection
|
|
11
|
+
- Start every non-trivial task by identifying the needed roles and the lead role.
|
|
12
|
+
- Do not activate every role by default. Choose the smallest set that covers product intent, UX, technical design, implementation, verification, delivery, reliability, data, compliance, documentation, and risk.
|
|
13
|
+
- If a role is skipped, state why the task does not need it.
|
|
14
|
+
|
|
15
|
+
## Product Owner
|
|
16
|
+
- Owns user value, acceptance criteria, scope boundaries, and release readiness.
|
|
17
|
+
- Converts vague requests into concrete outcomes, non-goals, constraints, and acceptance tests.
|
|
18
|
+
- Rejects implementation work when the problem statement, priority, or done criteria are unclear.
|
|
19
|
+
|
|
20
|
+
## Product Manager
|
|
21
|
+
- Owns product strategy, trade-offs, sequencing, and success metrics.
|
|
22
|
+
- Connects work to business value, user segments, adoption risks, and roadmap fit.
|
|
23
|
+
- Forces scope cuts when the requested solution is larger than the validated problem.
|
|
24
|
+
|
|
25
|
+
## Analyst
|
|
26
|
+
- Owns requirements discovery, domain modeling, process mapping, and edge cases.
|
|
27
|
+
- Identifies actors, workflows, state transitions, data definitions, and reporting needs.
|
|
28
|
+
- Documents assumptions and open questions before they become hidden implementation decisions.
|
|
29
|
+
|
|
30
|
+
## Architect
|
|
31
|
+
- Owns system boundaries, integration contracts, data flow, and long-term maintainability.
|
|
32
|
+
- Chooses patterns that fit the existing codebase and records meaningful trade-offs.
|
|
33
|
+
- Blocks designs that violate security, scalability, testability, or clean architecture constraints.
|
|
34
|
+
- Discusses the proposed architecture with the user before implementation begins.
|
|
35
|
+
|
|
36
|
+
## Developer
|
|
37
|
+
- Owns implementation quality, local consistency, refactoring discipline, and maintainable code.
|
|
38
|
+
- Keeps changes small, typed, tested, and aligned with existing patterns.
|
|
39
|
+
- Does not start coding until acceptance criteria and technical boundaries are clear enough.
|
|
40
|
+
- Confirms the agreed implementation approach before editing files, except for trivial mechanical changes.
|
|
41
|
+
|
|
42
|
+
## QA
|
|
43
|
+
- Owns verification strategy, test coverage, regression risk, and release confidence.
|
|
44
|
+
- Defines happy paths, failure paths, boundary cases, and non-functional checks.
|
|
45
|
+
- Challenges work that has implementation but no credible test plan.
|
|
46
|
+
|
|
47
|
+
## DevOps
|
|
48
|
+
- Owns deployment, CI/CD, observability, runtime configuration, rollback, and operational readiness.
|
|
49
|
+
- Verifies environment segregation, infrastructure as code, migrations, secrets, and runbooks.
|
|
50
|
+
- Blocks releases that cannot be deployed, monitored, rolled back, or supported.
|
|
51
|
+
|
|
52
|
+
## Security
|
|
53
|
+
- Owns threat modeling, abuse cases, data classification, identity, secrets, and dependency risk.
|
|
54
|
+
- Reviews authentication, authorization, input handling, logging, encryption, and third-party exposure.
|
|
55
|
+
- Treats security findings as release blockers unless explicitly risk-accepted by the Product Owner.
|
|
56
|
+
|
|
57
|
+
## UX/UI Designer
|
|
58
|
+
- Owns user experience, interaction design, accessibility, responsive behavior, UI copy, and flow clarity.
|
|
59
|
+
- Reviews user-facing work for mobile-first behavior, empty/loading/error/success states, tooltips, and usability.
|
|
60
|
+
- Blocks user-facing releases that are confusing, inaccessible, or broken on target viewports.
|
|
61
|
+
|
|
62
|
+
## SRE / Reliability Engineer
|
|
63
|
+
- Owns SLOs, error budgets, incident response, capacity, resilience, and production reliability.
|
|
64
|
+
- Reviews observability, alerts, dashboards, saturation, failover, degradation, and post-release monitoring.
|
|
65
|
+
- Blocks releases that cannot be operated, monitored, scaled, or recovered within agreed RTO/RPO.
|
|
66
|
+
|
|
67
|
+
## Data Engineer / Data Analyst
|
|
68
|
+
- Owns data pipelines, analytics models, reporting definitions, data quality, lineage, and metric correctness.
|
|
69
|
+
- Verifies dashboards, business metrics, ETL/ELT jobs, aggregation logic, and data freshness.
|
|
70
|
+
- Blocks decisions based on ambiguous, unvalidated, or inconsistent data definitions.
|
|
71
|
+
|
|
72
|
+
## DBA / Database Engineer
|
|
73
|
+
- Owns database performance, indexes, locking, migrations, replication, backups, partitioning, and restore safety.
|
|
74
|
+
- Reviews schema changes, query plans, backfills, constraints, transaction scope, and production data risk.
|
|
75
|
+
- Blocks migrations that are unsafe, irreversible without plan, unbounded, or likely to cause downtime.
|
|
76
|
+
|
|
77
|
+
## Tech Lead / Engineering Manager
|
|
78
|
+
- Owns technical coordination, sequencing, ownership boundaries, integration planning, and delivery coherence.
|
|
79
|
+
- Splits work across agents or teams, assigns integration ownership, and manages technical debt trade-offs.
|
|
80
|
+
- Ensures the final solution is cohesive across product, architecture, implementation, QA, DevOps, and security.
|
|
81
|
+
|
|
82
|
+
## Release Manager
|
|
83
|
+
- Owns release coordination, go/no-go checklist, release window, communication, rollout, and rollback readiness.
|
|
84
|
+
- Verifies versioning, changelog, migrations, feature flags, deployment order, and post-release monitoring.
|
|
85
|
+
- Blocks releases without clear owner, rollback path, evidence, or stakeholder communication.
|
|
86
|
+
|
|
87
|
+
## Support / Customer Success
|
|
88
|
+
- Owns customer impact, support readiness, FAQs, known issues, user communication, and feedback loops.
|
|
89
|
+
- Reviews user-facing changes for diagnosability, help text, recovery paths, and support escalation needs.
|
|
90
|
+
- Feeds production incidents, tickets, and user pain back into Product Owner and QA workflows.
|
|
91
|
+
|
|
92
|
+
## Compliance / Privacy
|
|
93
|
+
- Owns regulatory requirements, privacy obligations, retention, consent, auditability, and data processing risk.
|
|
94
|
+
- Reviews PII, restricted data, data residency, retention policies, access logs, consent, and third-party processors.
|
|
95
|
+
- Blocks releases that violate compliance obligations unless explicit executive-level risk acceptance is recorded.
|
|
96
|
+
|
|
97
|
+
## Content / Technical Writer
|
|
98
|
+
- Owns user docs, technical docs, runbooks, release notes, changelogs, API examples, and help content.
|
|
99
|
+
- Ensures documentation is accurate, actionable, current, and aligned with shipped behavior.
|
|
100
|
+
- Blocks delivery when required docs or operational runbooks are missing for impacted users or operators.
|
|
101
|
+
|
|
102
|
+
## Game Designer
|
|
103
|
+
- Owns game mechanics, progression, difficulty, economy, onboarding, feedback loops, and player engagement.
|
|
104
|
+
- Reviews game UX for controls, tutorials, HUD clarity, reward loops, failure recovery, and accessibility options.
|
|
105
|
+
- Blocks game changes that break core loops, progression balance, or player comprehension.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Safe and verifiable AI-assisted software development practices
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AI-Assisted Development
|
|
7
|
+
|
|
8
|
+
AI-generated work must meet the same engineering bar as human-written work. Speed does not replace verification.
|
|
9
|
+
|
|
10
|
+
## Grounding
|
|
11
|
+
- Inspect the existing codebase before proposing or editing code.
|
|
12
|
+
- Do not invent APIs, files, dependencies, commands, environment variables, or product requirements.
|
|
13
|
+
- When uncertain, state the assumption, verify locally, or ask the user before implementation.
|
|
14
|
+
- Prefer existing project patterns over generic generated patterns.
|
|
15
|
+
|
|
16
|
+
## Implementation
|
|
17
|
+
- Keep AI-generated changes scoped to the agreed plan.
|
|
18
|
+
- Do not rewrite unrelated code, rename public APIs, or reformat broad areas without explicit need.
|
|
19
|
+
- Add tests and evidence for AI-generated behavior like any other change.
|
|
20
|
+
- Generated code must be understandable, maintainable, typed, and aligned with security rules.
|
|
21
|
+
|
|
22
|
+
## Review
|
|
23
|
+
- Treat AI output as untrusted until reviewed.
|
|
24
|
+
- Check generated code for hallucinated imports, broken edge cases, security regressions, and excessive abstraction.
|
|
25
|
+
- Do not accept generated explanations as proof. Use tests, builds, type checks, docs, or runtime evidence.
|
|
26
|
+
- Record prompts, assumptions, or model-specific behavior when they materially affect product behavior or repeatability.
|
|
27
|
+
|
|
28
|
+
## User Alignment
|
|
29
|
+
- Discuss the approach with the user before non-trivial AI-assisted implementation.
|
|
30
|
+
- Explain trade-offs clearly and identify risks introduced by generated code.
|
|
31
|
+
- If generated code reveals a better or riskier path than agreed, pause and realign before continuing.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: API contract, versioning, idempotency, and compatibility standards
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# API Design
|
|
7
|
+
|
|
8
|
+
APIs are product contracts. Design them for clarity, compatibility, safety, and operability before implementation.
|
|
9
|
+
|
|
10
|
+
## Contracts
|
|
11
|
+
- Define request, response, error shape, authentication, authorization, pagination, filtering, sorting, and rate limits before coding.
|
|
12
|
+
- Use stable field names and explicit types. Avoid ambiguous blobs such as `metadata` unless the schema is documented.
|
|
13
|
+
- Use consistent naming, casing, date formats, IDs, and enum values across endpoints.
|
|
14
|
+
- Public API changes require examples for success, validation failure, authorization failure, and unexpected failure.
|
|
15
|
+
|
|
16
|
+
## Compatibility
|
|
17
|
+
- Prefer backward-compatible changes: add optional fields before removing or renaming anything.
|
|
18
|
+
- Version breaking changes intentionally and document migration steps.
|
|
19
|
+
- Do not leak internal models directly as API responses.
|
|
20
|
+
- Keep error codes stable even when error messages improve.
|
|
21
|
+
|
|
22
|
+
## Safety
|
|
23
|
+
- Use idempotency keys for retryable create, payment, provisioning, email, or side-effecting operations.
|
|
24
|
+
- Validate input at the boundary and return user-safe errors.
|
|
25
|
+
- Enforce authorization per resource, not just per endpoint.
|
|
26
|
+
- Apply rate limits and abuse protection for public or high-cost endpoints.
|
|
27
|
+
|
|
28
|
+
## Testing
|
|
29
|
+
- Add contract tests for request/response shape and error cases.
|
|
30
|
+
- Add backward-compatibility tests when changing existing APIs.
|
|
31
|
+
- Include tests for pagination, filtering, authorization, and idempotency when applicable.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Lightweight architecture decision records and design documentation
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Architecture Decisions
|
|
7
|
+
|
|
8
|
+
Important architecture choices must be recorded briefly. The goal is traceability, not bureaucracy.
|
|
9
|
+
|
|
10
|
+
## When to Record an ADR
|
|
11
|
+
- Record an ADR when changing system boundaries, data ownership, integration contracts, authentication, authorization, infrastructure, deployment, or storage patterns.
|
|
12
|
+
- Record an ADR when choosing a new framework, library, cloud service, messaging pattern, database, or testing strategy.
|
|
13
|
+
- Record an ADR when a decision has meaningful trade-offs, migration cost, security impact, or rollback complexity.
|
|
14
|
+
|
|
15
|
+
## ADR Format
|
|
16
|
+
- Title: short decision name.
|
|
17
|
+
- Status: proposed, accepted, superseded, or rejected.
|
|
18
|
+
- Context: problem, constraints, and forces.
|
|
19
|
+
- Decision: chosen approach.
|
|
20
|
+
- Consequences: benefits, costs, risks, and follow-up work.
|
|
21
|
+
- Alternatives considered: at least one reasonable option and why it was not chosen.
|
|
22
|
+
|
|
23
|
+
## Decision Hygiene
|
|
24
|
+
- Keep ADRs concise and link them from PRs when relevant.
|
|
25
|
+
- Supersede old ADRs instead of rewriting history.
|
|
26
|
+
- If a decision is reversed, record why new information changed the outcome.
|
|
27
|
+
- Architecture decisions must align with security, testing, observability, and delivery quality gates.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Engineering code review standards, checklists, and approval expectations
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Review Engineering
|
|
7
|
+
|
|
8
|
+
Code review protects behavior, users, operations, and maintainability. Review risk before style.
|
|
9
|
+
|
|
10
|
+
## Review Order
|
|
11
|
+
- Review behavior, data safety, security, reliability, and user impact before naming or formatting.
|
|
12
|
+
- Check whether the change matches the agreed solution, acceptance criteria, and Definition of Done.
|
|
13
|
+
- Verify tests cover meaningful behavior, failure paths, and regression risk.
|
|
14
|
+
- Confirm evidence: commands run, screenshots, logs, traces, benchmarks, or QA results when relevant.
|
|
15
|
+
|
|
16
|
+
## Required Checks
|
|
17
|
+
- API changes: contract, compatibility, auth, validation, rate limits, and error shape.
|
|
18
|
+
- Data changes: migrations, indexes, constraints, backfills, rollback, and sensitive data handling.
|
|
19
|
+
- UI changes: responsive layout, accessibility, copy, states, and screenshots.
|
|
20
|
+
- Async changes: idempotency, retries, timeout, DLQ, and observability.
|
|
21
|
+
- Infra changes: plan output, least privilege, cost, scalability, rollback, and drift risk.
|
|
22
|
+
- Static analysis: pre-commit hook, lint, typecheck, secret scan, dependency scan, and SAST status.
|
|
23
|
+
|
|
24
|
+
## Review Findings
|
|
25
|
+
- Findings must include severity, file or artifact, risk, expected behavior, and concrete recommendation.
|
|
26
|
+
- Do not approve unresolved blockers, failing CI, missing tests, or undocumented risk acceptance.
|
|
27
|
+
- Nitpicks must not block unless they hide real maintainability, readability, or consistency risk.
|
|
28
|
+
- If the change is too large to review reliably, request split PRs or staged rollout.
|
|
29
|
+
|
|
30
|
+
## Self-Review
|
|
31
|
+
- Authors must review their own diff before requesting review.
|
|
32
|
+
- Remove debug code, dead code, unrelated formatting, and accidental files.
|
|
33
|
+
- Summarize architectural decisions, trade-offs, test evidence, and known gaps in the PR.
|
|
34
|
+
- Confirm static analysis and required hooks passed before requesting review.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Concurrency, async jobs, retries, idempotency, and distributed workflow rules
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Concurrency & Async
|
|
7
|
+
|
|
8
|
+
Concurrent and asynchronous work must be idempotent, observable, and safe under retries, partial failure, and duplicate delivery.
|
|
9
|
+
|
|
10
|
+
## Concurrency Control
|
|
11
|
+
- Identify shared mutable state before implementation.
|
|
12
|
+
- Use transactions, optimistic concurrency, locks, leases, or compare-and-swap when multiple writers can collide.
|
|
13
|
+
- Avoid relying on timing, sleep, or process-local memory for correctness.
|
|
14
|
+
- Document ordering assumptions and what happens when events arrive late, duplicated, or out of order.
|
|
15
|
+
|
|
16
|
+
## Async Jobs
|
|
17
|
+
- Jobs must have owner, trigger, payload schema, retry policy, timeout, dead-letter handling, and observability.
|
|
18
|
+
- Payloads should carry stable IDs, not large snapshots, unless snapshots are required for correctness.
|
|
19
|
+
- Long-running jobs must report progress and support safe resume or retry.
|
|
20
|
+
- Background work must not hide user-visible failures without surfacing status or recovery.
|
|
21
|
+
|
|
22
|
+
## Retries
|
|
23
|
+
- Retried operations must be idempotent or protected with idempotency keys.
|
|
24
|
+
- Use bounded retries with exponential backoff and jitter.
|
|
25
|
+
- Do not retry validation errors, authorization errors, or deterministic business rule failures.
|
|
26
|
+
- Record retry exhaustion as an operational signal.
|
|
27
|
+
|
|
28
|
+
## Distributed Workflows
|
|
29
|
+
- Prefer explicit state machines for multi-step workflows.
|
|
30
|
+
- Define compensation or forward-fix behavior for partial failure.
|
|
31
|
+
- Use durable queues or workflow engines for critical multi-step processes instead of in-memory orchestration.
|
|
32
|
+
- Emit events or audit entries for important state transitions.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Runtime configuration, feature flags, environment variables, and typed config rules
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Configuration Management
|
|
7
|
+
|
|
8
|
+
Configuration changes product behavior. Treat config as code, validate it, and make ownership explicit.
|
|
9
|
+
|
|
10
|
+
## Config Design
|
|
11
|
+
- Separate build-time config from runtime config.
|
|
12
|
+
- Validate required configuration at startup with typed schemas and clear failure messages.
|
|
13
|
+
- Use safe defaults only when they are genuinely safe for every environment.
|
|
14
|
+
- Do not scatter raw environment variable reads across the codebase. Centralize config loading.
|
|
15
|
+
|
|
16
|
+
## Feature Flags
|
|
17
|
+
- Every feature flag needs owner, purpose, default, rollout plan, cleanup plan, and expiration condition.
|
|
18
|
+
- Flags must fail safe when config is unavailable.
|
|
19
|
+
- Avoid long-lived flags that create permanent parallel behavior.
|
|
20
|
+
- Test both enabled and disabled paths for risky flags.
|
|
21
|
+
|
|
22
|
+
## Environment Management
|
|
23
|
+
- Keep dev, staging, and production configuration isolated.
|
|
24
|
+
- Do not use production secrets, endpoints, or customer data in local or test environments.
|
|
25
|
+
- Document required environment variables, allowed values, and examples.
|
|
26
|
+
- Configuration changes that affect deployment need release notes and rollback steps.
|
|
27
|
+
|
|
28
|
+
## Secrets
|
|
29
|
+
- Secrets are not configuration files. Use approved secret managers and runtime injection.
|
|
30
|
+
- Never log secret values, tokens, connection strings, or signed URLs.
|
|
31
|
+
- Rotate secrets when access scope, ownership, or exposure risk changes.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Data modeling, domain boundaries, invariants, and migration discipline
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Data Modeling & Domain
|
|
7
|
+
|
|
8
|
+
Data models encode business rules. Treat schema, state, and naming decisions as long-lived product contracts.
|
|
9
|
+
|
|
10
|
+
## Domain Modeling
|
|
11
|
+
- Use domain language in types, tables, events, and functions. Avoid generic names such as `data`, `item`, `payload`, or `status` without context.
|
|
12
|
+
- Document core invariants: what must always be true, who can change it, and what events change it.
|
|
13
|
+
- Model state transitions explicitly. Avoid free-form status values without an allowed transition map.
|
|
14
|
+
- Use value objects or narrow types for money, dates, IDs, units, quantities, and other rule-heavy values.
|
|
15
|
+
|
|
16
|
+
## Ownership
|
|
17
|
+
- Assign a clear owner for each data model or bounded context.
|
|
18
|
+
- Do not let unrelated modules write directly to another context's data without an explicit service, event, or contract.
|
|
19
|
+
- Keep derived data traceable to its source of truth.
|
|
20
|
+
|
|
21
|
+
## Schema Design
|
|
22
|
+
- Design indexes from real query patterns and cardinality, not guesses.
|
|
23
|
+
- Use constraints for invariants the database can enforce.
|
|
24
|
+
- Avoid nullable fields unless the meaning of null is explicit.
|
|
25
|
+
- Classify sensitive fields at design time and apply encryption, tokenization, retention, and audit rules when needed.
|
|
26
|
+
|
|
27
|
+
## Migrations
|
|
28
|
+
- Migrations must be backward-compatible when possible and safe for rolling deploys.
|
|
29
|
+
- Separate expand, backfill, switch, and contract phases for risky schema changes.
|
|
30
|
+
- Backfills must be resumable, observable, and rate-limited when touching production-scale data.
|
|
31
|
+
- Add rollback or forward-fix instructions for every non-trivial migration.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Required delivery flow from development through QA automation and evidence
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Delivery Quality Gates
|
|
7
|
+
|
|
8
|
+
Development work is not complete when code compiles. Every implementation must move through developer verification, QA review, automation planning, and evidence capture.
|
|
9
|
+
|
|
10
|
+
## Developer Gate
|
|
11
|
+
- Developer delivers code with unit tests for new or changed business logic.
|
|
12
|
+
- Unit tests must cover success paths, failure paths, and relevant boundary cases.
|
|
13
|
+
- Developer must run the focused unit test suite and report the exact command and result.
|
|
14
|
+
- If unit tests are not feasible, Developer must document the technical reason and propose the smallest testable refactor.
|
|
15
|
+
- Developer must address API, data, frontend, performance, concurrency, config, and AI-assisted development rules when the change touches those areas.
|
|
16
|
+
|
|
17
|
+
## QA Gate
|
|
18
|
+
- QA receives the Developer handoff before release approval.
|
|
19
|
+
- QA must produce a test plan covering acceptance criteria, regression areas, edge cases, data setup, and environment assumptions.
|
|
20
|
+
- QA must execute or explicitly defer each test case with a reason.
|
|
21
|
+
- QA findings must include severity, reproduction steps, expected result, actual result, and evidence.
|
|
22
|
+
|
|
23
|
+
## Automation Gate
|
|
24
|
+
- QA and Developer must identify which manual checks should become automated tests.
|
|
25
|
+
- Prefer Playwright for browser-based E2E, smoke, and regression flows.
|
|
26
|
+
- Use Page Object pattern for Playwright suites. Selectors belong in page objects or stable test helpers, not scattered through test bodies.
|
|
27
|
+
- Automated tests must be deterministic and avoid real network, clock, or randomness unless controlled by fixtures, mocks, or seeded data.
|
|
28
|
+
|
|
29
|
+
## Evidence Gate
|
|
30
|
+
- Every completed delivery must include test evidence: commands run, pass/fail result, logs or screenshots when relevant, and unresolved risks.
|
|
31
|
+
- Playwright evidence should include trace, screenshot, or video for failed E2E cases when the framework supports it.
|
|
32
|
+
- User-facing delivery should include screenshots or recordings for key responsive breakpoints when practical.
|
|
33
|
+
- Manual QA evidence should include tested build/version, environment, browser/device when relevant, and timestamp.
|
|
34
|
+
- Release approval requires visible evidence from Developer and QA, not just a verbal status.
|
|
35
|
+
|
|
36
|
+
## Release Decision
|
|
37
|
+
- Product Owner gives go/no-go using QA results, automation status, unresolved defects, and risk acceptance.
|
|
38
|
+
- Security, DevOps, or QA blockers cannot be bypassed without explicit Product Owner risk acceptance.
|
|
39
|
+
- A delivery with deferred tests must include the follow-up backlog item and owner before release.
|
|
40
|
+
- Release approval must satisfy Definition of Done, release readiness, rollback, and documentation requirements when applicable.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Dependency updates, lockfiles, supply chain review, and vulnerability handling
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Dependency Management
|
|
7
|
+
|
|
8
|
+
Dependencies are part of the product attack surface and runtime behavior. Treat them as code.
|
|
9
|
+
|
|
10
|
+
## Adding Dependencies
|
|
11
|
+
- Prefer the standard library or existing project dependencies before adding a new package.
|
|
12
|
+
- Justify every new runtime dependency with purpose, maintenance status, license, security posture, and alternatives considered.
|
|
13
|
+
- Do not add dependencies for trivial utilities that can be implemented safely in a few lines.
|
|
14
|
+
- Avoid packages with low maintenance, unclear ownership, known malware history, or broad install scripts.
|
|
15
|
+
|
|
16
|
+
## Versioning
|
|
17
|
+
- Pin dependency versions through lockfiles and commit lockfile updates with the package manifest.
|
|
18
|
+
- Do not manually edit lockfiles unless the package manager requires it and the change is reviewed.
|
|
19
|
+
- Major upgrades require changelog review, migration notes, test evidence, and rollback considerations.
|
|
20
|
+
- Keep dependency updates atomic unless a coordinated upgrade is required.
|
|
21
|
+
|
|
22
|
+
## Supply Chain Security
|
|
23
|
+
- Run dependency scanning in CI and block critical or high vulnerabilities unless risk-accepted.
|
|
24
|
+
- Never run unvetted package execution commands in CI.
|
|
25
|
+
- Review transitive dependency risk when adding security-sensitive, build, auth, crypto, or deployment tooling.
|
|
26
|
+
- Remove unused dependencies promptly.
|
|
27
|
+
|
|
28
|
+
## Automation
|
|
29
|
+
- Use Dependabot, Renovate, or equivalent for routine updates where possible.
|
|
30
|
+
- Group low-risk patch updates, but keep major and security updates separate.
|
|
31
|
+
- Security updates must include the vulnerability identifier, affected package, fixed version, test evidence, and any compensating controls.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: DevOps tool categories, operational design, scalability, observability, and reporting
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# DevOps Tooling & Operations
|
|
7
|
+
|
|
8
|
+
DevOps decisions must cover deployability, scalability, downtime strategy, observability, reporting, security, and recovery. Tools are selected by capability, not trend.
|
|
9
|
+
|
|
10
|
+
## Stack by Category
|
|
11
|
+
- **IaC**: Terraform, OpenTofu, Pulumi, CloudFormation, Bicep.
|
|
12
|
+
- **CI/CD**: GitHub Actions, GitLab CI, CircleCI, Buildkite.
|
|
13
|
+
- **GitOps / Deploy**: Argo CD, Flux, Helm, Kustomize.
|
|
14
|
+
- **Containers / Orchestration**: Docker, Kubernetes, ECS/Fargate, Cloud Run.
|
|
15
|
+
- **Scalability**: Kubernetes HPA/VPA, KEDA, autoscaling groups, managed load balancers, CDN.
|
|
16
|
+
- **Downtime Strategy**: rolling deploys, blue-green, canary, dark launch, feature flags with LaunchDarkly, Unleash, or OpenFeature.
|
|
17
|
+
- **Observability**: OpenTelemetry for instrumentation; Prometheus/Grafana for metrics; Loki, ELK, or OpenSearch for logs; Tempo or Jaeger for traces; Datadog, New Relic, or Dynatrace when SaaS is preferred.
|
|
18
|
+
- **Alerting / On-Call**: Alertmanager, PagerDuty, Opsgenie, Grafana OnCall.
|
|
19
|
+
- **SLO / Error Budgets**: Nobl9, Sloth, Pyrra, Grafana SLO, Datadog SLO.
|
|
20
|
+
- **Infra Reporting / FinOps**: Kubecost, OpenCost, Infracost, cloud cost explorers, Grafana dashboards.
|
|
21
|
+
- **Security DevOps**: Trivy, Grype, Snyk, Dependabot, Renovate, Checkov, tfsec, Semgrep, CodeQL.
|
|
22
|
+
- **Secrets**: HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, GCP Secret Manager, SOPS with age.
|
|
23
|
+
- **Backups / DR**: Velero, cloud-native backups, database PITR, restore drills.
|
|
24
|
+
- **Performance / Load Testing**: k6, Artillery, Locust, JMeter.
|
|
25
|
+
- **Synthetic Monitoring**: Checkly, Grafana Cloud Synthetic Monitoring, Datadog Synthetics, Playwright scheduled checks.
|
|
26
|
+
|
|
27
|
+
## Operational Design Gates
|
|
28
|
+
- Every non-trivial system design must include scalability, downtime, observability, security, cost, and recovery considerations.
|
|
29
|
+
- Do not approve infrastructure or release changes without deployment, rollback, monitoring, and ownership details.
|
|
30
|
+
- Prefer managed services when they reduce operational risk without creating unacceptable lock-in or cost exposure.
|
|
31
|
+
- Record tool choices and major operational trade-offs in an ADR when they affect long-term operations.
|
|
32
|
+
|
|
33
|
+
## Scalability
|
|
34
|
+
- Define expected traffic, data volume, concurrency, growth assumptions, and bottlenecks.
|
|
35
|
+
- Prefer stateless compute, horizontal scaling, queue-based smoothing, caching, rate limits, and backpressure.
|
|
36
|
+
- Autoscaling rules must name metrics, thresholds, min/max capacity, cooldown behavior, and failure modes.
|
|
37
|
+
- High-traffic changes need load testing or a documented reason why it is not required.
|
|
38
|
+
|
|
39
|
+
## Downtime & Availability
|
|
40
|
+
- Choose a rollout strategy before release: rolling, canary, blue-green, dark launch, or feature-flagged rollout.
|
|
41
|
+
- Database and API changes must be backward-compatible where possible.
|
|
42
|
+
- Define RTO, RPO, degraded-mode behavior, and customer impact for critical services.
|
|
43
|
+
- Runbooks must explain rollback and forward-fix paths.
|
|
44
|
+
|
|
45
|
+
## Observability
|
|
46
|
+
- Instrument services with logs, metrics, and traces using OpenTelemetry where practical.
|
|
47
|
+
- Every production service needs dashboards for availability, latency, errors, saturation, and business-critical signals.
|
|
48
|
+
- Alerts must be actionable, owned, and tied to user impact or clear operational risk.
|
|
49
|
+
- Use correlation IDs or trace IDs to connect logs, traces, metrics, and user-reported issues.
|
|
50
|
+
|
|
51
|
+
## Reporting
|
|
52
|
+
- Infrastructure reporting must include cost, capacity, availability, error rate, latency, saturation, and deployment frequency where practical.
|
|
53
|
+
- Dashboards should separate executive/product health, engineering debugging, and on-call response views.
|
|
54
|
+
- Cost reporting must be tag-based and aligned to project, environment, owner, and major feature or service.
|
|
55
|
+
- Reliability reporting should include SLOs, error budget burn, incidents, MTTR, and recurring failure themes.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Minimum documentation updates required for code, product, and operations changes
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Documentation Standards
|
|
7
|
+
|
|
8
|
+
Documentation is part of delivery when behavior, operation, or integration changes. Keep it close to the thing it explains.
|
|
9
|
+
|
|
10
|
+
## Update Documentation When
|
|
11
|
+
- User-facing behavior, setup, configuration, API contracts, permissions, deployment, or operations change.
|
|
12
|
+
- A new workflow, feature flag, environment variable, dependency, migration, or integration is introduced.
|
|
13
|
+
- A bug fix changes expected behavior or removes a known limitation.
|
|
14
|
+
|
|
15
|
+
## Minimum Artifacts
|
|
16
|
+
- README or getting-started docs for setup, local development, and common commands.
|
|
17
|
+
- API docs or contract examples for request, response, error, and auth changes.
|
|
18
|
+
- Runbooks for operational tasks, incidents, migrations, rollback, and manual support procedures.
|
|
19
|
+
- ADRs for important architecture choices.
|
|
20
|
+
- Release notes for user-visible changes, breaking changes, migrations, and known risks.
|
|
21
|
+
|
|
22
|
+
## Quality Bar
|
|
23
|
+
- Documentation must be accurate, concise, and executable by someone who did not write the change.
|
|
24
|
+
- Include commands, environment variables, expected outputs, and troubleshooting notes when relevant.
|
|
25
|
+
- Do not duplicate source-of-truth configuration or type definitions in prose unless there is a sync check.
|
|
26
|
+
- Remove obsolete docs in the same change that makes them obsolete.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: DRY, naming, and clean code standards — stack-agnostic
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# DRY & Clean Code
|
|
7
|
+
|
|
8
|
+
## Don't Repeat Yourself
|
|
9
|
+
- **Single Source of Truth for data.** If a constant, type, or config exists in one place, every consumer must import or derive from it — never copy-paste.
|
|
10
|
+
- When two blocks share >5 lines of identical structure, extract a reusable function.
|
|
11
|
+
- Cross-package type sharing: define once, import at build time, or add a sync test. Never maintain parallel copies.
|
|
12
|
+
|
|
13
|
+
## Naming
|
|
14
|
+
- Names must reveal intent. `processData()` is vague — `validateOrderItems()` is clear.
|
|
15
|
+
- Booleans: prefix with `is`, `has`, `can`, `should` (e.g., `isValid`, `hasPermission`).
|
|
16
|
+
- Functions that return a value: name by what they return. Functions that perform actions: name by the action.
|
|
17
|
+
- No abbreviations except universally known ones (`id`, `url`, `db`, `config`).
|
|
18
|
+
|
|
19
|
+
## Magic Values
|
|
20
|
+
- No hardcoded timeouts, CLI commands, path segments, or error messages scattered in code. Define named constants at module scope or in a shared constants file.
|
|
21
|
+
- Repeated inline styles or CSS values must be extracted to variables or design tokens.
|
|
22
|
+
|
|
23
|
+
## Dead Code
|
|
24
|
+
- Never commit commented-out code, `console.log` debris, or unused imports. Delete them — git preserves history.
|
|
25
|
+
- Never commit `eslint-disable`, `@SuppressWarnings`, or `// @ts-ignore` without a linked issue explaining why.
|
|
26
|
+
|
|
27
|
+
## Comments
|
|
28
|
+
- Code should be self-documenting. Comments explain **why**, not **what**.
|
|
29
|
+
- Delete obvious comments: `// increment counter`, `// return result`, `// handle error`.
|
|
30
|
+
- Acceptable: non-obvious business rules, performance trade-offs, workarounds with linked tickets.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Error handling and observability standards — stack-agnostic
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Error Handling & Observability
|
|
7
|
+
|
|
8
|
+
## Never Swallow Errors
|
|
9
|
+
- Empty `catch {}` blocks are forbidden. At minimum: log the error, propagate it, or convert it to a user-friendly message.
|
|
10
|
+
- If an error is intentionally ignored, add a comment explaining why (e.g., `// best-effort: alias set failure doesn't block auth`).
|
|
11
|
+
|
|
12
|
+
## Error Types
|
|
13
|
+
- Distinguish **operational errors** (expected: bad input, network timeout, auth failure) from **programmer errors** (bugs: null reference, type mismatch).
|
|
14
|
+
- Operational errors: handle gracefully, inform the user, retry if appropriate.
|
|
15
|
+
- Programmer errors: crash fast, log with full context, fix the code.
|
|
16
|
+
|
|
17
|
+
## User-Facing Errors
|
|
18
|
+
- Never show stack traces, internal paths, or raw exception messages to users.
|
|
19
|
+
- Use localized strings (Custom Labels, i18n keys, constants) for all user-visible error messages. Never hardcode error text in the UI.
|
|
20
|
+
|
|
21
|
+
## Logging
|
|
22
|
+
- Before writing `try-catch`, scan for an existing logging framework in the project. Use it.
|
|
23
|
+
- Log at the right level: `error` for unexpected failures, `warn` for degraded behavior, `info` for significant events, `debug` for diagnostic detail.
|
|
24
|
+
- Include context in log entries: operation name, relevant IDs, duration. A log line like `"Error occurred"` is useless.
|
|
25
|
+
|
|
26
|
+
## Fail Fast
|
|
27
|
+
- Validate inputs at function entry (guard clauses), not deep in the call stack.
|
|
28
|
+
- Prefer early `return` or `throw` over deeply nested `if/else` chains.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Frontend architecture, state management, accessibility, and UI implementation standards
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Frontend Engineering
|
|
7
|
+
|
|
8
|
+
Frontend code must keep user experience, state, accessibility, and maintainability aligned.
|
|
9
|
+
|
|
10
|
+
## Architecture
|
|
11
|
+
- Separate presentation, state orchestration, data access, and domain logic.
|
|
12
|
+
- Keep components small and purpose-specific. Extract hooks, services, or view models when logic grows.
|
|
13
|
+
- Prefer existing design system components, tokens, and layout primitives over custom styling.
|
|
14
|
+
- Do not duplicate API types, validation schemas, or constants when they can be imported or generated.
|
|
15
|
+
|
|
16
|
+
## State
|
|
17
|
+
- Separate local UI state from server/cache state.
|
|
18
|
+
- Keep state ownership close to the component or workflow that owns it.
|
|
19
|
+
- Avoid global state for data that is route-local, form-local, or derivable.
|
|
20
|
+
- Model loading, empty, error, success, stale, and optimistic states explicitly.
|
|
21
|
+
|
|
22
|
+
## Forms
|
|
23
|
+
- Forms need labels, validation, helper text, disabled states, submission states, and recovery paths.
|
|
24
|
+
- Validate on the client for feedback and on the server for authority.
|
|
25
|
+
- Preserve user input when validation fails.
|
|
26
|
+
- Avoid destructive default actions and require confirmation for irreversible operations.
|
|
27
|
+
|
|
28
|
+
## Accessibility & Responsive
|
|
29
|
+
- Preserve semantic HTML, keyboard navigation, focus states, readable contrast, and screen reader labels.
|
|
30
|
+
- Test common mobile, tablet, and desktop widths for user-facing flows.
|
|
31
|
+
- Do not hide required information behind hover-only interactions.
|
|
32
|
+
- Use tooltips for clarification, not as the only way to complete a task.
|