context

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package context provides a tool-agnostic system for managing project context that can be converted to various AI assistant formats (CLAUDE.md, .cursorrules, etc.).

The context package uses a JSON-based canonical format (CONTEXT.json) that can be validated against a JSON Schema and converted to tool-specific formats.

Usage

Create a CONTEXT.json file in your project root:

{
  "$schema": "https://github.com/agentplexus/assistantkit/context/schema/project-context.schema.json",
  "name": "my-project",
  "description": "A brief description",
  "language": "go",
  "commands": {
    "build": "go build ./...",
    "test": "go test ./..."
  }
}

Then convert to tool-specific formats:

import (
    "github.com/agentplexus/assistantkit/context"
    _ "github.com/agentplexus/assistantkit/context/claude" // Register converter
)

ctx, _ := context.ReadFile("CONTEXT.json")
context.WriteFile(ctx, "claude", "CLAUDE.md")

Supported Formats

  • claude: CLAUDE.md for Claude Code
  • (future) cursor: .cursorrules for Cursor IDE
  • (future) copilot: .github/copilot-instructions.md for GitHub Copilot

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyContext      = core.ErrEmptyContext
	ErrMissingName       = core.ErrMissingName
	ErrUnsupportedFormat = core.ErrUnsupportedFormat
)

Re-export core errors.

Functions

func Convert

func Convert(ctx *Context, format string) ([]byte, error)

Convert converts a context to a specific format.

func ConverterNames

func ConverterNames() []string

ConverterNames returns the names of all registered converters.

func GenerateAll

func GenerateAll(ctx *Context, dir string) error

GenerateAll generates all supported formats in the given directory.

func RegisterConverter

func RegisterConverter(converter Converter)

RegisterConverter registers a converter with the default registry.

func WriteFile

func WriteFile(ctx *Context, format, path string) error

WriteFile writes a context to a file in a specific format.

Types

type Architecture

type Architecture = core.Architecture

Architecture describes the project architecture.

type Context

type Context = core.Context

Context is the canonical project context.

func NewContext

func NewContext(name string) *Context

NewContext creates a new empty Context with the given name.

func Parse

func Parse(data []byte) (*Context, error)

Parse parses JSON data into a Context.

func ReadFile

func ReadFile(path string) (*Context, error)

ReadFile reads a Context from a JSON file.

type ConversionError

type ConversionError = core.ConversionError

ConversionError represents a conversion error.

type Converter

type Converter = core.Converter

Converter is the interface for format converters.

func GetConverter

func GetConverter(name string) (Converter, bool)

GetConverter returns a converter by name.

type Dependencies

type Dependencies = core.Dependencies

Dependencies describes project dependencies.

type Dependency

type Dependency = core.Dependency

Dependency represents a single dependency.

type Diagram

type Diagram = core.Diagram

Diagram represents an architecture diagram.

type Files

type Files = core.Files

Files describes important files.

type Note

type Note = core.Note

Note represents an additional note.

type Package

type Package = core.Package

Package describes a package or module.

type ParseError

type ParseError = core.ParseError

ParseError represents a parsing error.

type Related = core.Related

Related represents a related project or resource.

type Testing

type Testing = core.Testing

Testing describes the testing strategy.

type WriteError

type WriteError = core.WriteError

WriteError represents a write error.

Directories

Path Synopsis
Package claude provides a converter for generating CLAUDE.md files from the canonical project context format.
Package claude provides a converter for generating CLAUDE.md files from the canonical project context format.
Package core provides the canonical types for project context that can be converted to various AI assistant formats (CLAUDE.md, .cursorrules, etc.).
Package core provides the canonical types for project context that can be converted to various AI assistant formats (CLAUDE.md, .cursorrules, etc.).

Jump to

Keyboard shortcuts

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