Techniques for analyzing code to extract documentation.
Find and analyze UI components and their interactions
Search for UI component files
src
\.(tsx|jsx|vue)$|@Component|export.*component
*.tsx
src
]]>
Analyze styling and visual elements
src/styles
true
src
className=|style=|styled\.|makeStyles|@apply
]]>
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
src
Route.*path=|router\.push|navigate\(|Link.*to=
src
onClick=|onSubmit=|onChange=|handleClick|handleSubmit
src
validate|validation|required|pattern=|minLength|maxLength
]]>
Analyze how the system communicates with users
Error messages and alerts
Success notifications
Loading indicators
Tooltips and help text
Confirmation dialogs
Progress indicators
src
toast|notification|alert|message|error.*message|success.*message
src
loading|isLoading|pending|spinner|skeleton|placeholder
src
modal|dialog|confirm|popup|overlay
]]>
Check for accessibility features and compliance
ARIA labels and roles
Keyboard navigation support
Screen reader compatibility
Focus management
Color contrast considerations
src
aria-|role=|tabIndex|alt=|title=|accessibilityLabel
src
focus\(|blur\(|onFocus|onBlur|autoFocus|focusable
]]>
Analyze responsive design and mobile experience
Breakpoint definitions
Mobile-specific components
Touch event handlers
Viewport configurations
Media queries
src
@media|breakpoint|mobile|tablet|desktop|responsive
src
onTouch|swipe|gesture|tap|press
]]>
Use semantic search to find conceptually related code when available.
Finding code by concept rather than keywords
Discovering implementations across different naming conventions
When pattern-based search isn't finding expected results
user authentication login security JWT token validation
payment processing transaction billing invoice checkout
]]>
This is an optional tool - use when semantic understanding would help find related code that keyword search might miss
Analyze entry points to understand feature flow.
Find main functions, controllers, or route handlers.
Trace execution flow.
Map decision branches.
Document input validation.
Start by exploring directory structure
src
false
src/controllers
true
]]>
Search for specific patterns
src
(app\.(get|post|put|delete)|@(Get|Post|Put|Delete)|router\.(get|post|put|delete))
]]>
Read known entry points directly
src/app.ts
src/controllers/feature.controller.ts
]]>
Use semantic search as an alternative discovery method
main entry point application startup initialization bootstrap
]]>
Extract API specifications from code.
- HTTP method
- Route path
- Path/query parameters
- Request/response schemas
- Status codes
- Schema and input types
- Resolvers
- Return types
- Field arguments
Map dependencies and integration points.
Import/require statements
package.json dependencies
External API calls
DB connections
Message queue integrations
Filesystem operations
Start with package.json to understand dependencies
package.json
]]>
Follow import chains to map dependencies
src
^import\s+.*from\s+['"]([^'"]+)['"]|require\s*\(\s*['"]([^'"]+)['"]\s*\)
]]>
Find external API integrations
src
(fetch|axios|http\.request|request\(|\.get\(|\.post\()
]]>
Extract data models, schemas, and type definitions.
- interfaces, types, classes, enums
- Schema definitions, migration files, ORM models
- JSON Schema, Joi/Yup/Zod schemas, validation decorators
src
^export\s+(interface|type|class|enum)\s+(\w+)
src/models
@(Entity|Table|Model)|class\s+\w+\s+extends\s+(Model|BaseEntity)
]]>
Identify and document business rules.
Complex conditionals
Calculation functions
Validation rules
State machines
Domain-specific constants and algorithms
Why logic exists (business need)
When logic applies (conditions)
What logic does (transformation)
Edge cases
Impact of changes
Document error handling and recovery.
try/catch blocks, error boundaries
Custom error classes
Error codes and messages
Logging, fallbacks, retries, circuit breakers
src
try\s*{|catch\s*\(|throw\s+new|class\s+\w*Error\s+extends
src
ERROR_|_ERROR|ErrorCode|errorCode
]]>
Identify security measures and vulnerabilities.
- JWT, sessions, OAuth, API keys
- RBAC, permission checks, ownership validation
- Encryption, hashing, sensitive data handling
- Sanitization, SQLi/XSS/CSRF prevention
Identify performance factors and optimization opportunities.
DB query patterns (N+1)
Caching strategies
Async usage
Batch processing
Resource pooling
Memory management
Algorithm complexity
Time/space complexity
DB query counts
API response times
Memory usage
Concurrency handling
Analyze test coverage.
__tests__, *.test.ts, *.spec.ts
Function coverage
integration/, e2e/
Workflow coverage
api-tests/, *.api.test.ts
Endpoint coverage
src
\.(test|spec)\.(ts|js|tsx|jsx)$
*.test.ts
src
(describe|it|test)\s*\(\s*['"`]([^'"`]+)['"`]
]]>
Extract configuration options and their impacts.
.env files, config files, CLI args, feature flags
Default values
Valid values
Behavior impact
Config dependencies
Security implications
Map user workflows through the feature.
Identify entry points (UI, API, CLI).
Trace user actions.
Document decision points.
Map data transformations.
Identify outcomes.
Flow diagrams, procedures, decision trees, state diagrams.
Document integration with other systems.
Sync API calls, async messaging, events, batch processing, streaming.
Protocols, auth, error handling, data transforms, SLAs.
package.json, READMEs, migration guides, breaking changes docs.
.
"engines":|"peerDependencies":|requires?\s+\w+\s+version|compatible\s+with
]]>
@deprecated, TODO comments, legacy code markers.
Deprecation date, removal timeline, migration path, alternatives.
Public APIs documented.
Examples for complex features.
Error scenarios covered.
Config options explained.
Security addressed.
Cyclomatic complexity, code duplication, test coverage, doc coverage, tech debt.