CommunityWriting & Editinggithub.com

DDDFXYqiming/Agent_Extensions

Agent Skills & DeepSeek Harness (DSH) extension library: General-purpose agent skills (General_skills) + DSH standard plugins (dsh-plugin), an out-of-the-box AI Agent capability enhancement collection.

What is Agent_Extensions?

This skill provides a cross-session long-term memory management system for AI agents (e.g., Claude Code, Cursor, Codex) integrated with the DeepSeek Harness (DSH) framework. It organizes memory into three levels: L1 (index, visible every turn), L2 (environment facts), and L3 (task experience/SOPs). The system defines explicit triggers for reading memory (e.g., new tasks, encountering difficulties) and writing memory (only after successful action verification, with mandatory evidence). It prohibits writing unverified information, ephemeral state, or common knowledge. The skill also includes tools like `memory_list`, `memory_read`, `memory_write`, and `memory_index` for programmatic access, and follows principles of action verification, minimal sufficiency, and immutability of verified facts. It is designed to reduce costly retries by persisting environment-specific facts and complex task experience.

Works with~Claude Code~Codex CLI~Cursor
npx skills add DDDFXYqiming/Agent_Extensions

Installed? Explore more Writing & Editing skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Memory Management (DSH Edition)

Cross-session long-term memory: L1 index injection (visible every turn) + L2 environment facts + L3 task experience.

Trigger Timing

Reading (When to Look Up Memory)

  • At the start of a new task: if the task involves the local environment, tool configuration, specific tech stacks, or similar things done before → first memory_list to see what's available, then memory_read to retrieve relevant entries
  • When encountering difficulties / hitting obstacles: memory_read to check if there is a relevant SOP (keyword match against sops/ filenames or facts section)
  • Memory index in model prompt (memory:index): L1 existence index visible every turn — when related trigger words are seen, actively call memory_read/memory_list to get details

Writing (When to Consolidate Memory)

When a task is completed (or a phase is completed) and there is information validated by successful actions, call memory_write:

Can Write (must include evidence):

  • Environment-specific facts: paths, configurations, measured parameters, tool behavior (→ entry_type: fact)
  • Complex task experience: pain points that required multiple retries to succeed, hidden preconditions, stable steps (→ entry_type: sop)
  • General hard rules (→ also possible via memory_write sop or directly suggest maintaining [RULES])

Forbidden to Write (writing would be pollution):

  • ❌ Information without verification evidence (no action, no memory)
  • ❌ Model's inherent knowledge, reasoned guesses, unverified assumptions
  • ❌ Ephemeral state: timestamps, PIDs, temporary paths, one-time IDs
  • ❌ General common sense, log records, details of reasoning steps

Index Synchronization

  • memory_write automatically syncs the L1 index; manual operation is usually unnecessary
  • After manually modifying facts.md / sops/ files → memory_index to rebuild the index
  • When the index exceeds 30 lines: trim [RULES] (word-level edits, do NOT overwrite the full text)

Storage Layout

<home>/.dsh/memory/
├── memory_management_sop.md   L0 meta-rules (how to manage memory)
├── index.txt                  L1 index (≤30 lines: L2/L3 existence list + RULES)
├── facts.md                   L2 environment facts (## SECTION)
├── sops/*.md                  L3 task experience
└── file_access_stats.json     read frequency statistics

Tools

ToolPurpose
memory_listList all memory (facts + sops + index line count)
memory_readRead specified memory (index / fact topic / sop filename)
memory_writeWrite memory (fact/sop, evidence required)
memory_indexRebuild the L1 index automatic section

Principles

  1. Action Verification: No Execution, No Memory. Only write information that has been successfully verified.
  2. Minimum Sufficiency: Keep content as short as possible; only record information whose forgetting would lead to costly retries.
  3. Do Not Delete or Alter Verified Facts: You may compress or migrate, but never discard.
  4. Active Writing: Memory writes are always initiated by the model/user; the system will never automatically modify configurations or install plugins.

Related Skills