cocosearch-add-grammar

Add CocoSearch grammar handlers using PATH_PATTERNS and metadata extraction.

37|6|Updated Feb 16, 2026
One-click install
npx skills add https://github.com/VioletCranberry/coco-search --skill cocosearch-add-grammar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cocosearch-add-grammar
Source: https://github.com/VioletCranberry/coco-search/tree/main/skills/cocosearch-add-grammar
Command: npx skills add https://github.com/VioletCranberry/coco-search --skill cocosearch-add-grammar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams add grammar handlers to CocoSearch for domain-specific file formats that share a base language extension. It guides through architecture choices, content validation, metadata extraction, tests, and registration.

Core Features & Use Cases

  • Define a new grammar handler by specifying PATH_PATTERNS, implementing _has_content_markers and _extract_grammar_metadata, and leveraging YamlGrammarBase for common logic.
  • Ensure safe, deterministic parsing by defining SEPARATOR_SPEC and hierarchical metadata blocks like job:build, step:deploy, or service:web.
  • Verify compatibility with autodiscovery so new grammars are automatically registered on import.

Quick Start

Create a new grammar handler at src/cocosearch/handlers/grammars/<grammar>.py following the template and run the grammar tests.

Frequently Asked Questions about cocosearch-add-grammar

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

FAQPage Schema
How do I add a custom grammar handler to CocoSearch for YAML metadata extraction?

To add a custom grammar handler, create a new file at src/cocosearch/handlers/grammars/ that specifies PATH_PATTERNS, implements _has_content_markers and _extract_grammar_metadata, and extends YamlGrammarBase for common parsing logic.

How does CocoSearch autodiscovery register new grammar handlers on import?

CocoSearch autodiscovery automatically registers new grammar handlers when they follow the standard base conventions and are placed in the correct handlers directory, ensuring reliable discovery without manual registry entries.

Can I parse hierarchical metadata blocks like job:build or step:deploy using custom grammar extensions?

Yes, custom grammar extensions support hierarchical metadata blocks like job, step, or service by leveraging YamlGrammarBase and defining SEPARATOR_SPEC for safe, deterministic parsing of structured YAML content.

What is the best way to test custom grammar handlers for conflict avoidance in CocoSearch?

The best way to test custom grammar handlers is to run the standard grammar tests after creating your handler, which verifies content validation, metadata extraction, and ensures no conflicts with existing PATH_PATTERNS or registry entries.

Do I need to manually update the CocoSearch registry when adding a new YAML grammar extension?

No, you do not need to manually update the registry if your grammar handler follows the standard autodiscovery conventions, as the system ensures proper registry updates for reliable discovery and usage automatically.