Skip to main content

Purpose

This skill allows AI agents to manually execute the Semantic Compaction process outside of the standard GitHub Actions PR workflow. It analyzes a provided diff file and uses an LLM to condense and append significant architectural changes into the project’s compressed memory tier (.agents/brain/current_state.dsom).

Prerequisites

  1. Python & uv: The uv package manager must be available on the system.
  2. Gemini API Key (Optional): The environment variable GEMINI_API_KEY or GOOGLE_API_KEY can be set in the executing terminal to leverage the Gemini AI API for compaction. If neither credential is set, the system automatically falls back to a zero-API local Semantic Compaction engine.
  3. Diff File: A valid Git diff file or text file containing changes must be prepared.

Execution Flow

When tasked with running the state sync locally, execute the following terminal command (ensure you replace <diff_file> with the actual path to your diff):

Execution Rules

  1. Never write the API key to disk: If the API key is not present in the environment, instruct the human operator to export it manually in their terminal session before proceeding.
  2. Review before execution: Generate the diff file locally first (e.g., git diff > local.diff) and verify its contents to prevent bloating the compaction prompt with irrelevant artifact changes.
  3. Verify Timestamp: After successful execution, check .agents/brain/current_state.dsom to ensure the timestamp in the OKF frontmatter was correctly updated.

Deep State of Mind (DSOM) For My AI Protocol | Harisfazillah Jamel (LinuxMalaysia) | 2026-07-27 Standard: UK English | DBP-standard Bahasa Melayu Malaysia (Piawai) | GNU General Public License v3.0