Files
org-agent-contrib/skills/org-skill-context-manager.org

2.7 KiB

SKILL: Context Manager (Universal Literate Note)

Overview

The Context Manager handles the cognitive stack of the agent, allowing for switching between different projects, areas, and tasks while maintaining a clean environment.

Phase A: Demand (PRD)

1. Purpose

Manage a stack-based context system for the agent.

2. User Needs

  • Push/Pop: Ability to enter and exit specific project contexts.
  • Path Resolution: Resolve relative paths based on the current context.

Phase B: Blueprint (PROTOCOL)

Phase B: Blueprint (PROTOCOL)

1. Architectural Intent

The Context Manager will operate as a stack-based system, allowing nested contexts. Each context will maintain its own set of variables (primarily file paths, but extensible to other configuration). The core functionality will be exposed through Lisp functions for pushing, popping, and resolving paths within the current context. Error handling will be robust, providing clear messages when a context is misconfigured or a requested resource is unavailable.

2. Semantic Interfaces (Lisp signatures)

`push-context`

Signature: `(push-context context-id &key initial-bindings) => context-id` Example: `(push-context 'my-project :project-dir "path/to/my/project" :author "Jane Doe")`

`pop-context`

Signature: `(pop-context) => context-id` Example: `(pop-context)`

`resolve-path`

Signature: `(resolve-path path &key context-id) => absolute-path` Example: `(resolve-path "data/input.txt" :context-id 'my-project)`

`get-context-value`

Signature: `(get-context-value key &key context-id) => value` Example: `(get-context-value :project-dir :context-id 'my-project)`

`context-id`

Signature:`(context-id) => symbol` Example:`(context-id) ; returns the current context-id eg 'my-project or nil if top level`