Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .claude/commands/spectr/apply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
description: Implement an approved Spectr change and keep tasks in sync.
---

<!-- spectr:START -->

**Guardrails**
- Favor straightforward, minimal implementations first and add complexity only when it is requested or clearly required.
- Keep changes tightly scoped to the requested outcome.
- Refer to `spectr/AGENTS.md` (located inside the `spectr/` directory—run `ls spectr` or `spectr init` if you don't see it) if you need additional Spectr conventions or clarifications.

**Steps**
Track these steps as TODOs and complete them one by one.
1. Read `spectr/changes/<id>/proposal.md`, `design.md` (if present), and `tasks.md` to confirm scope and acceptance criteria.
2. Work through tasks sequentially, keeping edits minimal and focused on the requested change.
3. Confirm completion before updating statuses—make sure every item in `tasks.md` is finished.
4. Update the checklist after all work is done so each task is marked `- [x]` and reflects reality.
5. Reference `spectr list` when additional context is required.

**Reference**
- Read `spectr/changes/<id>/proposal.md` for proposal details.
- Read `spectr/changes/<id>/specs/<capability>/spec.md` for delta specs.


<!-- spectr:END -->

30 changes: 30 additions & 0 deletions .claude/commands/spectr/proposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
description: Scaffold a new Spectr change and validate strictly.
---

<!-- spectr:START -->

**Guardrails**
- Favor straightforward, minimal implementations first and add complexity only when it is requested or clearly required.
- Keep changes tightly scoped to the requested outcome.
- Refer to `spectr/AGENTS.md` (located inside the `spectr/` directory—run `ls spectr` or `spectr init` if you don't see it) if you need additional Spectr conventions or clarifications.
- Identify any vague or ambiguous details and ask the necessary follow-up questions before editing files.

**Steps**
1. Review `spectr/project.md`, run `spectr list` and `spectr list --specs`, and inspect related code or docs (e.g., via `rg`/`ls`) to ground the proposal in current behaviour; note any gaps that require clarification.
2. Choose a unique verb-led `change-id` and scaffold `proposal.md`, `tasks.md`, and `design.md` (when needed) under `spectr/changes/<id>/`.
3. Map the change into concrete capabilities or requirements, breaking multi-scope efforts into distinct spec deltas with clear relationships and sequencing.
4. Capture architectural reasoning in `design.md` when the solution spans multiple systems, introduces new patterns, or demands trade-off discussion before committing to specs.
5. Draft spec deltas in `spectr/changes/<id>/specs/<capability>/spec.md` (one folder per capability) using `## ADDED|MODIFIED|REMOVED Requirements` with at least one `#### Scenario:` per requirement and cross-reference related capabilities when relevant.
6. Draft `tasks.md` as an ordered list of small, verifiable work items that deliver user-visible progress, include validation (tests, tooling), and highlight dependencies or parallelizable work.
7. Validate with `spectr validate <id> --strict` and resolve every issue before sharing the proposal.

**Reference**
- Read delta specs directly at `spectr/changes/<id>/specs/<capability>/spec.md` when validation fails.
- Read existing specs at `spectr/specs/<capability>/spec.md` to understand current state.
- Search existing requirements with `rg -n "Requirement:|Scenario:" spectr/specs` before writing new ones.
- Explore the codebase with `rg <keyword>`, `ls`, or direct file reads so proposals align with current implementation realities.


<!-- spectr:END -->

47 changes: 47 additions & 0 deletions .claude/commands/spectr/sync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
description: Detect spec drift from code and update specs interactively.
---

<!-- spectr:START -->

### Guardrails
- Code is the source of truth—specs should reflect actual implementation.
- Only update specs after user confirms each change.
- Keep spec updates minimal and focused on actual drift.
- Create missing specs for new capabilities supported by the implementation.
- Refer to `spectr/AGENTS.md` for Spectr conventions.

### Steps
1. Determine scope:
- If arguments specify capabilities (e.g., `<Capabilities>auth, cli</Capabilities>`), focus on those.
- Otherwise, ask the user which capabilities to sync, or analyze recent git changes to suggest candidates.

2. Load current specs:
- Run `spectr list --specs` to enumerate capabilities.
- Read each relevant `spectr/specs/<capability>/spec.md`.

3. Analyze implementation:
- For each capability, identify related code (by directory name, imports, or user guidance).
- Read the implementation and understand actual behavior.

4. Detect drift:
- Compare code behavior against spec requirements and scenarios.
- Identify: new features (to be ADDED), changed behavior (to be MODIFIED), removed features (to be REMOVED).

5. Interactive review:
- For each drift item, present: the requirement, what code does, and proposed spec change.
- Ask user to confirm, modify, or skip each change.

6. Apply updates:
- Edit specs directly with confirmed changes.
- Run `spectr validate --strict` to ensure validity.
- Show summary of changes made.

### Reference
- Read `spectr/specs/<capability>/spec.md` to view current spec content.
- Search code with `rg` to find implementations.
- Validate after edits with `spectr validate --strict`.


<!-- spectr:END -->

16 changes: 16 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- spectr:START -->
# Spectr Instructions

These instructions are for AI assistants working in this project.

Always open `@/spectr/AGENTS.md` when the request:
- Mentions planning or proposals (words like proposal, spec, change, plan)
- Introduces new capabilities, breaking changes, architecture shifts, or big performance/security work
- Sounds ambiguous and you need the authoritative spec before coding

Use `@/spectr/AGENTS.md` to learn:
- How to create and apply change proposals
- Spec format and conventions
- Project structure and guidelines

<!-- spectr:END -->
7 changes: 4 additions & 3 deletions dictionary/markdown-claude.dict
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/openspec:proposal
/openspec:apply
/openspec:archive
/spectr:proposal
/spectr:apply
/spectr:archive
ULTRATHINK
20 changes: 0 additions & 20 deletions lua/plugins/big-file-plugin.lua

This file was deleted.

27 changes: 20 additions & 7 deletions lua/plugins/lspconfig-plugin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ return {
servers = {
-- phpactor = {},
-- volar = {},
svelte_ls = {},
vue_ls = {},
-- harper_ls = {
-- settings = {
Expand Down Expand Up @@ -110,7 +111,16 @@ return {
rust_analyzer = {},
texlab = {},
vhdl_ls = {},
tailwindcss = {},
tailwindcss = {
filetypes = { "templ", "astro", "javascript", "typescript", "react" },
settings = {
tailwindCSS = {
includeLanguages = {
templ = "html",
},
},
},
},
hdl_checker = {},
jsonls = {},
yamlls = {},
Expand Down Expand Up @@ -187,12 +197,15 @@ return {
vim.lsp.buf.format,
{ buffer = args.buf, desc = '[C]ode [F]ormat' }
)
vim.keymap.set(
'n',
'<leader>ca',
vim.lsp.buf.code_action,
{ buffer = args.buf, desc = '[C]ode [A]ction' }
)
-- vim.keymap.set(
-- 'n',
-- '<leader>ca',
-- vim.lsp.buf.code_action,
-- { buffer = args.buf, desc = '[C]ode [A]ction' }
-- )
vim.keymap.set({ "n", "x" }, "<leader>ca", function()
require("tiny-code-action").code_action()
end, { noremap = true, silent = true })
vim.keymap.set(
'n',
'<leader>ls',
Expand Down
3 changes: 1 addition & 2 deletions lua/plugins/telescope-plugin.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
return {
'nvim-telescope/telescope.nvim',
-- tag = '0.1.9',
ref = '84b9ba066d1860f7a586ce9cd732fd6c4f77d1d9',
tag = 'v0.2.0',
event = 'BufWinEnter',
dependencies = {
'nvim-telescope/telescope-media-files.nvim',
Expand Down
22 changes: 22 additions & 0 deletions lua/plugins/tiny-code-action-plugin.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
return {
"rachartier/tiny-code-action.nvim",
dependencies = {
{ "nvim-lua/plenary.nvim" },

-- optional picker via telescope
{ "nvim-telescope/telescope.nvim" },
-- optional picker via fzf-lua
{ "ibhagwan/fzf-lua" },
-- .. or via snacks
{
"folke/snacks.nvim",
opts = {
terminal = {},
}
}
},
event = "LspAttach",
opts = {
picker = "buffer",
},
}
76 changes: 42 additions & 34 deletions lua/plugins/tree-sitter-plugin.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
return {
"nvim-treesitter/nvim-treesitter",
version = false,
branch = "main",
-- branch = "main",
rev = "00c906abb9550e72bc0c640545b5499b9525bb40",
build = ":TSUpdate",
event = { "BufReadPost", "BufNewFile" },
dependencies = {
Expand All @@ -16,41 +17,37 @@ return {
vim.g.load_textobjects = true
end,
},
-- {
-- "nvim-treesitter/nvim-treesitter-context",
-- config = function()
-- require("treesitter-context").setup {
-- -- Enable this plugin (Can be enabled/disabled later via commands)
-- enable = true,
-- -- Enable multiwindow support.
-- multiwindow = false,
-- -- How many lines the window should span. Values <= 0 mean no limit.
-- max_lines = 8,
-- -- Minimum editor window height to enable context. Values <= 0 mean no limit.
-- min_window_height = 0,
-- line_numbers = true,
-- -- Maximum number of lines to show for a single context
-- multiline_threshold = 20,
-- -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
-- trim_scope = 'outer',
-- mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline'
-- -- Separator between context and content. Should be a single character string, like '-'.
-- -- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
-- separator = nil,
-- -- The Z-index of the context window
-- zindex = 20,
-- -- (fun(buf: integer): boolean) return false to disable attaching
-- on_attach = nil,
-- }
-- end,
-- },
{
"nvim-treesitter/nvim-treesitter-context",
config = function()
require("treesitter-context").setup {
-- Enable this plugin (Can be enabled/disabled later via commands)
enable = true,
-- Enable multiwindow support.
multiwindow = false,
-- How many lines the window should span. Values <= 0 mean no limit.
max_lines = 8,
-- Minimum editor window height to enable context. Values <= 0 mean no limit.
min_window_height = 0,
line_numbers = true,
-- Maximum number of lines to show for a single context
multiline_threshold = 20,
-- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
trim_scope = 'outer',
mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline'
-- Separator between context and content. Should be a single character string, like '-'.
-- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
separator = nil,
-- The Z-index of the context window
zindex = 20,
-- (fun(buf: integer): boolean) return false to disable attaching
on_attach = nil,
}
end,
},
-- { 'nvim-treesitter/playground' }
},
cmd = { "TSUpdateSync" },
keys = {
{ "<c-space>", desc = "Increment selection" },
{ "<bs>", desc = "Decrement selection", mode = "x" },
},
opts = {
auto_install = true,
ensure_installed = {
Expand Down Expand Up @@ -115,7 +112,18 @@ return {
},
highlight = {
enable = true,
additional_vim_regex_highlighting = { "markdown" },
disable = function(lang, buf)
if lang == "rustsdf" then
return true
end
local max_filesize = 100 * 1024 -- 100 KB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
end,
-- additional_vim_regex_highlighting = { "markdown" },
additional_vim_regex_highlighting = false,
},
indent = {
enable = true,
Expand Down
Loading