搜索

PythonReactSEOPDF
OpenClaw

openclaw-interchange

Shared .md interchange library for OpenClaw skills — atomic writes, deterministic serialization, YAML frontmatter, advisory locking, and schema validation. The foundation all other OpenClaw skills build on.

frank-bot070 来源安装数☆ 0 仓库 Stars

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install frank-bot07/openclaw-interchange

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

@openclaw/interchange

The shared library that powers agent-to-agent communication via .md files.

Usage

import { writeMd, readMd, acquireLock } from '@openclaw/interchange';

// Write an interchange file atomically
await writeMd('ops/status.md', { skill: 'crm', status: 'healthy' }, '## Status\nAll systems go.');

// Read it back
const { meta, content } = readMd('ops/status.md');

Key Features

  • Atomic writes (tmp + fsync + rename)
  • Deterministic serialization (sorted keys, stable YAML)
  • Advisory file locking with stale lock detection
  • YAML frontmatter parsing
  • Schema validation
  • Circuit breaker pattern
  • Generation tracking + content hashing

来源信息

Source
github
Repository
openclaw/skills
Path
skills/frank-bot07/openclaw-interchange
Version
—
Commit
3fdac638e8064cf949a873d256369dadcd4ac07a
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

README

@openclaw/interchange

Tests Node License: MIT

The shared .md interchange library that every OpenClaw skill builds on.

Interchange provides atomic file I/O, deterministic serialization, YAML frontmatter parsing, advisory locking, and schema validation for .md interchange files. It's the foundation layer — ensuring that every skill speaks the same language and every write is crash-safe.

Features

  • Atomic writes — tmp + fsync + rename protocol prevents partial writes
  • Deterministic serialization — same input always produces byte-identical output
  • YAML frontmatter — read/write structured metadata in .md files
  • Advisory locking — prevent concurrent writes from multiple agents
  • Schema validation — validate frontmatter and interchange layers
  • Content hashing & generations — track changes with generation IDs and content hashes
  • Staleness detection — check if interchange files need regeneration
  • DB-to-interchange reconciliation — sync database state to .md files
  • Circuit breaker — resilient I/O with automatic failure detection
  • Helpers — slugify, table formatting, currency formatting, relative time

Quick Start

cd skills/interchange
npm install
import { readMd, writeMd, acquireLock, releaseLock, validateFrontmatter } from '@openclaw/interchange';

// Read a .md interchange file
const doc = readMd('path/to/file.md');
console.log(doc.frontmatter, doc.body);

// Atomic write with frontmatter
writeMd('path/to/output.md', {
  frontmatter: { type: 'report', generated: new Date().toISOString() },
  body: '## Summary\nAll systems operational.'
});

// Advisory locking
const lock = acquireLock('path/to/file.md');
try {
  // ... safe writes ...
} finally {
  releaseLock(lock);
}

API Reference

| Export | Descrip...

来源内容

SKILL.md
# @openclaw/interchange

The shared library that powers agent-to-agent communication via `.md` files.

## Usage

```javascript
import { writeMd, readMd, acquireLock } from '@openclaw/interchange';

// Write an interchange file atomically
await writeMd('ops/status.md', { skill: 'crm', status: 'healthy' }, '## Status\nAll systems go.');

// Read it back
const { meta, content } = readMd('ops/status.md');
```

## Key Features
- Atomic writes (tmp + fsync + rename)
- Deterministic serialization (sorted keys, stable YAML)
- Advisory file locking with stale lock detection
- YAML frontmatter parsing
- Schema validation
- Circuit breaker pattern
- Generation tracking + content hashing
README
# @openclaw/interchange

[![Tests](https://img.shields.io/badge/tests-32%20passing-brightgreen)]() [![Node](https://img.shields.io/badge/node-%3E%3D18-blue)]() [![License: MIT](https://img.shields.io/badge/license-MIT-yellow)]()

> The shared .md interchange library that every OpenClaw skill builds on.

Interchange provides atomic file I/O, deterministic serialization, YAML frontmatter parsing, advisory locking, and schema validation for `.md` interchange files. It's the foundation layer — ensuring that every skill speaks the same language and every write is crash-safe.

## Features

- **Atomic writes** — tmp + fsync + rename protocol prevents partial writes
- **Deterministic serialization** — same input always produces byte-identical output
- **YAML frontmatter** — read/write structured metadata in `.md` files
- **Advisory locking** — prevent concurrent writes from multiple agents
- **Schema validation** — validate frontmatter and interchange layers
- **Content hashing & generations** — track changes with generation IDs and content hashes
- **Staleness detection** — check if interchange files need regeneration
- **DB-to-interchange reconciliation** — sync database state to `.md` files
- **Circuit breaker** — resilient I/O with automatic failure detection
- **Helpers** — slugify, table formatting, currency formatting, relative time

## Quick Start

```bash
cd skills/interchange
npm install
```

```js
import { readMd, writeMd, acquireLock, releaseLock, validateFrontmatter } from '@openclaw/interchange';

// Read a .md interchange file
const doc = readMd('path/to/file.md');
console.log(doc.frontmatter, doc.body);

// Atomic write with frontmatter
writeMd('path/to/output.md', {
  frontmatter: { type: 'report', generated: new Date().toISOString() },
  body: '## Summary\nAll systems operational.'
});

// Advisory locking
const lock = acquireLock('path/to/file.md');
try {
  // ... safe writes ...
} finally {
  releaseLock(lock);
}
```

## API Reference

| Export | Descrip...

相关技能

OpenClaw

x402hub

capncoconut

Register, communicate, and earn on the x402hub AI agent marketplace. Use when an agent needs to register on x402hub, browse or claim bounties, submit deliverables, send messages to other agents via x402 Relay,...

OpenClaw

claw

capevace

Real-time event bus for AI agents. Publish, subscribe, and share live signals across a network of agents with Unix-style simplicity.

OpenClaw

captchas-openclaw

captchasco

OpenClaw integration guidance for CAPTCHAS Agent API, including OpenResponses tool schemas and plugin tool registration.