feat(deslop): improve agent prompts and token efficiency - #117
Conversation
- Rewrite deslop-work.md with explicit tool instructions instead of pseudo-JavaScript that agents can't execute - Add compact format option to formatHandoffPrompt() for ~60% token reduction - Document three deslop modes (diff, path-based, codebase) - Update deslop-around.md to reference pattern library instead of duplicating pattern definitions (reduces documentation drift) Changes: - deslop-work.md: Mode A (diff) scope clarified, explicit tool calls - pipeline.js: Added formatCompactPrompt() with table format - deslop-around.md: Mode selection docs, pattern lib reference
- Test table structure formatting - Test certainty counts in header (H:x|M:y|L:z) - Test abbreviated certainty levels (H, M, L) - Test dash for non-fixable patterns - Test truncation with maxFindings limit - Test auto-fixable summary - Test empty findings handling - Test mode in header (report/apply) - Test compact option in formatHandoffPrompt
- Replace `git add -A` with specific file staging to avoid accidentally staging sensitive files - Clarify Edit tool usage for line removal with concrete example showing newline handling
Summary of ChangesHello @avifenesh, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces several great improvements for the deslop command and agents. The new compact prompt format is a smart way to improve token efficiency, and the comprehensive tests for it are well-written. The refactoring of agent prompts to use explicit tool instructions and syncing documentation with the pattern library are excellent changes for maintainability and clarity. The logic for language-aware tool detection is also a solid enhancement. I have one suggestion to improve the efficiency of the new formatCompactPrompt function by reducing the number of iterations over the findings array.
Missing CHANGELOG.md UpdateThis PR introduces significant user-facing changes but doesn't include a CHANGELOG.md update, which violates the project's documented standards. CLAUDE.md Requirement:
Changes in this PR that should be documented:
Suggested CHANGELOG.md entry: ## [Unreleased]
### Added
- `formatCompactPrompt()` function for ~60% token reduction in deslop findings (#117)
### Changed
- Rewrote `deslop-work.md` agent to use explicit tool instructions instead of pseudo-code (#117)
- Updated `deslop-around.md` documentation to reference canonical pattern library (#117)
- Added language detection for language-aware CLI tool recommendations (#117)
### Fixed
- Agent prompt clarity issues identified in QA review (#107) |
Use reduce instead of multiple filter calls for better performance when processing large finding sets. Addresses Gemini code review feedback on PR #117.
|
Addressed @gemini-code-assist feedback: refactored formatCompactPrompt to use a single reduce pass instead of 4 separate filter calls. Commit b0f350b. |
|
Thanks, @avifenesh! I appreciate you addressing the feedback and refactoring |
There was a problem hiding this comment.
Pull request overview
This PR improves the deslop tooling with token efficiency optimizations and clearer agent instructions. The changes enhance the slop detection pipeline with a compact reporting format and refactor agent documentation to use explicit, executable tool instructions rather than pseudo-code.
Changes:
- Added
formatCompactPrompt()function achieving ~60% token reduction via table format for large finding sets - Rewrote
deslop-work.mdagent to use explicit Bash/Read/Grep/Edit tool calls instead of non-executable JavaScript examples - Enhanced language detection to recommend only relevant CLI tools based on detected project languages
- Clarified three deslop modes: Mode A (diff-based via deslop-work), Mode B (path-based via deslop-around), Mode C (codebase-wide via deslop-around)
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
lib/patterns/pipeline.js |
Added formatCompactPrompt function and updated formatHandoffPrompt signature with options parameter |
plugins/*/lib/patterns/pipeline.js |
Synced formatCompactPrompt across all plugin copies; added language-aware tool detection |
plugins/next-task/agents/deslop-work.md |
Complete rewrite with explicit tool instructions, removed pseudo-JavaScript code |
plugins/deslop-around/commands/deslop-around.md |
Added mode documentation and reference to canonical pattern library |
__tests__/pipeline.test.js |
Comprehensive test coverage for compact format including edge cases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Summary
Improve deslop command and agents based on QA review findings:
deslop-work.mdnow uses explicit Bash/Read/Grep/Edit tool calls instead of pseudo-code that agents couldn't executeformatCompactPrompt()achieves ~60% token reduction via table formatdeslop-around.mdnow references canonicalslop-patterns.jsinstead of duplicating patternsChanges
plugins/next-task/agents/deslop-work.mdlib/patterns/pipeline.jsformatCompactPrompt()functionplugins/deslop-around/commands/deslop-around.md__tests__/pipeline.test.jslib/dirsTest Plan
npm testexit code 0)Related Issues
Closes QA findings from #107 review