Complete SRC Documentation

Shared by a Kramon member · Other · 0 likes · 0 comments ·

Prompt

You are an expert software engineer and technical writer. Your task is to DOCUMENT the CODEBASE using clear, accurate, and maintainable COMMENTS. ⚠️ IMPORTANT: ONLY operate on files inside the `src/` directory. DO NOT read, modify, or comment on any files outside `src/` (e.g., config, build, public, scripts, tests, or root files). DO NOT change functionality, logic, formatting, or file structure. ONLY add comments. General Rules: - Scope is STRICTLY limited to `src/`. - Do NOT refactor, rename variables, or reorder code. - Do NOT remove or add logic. - Do NOT add TODOs unless the code already implies missing behavior. - Comments must reflect what the code ACTUALLY does, not what it “should” do. - If intent is unclear, document observable behavior only. Commenting Style: - Use concise, professional, developer-grade comments. - Prefer explanatory comments over obvious ones. - Avoid narrating syntax (e.g., “this is a loop”). - Explain *why* something exists when possible; otherwise explain *what* it does. - Keep comment tone and structure consistent across all files. What to Document: 1. File-Level (Top of Each File in `src/`) - Purpose of the file - Responsibility within the application - Key dependencies or integrations (APIs, DBs, browser APIs, libraries) 2. Imports - Comment only non-obvious or critical imports - Explain side-effect imports or configuration-only imports 3. Functions / Methods - Purpose of the function - Parameters (what they represent) - Return value and side effects - Important assumptions or constraints 4. Components (React / UI) - What the component renders - State it manages - Props that affect behavior - Effects, subscriptions, and cleanup logic 5. State & Variables - Complex state objects - Derived or computed state - Magic numbers, constants, or hardcoded values 6. Logic Blocks - Business logic conditionals - Data transformations (map, filter, reduce) - Async flows (API calls, retries, error handling) - Security-sensitive logic (auth, tokens, validation) 7. External Interactions - API calls (endpoint intent and payload purpose) - Database access (what data is read/written and why) - Browser APIs (IndexedDB, Media APIs, Storage, etc.) 8. Error Handling - Expected failure cases - How errors are handled or surfaced 9. Performance or Edge Cases - Memoization, debouncing, throttling - Caching strategies - Explicit edge-case handling Output Requirements: - Add comments directly above or beside the relevant code. - Use the correct comment syntax for the language in each file. - Keep comments readable and non-redundant. - The final result should allow a new developer to understand the entire `src/` directory without external documentation. Proceed file by file, but STOP once all files in `src/` are fully documented.

Browse more AI prompts · More other prompts