Skip to content

v0.1.2 — Handoff Prompt Enrichment

Choose a tag to compare

@VKirill VKirill released this 13 May 23:59

v0.1.2 — Handoff Prompt Enrichment

RU

В этом релизе улучшен UserPromptSubmit hook для handoff-режима Codex.

Что добавлено

  • handoff-intake-classifier.py теперь формирует не только intent/flags, но и более профессиональный normalized_task_brief для implementation-запросов.
  • Для архитектурных запросов hook добавляет engineering vocabulary: root-cause analysis, architecture boundaries, typed contracts, canonical source of truth, call graph impact, migration/removal of obsolete paths, scoped verification.
  • Добавлен deterministic repo profile из текущей рабочей директории:
    • root и nearest-workspace package.json;
    • runtime engines и packageManager;
    • npm workspaces / monorepo layout;
    • allowlist архитектурно значимых dependency versions: frameworks, backend, TypeScript, build tools, test/e2e, ORM/database, cache/queue, contracts/API, UI, quality, observability/logging;
    • AGENTS.md правила, включая GitNexus impact analysis и detect_changes, если они есть в проекте.
  • Короткие follow-up prompts вроде доработай, продолжай, ещё, тогда, сделай так теперь могут использовать предыдущий локальный hook context перед вызовом LLM.
  • Добавлено приватное локальное state-хранилище для предыдущего prompt/context:
    • сначала ~/.codex/private/handoff-classifier-state.json;
    • fallback ~/.codex/memories/handoff-classifier-state.json, если private path read-only;
    • override через HANDOFF_CLASSIFIER_STATE_PATH;
    • state ограничен по размеру и пишется с правами 0600.
  • Добавлен redaction распространённых secrets перед повторным использованием контекста: sk-*, OPENAI_API_KEY=..., TOKEN=..., Authorization: Bearer ....
  • Увеличен default LLM timeout до 4.0, чтобы расширенный prompt enrichment не откатывался в deterministic слишком часто.
  • README и README-RU обновлены под новый workflow.

Практический эффект

Фраза вроде доработай пожалуйста после предыдущей задачи больше не выглядит для classifier как пустой запрос. Hook подтягивает предыдущий локальный context и помогает модели понять, что именно нужно продолжать, сохраняя scope текущей сессии/репозитория.

Для проектов вроде Node/Nuxt hook теперь подставляет конкретный стек, например Nuxt/Vue/TypeScript/Vitest/Tailwind/Zod/Turbo версии, если они реально есть в package.json.

Проверка

  • python3 -m py_compile hooks/handoff-intake-classifier.py scripts/validate-pack.py
  • python3 scripts/validate-pack.py
  • git diff --check
  • ручной двухшаговый тест follow-up prompt: полный prompt -> доработай пожалуйста
  • ручной тест repo profile для selfystudio/apps/admin и selfystudio/packages/ai-prompts

EN

This release improves the Codex handoff UserPromptSubmit hook.

Added

  • handoff-intake-classifier.py now emits not only intent/flags, but also a professional normalized_task_brief for implementation prompts.
  • Architecture-grade prompts now receive engineering vocabulary: root-cause analysis, architecture boundaries, typed contracts, canonical source of truth, call graph impact, migration/removal of obsolete paths, and scoped verification.
  • Added deterministic repo profile extraction from the current working directory:
    • root and nearest-workspace package.json;
    • runtime engines and packageManager;
    • npm workspaces / monorepo layout;
    • allowlisted architecture-significant dependency versions: frameworks, backend, TypeScript, build tools, test/e2e, ORM/database, cache/queue, contracts/API, UI, quality, observability/logging;
    • AGENTS.md project rules, including GitNexus impact analysis and detect_changes when present.
  • Short follow-up prompts like доработай, продолжай, ещё, тогда, and сделай так can now use the previous local hook context before calling the LLM.
  • Added private local state for the previous prompt/context:
    • primary path: ~/.codex/private/handoff-classifier-state.json;
    • fallback path: ~/.codex/memories/handoff-classifier-state.json when the private path is read-only;
    • override via HANDOFF_CLASSIFIER_STATE_PATH;
    • state is capped and written with 0600 permissions.
  • Added redaction for common secrets before context reuse: sk-*, OPENAI_API_KEY=..., TOKEN=..., Authorization: Bearer ....
  • Raised the default LLM timeout to 4.0 so richer prompt enrichment is less likely to fall back to deterministic mode.
  • Updated README and README-RU for the new workflow.

Practical impact

A phrase like доработай пожалуйста after a previous task no longer looks empty to the classifier. The hook uses previous local context to help the model understand what to continue while keeping scope anchored to the current session/repo.

For Node/Nuxt projects, the hook now injects the actual relevant stack, such as Nuxt/Vue/TypeScript/Vitest/Tailwind/Zod/Turbo versions, when those packages are present in package.json.

Verification

  • python3 -m py_compile hooks/handoff-intake-classifier.py scripts/validate-pack.py
  • python3 scripts/validate-pack.py
  • git diff --check
  • manual two-step follow-up prompt test: full prompt -> доработай пожалуйста
  • manual repo profile tests for selfystudio/apps/admin and selfystudio/packages/ai-prompts