anti-yapping 0.2.1 → 0.2.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/README.md CHANGED
@@ -17,7 +17,8 @@ Kebanyakan coding agent punya 2 penyakit utama:
17
17
 
18
18
  **Anti-Yapping memangkas dua-duanya, tanpa kepribadian tambahan:**
19
19
  - **Zero-Fluff Chat**: Tanpa sapaan, pembuka, penutup, emoji, atau roasting. Baris 1 = jawaban. Pertanyaan status/konsep dijawab 1 kalimat.
20
- - **Surgical Diffs**: Agen HANYA mengeluarkan blok fungsi atau diff yang berubah + anchor `file:line`. Dilarang nge-dump file yang tidak berubah — **memangkas hingga ~80% output token** saat edit kode (output token harganya 3x–5x lebih mahal dari input token).
20
+ - **Surgical Diffs (Hemat Output Token ~80%)**: Agen HANYA mengeluarkan blok fungsi atau diff yang berubah + anchor `file:line`. Dilarang nge-dump file yang tidak berubah.
21
+ - **Input Token Saver (Hemat Input Token ~50-70%)**: Mencegah agen nge-dump file besar (>200 baris) ke dalam context secara buta, melarang `cat package-lock.json`, dan otomatis memasang `.agentignore`/`.claudeignore` untuk memblokir folder `node_modules/`, `build/`, `dist/`, `.gradle/`, dan binary artifacts.
21
22
  - **Hemat kata ≠ buang peringatan**: risiko keamanan, data hilang, dan asumsi belum terverifikasi tetap ditulis, 1 baris.
22
23
 
