diff --git a/agents/image/svg-to-png.md b/agents/image/svg-to-png.md new file mode 100644 index 0000000..9624da5 --- /dev/null +++ b/agents/image/svg-to-png.md @@ -0,0 +1,81 @@ +--- +name: image/svg-to-png +description: "This agent converts SVG files to PNG images. It accepts SVG inputs via URL or local file path, supports custom dimensions, and can preserve transparent backgrounds." +tools: Bash, WebFetch +model: haiku +--- + +You are an expert image conversion specialist with deep knowledge of ImageMagick, SVG rendering, and raster image formats. You excel at producing high-quality PNG output from SVG source files. + +## Core Mission + +You convert SVG files to PNG format using the `magick` CLI tool (ImageMagick). You accept either a URL to a remote SVG file or a local file path to an SVG file. + +## Workflow + +### Step 1: Identify the Input + +- Determine whether the user has provided a **URL** or a **local file path**. +- If a URL is provided, download the SVG file first using `curl` or `wget` to a temporary location. +- If a local path is provided, verify the file exists before proceeding. + +### Step 2: Analyze the SVG + +- Read the SVG file contents to determine if it has a transparent background. +- An SVG likely needs a transparent background if: + - It does NOT have an explicit background rectangle covering the full canvas. + - It does NOT set a `background` or `background-color` CSS property on the root element. + - The root `` element does NOT have a `style` attribute with a solid background color. + - It is a logo, icon, or graphic element that would typically be used as an overlay. +- If in doubt, **default to preserving transparency** (use `-background none`). + +### Step 3: Construct and Execute the Command + +The base conversion command is: + +```bash +magick input.svg output.png +``` + +For transparent backgrounds, use: + +```bash +magick -background none input.svg output.png +``` + +Additional options to consider: + +- **Density/Resolution**: Use `-density 300` or similar for higher quality rasterization. SVGs are vector, so specifying a higher density before the input file produces crisper output. Default to `-density 300` unless the user specifies otherwise. +- **Resize**: If the user requests specific dimensions, add `-resize WIDTHxHEIGHT` after the input file. +- **Output path**: By default, name the output file the same as the input but with a `.png` extension, in the same directory. If the input was a URL, place the output in the current working directory. + +Full command pattern: + +```bash +# With transparency +magick -density 300 -background none input.svg output.png + +# Without transparency +magick -density 300 input.svg output.png +``` + +### Step 4: Verify the Output + +- After conversion, verify the output file was created and has a non-zero file size. +- Use `magick identify output.png` to confirm the output dimensions and format. +- Report the output file path, dimensions, and file size to the user. + +## Error Handling + +- If `magick` is not installed, inform the user and suggest installation (e.g., `brew install imagemagick` on macOS, `apt install imagemagick` on Linux, or `nix-shell -p imagemagick`). +- If the URL is unreachable, report the HTTP error and ask the user to verify the URL. +- If the local file does not exist, report the error and ask for the correct path. +- If the SVG is malformed or conversion fails, show the error output from `magick` and suggest possible fixes. +- If the output PNG is 0 bytes, the conversion likely failed silently — investigate and report. + +## Important Notes + +- Always use `magick` (ImageMagick v7 syntax), not the older `convert` command. +- Place `-background none` and `-density` **before** the input filename — this is critical for ImageMagick to apply these settings during SVG parsing. +- When downloading from a URL, use `-L` flag with curl to follow redirects: `curl -L -o temp.svg `. +- Clean up any temporary files created during the process (e.g., downloaded SVGs from URLs) unless the user wants to keep them. diff --git a/agents/notes/daily-summary.md b/agents/notes/daily-summary.md new file mode 100644 index 0000000..cc8af16 --- /dev/null +++ b/agents/notes/daily-summary.md @@ -0,0 +1,70 @@ +--- +name: notes/daily-summary +description: "Add executive summary to a daily Obsidian note (today or yesterday)." +tools: Read, Write, Edit +model: sonnet +color: cyan +--- + +You are a daily note summarizer. You MUST use tools to complete this task. Never generate a response without first reading the actual file. + +## Step 1: Determine the Target Date + +- If the user specifies "today" or "yesterday," use that. +- If the user does not specify and the session is interactive, ask which note they'd like summarized. +- If the user does not specify and the session is non-interactive, default to yesterday's note. + +## Step 2: Read the Note + +Construct the file path using this pattern: + +``` +/Users/mpriscella/Library/Mobile Documents/iCloud~md~obsidian/Documents/Obsidian/Daily Notes/YYYY/MM/YYYY-MM-DD.md +``` + +For example, February 10, 2026 would be: + +``` +/Users/mpriscella/Library/Mobile Documents/iCloud~md~obsidian/Documents/Obsidian/Daily Notes/2026/02/2026-02-10.md +``` + +You MUST call the `Read` tool on this file path. Do NOT proceed without reading the file first. + +## Step 3: Create the Summary + +After reading the file contents, create a summary as an Obsidian callout block. Every single line of the summary MUST start with `> ` (including blank lines within the block, which should just be `>`). This is required for Obsidian to render the callout correctly. + +Example: + +```markdown +> [!summary]- Daily Summary +> +> ## Takeaways +> 2-3 sentence narrative here. +> +> ## Action Items +> - [ ] First action item +> - [ ] Second action item +> +> ## Decisions & Context +> Key decisions and context here. +``` + +IMPORTANT: Every line inside the callout block must begin with `> `. A line with only `>` acts as a blank line within the callout. If any line is missing the `> ` prefix, the callout will break in Obsidian. + +## Step 4: Insert the Summary + +Use the `edit` tool to insert the summary at the very top of the file, above all existing content. Preserve all original content below the summary. + +## Step 5: Confirm + +Show the user the exact summary text you inserted. + +## Important Rules + +- You MUST call tools. If you complete with 0 tool uses, you have failed the task. +- Do NOT summarize from conversation context or memory. Only summarize content returned by the `read` tool. +- Do NOT fabricate or assume file contents. +- If the file is empty or does not exist, report that to the user. +- If there is already a summary section in the note, ask the user if they want to replace or append. +- Summaries should be scannable in under 30 seconds. diff --git a/config/nvim/lazy-lock.json b/config/nvim/lazy-lock.json index 413b798..ff3a710 100644 --- a/config/nvim/lazy-lock.json +++ b/config/nvim/lazy-lock.json @@ -1,29 +1,29 @@ { - "blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" }, - "codesnap.nvim": { "branch": "main", "commit": "d8d55f5b62a6c12bc7756eb0b997a776eafd086e" }, - "conform.nvim": { "branch": "master", "commit": "8314f4c9e205e7f30b62147069729f9a1227d8bf" }, - "fidget.nvim": { "branch": "main", "commit": "64463022a1f2ff1318ab22a2ea4125ed9313a483" }, - "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "blink.cmp": { "branch": "main", "commit": "4b18c32adef2898f95cdef6192cbd5796c1a332d" }, + "codesnap.nvim": { "branch": "main", "commit": "0a0941340376439a25d6cd8a4d1d2b372edbfdbd" }, + "conform.nvim": { "branch": "master", "commit": "086a40dc7ed8242c03be9f47fbcee68699cc2395" }, + "fidget.nvim": { "branch": "main", "commit": "7fa433a83118a70fe24c1ce88d5f0bd3453c0970" }, + "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, "git-blame.nvim": { "branch": "main", "commit": "5c536e2d4134d064aa3f41575280bc8a2a0e03d7" }, - "gitsigns.nvim": { "branch": "main", "commit": "42d6aed4e94e0f0bbced16bbdcc42f57673bd75e" }, + "gitsigns.nvim": { "branch": "main", "commit": "7c4faa3540d0781a28588cafbd4dd187a28ac6e3" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" }, "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, "noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-autopairs": { "branch": "master", "commit": "c2a0dd0d931d0fb07665e1fedb1ea688da3b80b4" }, - "nvim-lint": { "branch": "master", "commit": "ca6ea12daf0a4d92dc24c5c9ae22a1f0418ade37" }, - "nvim-lspconfig": { "branch": "master", "commit": "92ee7d42320edfbb81f3cad851314ab197fa324a" }, + "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, + "nvim-lint": { "branch": "master", "commit": "606b823a57b027502a9ae00978ebf4f5d5158098" }, + "nvim-lspconfig": { "branch": "master", "commit": "0203a9608d63eda57679b01e69f33a7b4c34b0d1" }, "nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" }, - "nvim-surround": { "branch": "main", "commit": "1098d7b3c34adcfa7feb3289ee434529abd4afd1" }, - "nvim-tree.lua": { "branch": "master", "commit": "321bc61580fd066b76861c32de3319c3a6d089e7" }, + "nvim-surround": { "branch": "main", "commit": "61319d4bd1c5e336e197defa15bd104c51f0fb29" }, + "nvim-tree.lua": { "branch": "master", "commit": "a0db8bf7d6488b1dcd9cb5b0dfd6684a1e14f769" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-treesitter-context": { "branch": "master", "commit": "64dd4cf3f6fd0ab17622c5ce15c91fc539c3f24a" }, - "nvim-web-devicons": { "branch": "master", "commit": "6788013bb9cb784e606ada44206b0e755e4323d7" }, + "nvim-treesitter-context": { "branch": "master", "commit": "529ee357b8c03d76ff71233afed68fd0f5fe10b1" }, + "nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, - "render-markdown.nvim": { "branch": "main", "commit": "73a6ebc842cf81926eb1d424820b800f6f6a1227" }, - "snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" }, - "telescope.nvim": { "branch": "master", "commit": "e69b434b968a33815e2f02a5c7bd7b8dd4c7d4b2" }, + "render-markdown.nvim": { "branch": "main", "commit": "e3c18ddd27a853f85a6f513a864cf4f2982b9f26" }, + "snacks.nvim": { "branch": "main", "commit": "9912042fc8bca2209105526ac7534e9a0c2071b2" }, + "telescope.nvim": { "branch": "master", "commit": "3333a52ff548ba0a68af6d8da1e54f9cd96e9179" }, "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }, "vscpanel.nvim": { "branch": "main", "commit": "d38fe9d56ef681452633f75ad721256ce3888b36" }, diff --git a/config/nvim/lua/custom/plugins/autoformat.lua b/config/nvim/lua/custom/plugins/autoformat.lua index c53cd1b..8fefb30 100644 --- a/config/nvim/lua/custom/plugins/autoformat.lua +++ b/config/nvim/lua/custom/plugins/autoformat.lua @@ -23,6 +23,7 @@ return { formatters_by_ft = { lua = { "lua-language-server" }, nix = { "alejandra" }, + php = { "mago_format" }, }, }, } diff --git a/config/nvim/lua/custom/plugins/lsp.lua b/config/nvim/lua/custom/plugins/lsp.lua index e5d56b5..8249a79 100644 --- a/config/nvim/lua/custom/plugins/lsp.lua +++ b/config/nvim/lua/custom/plugins/lsp.lua @@ -72,6 +72,8 @@ return { tailwindcss = {}, -- https://github.com/hashicorp/terraform-ls terraformls = {}, + -- https://github.com/typescript-language-server/typescript-language-server + ts_ls = {}, -- https://github.com/zigtools/zls zls = {}, } diff --git a/config/nvim/lua/custom/plugins/telescope.lua b/config/nvim/lua/custom/plugins/telescope.lua index 1827592..ca1db10 100644 --- a/config/nvim/lua/custom/plugins/telescope.lua +++ b/config/nvim/lua/custom/plugins/telescope.lua @@ -1,6 +1,6 @@ return { 'nvim-telescope/telescope.nvim', - tag = 'v0.2.0', + tag = 'v0.2.1', dependencies = { 'nvim-lua/plenary.nvim' }, diff --git a/docs/gpg.md b/docs/gpg.md index 3e69f52..b1880de 100644 --- a/docs/gpg.md +++ b/docs/gpg.md @@ -28,9 +28,6 @@ Follow the prompts: ```bash # List all secret keys with long format key IDs gpg --list-secret-keys --keyid-format=long - -# Or use the provided alias -gpg-list ``` Output will look like: @@ -48,9 +45,6 @@ Your **GPG Key ID** is `ABC123DEF456` (the part after `rsa4096/`). ```bash # Export your public key (replace with your actual key ID) gpg --armor --export ABC123DEF456 - -# Or use the provided alias -gpg-export ABC123DEF456 ``` Copy the entire output (including `-----BEGIN PGP PUBLIC KEY BLOCK-----` and `-----END PGP PUBLIC KEY BLOCK-----`). @@ -127,17 +121,15 @@ This dotfiles setup supports different GPG keys for different machines: ## GPG Key Management Commands -The dotfiles include helpful aliases: - ```bash # List all secret keys -gpg-list +gpg --list-secret-keys --keyid-format=long # Export a public key -gpg-export KEY_ID +gpg --armor --export KEY_ID # Restart GPG agent (if having issues) -gpg-restart +gpg-connect-agent reloadagent /bye # Edit a key (change expiration, add email, etc.) gpg --edit-key KEY_ID @@ -148,9 +140,6 @@ gpg --edit-key KEY_ID **GPG agent not starting:** ```bash # Restart the GPG agent -gpg-restart - -# Or manually gpg-connect-agent reloadagent /bye ``` @@ -171,7 +160,7 @@ gpg> expire gpg> save # Re-export and update on GitHub -gpg-export KEY_ID +gpg --armor --export KEY_ID ``` ## Security Best Practices diff --git a/flake.lock b/flake.lock index 7648874..4c5a5d6 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1769699427, - "narHash": "sha256-dAQt3qXugGhg92A+jqaUcmH0elbgEN/mV4vy1+ohLZk=", + "lastModified": 1772633327, + "narHash": "sha256-jl+DJB2DUx7EbWLRng+6HNWW/1/VQOnf0NsQB4PlA7I=", "owner": "nix-community", "repo": "home-manager", - "rev": "2a08ab21abc8b482f41c521b5f9b0df5b18a67eb", + "rev": "5a75730e6f21ee624cbf86f4915c6e7489c74acc", "type": "github" }, "original": { @@ -27,11 +27,11 @@ ] }, "locked": { - "lastModified": 1768764703, - "narHash": "sha256-5ulSDyOG1U+1sJhkJHYsUOWEsmtLl97O0NTVMvgIVyc=", + "lastModified": 1772379624, + "narHash": "sha256-NG9LLTWlz4YiaTAiRGChbrzbVxBfX+Auq4Ab/SWmk4A=", "owner": "nix-darwin", "repo": "nix-darwin", - "rev": "0fc4e7ac670a0ed874abacf73c4b072a6a58064b", + "rev": "52d061516108769656a8bd9c6e811c677ec5b462", "type": "github" }, "original": { @@ -42,11 +42,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1769527094, - "narHash": "sha256-xV20Alb7ZGN7qujnsi5lG1NckSUmpIb05H2Xar73TDc=", + "lastModified": 1772615108, + "narHash": "sha256-lC0KbklwgeSqS+sTkaYpnSYr/HDeVMzYUZqV/dT31Lo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "afce96367b2e37fc29afb5543573cd49db3357b7", + "rev": "0c39f3b5a9a234421d4ad43ab9c7cf64840172d0", "type": "github" }, "original": { @@ -71,11 +71,11 @@ ] }, "locked": { - "lastModified": 1769469829, - "narHash": "sha256-wFcr32ZqspCxk4+FvIxIL0AZktRs6DuF8oOsLt59YBU=", + "lastModified": 1772495394, + "narHash": "sha256-hmIvE/slLKEFKNEJz27IZ8BKlAaZDcjIHmkZ7GCEjfw=", "owner": "Mic92", "repo": "sops-nix", - "rev": "c5eebd4eb2e3372fe12a8d70a248a6ee9dd02eff", + "rev": "1d9b98a29a45abe9c4d3174bd36de9f28755e3ff", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 6c74044..3907e8a 100644 --- a/flake.nix +++ b/flake.nix @@ -47,6 +47,12 @@ system.primaryUser = username; }; + # Shared user identity configuration + userConfig = { + name = "Mike Priscella"; + email = "mpriscella@gmail.com"; + }; + mkHomeConfiguration = { system ? "aarch64-darwin", username, @@ -82,6 +88,7 @@ inherit gpgSigningKey; inherit isDarwinModule; inherit system; + inherit userConfig; } // extraSpecialArgs; in diff --git a/home-manager/home.nix b/home-manager/home.nix index 1e4c821..889f610 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -57,13 +57,14 @@ pkgs.tailwindcss-language-server pkgs.terraform-ls pkgs.tree-sitter + pkgs.typescript-language-server pkgs.zls ]; packages = [ pkgs.ack pkgs.act pkgs.age - pkgs.argocd + # pkgs.argocd pkgs.asciinema pkgs.asciinema-agg pkgs.bat @@ -96,6 +97,7 @@ pkgs.pnpm pkgs.ripgrep pkgs.sops + pkgs.typescript pkgs.uv pkgs.yarn pkgs.yq diff --git a/home-manager/programs/claude-code.nix b/home-manager/programs/claude-code.nix index 0f41ad4..d08a0dc 100644 --- a/home-manager/programs/claude-code.nix +++ b/home-manager/programs/claude-code.nix @@ -4,5 +4,19 @@ enable = true; enableMcpIntegration = true; + + agents = { + notes--daily-summary = ./../../agents/notes/daily-summary.md; + image--svg-to-png = ./../../agents/image/svg-to-png.md; + }; + + settings = { + permissions = { + allow = [ + "Edit(~/Library/Mobile\ Documents/iCloud~md~obsidian/Documents/Obsidian/Daily Notes/**)" + ]; + additionalDirectories = ["~/Library/Mobile\ Documents/iCloud~md~obsidian/Documents"]; + }; + }; }; } diff --git a/home-manager/programs/fish.nix b/home-manager/programs/fish.nix index 11acaf7..34b2874 100644 --- a/home-manager/programs/fish.nix +++ b/home-manager/programs/fish.nix @@ -1,4 +1,9 @@ -{config, ...}: { +{ + config, + lib, + system, + ... +}: { programs.fish = { enable = true; @@ -17,7 +22,8 @@ ''; }; - home.sessionPath = [ + # macOS Homebrew paths + home.sessionPath = lib.mkIf (lib.hasInfix "darwin" system) [ "/opt/homebrew/bin" "/opt/homebrew/sbin" ]; diff --git a/home-manager/programs/git.nix b/home-manager/programs/git.nix index e22dfa4..6011cbf 100644 --- a/home-manager/programs/git.nix +++ b/home-manager/programs/git.nix @@ -2,6 +2,7 @@ pkgs, lib, gpgSigningKey, + userConfig, ... }: { programs.git = { @@ -14,8 +15,8 @@ }; user = { - name = "Mike Priscella"; - email = "mpriscella@gmail.com"; + name = userConfig.name; + email = userConfig.email; }; init.defaultBranch = "main"; diff --git a/home-manager/programs/jujutsu.nix b/home-manager/programs/jujutsu.nix index 46439de..7dee418 100644 --- a/home-manager/programs/jujutsu.nix +++ b/home-manager/programs/jujutsu.nix @@ -2,6 +2,7 @@ pkgs, lib, gpgSigningKey, + userConfig, ... }: { programs.jujutsu = { @@ -20,8 +21,8 @@ "git_push_bookmark" = ''"mpriscella/push-" ++ change_id.short()''; }; user = { - name = "Mike Priscella"; - email = "mpriscella@gmail.com"; + name = userConfig.name; + email = userConfig.email; }; ui = { default-command = "log";