RachnaSutra AI GitHub

Functional specification

Purpose and scope#

This document states what RachnaSutra AI does from a user's point of view, which requirements are met in version 0.1.0, and how each is verified.

In scope (0.2.0): static analysis of web front-end source; report generation; fix planning and verification against a baseline; installation of Agent Skills into AI IDE projects; CI gating.

Out of scope (0.2.0): rendering, screenshots, browser automation, axe-core, Lighthouse, native mobile and TV runtime testing, model-backed inference from the CLI.

Users and personas#

These personas are assumed, not the result of user research.

PersonaGoalMain entry point
Frontend developerFind and fix UI defects quicklyrachnasutra audit, skills in the IDE
DesignerUnderstand hierarchy, tokens, consistencydesign-system inspect, vision and tokens skills
Accessibility specialistGet evidence for manual follow-upaccessibility, access skill, WCAG checklist
Engineering leadGate releases and track regressionsci, verify --report
Open-source contributorAdd rules, skills, adaptersMaintainer handbook

Functional requirements#

IDRequirementStatusVerified by
FR-01Scan HTML, JSX, TSX, Vue, Svelte, Astro and CSS/SCSS/LESS files under a pathimplementedbroken fixture test, JSX test
FR-02Apply 26 deterministic rules and emit findings with id, rule, severity, confidence, status, file, line, evidence, criterion, impact, fix, verification, limitationsimplementedschema validation in tests
FR-03Measure text contrast from literal colour pairs and compare with 4.5:1 (3:1 for large text)implementedcontrast tests
FR-04Never claim unrun checks passed; show coverage statesimplementedcoverage test
FR-05Output JSON, Markdown, accessible HTML and SARIF 2.1.0implementedreport tests, SARIF test
FR-06Honour rachnasutra.config.json (exclude, disableRules, failOn, maxFiles, imageBudgetKb)implementedconfig test
FR-07Produce an ordered fix plan from a saved report without editing filesimplementedCLI test
FR-08Re-audit and compare with a baseline by fingerprint (resolved, remaining, introduced)implementedfix verification test
FR-09Token inventory: custom properties, colours, font sizes, spacing, radiiimplementedCLI transcript
FR-10Install, uninstall and dry-run skills for five hosts with hash tracking and conflict handlingimplementedinstall tests
FR-11Run a browser audit when Playwright is installed. Exit 3 with no invented result when it is notimplementedCLI test
FR-12Stable exit codes for CIimplementedCLI test
FR-13Run the default audit offline with no model and no API keyimplementeddefault audit does not open a network connection. Browser mode uses localhost only
FR-14Thirteen skills with required sections and valid frontmatterimplementedrachnasutra verify
FR-15Browser audit with a screenshot and axe-coreimplemented when Playwright is installedkeyboard and screen-reader paths stay manual

Non-functional requirements#

IDRequirementHow it is met
NFR-01PrivacyNo network, telemetry or model calls; secret redaction in excerpts
NFR-02SafetyAudited files are never modified; writes only report files, install and uninstall; path containment
NFR-03DeterminismRules are pure functions of file contents; output is sorted; test asserts identical results across runs
NFR-04PortabilityNode.js 20 or newer; no shell dependencies; CI matrix for Windows, macOS, Linux
NFR-05Resource boundsLimits on file count, file size and time; truncation is reported
NFR-06Accessibility of the reportHTML report uses semantic tables, captions, scoped headers, focus styles, light and dark themes
NFR-07HonestyDocumented limitations in every report; no numeric score
NFR-08MaintainabilityZero runtime dependencies; rules in one module with a catalogue

User journeys#

Journey 1: first audit#

  1. The developer runs rachnasutra audit ..
  2. The tool prints a summary: counts by severity and a list of findings with locations.
  3. The tool has already written Markdown, HTML and JSON reports to ./rachnasutra-reports; the developer opens latest.html.
  4. The developer picks a finding, reads the evidence and fix, and edits the code.

Journey 2: fix and verify#

  1. Save a baseline: rachnasutra audit . (writes rachnasutra-reports/latest.json).
  2. Fix issues in code.
  3. Run rachnasutra verify --report rachnasutra-reports/latest.json ..
  4. The tool lists resolved, remaining and introduced findings. It exits with code 4 if new findings appeared.

Journey 3: AI-assisted review in an IDE#

  1. The developer installs skills: rachnasutra skills install --host claude --target ..
  2. The developer asks the assistant to use rachnasutra-prime.
  3. Prime detects capabilities, runs the CLI if present, selects specialists, and proposes a plan.
  4. The developer approves; rachnasutra-canvas makes minimal edits; rachnasutra-verify re-checks.

Journey 4: CI gate#

  1. The pipeline runs rachnasutra ci . with a threshold.
  2. Confirmed critical or high findings fail the build (exit code 1).
  3. SARIF output can be uploaded to code scanning.

Report content requirements#

Each finding has: ID (RS-0001 style), rule ID, category, title, severity, confidence, status, platform, file, line, evidence (with redacted excerpt), WCAG criterion where relevant, user impact, recommended fix, verification step, limitations and a fingerprint. Each report has: tool and version, timestamp, mode, files scanned, skipped counts, truncation flag, coverage table, token inventory and limitations. The machine-readable contract is schemas/report.schema.json.

Behavioural rules#

RuleBehaviour
Missing evidenceReported as not-run or unknown, never as a pass
Heuristic signalConfidence below high, status review-required
Gate defaultsci fails only on confirmed high or critical findings unless --fail-on is given
Unknown command or flag valueExit code 2 with a message
Capability not implementedExit code 3 with a message; no partial result
Install conflictBlocked unless --force; original is backed up

Acceptance criteria (met in 0.1.0, still met in 0.2.0)#

CriterionResult
Clean install works without an API keyMet: no runtime dependencies, no key code
doctor states what is available and unavailableMet: static audit can pass or fail. Browser and visual print NOTE because doctor does not launch a browser
Static audit on a flawed fixture is deterministic and evidencedMet: 22 findings, identical across runs
JSON, Markdown, HTML reports validate and show coverageMet: JSON validated against the contract in tests; coverage in every format
Generated skill files are validMet: 13 of 13 pass verify
No source changes or network use in default modeMet: test asserts files unchanged and no reports directory created
Unit, integration and security tests passMet: 152 of 152 on the recorded run
README, contributor docs, security policy, licence presentMet
Accurate creator attribution, no fake endorsementsMet
One example reproduces a finding and its fix verificationMet: fix verification test and user guide journey 2