docs: Add comprehensive JSDoc documentation for core tools #3604
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
This PR adds comprehensive JSDoc documentation for two core tools in KiloCode to improve developer experience and code maintainability:
readFileTool.ts: Enhanced with detailed JSDoc comments explaining the file reading functionality, parameters, return values, and usage examplesexecuteCommandTool.ts: Enhanced with detailed JSDoc documentation for command execution, error handling, and terminal integrationWhy: The existing core tools lacked proper documentation, making it difficult for new developers to understand their functionality, parameters, and usage patterns. This improvement follows JSDoc standards and provides comprehensive examples.
Implementation
Changes Made
readFileTool.ts:
getReadFileToolDescription()functionLineRange,FileEntry,FileResult)readFileTool()function with:executeCommandTool.ts:
ShellIntegrationErrorclassexecuteCommandTool()function with:ExecuteCommandOptionstypeexecuteCommand()function with detailed examplesDocumentation Standards
@param,@returns,@example)Screenshots
No screenshots applicable - this is a documentation-only change.
How to Test
IDE Integration Test:
TypeScript Compilation Test:
cd kilocode pnpm check-typesDocumentation Generation Test:
# If using JSDoc documentation generator npx jsdoc src/core/tools/readFileTool.ts src/core/tools/executeCommandTool.tsCode Review Test:
Get in Touch
Discord: Phosphate5429
Changeset: This PR includes a changeset (
patchlevel) for proper versioning.