@hasna/terminal 1.4.0 → 1.5.0
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/dist/ai.js +21 -1
- package/package.json +1 -1
- package/src/ai.ts +21 -1
package/dist/ai.js
CHANGED
|
@@ -177,12 +177,32 @@ RULES:
|
|
|
177
177
|
- NEVER install packages (npx, npm install, pip install, brew install). This is a READ-ONLY terminal.
|
|
178
178
|
- NEVER modify source code (sed -i, codemod, awk with redirect). Only observe, never change.
|
|
179
179
|
- Search src/ directory, NOT dist/ or node_modules/ for code queries.
|
|
180
|
-
- For compound questions ("how many X and are they Y"), prefer ONE command that captures all info. Do NOT chain with &&.
|
|
181
180
|
- Use exact file paths from the project context below. Do NOT guess paths.
|
|
182
181
|
- For "what would break if I deleted X": use grep -rn "from.*X\\|import.*X\\|require.*X" src/ to find all importers.
|
|
183
182
|
- For "find where X is defined": use grep -rn "export.*function X\\|export.*class X\\|export.*const X" src/
|
|
184
183
|
- For "show me the code of function X": use grep -A 20 "function X" src/ to show the function body.
|
|
185
184
|
- For conceptual questions about what code does: use cat on the relevant file, the AI summary will explain it.
|
|
185
|
+
|
|
186
|
+
COMPOUND QUESTIONS: For questions asking multiple things, prefer ONE command that captures all info. Extract multiple answers from a single output.
|
|
187
|
+
- "how many tests and do they pass" → bun test (extract count AND pass/fail from output)
|
|
188
|
+
- "what files changed and how many lines" → git log --stat -3 (shows files AND line counts)
|
|
189
|
+
- "what version of node and bun" → node -v && bun -v (only use && for trivial non-failing commands)
|
|
190
|
+
NEVER split into separate test runs or expensive commands chained with &&.
|
|
191
|
+
|
|
192
|
+
BLOCKED ALTERNATIVES: If your preferred command would require installing packages (npx, npm install), ALWAYS try a READ-ONLY alternative:
|
|
193
|
+
- Code quality analysis → grep -rn "TODO\\|FIXME\\|HACK\\|XXX" src/
|
|
194
|
+
- Linting → check if "lint" or "typecheck" exists in package.json scripts, run that
|
|
195
|
+
- Security scan → grep -rn "eval\\|exec\\|spawn\\|password\\|secret" src/
|
|
196
|
+
- Dependency audit → cat package.json | grep -A 50 dependencies
|
|
197
|
+
- Test coverage → bun test --coverage (or npm run test:coverage if available)
|
|
198
|
+
NEVER give up. Always try a grep/find/cat read-only alternative.
|
|
199
|
+
|
|
200
|
+
SEMANTIC MAPPING: When the user references a concept, search the file tree for RELATED terms:
|
|
201
|
+
- Look at directory names: src/agent/ likely contains "agentic" code
|
|
202
|
+
- Look at file names: lazy-executor.ts likely handles "lazy mode"
|
|
203
|
+
- When uncertain: grep -rn "keyword" src/ --include="*.ts" -l (list matching files)
|
|
204
|
+
|
|
205
|
+
ACTION vs CONCEPTUAL: If the prompt starts with "run", "execute", "check", "test", "build", "show output of" — ALWAYS generate an executable command. NEVER read README for action requests. Only read docs for "explain why", "what does X mean", "how was X designed".
|
|
186
206
|
cwd: ${process.cwd()}
|
|
187
207
|
shell: zsh / macOS${projectContext}${restrictionBlock}${contextBlock}`;
|
|
188
208
|
}
|
package/package.json
CHANGED
package/src/ai.ts
CHANGED
|
@@ -212,12 +212,32 @@ RULES:
|
|
|
212
212
|
- NEVER install packages (npx, npm install, pip install, brew install). This is a READ-ONLY terminal.
|
|
213
213
|
- NEVER modify source code (sed -i, codemod, awk with redirect). Only observe, never change.
|
|
214
214
|
- Search src/ directory, NOT dist/ or node_modules/ for code queries.
|
|
215
|
-
- For compound questions ("how many X and are they Y"), prefer ONE command that captures all info. Do NOT chain with &&.
|
|
216
215
|
- Use exact file paths from the project context below. Do NOT guess paths.
|
|
217
216
|
- For "what would break if I deleted X": use grep -rn "from.*X\\|import.*X\\|require.*X" src/ to find all importers.
|
|
218
217
|
- For "find where X is defined": use grep -rn "export.*function X\\|export.*class X\\|export.*const X" src/
|
|
219
218
|
- For "show me the code of function X": use grep -A 20 "function X" src/ to show the function body.
|
|
220
219
|
- For conceptual questions about what code does: use cat on the relevant file, the AI summary will explain it.
|
|
220
|
+
|
|
221
|
+
COMPOUND QUESTIONS: For questions asking multiple things, prefer ONE command that captures all info. Extract multiple answers from a single output.
|
|
222
|
+
- "how many tests and do they pass" → bun test (extract count AND pass/fail from output)
|
|
223
|
+
- "what files changed and how many lines" → git log --stat -3 (shows files AND line counts)
|
|
224
|
+
- "what version of node and bun" → node -v && bun -v (only use && for trivial non-failing commands)
|
|
225
|
+
NEVER split into separate test runs or expensive commands chained with &&.
|
|
226
|
+
|
|
227
|
+
BLOCKED ALTERNATIVES: If your preferred command would require installing packages (npx, npm install), ALWAYS try a READ-ONLY alternative:
|
|
228
|
+
- Code quality analysis → grep -rn "TODO\\|FIXME\\|HACK\\|XXX" src/
|
|
229
|
+
- Linting → check if "lint" or "typecheck" exists in package.json scripts, run that
|
|
230
|
+
- Security scan → grep -rn "eval\\|exec\\|spawn\\|password\\|secret" src/
|
|
231
|
+
- Dependency audit → cat package.json | grep -A 50 dependencies
|
|
232
|
+
- Test coverage → bun test --coverage (or npm run test:coverage if available)
|
|
233
|
+
NEVER give up. Always try a grep/find/cat read-only alternative.
|
|
234
|
+
|
|
235
|
+
SEMANTIC MAPPING: When the user references a concept, search the file tree for RELATED terms:
|
|
236
|
+
- Look at directory names: src/agent/ likely contains "agentic" code
|
|
237
|
+
- Look at file names: lazy-executor.ts likely handles "lazy mode"
|
|
238
|
+
- When uncertain: grep -rn "keyword" src/ --include="*.ts" -l (list matching files)
|
|
239
|
+
|
|
240
|
+
ACTION vs CONCEPTUAL: If the prompt starts with "run", "execute", "check", "test", "build", "show output of" — ALWAYS generate an executable command. NEVER read README for action requests. Only read docs for "explain why", "what does X mean", "how was X designed".
|
|
221
241
|
cwd: ${process.cwd()}
|
|
222
242
|
shell: zsh / macOS${projectContext}${restrictionBlock}${contextBlock}`;
|
|
223
243
|
}
|