Reskil - #84
Closed
alvinunreal wants to merge 4 commits into
Closed
Conversation
Contributor
Greptile OverviewGreptile SummaryThis PR adds a new "Cartography" skill that enables AI agents to generate hierarchical codebase documentation. The implementation introduces a hash-based change detection system that tracks file modifications in Key Changes:
Implementation Details:
Issue Found:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Orchestrator
participant CartographyTool
participant CartographyScript
participant FileSystem
participant Explorer
User->>Orchestrator: Request codebase mapping
Orchestrator->>CartographyTool: cartography scan . --extensions ts,tsx
CartographyTool->>CartographyScript: Execute bun run scripts/cartography.ts scan
CartographyScript->>FileSystem: Read .gitignore and scan directories
FileSystem-->>CartographyScript: Return file list
CartographyScript-->>CartographyTool: Return JSON with files
CartographyTool-->>Orchestrator: Return scanned files
Orchestrator->>CartographyTool: cartography update src --extensions ts,tsx
CartographyTool->>CartographyScript: Execute update command
CartographyScript->>FileSystem: Read existing .codemap.json
CartographyScript->>FileSystem: Calculate MD5 hashes for files
FileSystem-->>CartographyScript: Return file contents
CartographyScript->>CartographyScript: Calculate folder hash
CartographyScript->>CartographyScript: Compare with existing hashes
CartographyScript->>FileSystem: Write updated .codemap.json
CartographyScript-->>CartographyTool: Return changedFiles list
CartographyTool-->>Orchestrator: Return update result
Orchestrator->>Explorer: Analyze changed files
Explorer->>FileSystem: Read source files
FileSystem-->>Explorer: Return file contents
Explorer->>FileSystem: Write/update codemap.md
Explorer-->>Orchestrator: Analysis complete
Orchestrator->>CartographyTool: cartography update src --extensions ts,tsx
CartographyTool->>CartographyScript: Refresh hashes after analysis
CartographyScript->>FileSystem: Update .codemap.json with new hashes
CartographyScript-->>CartographyTool: Confirm update
CartographyTool-->>Orchestrator: Complete
Orchestrator-->>User: Codebase mapping finished
|
| if (extList) { | ||
| extensions = extList | ||
| .split(',') | ||
| .map((e) => '.' + e.trim().replace(/^\./, '')); // 预先计算点号前缀 |
Contributor
There was a problem hiding this comment.
Redundant computation - the dot prefix is already added by the .map(), so .replace(/^\./, '') just removes what was added.
Suggested change
| .map((e) => '.' + e.trim().replace(/^\./, '')); // 预先计算点号前缀 | |
| .map((e) => (e.startsWith('.') ? e : '.' + e.trim())); |
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/cartography.ts
Line: 254:254
Comment:
Redundant computation - the dot prefix is already added by the `.map()`, so `.replace(/^\./, '')` just removes what was added.
```suggestion
.map((e) => (e.startsWith('.') ? e : '.' + e.trim()));
```
How can I resolve this? If you propose a fix, please make it concise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Changes