Documentation
¶
Overview ¶
Package load provides the command for outputting assembled context.
The load command assembles context files from .context/ and outputs them in the recommended read order, suitable for providing to an AI assistant. This is the primary mechanism for giving AI tools access to project context.
Assembly Order ¶
Context files are assembled in priority order:
- CONSTITUTION.md - Hard rules and constraints
- TASKS.md - Current work items
- CONVENTIONS.md - Code patterns and standards
- ARCHITECTURE.md - System design
- DECISIONS.md - Architectural decisions with rationale
- LEARNINGS.md - Gotchas, tips, lessons learned
- GLOSSARY.md - Domain terminology
- DRIFT.md - Drift detection results
- AGENT_PLAYBOOK.md - AI-specific instructions
Token Budget ¶
The --budget flag limits output to approximately the specified token count. This is useful for AI assistants with context window limitations. Files are prioritized by importance, with lower-priority files truncated or omitted when budget constraints are reached.
Raw Output ¶
The --raw flag outputs file contents directly without assembly headers or priority-based ordering. This is useful for debugging or when exact file contents are needed.
File Organization ¶
- load.go: Command definition and flag handling
- run.go: Main load execution logic
- convert.go: Format conversion utilities
- sort.go: Priority-based file sorting
- out.go: Output formatting
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cmd ¶
Cmd returns the "ctx load" command for outputting assembled context.
The command loads context files from .context/ and outputs them in the recommended read order, suitable for providing to an AI assistant.
Flags:
- --budget: Token budget for assembly (default 8000)
- --raw: Output raw file contents without headers or assembly
Returns:
- *cobra.Command: Configured load command with flags registered
Types ¶
This section is empty.