Photo of Gil Creque in a pink TV

Worm Icon AddingtoolstoVSCodetoWriteNotes

🌿 growing
Topics Icon Dev Tools

I added a small workflow in Add new note templates to make the boring parts automatic.

The main piece is scripts/new-note.mjs. It takes a title from the command line:

npm run new:note -- "Adding tools to VS Code to Write Notes"

Then it generates a slug, creates a new markdown file in src/content/notes, and fills in the frontmatter this site expects:

---
title: "Adding tools to VS Code to Write Notes"
created: 2026-06-25T00:26:31-0400
type: note
tags:
  - inbox
updated: 2026-06-25T00:26:31-0400
slug: adding-tools-to-vs-code-to-write-notes
topics: []
status: seed
---

There were a couple of details worth getting right. The script checks for existing files and picks the next available filename instead of overwriting anything. It also formats timestamps for America/New_York with the correct offset, so notes created during daylight saving time get -0400 instead of a hard-coded -0500.

For VS Code, I added a task named New note. Running it prompts for the note title, calls the npm script, and sets VSCODE_CLI=1 so the script can open the newly-created file in the current editor window. That gives me a command-palette path for starting a note without leaving the editor.

I also added a workspace snippet in .vscode/note.code-snippets. Typing note and then pressing Ctrl+Space in a Markdown or MDX file inserts the same frontmatter shape. The snippet uses VS Code’s date variables and CURRENT_TIMEZONE_OFFSET, with the colon removed, so the timestamp still matches the Astro content schema.

The end result is intentionally small:

This is one of those little tooling changes that makes the site feel more writable. The structure is still there, but it gets out of the way.