Skip to content

Instantly share code, notes, and snippets.

View arnm's full-sized avatar
πŸ’­
looking for work 😬

Alexei Nunez arnm

πŸ’­
looking for work 😬
View GitHub Profile
@arnm
arnm / example_config.lua
Last active July 7, 2025 12:57
Neovim CodeCompanion Analytics Extension with Example Config
-- example_config.lua
require('codecompanion').setup {
extensions = {
analytics = {
opts = {
keymap = "<leader>aa",
retention_days = 365,
title_formatter = function(name)
return "### " .. name
end,
@arnm
arnm / checklist.lua
Last active July 7, 2025 12:57
Checklist tool for CodeCompanion
-- checklist_tools.lua
local data_path = vim.fn.stdpath('data') .. '/codecompanion'
local workspace_root = vim.fn.getcwd()
local workspace_id = vim.fn.substitute(workspace_root, '[/\\:*?"<>|]', '_', 'g')
local checklist_file = data_path .. '/checklists_v3_' .. workspace_id .. '.json'
vim.fn.mkdir(data_path, 'p')
---@class ChecklistTask
@arnm
arnm / example-effect-ts-http-server.txt
Created June 22, 2025 01:34
Example effect-ts http-server
Directory Structure:
└── ./
β”œβ”€β”€ src
β”‚ β”œβ”€β”€ Accounts
β”‚ β”‚ β”œβ”€β”€ AccountsRepo.ts
β”‚ β”‚ β”œβ”€β”€ Api.ts
β”‚ β”‚ β”œβ”€β”€ Http.ts
β”‚ β”‚ β”œβ”€β”€ Policy.ts
β”‚ β”‚ └── UsersRepo.ts
@arnm
arnm / codecompanion-chat-strategies.txt
Last active July 7, 2025 12:57
CodeCompanion Chat Strategies
Directory Structure:
└── ./
└── lua
└── codecompanion
└── strategies
└── chat
β”œβ”€β”€ agents
β”‚ β”œβ”€β”€ tools
β”‚ β”‚ β”œβ”€β”€ helpers
@arnm
arnm / codecompanion-chat-model-toggle.lua
Last active July 7, 2025 12:57
CodeCompanion Chat Model Toggle
--- CodeCompanion Model Toggle Extension
--- Provides quick model switching for chat buffers.
---@alias ModelName string
---@class ModelToggleOpts
---@field keymap string? Keymap to toggle models (default: "gM")
---@class ModelToggleConfig
---@field [adapter_name: string] ModelName Alternate model per adapter
@arnm
arnm / init.lua
Last active July 7, 2025 12:56
CodeCompanion Edit Chat Extension
local Snacks = require("snacks")
-- input:
-- DESIRED BEHAVIOR -------------------------------------------------------------
-- user: hello 1
-- llm: hello
-- user: hello 2
-- llm: hello again
-- user: hello 3 <- last user message
-- llm: hello again
@arnm
arnm / init.lua
Last active June 30, 2025 18:23
CodeCompanion Rules Chat Extension
--=============================================================================
-- CodeCompanion-Rules – manage rule files via chat.refs only
--=============================================================================
---@class CodeCompanionChatMessage
---@field content? string
---@field opts? table
---@field opts.reference? string
---@field role? string
---@field id? any
@arnm
arnm / lsp_files.lua
Created June 27, 2025 23:39
LSP-integrated file editing tools for CodeCompanion agents in Neovim (inspired by OpenCode)
---@diagnostic disable: undefined-field
-- write_file.lua --------------------------------------------------------------
---@class WriteFileToolArgs
---@field file_path string Absolute path of the file to write
---@field content string Content to write to the file
---@class EditFileToolArgs
---@field file_path string Absolute path of the file to edit
---@field old_string string The text to replace
@arnm
arnm / checklist_dag.lua
Last active July 7, 2025 12:56
DAG-enabled Checklist Tool for CodeCompanion: Lua sources and docs
-- checklist_dag.lua
-- DAG checklist tools with proper type annotations and standardized returns
local dag_manager_module = require('codecompanion.strategies.chat.agents.tools.checklist_lib.dag_manager')
local dag_formatter_module = require('codecompanion.strategies.chat.agents.tools.checklist_lib.dag_formatter')
local dag_executor = require('codecompanion.strategies.chat.agents.tools.checklist_lib.dag_executor')
local storage_module = require('codecompanion.strategies.chat.agents.tools.checklist_lib.storage')
-- Create DAG system instance
---@return table