aiwaku.nvim lua.instructions.md

Instructions for juhaku/aiwaku.nvim, covering lua code generate and review instructions, simplicity and minimal changes, no redundant guards, execution path coverage and luadoc annotations.

Instructions file for GitHub Copilot

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/juhaku/aiwaku.nvim/lua
Clone the repo
git clone --depth 1 https://github.com/juhaku/aiwaku.nvim

Made for: GitHub Copilot.

Per session 1,837 This file is loaded in full into every session.
When invoked 1,837 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01837 $0.01837
Opus 5 $0.00919 $0.00919
Sonnet 5 $0.00367 $0.00367
Haiku 4.5 $0.00184 $0.00184

Measured today against content hash d38be0ca38be, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

aiwaku.nvim lua.instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/instructions/lua.instructions.md · 118 lines

How it starts

The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Lua Code Generate and Review Instructions

Simplicity and minimal changes

  • Prefer the simplest correct solution. Flag over-engineering, unnecessary abstraction, or boilerplate.
  • Change only what the task requires. Do not refactor, rename, or reorganise unrelated code in the same commit.
    • Exception: refactor only when it removes genuine duplication or directly supports the requested change. Follow the KISS principle.
  • Remove unnecessary intermediate variables when the expression is already readable.
  • Flatten nested conditionals: prefer multiple early returns over deeply nested if blocks.
  • An extra line of code is not automatically better than a dense one; judge by comprehension, not line count.
  • DO not do any breaking changes if anyway possible, if NOT always confirm first.

No redundant guards

  • If a value is validated earlier in the same function, do not re-check it again further down.
  • Trust established invariants: once state.config, a buffer handle, or a window handle is confirmed valid at entry, deeper callees in the same execution path need not repeat that nil-check.
  • Each guard must appear exactly once per execution path. Duplicate guards are noise and obscure the real logic.
  • When a guard makes a subsequent check structurally impossible (e.g., early return on nil), remove the redundant check rather than leaving it as defensive dead code.

Execution path coverage

  • Every branch must be reachable and intentional. Dead code after a return statement is a bug.
  • Trace all guard/early-return combinations and verify the happy path is clear and direct.
  • For async flows wrapped with plenary.async.void, ensure every error path either returns cleanly or notifies the user — coroutines must not be silently abandoned.
  • When adding a new code path, verify existing guards still cover it or add the appropriate guard once at the right point.

LuaDoc annotations

Annotations drive type-checking and IDE support. Keep them accurate.

  • All public module functions (every key returned in M) must carry ---@param and ---@return annotations.
  • When constructing a table that satisfies a ---@class definition, add ---@type ClassName on the line before the return statement.
  • Functions wrapped in plenary.async.void must be annotated ---@async.
  • Optional fields use the ? suffix: ---@field foo? string.
  • lua/aiwaku/types.lua is the single source of type truth. Do not duplicate class shapes inline in implementation files; reference the types instead.
  • Module-level ---@class or ---@module doc blocks describe the module's public surface.
  • Do not add annotations for private/local functions unless their signatures are non-obvious.

Read the full file on GitHub · 118 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 118 lines · 1,837 tokens per session scan A d38be0ca38be

Subscribe to this mod's changes

aiwaku.nvim lua.instructions.md is an instructions file published in the GitHub repository juhaku/aiwaku.nvim (11 stars, last pushed 2mo ago), licensed MIT. It adds 1,837 tokens to every session, about $0.0092 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-02.