incorporate-snippets

Add validated code snippets with frontmatter to the sgai_find_snippets library.

130|8|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/sandgardenhq/sgai --skill incorporate-snippets
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: incorporate-snippets
Source: https://github.com/sandgardenhq/sgai/tree/main/cmd/sgai/skel/.sgai/skills/incorporate-snippets
Command: npx skills add https://github.com/sandgardenhq/sgai --skill incorporate-snippets

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adding new code snippets to the sgai_find_snippets library can be error‑prone when files lack proper frontmatter, use invalid filenames, or miss comprehensive comments, leading to retrieval issues.

Core Features & Use Cases

  • Gather snippet details: prompts for language, name, description, usage context, and code.
  • Validate and sanitize: ensures required fields, converts filenames to kebab‑case, checks syntax per language, and resolves name conflicts.
  • Save with proper format: writes frontmatter and code to sgai/snippets/{language}/ with correct extension and extensive comments.

Quick Start

Ask the skill to add a new Python snippet that parses JSON strings.

Frequently Asked Questions about incorporate-snippets

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add code snippets to a library with proper metadata and validation?

To add code snippets with proper metadata, this skill gathers language, name, and code details, then validates syntax and sanitizes filenames before writing the file. It resolves naming conflicts and applies frontmatter automatically.

What's the best way to ensure my code snippet filenames are kebab-case before saving?

The best way to ensure kebab-case filenames is using this skill, which automatically sanitizes snippet names during the creation process. It converts filenames before writing the final code file to the library.

Why do my code snippets fail retrieval when they lack frontmatter and comments?

Code snippets fail retrieval when missing frontmatter and comments because the library cannot index them properly. This skill solves the problem by automatically generating required metadata and explanatory comments before saving.

Does this snippet creation tool check syntax validation for different programming languages?

Yes, this snippet creation tool performs syntax validation specific to the programming language you specify. It checks the code structure before writing the file to ensure the snippet is valid and searchable.

Can I resolve naming conflicts when adding multiple code snippets to the same language directory?

Yes, you can resolve naming conflicts when adding code snippets because this skill includes conflict resolution logic. It checks existing files in the target language directory and handles duplicates before writing.

What metadata fields are required to create a searchable code snippet file?

Required metadata fields to create a searchable code snippet include language, name, description, usage context, and the code itself. This skill prompts for each field and validates them before saving the file.