smithery/sandgardenhq

incorporate-snippets

Guide for adding new code snippets to the library; When you need to add a new code snippet to the sgai_find_snippets library, when creating files without proper metadata, when using incorrect filenames or extensions, when adding code without extensive comments

Installation

$ npx skills add smithery/sandgardenhq --skill incorporate-snippets

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/sandgardenhq.

npx skills add smithery/sandgardenhq

Browse all from smithery/sandgardenhq

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,230 B
  • docs SUMMARY.md 77 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Incorporate Snippets

Overview

This skill guides the process of incorporating new code snippets into the sgaifindsnippets library. It ensures snippets are properly formatted and stored for future retrieval.

When to Use

Use this skill when:

  • Adding a new code snippet to the sgaifindsnippets library
  • Creating snippet files without frontmatter metadata
  • Using filenames with spaces, special characters, or wrong extensions
  • Adding code without extensive explanatory comments
  • Missing required fields like language, description

The Process

Phase 1: Gather Snippet Information

  • Ask for the programming language
  • Ask for the snippet name (brief, descriptive)
  • Ask for a single-line description
  • Ask for when to use the snippet
  • Ask for the code snippet itself

Phase 2: Validate Snippet

  • Check that all required fields are provided
  • Sanitize filename: convert to kebab-case, remove special characters
  • Ensure the code is syntactically correct for the language using language-specific validation
  • Verify the snippet follows best practices
  • Check for filename conflicts and resolve (append -2, -3, etc.)

Phase 3: Save Snippet

  • Generate the filename: kebab-case-name.extension
  • Create the sgai/snippets/{language}/ directory if missing (use the overlay directory, not .sgai/)
  • Write the frontmatter and code in the correct format
  • Confirm successful addition

Syntax Validation by Language

Language Validation Command Notes
JavaScript/TypeScript node -c <filename> Checks syntax
Python python -m py_compile <filename> Compiles to check syntax
Go go build -o /dev/null <filename> Builds to check syntax
Rust rustc --emit=dep-info <filename> Checks syntax
Java javac <filename> Compiles to check syntax

Filename Generation

  • Convert name to kebab-case: "Error Handling" → "error-handling"
  • Remove special characters: "Error Handling!" → "error-handling"
  • Add proper extension based on language
  • If filename exists, append number: error-handling.go, error-handling-2.go, etc.
  • Ensure directory exists, create if missing

File Format

Snippets must follow this exact format:

---
name: Snippet Name
description: Single line description; When to use this snippet
---

/* Extensive comment explaining the code */
actual_code_goes_here()

Common Mistakes

  • Creating files without frontmatter metadata
  • Using filenames with spaces or special characters
  • Missing extensive comments explaining the code
  • Not validating syntax before adding
  • Forgetting to create the language directory
  • Not checking for filename conflicts

Important Notes

  • Filenames should be kebab-case versions of the name
  • Extensions should match the language (e.g., .go, .js, .py)
  • Comments should be comprehensive but concise
  • Test snippets before adding if possible