Context worker

From oimiragieo/agent-studio · View interactive version

Context worker is an AI agent skill from the GitHub repository oimiragieo/agent-studio. Context management — pre-compact persistence, threshold alignment, microcompact/circuit breaker detection

How to use this skill

Skill file

Context Worker

NOTE: Startup and cleanup are handled by worker-base. This skill defines the WORK PROCEDURE.

When to Use This Skill

Features that modify context management hooks, memory consolidation, daily log infrastructure, mtime-based locking, or session-counting triggers.

Work Procedure

  1. Read the feature description carefully. Understand the exact behavior changes and how they integrate with existing memory infrastructure.
  1. Read source files. Before modifying:
  1. Write tests first (red). Create test file at tests/lib/memory/<descriptive-name>.test.cjs or tests/hooks/<name>.test.cjs. Tests must cover:

Use temp directories for filesystem isolation. Run tests — they should FAIL.

  1. Implement changes.
  1. Run tests (green). All tests pass.
  1. Run lint and format.

```

pnpm lint

npx prettier --check <modified-files>

```

  1. Run related existing tests for regression.

Example Handoff

{
  "salientSummary": "Created daily log writer with UTC timestamped entries, recursive dir creation, and fail-open behavior. Integrated into session-end hook. 18 tests.",
  "whatWasImplemented": "appendDailyLog() in memory-daily-log.cjs creates logs/YYYY/MM/YYYY-MM-DD.md directories recursively, appends timestamped bullets, sanitizes content. Session-end hook calls appendDailyLog after STM→MTM promotion.",
  "whatWasLeftUndone": "",
  "verification": {
    "commandsRun": [
      { "command": "node --test tests/lib/memory/daily-log.test.cjs", "exitCode": 0, "observation": "18 tests passing" },
      { "command": "pnpm lint", "exitCode": 0, "observation": "0 errors" }
    ]
  }
}

When to Return to Orchestrator

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.