docs

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchNPMReadme

func FetchNPMReadme(ctx context.Context, packageName, outputPath string) error

FetchNPMReadme fetches the README of an NPM package and saves it to outputPath.

Uses the package document URL (https://registry.npmjs.org/<pkg>) rather than the version document (https://registry.npmjs.org/<pkg>/latest). The README only lives on the package document; the version document is just the package.json contents and never has a readme field, which silently produced .noreadme sentinels for every package the bootstrap touched.

func FetchReadme

func FetchReadme(ctx context.Context, rawURL, outputPath string) error

FetchReadme downloads the README content (from subpath or root) and saves it to outputPath.

func GenerateLattice

func GenerateLattice(ctx context.Context, dir string, cfgs map[string]config.Server, g *graph.Graph) error

GenerateLattice generates the `.mcp_lattice` folder containing skills, relations, and downloaded READMEs.

func ParseGitHubURL

func ParseGitHubURL(rawURL string) (owner, repo, subpath, branch string, err error)

ParseGitHubURL parses a standard GitHub URL into (owner, repo, subpath, branch, error).

Types

type ClaudeSkillsOptions added in v1.1.0

type ClaudeSkillsOptions struct {
	// BinaryPath is the value used in `!`<bin> probe ...“ preflight blocks.
	// Defaults to "skillgraph-mcp" (assumes the binary is on $PATH).
	BinaryPath string
	// ConfigPath is passed to the probe binary so SKILL.md works regardless of
	// the CWD where Claude Code loads it. Absolute paths recommended.
	ConfigPath string
	// Force overwrites existing SKILL.md files. When false (default), the
	// generator skips skills whose target SKILL.md already exists and reports
	// them in the returned skip list. Prevents clobbering hand-curated skills
	// or symlinked content (e.g. a centralized skills hub).
	Force bool
}

ClaudeSkillsOptions configures how the generator renders SKILL.md files.

type GenerateResult added in v1.1.0

type GenerateResult struct {
	Written []string
	Skipped []string
}

GenerateResult reports what GenerateClaudeSkills did. Skipped lists names the generator refused to write because a file already existed and Force was false.

func GenerateClaudeSkills added in v1.1.0

func GenerateClaudeSkills(outDir string, cfgs map[string]config.Server, g *graph.Graph, opts ClaudeSkillsOptions) (GenerateResult, error)

GenerateClaudeSkills writes one SKILL.md per downstream skill under outDir. Each file declares its routing through skillgraph-mcp, runs a preflight health probe at load time (via the Claude Code `!` injection syntax), and lists the tools the gateway exposes for that skill.

By default the generator refuses to overwrite an existing SKILL.md (or a symlink standing in for one) and reports skipped names in the result. Pass opts.Force=true to overwrite. This protects hand-curated skills and centralized skill hubs symlinked into the output directory.

outDir is created if missing. Skills with names that aren't safe directory names are reported in the skip list.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL