Class: SolidAgent::AgentManifest::Parsers::GitHubPromptParser

Inherits:
BaseParser
  • Object
show all
Defined in:
lib/solid_agent/agent_manifest/parsers/github_prompt_parser.rb

Overview

GitHubPromptParser handles GitHub Copilot's .prompt.md format.

GitHub Copilot prompt files use Markdown with YAML frontmatter, supporting variables, tool references, and agent configuration.

Examples:

.prompt.md file

---
model: GPT-4o
tools: ['githubRepo', 'search/codebase']
description: 'Generate a new React form component'
---

Create a React form component for ${input:formName}

See Also:

Constant Summary

Constants inherited from BaseParser

BaseParser::FRONTMATTER_REGEX

Class Method Summary collapse

Methods inherited from BaseParser

parse

Class Method Details

.format_nameObject



24
25
26
# File 'lib/solid_agent/agent_manifest/parsers/github_prompt_parser.rb', line 24

def format_name
  :github_prompt
end

.parse_string(content) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/solid_agent/agent_manifest/parsers/github_prompt_parser.rb', line 28

def parse_string(content)
  frontmatter, body = extract_frontmatter(content)

  Manifest.new(
    name: extract_name(frontmatter, body),
    description: frontmatter["description"],
    version: "1.0.0",

    # Model
    model: normalize_github_model(frontmatter["model"]),
    config: {},

    # Tools are GitHub-specific references
    tools: parse_github_tools(frontmatter["tools"]),

    # Template with GitHub variable syntax
    instructions: body,
    template: body,

    # Preserve GitHub-specific config
    extensions: {
      github_prompt: extract_github_extensions(frontmatter)
    }
  )
end