pi-lens 3.6.1 → 3.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/index.ts +14 -13
- package/package.json +1 -1
- package/skills/ast-grep/SKILL.md +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to pi-lens will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [3.6.1] - 2026-04-02
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **Condensed skill auto-loading** — Injects 70-token tool selection guidance at session start:
|
|
9
|
+
- Quick reference for when to use lsp_navigation vs ast_grep_search vs grep
|
|
10
|
+
- References full skills for lazy loading (ast-grep, lsp-navigation)
|
|
11
|
+
- Prevents common tool selection errors without loading full skill content
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
- **Updated package description** — More concise: "Real-time code feedback for pi — LSP, linters, formatters, type-checking, structural analysis & booboo"
|
|
15
|
+
|
|
16
|
+
### Repository
|
|
17
|
+
- **AGENTS.md is now local-only** — Removed from git repo and added to `.gitignore` so it stays local to each developer's environment
|
|
18
|
+
- **Cleaned up debug files** — Removed old test files (`_debug-*.ts`, `_trigger-test.ts`, `_test-*.ts`) from repo
|
|
19
|
+
|
|
5
20
|
## [3.6.0] - 2026-04-02
|
|
6
21
|
|
|
7
22
|
### Added
|
package/index.ts
CHANGED
|
@@ -944,6 +944,11 @@ export default function (pi: ExtensionAPI) {
|
|
|
944
944
|
log(`Active tools: ${tools.join(", ")}`);
|
|
945
945
|
dbg(`session_start tools: ${tools.join(", ")}`);
|
|
946
946
|
|
|
947
|
+
// --- Condensed skill guidance for efficient tool selection ---
|
|
948
|
+
// Full skills available at skills/ast-grep/SKILL.md and skills/lsp-navigation/SKILL.md
|
|
949
|
+
const condensedGuidance =
|
|
950
|
+
"## Code Tool Selection\n- Navigation (definitions, references): lsp_navigation\n- Pattern search (functions, imports): ast_grep_search\n- Text/TODOs: grep\n- Full guides: skills/ast-grep, skills/lsp-navigation";
|
|
951
|
+
|
|
947
952
|
const parts: string[] = [];
|
|
948
953
|
|
|
949
954
|
// --- Error ownership reminder ---
|
|
@@ -952,6 +957,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
952
957
|
"📌 Remember: If you find ANY errors (test failures, compile errors, lint issues) in this codebase, fix them — even if you didn't cause them. Don't skip errors as 'not my fault'.",
|
|
953
958
|
);
|
|
954
959
|
|
|
960
|
+
// Add condensed skill guidance to system message
|
|
961
|
+
parts.push(condensedGuidance);
|
|
962
|
+
|
|
955
963
|
// Scan for project-specific rules (.claude/rules, .agents/rules, CLAUDE.md, etc.)
|
|
956
964
|
projectRulesScan = scanProjectRules(cwd);
|
|
957
965
|
if (projectRulesScan.hasCustomRules) {
|
|
@@ -969,13 +977,12 @@ export default function (pi: ExtensionAPI) {
|
|
|
969
977
|
dbg("session_start: no project rules found");
|
|
970
978
|
}
|
|
971
979
|
|
|
972
|
-
// TODO/FIXME scan — fast, no deps
|
|
980
|
+
// TODO/FIXME scan — fast, no deps (cached for on-demand reporting)
|
|
973
981
|
const todoResult = todoScanner.scanDirectory(cwd);
|
|
974
|
-
const todoReport = todoScanner.formatResult(todoResult);
|
|
975
982
|
dbg(`session_start TODO scan: ${todoResult.items.length} items`);
|
|
976
|
-
|
|
983
|
+
// Note: TODOs not shown at session start — use /lens-booboo to see them
|
|
977
984
|
|
|
978
|
-
// Dead code scan — use cache if fresh, auto-install if needed
|
|
985
|
+
// Dead code scan — use cache if fresh, auto-install if needed (cached for on-demand reporting)
|
|
979
986
|
if (await knipClient.ensureAvailable()) {
|
|
980
987
|
const cached = cacheManager.readCache<
|
|
981
988
|
ReturnType<KnipClient["analyze"]>
|
|
@@ -984,23 +991,20 @@ export default function (pi: ExtensionAPI) {
|
|
|
984
991
|
dbg(
|
|
985
992
|
`session_start Knip: cache hit (${Math.round((Date.now() - new Date(cached.meta.timestamp).getTime()) / 1000)}s ago)`,
|
|
986
993
|
);
|
|
987
|
-
const knipReport = knipClient.formatResult(cached.data);
|
|
988
|
-
if (knipReport) parts.push(knipReport);
|
|
989
994
|
} else {
|
|
990
995
|
const startMs = Date.now();
|
|
991
996
|
const knipResult = knipClient.analyze(cwd);
|
|
992
997
|
cacheManager.writeCache("knip", knipResult, cwd, {
|
|
993
998
|
scanDurationMs: Date.now() - startMs,
|
|
994
999
|
});
|
|
995
|
-
const knipReport = knipClient.formatResult(knipResult);
|
|
996
1000
|
dbg(`session_start Knip scan done`);
|
|
997
|
-
if (knipReport) parts.push(knipReport);
|
|
998
1001
|
}
|
|
999
1002
|
} else {
|
|
1000
1003
|
dbg(`session_start Knip: not available`);
|
|
1001
1004
|
}
|
|
1005
|
+
// Note: Knip results not shown at session start — use /lens-booboo to see dead code
|
|
1002
1006
|
|
|
1003
|
-
// Duplicate code detection — use cache if fresh, auto-install if needed
|
|
1007
|
+
// Duplicate code detection — use cache if fresh, auto-install if needed (cached for on-demand reporting)
|
|
1004
1008
|
if (await jscpdClient.ensureAvailable()) {
|
|
1005
1009
|
const cached = cacheManager.readCache<ReturnType<JscpdClient["scan"]>>(
|
|
1006
1010
|
"jscpd",
|
|
@@ -1009,8 +1013,6 @@ export default function (pi: ExtensionAPI) {
|
|
|
1009
1013
|
if (cached) {
|
|
1010
1014
|
dbg(`session_start jscpd: cache hit`);
|
|
1011
1015
|
_cachedJscpdClones = cached.data.clones;
|
|
1012
|
-
const jscpdReport = jscpdClient.formatResult(cached.data);
|
|
1013
|
-
if (jscpdReport) parts.push(jscpdReport);
|
|
1014
1016
|
} else {
|
|
1015
1017
|
const startMs = Date.now();
|
|
1016
1018
|
const jscpdResult = jscpdClient.scan(cwd);
|
|
@@ -1018,13 +1020,12 @@ export default function (pi: ExtensionAPI) {
|
|
|
1018
1020
|
cacheManager.writeCache("jscpd", jscpdResult, cwd, {
|
|
1019
1021
|
scanDurationMs: Date.now() - startMs,
|
|
1020
1022
|
});
|
|
1021
|
-
const jscpdReport = jscpdClient.formatResult(jscpdResult);
|
|
1022
1023
|
dbg(`session_start jscpd scan done`);
|
|
1023
|
-
if (jscpdReport) parts.push(jscpdReport);
|
|
1024
1024
|
}
|
|
1025
1025
|
} else {
|
|
1026
1026
|
dbg(`session_start jscpd: not available`);
|
|
1027
1027
|
}
|
|
1028
|
+
// Note: jscpd results not shown at session start — use /lens-booboo to see duplicates
|
|
1028
1029
|
|
|
1029
1030
|
// Note: type-coverage runs on-demand via /lens-booboo only (not at session_start)
|
|
1030
1031
|
|
package/package.json
CHANGED
package/skills/ast-grep/SKILL.md
CHANGED
|
@@ -143,6 +143,12 @@ pattern: "console.log($$$ARGS)"
|
|
|
143
143
|
|
|
144
144
|
**Error: "Multiple AST nodes detected"** → Your pattern has multiple code fragments. Use metavariables like `$TEST` instead of literal text in quotes.
|
|
145
145
|
|
|
146
|
+
**No matches found?** → Debug efficiently (don't `read` large files):
|
|
147
|
+
1. Use `ast_grep_search` with same pattern to preview matches - costs same as `read` for small result sets
|
|
148
|
+
2. Simplify pattern: remove constraints, test basic match first
|
|
149
|
+
3. Check metavariables capture what you expect (`$PARAM` = whole parameter including name and type)
|
|
150
|
+
4. Ensure quotes/parentheses balance in pattern
|
|
151
|
+
|
|
146
152
|
**Fallback:** If pattern fails twice → `grep -rn "pattern" src/`
|
|
147
153
|
|
|
148
154
|
**Debug:** https://ast-grep.github.io/playground.html
|