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 ¶
- Variables
- func Convert(ctx *Context, format string) ([]byte, error)
- func ConverterNames() []string
- func GenerateAll(ctx *Context, dir string) error
- func RegisterConverter(converter Converter)
- func WriteFile(ctx *Context, format, path string) error
- type Architecture
- type Context
- type ConversionError
- type Converter
- type Dependencies
- type Dependency
- type Diagram
- type Files
- type Note
- type Package
- type ParseError
- type Related
- type Testing
- type WriteError
Constants ¶
This section is empty.
Variables ¶
var ( ErrEmptyContext = core.ErrEmptyContext ErrMissingName = core.ErrMissingName ErrUnsupportedFormat = core.ErrUnsupportedFormat )
Re-export core errors.
Functions ¶
func ConverterNames ¶
func ConverterNames() []string
ConverterNames returns the names of all registered converters.
func GenerateAll ¶
GenerateAll generates all supported formats in the given directory.
func RegisterConverter ¶
func RegisterConverter(converter Converter)
RegisterConverter registers a converter with the default registry.
Types ¶
type Architecture ¶
type Architecture = core.Architecture
Architecture describes the project architecture.
type Context ¶
Context is the canonical project context.
func NewContext ¶
NewContext creates a new empty Context with the given name.
type ConversionError ¶
type ConversionError = core.ConversionError
ConversionError represents a conversion error.
type Converter ¶
Converter is the interface for format converters.
func GetConverter ¶
GetConverter returns a converter by name.
type Dependencies ¶
type Dependencies = core.Dependencies
Dependencies describes project dependencies.
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.). |