or run

npx @tessl/cli init
Log in

Version

Files

tile.json

rubric.jsonevals/scenario-2/

{
  "context": "This criteria evaluates how well the engineer uses picocolors to handle environments where the process object may be missing. It focuses on proper defensive programming techniques including typeof checks, optional chaining, and proper fallback behavior when detecting color support.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Uses picocolors import",
      "description": "Imports picocolors package or uses require() to access picocolors functionality",
      "max_score": 10
    },
    {
      "name": "Uses isColorSupported property",
      "description": "Accesses the isColorSupported property from picocolors to detect color support capability in the environment",
      "max_score": 20
    },
    {
      "name": "Implements defensive checks",
      "description": "Uses typeof checks or optional chaining (e.g., typeof process !== 'undefined', process?.stdout) to safely access the process object without throwing errors in environments where it's missing",
      "max_score": 25
    },
    {
      "name": "Uses color formatter",
      "description": "Uses picocolors color formatting function (e.g., red(), green(), blue()) to apply ANSI color codes to text",
      "max_score": 15
    },
    {
      "name": "Conditional formatting",
      "description": "Implements conditional logic that applies color formatting when supported and returns plain text when not supported, avoiding ANSI codes in unsupported environments",
      "max_score": 20
    },
    {
      "name": "Handles edge cases",
      "description": "Properly handles edge cases such as process existing but process.stdout being undefined, or gracefully degrades when TTY is not available",
      "max_score": 10
    }
  ]
}