pi-tool-discipline 0.1.4 → 0.1.5
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/extensions/index.ts +7 -12
- package/package.json +1 -1
package/extensions/index.ts
CHANGED
|
@@ -44,19 +44,14 @@ const BASH_GUIDELINES = [
|
|
|
44
44
|
const DISCIPLINE = `
|
|
45
45
|
## Tool Discipline (pi-tool-discipline)
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
Search tool priority:
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
- ffgrep/fffind work with absolute paths outside the workspace (separate index), and ffgrep supports regex, path and exclude filters. If a search seems to miss something, adjust its parameters (path, exclude, regex, caseSensitive) — do NOT fall back to bash \`grep\`/\`rg\`/\`find\`/\`ls\`.
|
|
56
|
-
- Read files with \`read\` (use \`offset\`/\`limit\` for large files); never use bash \`cat\`/\`head\`/\`tail\`/\`sed\` to read.
|
|
57
|
-
- Do NOT use the bash tool for \`grep\`/\`rg\`/\`find\`/\`ls\`/\`cat\`/\`sed\`/\`head\`/\`tail\`/\`which\` searches or file reads.
|
|
58
|
-
- Bash stays allowed only when dedicated tools cannot do the job: pipelines, git, npm, running programs, network requests, file mutations.
|
|
59
|
-
- If bash searching is truly unavoidable, prefer \`rg\` over \`grep\`.`;
|
|
49
|
+
1. ffgrep / fffind (from @ff-labs/pi-fff) — always preferred. They work with absolute paths outside the workspace and support regex / path / exclude filters.
|
|
50
|
+
2. If ffgrep/fffind cannot do the job, search with a dedicated grep/find TOOL and adjusted parameters (path, exclude, regex) — never with bash's grep or find.
|
|
51
|
+
3. Never run bash \`grep\` or \`find\`. Never use bash \`ls\`/\`cat\`/\`head\`/\`tail\`/\`sed\`/\`which\` directly for searching or reading — use ffgrep / fffind / read instead.
|
|
52
|
+
4. Read files with \`read\` (offset/limit for large files).
|
|
53
|
+
5. Bash stays allowed only when dedicated tools cannot do the job: pipelines, git, npm, running programs, network requests, file mutations.
|
|
54
|
+
6. If bash searching is truly unavoidable, use \`rg\` (never \`grep\`).`;
|
|
60
55
|
|
|
61
56
|
function stripBashGuidelines(prompt: string): string {
|
|
62
57
|
let out = prompt;
|
package/package.json
CHANGED