refactor(skills): use %%SKILLS_DIR%% placeholder for portable tangling

- Updated 22 skill org files to use %%SKILLS_DIR%% placeholder
- Modified opencortex.sh setup to replace placeholder with XDG path
- Modified doctor_repair to handle placeholder replacement
- Removed hardcoded absolute path
This commit is contained in:
2026-04-30 11:14:31 -04:00
parent dabf52f234
commit 1eb8a3db92
24 changed files with 27 additions and 27 deletions

View File

@@ -109,8 +109,8 @@ setup_system() {
for f in "$SCRIPT_DIR/skills"/*.org; do for f in "$SCRIPT_DIR/skills"/*.org; do
fname=$(basename "$f" .org) fname=$(basename "$f" .org)
echo "Tangling skills/$fname.org..." echo "Tangling skills/$fname.org..."
# Copy org to XDG first (skills need to be loaded from XDG path) # Replace %%SKILLS_DIR%% placeholder with actual XDG path
cp "$f" "$OC_DATA_DIR/skills/" sed "s|%%SKILLS_DIR%%|$OC_DATA_DIR/skills|g" "$f" > "$OC_DATA_DIR/skills/$fname.org"
(cd "$OC_DATA_DIR/skills" && emacs -Q --batch --eval "(require 'org)" --eval "(setq org-confirm-babel-evaluate nil)" --eval "(org-babel-tangle-file \"${fname}.org\")") >/dev/null 2>&1 || true (cd "$OC_DATA_DIR/skills" && emacs -Q --batch --eval "(require 'org)" --eval "(setq org-confirm-babel-evaluate nil)" --eval "(org-babel-tangle-file \"${fname}.org\")") >/dev/null 2>&1 || true
done done
@@ -183,8 +183,8 @@ doctor_repair() {
if [ -f "$f" ]; then if [ -f "$f" ]; then
fname=$(basename "$f" .org) fname=$(basename "$f" .org)
echo " Checking skill/$fname..." echo " Checking skill/$fname..."
# Copy .org to XDG temporarily for tangle, then remove # Replace %%SKILLS_DIR%% placeholder and copy to XDG
cp "$f" "$OC_DATA_DIR/skills/" sed "s|%%SKILLS_DIR%%|$OC_DATA_DIR/skills|g" "$f" > "$OC_DATA_DIR/skills/$fname.org"
if ! sbcl --non-interactive \ if ! sbcl --non-interactive \
--eval "(load \"$OC_DATA_DIR/skills/${fname}.lisp\")" \ --eval "(load \"$OC_DATA_DIR/skills/${fname}.lisp\")" \
--eval "(format t \"OK~%\")" 2>/dev/null | grep -q "OK"; then --eval "(format t \"OK~%\")" 2>/dev/null | grep -q "OK"; then

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: Bouncer (org-skill-bouncer.org) #+TITLE: SKILL: Bouncer (org-skill-bouncer.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :system:bouncer:authorization:autonomy: #+FILETAGS: :system:bouncer:authorization:autonomy:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-bouncer.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-bouncer.lisp
* Overview * Overview
The *Bouncer Skill* is the physical security layer of OpenCortex. It enforces operational security checks on all proposed actions. The *Bouncer Skill* is the physical security layer of OpenCortex. It enforces operational security checks on all proposed actions.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: CLI Gateway (org-skill-cli-gateway.org) #+TITLE: SKILL: CLI Gateway (org-skill-cli-gateway.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :skill:gateway:cli: #+FILETAGS: :skill:gateway:cli:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-cli-gateway.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-cli-gateway.lisp
* Overview * Overview
The *CLI Gateway* provides a command-line interface for interacting with the OpenCortex daemon. The *CLI Gateway* provides a command-line interface for interacting with the OpenCortex daemon.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: Config Manager (org-skill-config-manager.org) #+TITLE: SKILL: Config Manager (org-skill-config-manager.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :skill:setup:config: #+FILETAGS: :skill:setup:config:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-config-manager.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-config-manager.lisp
* Overview * Overview
The *Config Manager* skill provides the OpenCortex Agent with the capability to manage its own environment variables and provider configurations. It includes an interactive setup wizard for LLM providers, gateways, and system settings. The *Config Manager* skill provides the OpenCortex Agent with the capability to manage its own environment variables and provider configurations. It includes an interactive setup wizard for LLM providers, gateways, and system settings.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: Credentials Vault (org-skill-credentials-vault.org) #+TITLE: SKILL: Credentials Vault (org-skill-credentials-vault.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :system:security:vault: #+FILETAGS: :system:security:vault:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-credentials-vault.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-credentials-vault.lisp
* Overview * Overview
The *Credentials Vault* provides secure in-memory storage for sensitive API keys and session tokens. The *Credentials Vault* provides secure in-memory storage for sensitive API keys and session tokens.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: Diagnostics (org-skill-diagnostics.org) #+TITLE: SKILL: Diagnostics (org-skill-diagnostics.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :system:diagnostics:doctor: #+FILETAGS: :system:diagnostics:doctor:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-diagnostics.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-diagnostics.lisp
* Overview * Overview
The *Diagnostics Skill* (Doctor) provides system-wide health checks and dependency verification. It validates external dependencies, XDG environment, and LLM provider connectivity. The *Diagnostics Skill* (Doctor) provides system-wide health checks and dependency verification. It validates external dependencies, XDG environment, and LLM provider connectivity.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: Engineering Standards (org-skill-engineering-standards.org) #+TITLE: SKILL: Engineering Standards (org-skill-engineering-standards.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :system:engineering:chaos: #+FILETAGS: :system:engineering:chaos:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-engineering-standards.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-engineering-standards.lisp
* Overview * Overview
The *Engineering Standards Skill* enforces technical invariants, including the **Commit-Before-Modify** rule and **Chaos-Driven Development**. The *Engineering Standards Skill* enforces technical invariants, including the **Commit-Before-Modify** rule and **Chaos-Driven Development**.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: Gardener (org-skill-gardener.org) #+TITLE: SKILL: Gardener (org-skill-gardener.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :skill:maintenance:gardener: #+FILETAGS: :skill:maintenance:gardener:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-gardener.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-gardener.lisp
* Overview * Overview
The *Gardener Skill* performs periodic maintenance on the Memex knowledge graph. The *Gardener Skill* performs periodic maintenance on the Memex knowledge graph.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: Gateway Manager (org-skill-gateway-manager.org) #+TITLE: SKILL: Gateway Manager (org-skill-gateway-manager.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :skill:gateway:manager: #+FILETAGS: :skill:gateway:manager:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-gateway-manager.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-gateway-manager.lisp
* Overview * Overview
The *Gateway Manager* handles the registration and linking of external communication platforms. The *Gateway Manager* handles the registration and linking of external communication platforms.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: Homoiconic Memory (org-skill-homoiconic-memory.org) #+TITLE: SKILL: Homoiconic Memory (org-skill-homoiconic-memory.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :harness:memory:homoiconic: #+FILETAGS: :harness:memory:homoiconic:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-homoiconic-memory.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-homoiconic-memory.lisp
* Overview * Overview
The *Homoiconic Memory* skill provides the capability to treat system memory as executable code and vice-versa. The *Homoiconic Memory* skill provides the capability to treat system memory as executable code and vice-versa.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: Literate Programming (org-skill-literate-programming.org) #+TITLE: SKILL: Literate Programming (org-skill-literate-programming.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :system:literate:tangle: #+FILETAGS: :system:literate:tangle:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-literate-programming.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-literate-programming.lisp
* Overview * Overview
The *Literate Programming* skill ensures the synchronization between `.org` sources and `.lisp` artifacts. The *Literate Programming* skill ensures the synchronization between `.org` sources and `.lisp` artifacts.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: Llama Backend (org-skill-llama-backend.org) #+TITLE: SKILL: Llama Backend (org-skill-llama-backend.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :skill:llm:backend:ollama: #+FILETAGS: :skill:llm:backend:ollama:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-llama-backend.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-llama-backend.lisp
* Overview * Overview
The *Llama Backend* skill provides the actual implementation for calling local models via Ollama. The *Llama Backend* skill provides the actual implementation for calling local models via Ollama.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: LLM Gateway (org-skill-llm-gateway.org) #+TITLE: SKILL: LLM Gateway (org-skill-llm-gateway.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :skill:llm:gateway: #+FILETAGS: :skill:llm:gateway:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-llm-gateway.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-llm-gateway.lisp
* Overview * Overview
The *LLM Gateway* skill provides a unified interface for interacting with multiple Large Language Model providers. The *LLM Gateway* skill provides a unified interface for interacting with multiple Large Language Model providers.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: Peripheral Vision (org-skill-peripheral-vision.org) #+TITLE: SKILL: Peripheral Vision (org-skill-peripheral-vision.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :harness:peripheral:context: #+FILETAGS: :harness:peripheral:context:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-peripheral-vision.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-peripheral-vision.lisp
* Overview * Overview
The *Peripheral Vision* skill enhances the context engine with high-level summaries of distant memory nodes. The *Peripheral Vision* skill enhances the context engine with high-level summaries of distant memory nodes.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: Policy (org-skill-policy.org) #+TITLE: SKILL: Policy (org-skill-policy.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :system:policy:constitutional: #+FILETAGS: :system:policy:constitutional:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-policy.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-policy.lisp
* Overview * Overview
The *Policy Skill* is the constitutional layer of OpenCortex. It enforces foundational invariants like transparency and autonomy on all proposed actions. The *Policy Skill* is the constitutional layer of OpenCortex. It enforces foundational invariants like transparency and autonomy on all proposed actions.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: Protocol Validator (org-skill-protocol-validator.org) #+TITLE: SKILL: Protocol Validator (org-skill-protocol-validator.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :system:protocol:validation: #+FILETAGS: :system:protocol:validation:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-protocol-validator.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-protocol-validator.lisp
* Overview * Overview
The *Protocol Validator* skill enforces strict schema compliance for all internal and external communication. The *Protocol Validator* skill enforces strict schema compliance for all internal and external communication.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: REPL (org-skill-repl.org) #+TITLE: SKILL: REPL (org-skill-repl.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :system:repl:interactive:debug: #+FILETAGS: :system:repl:interactive:debug:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-repl.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-repl.lisp
* Overview * Overview
The *REPL Skill* provides persistent Lisp evaluation, inspection, and debugging capabilities. This enables the agent to verify behavior at runtime rather than just at the text level. The *REPL Skill* provides persistent Lisp evaluation, inspection, and debugging capabilities. This enables the agent to verify behavior at runtime rather than just at the text level.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: Scribe (org-skill-scribe.org) #+TITLE: SKILL: Scribe (org-skill-scribe.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :skill:scribe:documentation: #+FILETAGS: :skill:scribe:documentation:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-scribe.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-scribe.lisp
* Overview * Overview
The *Scribe Skill* manages the agent's internal documentation and logs. The *Scribe Skill* manages the agent's internal documentation and logs.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: Self Edit (org-skill-self-edit.org) #+TITLE: SKILL: Self Edit (org-skill-self-edit.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :system:autonomy:self-edit: #+FILETAGS: :system:autonomy:self-edit:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-self-edit.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-self-edit.lisp
* Overview * Overview
The *Self Edit* skill allows the OpenCortex Agent to modify its own literate source code. The *Self Edit* skill allows the OpenCortex Agent to modify its own literate source code.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: Self Fix (org-skill-self-fix.org) #+TITLE: SKILL: Self Fix (org-skill-self-fix.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :system:autonomy:self-fix: #+FILETAGS: :system:autonomy:self-fix:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-self-fix.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-self-fix.lisp
* Overview * Overview
The *Self Fix* skill enables the agent to automatically repair broken skills and harness components. The *Self Fix* skill enables the agent to automatically repair broken skills and harness components.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: Shell Actuator (org-skill-shell-actuator.org) #+TITLE: SKILL: Shell Actuator (org-skill-shell-actuator.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :skill:actuator:shell: #+FILETAGS: :skill:actuator:shell:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-shell-actuator.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-shell-actuator.lisp
* Overview * Overview
The *Shell Actuator* provides the agent with the capability to execute bash commands. The *Shell Actuator* provides the agent with the capability to execute bash commands.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: Tool Permissions (org-skill-tool-permissions.org) #+TITLE: SKILL: Tool Permissions (org-skill-tool-permissions.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :skill:security:permissions: #+FILETAGS: :skill:security:permissions:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-tool-permissions.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-tool-permissions.lisp
* Overview * Overview
The *Tool Permissions* skill manages the authorization levels for different cognitive tools. The *Tool Permissions* skill manages the authorization levels for different cognitive tools.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: Utils Lisp (org-skill-utils-lisp.org) #+TITLE: SKILL: Utils Lisp (org-skill-utils-lisp.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :skill:utils:lisp:validation:evaluation: #+FILETAGS: :skill:utils:lisp:validation:evaluation:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-utils-lisp.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-utils-lisp.lisp
* Overview * Overview
The *Utils Lisp* skill provides advanced structural validation, sandboxed evaluation, and formatting for Common Lisp code. The *Utils Lisp* skill provides advanced structural validation, sandboxed evaluation, and formatting for Common Lisp code.

View File

@@ -1,7 +1,7 @@
#+TITLE: SKILL: Utils Org (org-skill-utils-org.org) #+TITLE: SKILL: Utils Org (org-skill-utils-org.org)
#+AUTHOR: Agent #+AUTHOR: Agent
#+FILETAGS: :skill:utils:org: #+FILETAGS: :skill:utils:org:
#+PROPERTY: header-args:lisp :tangle /home/user/.local/share/opencortex/skills/org-skill-utils-org.lisp #+PROPERTY: header-args:lisp :tangle %%SKILLS_DIR%%/org-skill-utils-org.lisp
* Overview * Overview
The *Utils Org* skill provides advanced structural manipulation for Org-mode files and their AST representation. The *Utils Org* skill provides advanced structural manipulation for Org-mode files and their AST representation.