Skip to content

Add root agents.md with mandatory positive/negative/edge-case test guidance #44

@RudoiDmytro

Description

@RudoiDmytro

Summary

Add a root-level agents.md to the ui-toolkit repository and require AI agents to cover positive, negative, and edge cases whenever they write or update tests.

Why

  • ui-toolkit currently has useful AI-agent guidance in specs/planning-artifacts/architecture.md, including quality enforcement expectations, but that guidance is buried in a planning artifact instead of a root agent file.
  • The repo already has multiple testing layers (make test-unit, make test-e2e, make test-visual) plus Storybook-driven component workflows, so a root agent policy would remove ambiguity.
  • Component libraries are especially vulnerable to incomplete tests when agents only verify the primary state and skip disabled, error, empty, or boundary states.

Proposed Change

Create agents.md in the repository root and include a mandatory "test scenario coverage" section for AI agents. That section should require agents to:

  1. Choose the correct verification layer for the change:
    • unit
    • integration
    • e2e
    • visual regression
    • Storybook/state coverage where relevant
  2. Cover all applicable scenario classes whenever tests are added or updated:
    • positive / happy path
    • negative / invalid / failure path
    • boundary / edge cases
  3. Check component state matrices, not just the default render.
  4. Document a concrete "not applicable" reason for any omitted category.
  5. Run the relevant verification commands before marking work complete.

Minimum Scenario Matrix To Document

The new agents.md should explicitly require agents to think through:

  • default render / expected success state
  • disabled, loading, error, empty, and success variants
  • invalid props or unsupported combinations
  • boundary values for size, length, count, and layout constraints
  • keyboard and focus behavior for interactive components
  • accessibility expectations exposed through UI state changes
  • responsive and visual regression risk for reusable components
  • regression coverage for previously reported component bugs

Acceptance Criteria

  • A root agents.md exists in ui-toolkit.
  • It promotes the agent/testing rules from planning docs into a discoverable root instruction file.
  • It explicitly states that positive, negative, and edge-case coverage is mandatory when agents write or update tests.
  • It includes repo-specific verification commands for unit, e2e, and visual checks.
  • It requires an explicit reason whenever an agent skips an expected scenario class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions