Heuristics for analyzing a codebase to extract reliable, user-facing documentation.
This file contains technique checklists only—no tool instructions or invocations.
Find and analyze UI components and their interactionsStart from feature or route directories and enumerate components related to the requested topic.Differentiate container vs presentational components; note composition patterns.Trace inputs/outputs: props, state, context, events, and side effects.Record conditional rendering that affects user-visible states.Primary components and responsibilities.Props/state/context that change behavior.High-level dependency/composition map.Analyze styling and visual elementsIdentify design tokens and utility classes used to drive layout and state.Capture responsive behavior and breakpoint rules that materially change UX.Document visual affordances tied to state (loading, error, disabled).Key classes/selectors influencing layout/state.Responsive behavior summary and breakpoints.Map user interactions and navigation flows
Route definitions and navigation
Form submissions and validations
Button clicks and event handlers
State changes and UI updates
Loading and error states
Outline entry points and expected outcomes for each primary flow.Summarize validation rules and failure states the user can encounter.Record redirects and deep-link behavior relevant to the feature.Flow diagrams or bullet sequences for main tasks.Validation conditions and error messages.Navigation transitions and guards.Analyze how the system communicates with usersError messages and alertsSuccess notificationsLoading indicatorsTooltips and help textConfirmation dialogsProgress indicatorsMap message triggers to the user actions that cause them.Capture severity, persistence, and dismissal behavior.Note localization or accessibility considerations in messages.Catalog of messages with purpose and conditions.Loading/progress patterns and timeouts.Check for accessibility features and complianceARIA labels and rolesKeyboard navigation supportScreen reader compatibilityFocus managementColor contrast considerationsConfirm interactive elements have clear focus and labels.Describe keyboard-only navigation paths for core flows.Accessibility gaps affecting task completion.Analyze responsive design and mobile experienceBreakpoint definitionsMobile-specific componentsTouch event handlersViewport configurationsMedia queriesSummarize layout changes across breakpoints that alter workflow.Note touch targets and gestures required on mobile.Table of key differences per breakpoint.Understand feature entry points and control flowIdentify main functions, controllers, or route handlers.Trace execution and decision branches.Document input validation and preconditions.Entry points list and short purpose statements.Decision matrix or flow sketch.Extract API specifications from codeHTTP method and route pathPath/query parametersRequest/response schemasStatus codes and error bodiesSchema and input typesResolvers and return typesField arguments and constraintsMap dependencies and integration pointsImports and module boundariesPackage and runtime dependenciesExternal API/SDK usageDB connections and migrationsMessaging/queue/event streamsFilesystem or network side effectsDependency graph summary and hot spots.List of external integrations and auth methods.Extract data models, schemas, and type definitions- interfaces, types, classes, enums- Schema definitions, migration files, ORM models- JSON Schema, Joi/Yup/Zod schemas, validation decoratorsCanonical definitions and field constraints.Entity relationships and ownership.Identify and document business rulesComplex conditionalsCalculation functionsValidation rulesState machinesDomain-specific constants and algorithmsWhy the logic exists (business need)When the logic applies (conditions)What the logic does (transformation)Edge cases and invariantsImpact of changesDocument error handling and recovery
try/catch blocks and error boundaries
Custom error classes and codes
Logging, fallbacks, retries, circuit breakers
Error taxonomy and user-facing messages.Recovery/rollback strategies and timeouts.Identify security measures and vulnerabilitiesJWT, sessions, OAuth, API keysRBAC, permission checks, ownership validationEncryption, hashing, sensitive data handlingSanitization and injection preventionThreat surfaces and mitigations relevant to the feature.Identify performance factors and optimization opportunitiesExpensive loops/algorithmsDB query patterns (e.g., N+1)Caching strategiesConcurrency and async usageBatching and resource poolingMemory management and object lifetimesTime/space complexityDB query countsAPI response timesMemory usageConcurrency handlingAssess test coverage at a useful granularityFunction-level coverage and edge casesWorkflow coverage and contract boundariesEndpoint success/failure paths and schemasList of critical behaviors missing tests.Extract configuration options and their impacts.env files, config files, CLI args, feature flagsDefault values and valid rangesBehavioral impact of each optionDependencies between optionsSecurity implicationsMap user workflows through the featureIdentify entry points (UI, API, CLI)Trace user actions and decision pointsMap data transformationsIdentify outcomes and completion criteriaFlow diagrams, procedures, decision trees, state diagramsDocument integration with other systemsSync API calls, async messaging, events, batch processing, streamingProtocols, auth, error handling, data transforms, SLAsSummarize version constraints and compatibilitypackage manifests, READMEs, migration guides, breaking changes docsMinimum/recommended versions and notable constraints.Track deprecations and migrationsExplicit deprecation notices and TODO markersLegacy code paths and adaptersDeprecation date and removal timelineMigration path and alternativesPublic APIs documented with inputs/outputs and errorsExamples for complex featuresError scenarios covered with recovery guidanceConfig options explained with defaults and impactsSecurity considerations addressedCyclomatic complexityCode duplicationTest coverage and gapsDocumentation coverage for user-visible behaviorsKnown technical debt affecting UX