Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

Trajectory Memory

БесплатноЗапускает вложенные скриптыНе проверен

Use when any research pipeline skill needs project-local JSONL ReAct trajectory memory, reusable prior context from similar projects, or durable…

yihanghu2004от yihanghu200467 установок в других каталогах

Об этом скилле

Skill: trajectory-memory

This is a cross-cutting companion skill for the research pipeline. It does not replace evidence management. It tells the agent how to use project-local trajectory memory as workflow memory.

Scope

Use this skill whenever a project-stage skill starts, resumes, or finishes a meaningful tool/action step.

The project-local memory files are:

state/projects/<slug>/trajectory_context.md
state/projects/<slug>/trajectory_memory.jsonl
state/projects/<slug>/trajectory_summary.md

trajectory_context.md contains reusable workflow priors retrieved from similar old projects when the project was initialized.

trajectory_memory.jsonl contains this project's own append-only ReAct trace.

trajectory_summary.md contains compressed project-local workflow memory. It is generated from trajectory_memory.jsonl and should be read before the raw recent tail when the JSONL trace grows long.

Hard Rules

  1. Treat trajectory memory as workflow prior only.
  2. Never treat trajectory memory as literature evidence.
  3. Any paper claim, metric, dataset fact, limitation, or citation still requires an EV record in evidence.json.
  4. Do not copy old-project conclusions into the new project without current evidence.
  5. Do not use root-level/global trajectory_memory.jsonl; memory is project-local.
  6. Do not bulk-load huge JSONL logs. Use get_recent_context() or stream recent records only.
  7. Treat trajectory_summary.md as compressed workflow memory only. It is never a replacement for evidence.json.

Start-Of-Skill Protocol

Before executing a research-stage skill:

  1. Identify the active <slug>.
  2. Read state/projects/<slug>/trajectory_context.md if it exists.
  3. Read state/projects/<slug>/trajectory_summary.md if it exists.
  4. Read the current project's recent trajectory context and log that read as a visible memory step:
python scripts/trajectory_logger.py state/projects/<slug> retrieve \
  --requester-phase "<phase>" \
  --source trajectory_context.md \
  --source trajectory_summary.md \
  --source trajectory_memory.jsonl \
  --n 5 \
  --output both
  1. Use the retrieved context to avoid repeated failed searches, reuse useful workflow patterns, and preserve known project-specific constraints.
  2. If the context conflicts with evidence.json, project.md, or the user's latest instruction, prefer the current project files and user instruction.

The command output contains a MEMORY CHECK CARD. Surface that card in the interactive reply before running the stage action.

Logging Protocol

After each meaningful action, append one ReAct step:

python scripts/trajectory_logger.py state/projects/<slug> log \
  --phase "<phase>" \
  --thought "<why this action is needed before execution>" \
  --action-name "<tool_or_script_name>" \
  --action-param key=value \
  --observation "<objective result after execution>" \
  --reflection "<optional lesson, retry reason, or next constraint>" \
  --output both

The log command also appends a Memory_Store bookkeeping step by default, so the workspace timeline shows what project memory was stored. Use --no-store-event only for maintenance scripts that must avoid bookkeeping noise.

The command output contains a TRAJECTORY ACTION CARD and a MEMORY STORE CARD. Surface both cards in the interactive reply after completing the stage action.

Use stable phase names such as:

Memory_Retrieve
Memory_Store
S1_ArxivSearch
S2_SemanticScholar
S3_PaperReader
S4_LitReview
S5_ResearchPlanner
S6_ReportWriting
S7_ClaimAudit
S8_PaperReview
S9_ScienceSlides
Project_Init
Session_Restore

For a human-facing view of both research actions and memory IO, run:

python scripts/trajectory_logger.py state/projects/<slug> timeline --n 20

Context Compaction Protocol

When the trajectory JSONL becomes too long for prompt injection, compress old steps into a bounded summary and keep a recent raw tail. This follows the same principle as coding-agent context compaction: durable summary first, recent verbatim context second, raw log preserved for audit.

Run compaction after a long stage, before session handoff, or before using a project as reusable memory for future projects:

python scripts/trajectory_logger.py state/projects/<slug> compact \
  --keep-recent 8 \
  --max-chars 9000 \
  --output both

This writes:

state/projects/<slug>/trajectory_summary.md

and appends a visible Memory_Compact step to trajectory_memory.jsonl.

The command output contains a CONTEXT COMPRESSION CARD. Surface that card in the interactive reply when compaction is part of the workflow.

For prompt injection after compaction, use:

python scripts/trajectory_logger.py state/projects/<slug> compressed \
  --recent-n 5 \
  --summary-chars 6000

The compressed context must preserve:

last known state
phase-aware progress
durable decisions
reusable workflow lesso
Полный SKILL.md на ClawHub

Установить Trajectory Memory в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл Trajectory Memory?

Use when any research pipeline skill needs project-local JSONL ReAct trajectory memory, reusable prior context from similar projects, or durable thought/action/observation/reflection logging. Applies before and after arxiv-search, semantic-scholar, paper-reader, literature-synthesis, research-planner, report-writer, claim-auditor, paper-reviewer, and science-slides.

Как установить скилл Trajectory Memory?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Trajectory Memory запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить Trajectory Memory с