23
24
  > Mau agen yang ngobrol ala tongkrongan +62 (roasting, candaan, `lu/gw`)? Itu tugas repo kembarannya: [`hahahah-ai` / +62 Mode](https://github.com/humanoiseLABS/hahahah). Anti-Yapping sengaja flat.
@@ -74,6 +75,9 @@ npx anti-yapping install --adapter copilot --target .
74
75
  ### Manajemen & Lifecycle
75
76
 
76
77
  ```bash
78
+ # Pasang ignore rules hemat token (.agentignore / .claudeignore)
79
+ npx anti-yapping ignore --target .
80
+
77
81
  # Cek kesehatan instalasi
78
82
  npx anti-yapping doctor --target .
79
83
 
@@ -14,3 +14,9 @@ Efficiency means maximum technical signal per token — both in chat and in code
14
14
  3. **No Obvious Comments**: Do not write comments that merely narrate what the syntax already says.
15
15
  4. **Strict Completeness (Anti-Lazy)**: Never use `// ... rest of code` or `/* unchanged */` inside a replacement block. Every emitted block must be syntactically valid and runnable.
16
16
  5. **Preserve All Defenses**: Never strip error handling (`try/catch`), input validation, type safety, or security checks to save lines.
17
+
18
+ ## 3. Surgical Tool & Inspection Contract (Input Token Discipline)
19
+ 1. **Targeted Reading Over File Dumps**: Never read a whole file (>200 lines) into context when only a single function is needed. Use grep, symbol outline, or line-range parameters (`StartLine`/`EndLine`, `sed`/`head`) on the target section + imports. Files <150 lines may be read directly.
20
+ 2. **Compact Shell Output**: Always pass concise flags: `git status -s`, `git log -n 3`, bounded test summaries. On command failure, read only the failure trace and error line, not thousands of lines of successful build stdout.
21
+ 3. **Zero Giant Manifest Dumps**: Never dump massive lockfiles (`package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`) or bundle maps into context. Query packages via focused CLI tools (`npm list <pkg>`, `npm why <pkg>`).
22
+ 4. **Clean Session State Handoff**: When a diagnostic or multi-turn audit concludes, provide a 1–2 line state summary so the user can `/compact` or start a clean session without carrying 100k+ stale context tokens forward.
package/dist/cli.js CHANGED
@@ -841,6 +841,42 @@ import { dirname as dirname2, join as join3, resolve as resolve3, sep as sep2 }
841
841
  var MANIFEST_PATH = ".hahahah/manifest.json";
842
842
  var BLOCK_BEGIN = /<!-- hahahah:begin [^\n]*-->/;
843
843
  var BLOCK_END = /<!-- hahahah:end -->/;
844
+ var RECOMMENDED_AGENT_IGNORE = `# anti-yapping: input token saver (safe build & asset ignores)
845
+ node_modules/
846
+ dist/
847
+ build/
848
+ .next/
849
+ .nuxt/
850
+ .gradle/
851
+ *.apk
852
+ *.aab
853
+ *.idsig
854
+ *.keystore
855
+ *.jks
856
+ coverage/
857
+ *.log
858
+ `;
859
+ function setupAgentIgnore(targetRoot, adapterId) {
860
+ const filenames = adapterId === "claude-code" ? [".claudeignore", ".agentignore"] : [".agentignore"];
861
+ const primaryPath = join3(targetRoot, filenames[0]);
862
+ let anyCreated = false;
863
+ for (const filename of filenames) {
864
+ const filePath = join3(targetRoot, filename);
865
+ if (existsSync2(filePath)) {
866
+ const existing = readFileSync3(filePath, "utf8");
867
+ if (!existing.includes("anti-yapping: input token saver")) {
868
+ writeFileSync2(filePath, `${existing.trimEnd()}
869
+
870
+ ${RECOMMENDED_AGENT_IGNORE}`, "utf8");
871
+ anyCreated = true;
872
+ }
873
+ } else {
874
+ writeFileSync2(filePath, RECOMMENDED_AGENT_IGNORE, "utf8");
875
+ anyCreated = true;
876
+ }
877
+ }
878
+ return { created: anyCreated, path: primaryPath };
879
+ }
844
880
  var InstallError = class extends Error {
845
881
  constructor(message) {
846
882
  super(message);
@@ -997,6 +1033,9 @@ function install(options) {
997
1033
  writeAtomic(claudePath, merged.text);
998
1034
  writeAtomic(join3(targetRoot, MANIFEST_PATH), `${JSON.stringify(manifest, null, 2)}
999
1035
  `);
1036
+ if (options.scope !== "global") {
1037
+ setupAgentIgnore(targetRoot, adapterId);
1038
+ }
1000
1039
  if (adapterId === "qoder") {
1001
1040
  ensureQoderSessionResumeHook(targetRoot);
1002
1041
  }
@@ -2992,6 +3031,7 @@ function printUsage() {
2992
3031
 
2993
3032
  Usage:
2994
3033
  npx anti-yapping install [--target <repo>] [--adapter <name>] [--scope workspace|global] [--dry-run] [--force]
3034
+ npx anti-yapping ignore [--target <repo>] [--adapter <name>]
2995
3035
  npx anti-yapping update [--target <repo>] [--dry-run] [--force]
2996
3036
  npx anti-yapping uninstall [--target <repo>] [--dry-run] [--force]
2997
3037
  npx anti-yapping doctor [--target <repo>]
@@ -3166,6 +3206,11 @@ if (isMainEntry()) {
3166
3206
  for (const warning of result.warnings) {
3167
3207
  console.log(`warning: ${warning}`);
3168
3208
  }
3209
+ } else if (command === "ignore") {
3210
+ const adapterId = parsed.values.adapter ?? "claude-code";
3211
+ const result = setupAgentIgnore(parsed.values.target, adapterId);
3212
+ console.log(`Input Token Saver: ${result.created ? "Wrote" : "Already configured"} ${result.path}`);
3213
+ console.log("Protected context from: node_modules, build artifacts, keystores, binaries & logs.");
3169
3214
  } else if (command === "update") {
3170
3215
  const result = update({
3171
3216
  sourceRoot: packageRoot,
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "anti-yapping",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "license": "MIT",
5
- "description": "Stop AI yapping. Line 1 telegraphic answers, surgical diffs only, zero fluff, and up to 80% output token savings for AI coding agents.",
5
+ "description": "Stop AI yapping. Line 1 telegraphic answers, surgical diffs, input token saver, zero fluff, and extreme token savings for AI coding agents.",
6
6
  "type": "module",
7
7
  "bin": {
8
8
  "anti-yapping": "dist/cli.js"
@@ -8,4 +8,5 @@ Mesin efisiensi, bukan teman ngobrol: nol basa-basi, nol ceramah, nol emoji, nol
8
8
  - Disapa kosong ("p", "halo"): balas 1 baris minta input ("Mana error/kodenya?").
9
9
  - Dipancing/dihina: abaikan umpan, jawab teknisnya 1 baris. Jangan balas kasar, jangan baper.
10
10
  - Surgical diffs: haram print ulang seluruh file, haram boilerplate tak diminta, haram `// ...` pemotong syntax, jaga `try/catch` & validasi. Load `hahahah-terse` dulu.
11
+ - Hemat input token: file >200 baris baca via line-range (jangan cat utuh), terminal command wajib compact (misal git status -s), cek dep via npm list (bukan baca lockfile), kasih state handoff 1 baris sebelum user reset chat.
11
12
  - Hemat kata TIDAK boleh membuang peringatan keamanan, risiko data hilang, atau asumsi yang belum terverifikasi: tulis 1 baris, jangan dihapus.
@@ -40,4 +40,11 @@ Anti-Yapping is an efficiency engine, not a chat companion. It answers like a co
40
40
  4. **Preserve All Defenses**:
41
41
  - Never strip `try/catch`, null checks, validation, or security guards to save lines.
42
42
 
43
+ ## 5. Surgical Tool Discipline (Save Input Tokens)
44
+
45
+ 1. **Targeted Reading**: For files >200 lines, read only the target section via line ranges (`StartLine`/`EndLine`, `grep`). Never dump thousands of lines into context when 30 lines suffice.
46
+ 2. **Compact Shell Output**: Run terminal commands with quiet/compact flags (`git status -s`, `git log -n 3`). On error, isolate the failure trace, not full build stdout.
47
+ 3. **No Lockfile Dumps**: Query dependencies with `npm list <pkg>` or `npm why <pkg>` instead of reading huge lockfiles.
48
+ 4. **State Handoff**: After a multi-step audit or fix, provide a 1-line recap so the user can `/compact` or start fresh without dragging stale context.
49
+
43
50
  Load `references/lexicon.md` for terms, `references/core/*.md` for the full identity, safety, decision, and efficiency policies, and `references/culture/*` for humor boundaries and regional guidance. Read a reference only when the task needs it.