instructions

package
v1.209.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SectionOrder = map[string]int{
	"project_context":         1,
	"common_commands":         2,
	"stack_patterns":          3,
	"component_dependencies":  4,
	"naming_conventions":      5,
	"frequent_issues":         6,
	"infrastructure_patterns": 7,
	"component_catalog":       8,
	"team_conventions":        9,
	"recent_learnings":        10,
}

SectionOrder defines the canonical order for sections in ATMOS.md.

View Source
var SectionTitles = map[string]string{
	"project_context":         "Project Context",
	"common_commands":         "Common Commands",
	"stack_patterns":          "Stack Patterns",
	"component_dependencies":  "Component Dependencies",
	"naming_conventions":      "Naming Conventions",
	"frequent_issues":         "Frequent Issues & Solutions",
	"infrastructure_patterns": "Infrastructure Patterns",
	"component_catalog":       "Component Catalog Structure",
	"team_conventions":        "Team Conventions",
	"recent_learnings":        "Recent Learnings",
}

SectionTitles maps section keys to display titles.

Functions

func ExtractSection

func ExtractSection(content, sectionKey string) (string, error)

ExtractSection extracts a specific section from markdown content by key.

func MergeContent

func MergeContent(existing, update string) string

MergeContent intelligently merges new content into existing section content. This preserves manual edits while adding AI-generated updates.

func ParseSections

func ParseSections(content string) (map[string]*Section, error)

ParseSections parses a markdown document and extracts sections by ## headers.

Types

type Config

type Config struct {
	Enabled  bool
	FilePath string // Path to ATMOS.md (relative to base path).
}

Config holds configuration for project instructions.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default instructions configuration.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager manages project instructions (ATMOS.md) lifecycle.

func NewManager

func NewManager(basePath string, config *Config) *Manager

NewManager creates a new project instructions manager.

func (*Manager) GetContext

func (m *Manager) GetContext() string

GetContext returns the full ATMOS.md content formatted for AI context.

func (*Manager) Load

func (m *Manager) Load(ctx context.Context) (*ProjectInstructions, error)

Load loads the ATMOS.md file from disk and parses it. If the file does not exist, it returns nil without error.

func (*Manager) Reload

func (m *Manager) Reload(ctx context.Context) error

Reload reloads the instructions from disk if the file has been modified.

type ProjectInstructions

type ProjectInstructions struct {
	FilePath     string
	Content      string
	Sections     map[string]*Section
	LastModified time.Time
	Enabled      bool
}

ProjectInstructions represents the in-memory state of an ATMOS.md file.

type Section

type Section struct {
	Name    string
	Content string
	Order   int
}

Section represents a parsed section from ATMOS.md.

Jump to

Keyboard shortcuts

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