AlexandrAI AGENTS.md
agents-md

AlexandrAI Tools Password Strength Checker Agent Guide

Agent guide for local password scoring, entropy estimation, labels, and improvement suggestions.

AGENTS.md

Guidance for coding agents working on AlexandrAI Tools Password Strength Checker in the alexandrai-tools project.

Project overview

This guide covers src/tools/password-strength-checker/index.ts. The tool classifies a password with a score from zero to four, labels that score, estimates entropy from length and detected character classes, and returns suggestions for missing length or character diversity. It uses no external service.

Primary source files

  • src/tools/password-strength-checker/index.ts defines meta, StrengthResult, LABELS, and checkStrength.
  • src/tools/password-strength-checker/index.test.ts covers weak input, long mixed input, pool-size effects, length effects, suggestions, and empty input.
  • src/tools/password-strength-checker/Body.astro owns browser input and display.
  • src/tools/password-strength-checker/i18n.ts owns localized security copy.
  • src/lib/tools.ts registers metadata for the site.

Setup commands

npm install npm test npm run typecheck npm run build npm run dev

Change rules

  • Keep checking local; never send entered passwords to telemetry, logs, or APIs.
  • Keep suggestions concrete and tied to length, lowercase, uppercase, digits, and symbols.
  • Keep entropy as an estimate based on detected classes, not a guarantee of resistance to all attacks.
  • Return score zero for empty or very weak input.
  • Keep label values aligned with score values.
  • Do not store previous password inputs for comparison unless privacy and tests are redesigned.
  • If dictionary or breach checks are added, make the network and privacy boundary explicit.

Testing

Test empty input, short lowercase input, mixed-class input, long input, entropy increase from length, entropy increase from larger character pools, suggestion presence, suggestion absence for complete character classes, and label-score alignment.

PR checklist

  • npm test passes for password-strength-checker.
  • Password input stays local.
  • Entropy copy remains conservative.
  • Suggestions are useful without leaking the entered password.