Claude-skill-registry gnu-recutils
Work with GNU recutils for plain-text record databases. Use when creating, querying, or validating .rec files, defining record schemas with %rec descriptors, converting between rec/CSV formats, or when the user mentions recutils, recsel, recins, recfmt, or record-oriented data files.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/gnu-recutils" ~/.claude/skills/majiayu000-claude-skill-registry-gnu-recutils && rm -rf "$T"
manifest:
skills/data/gnu-recutils/SKILL.mdsource content
GNU Recutils
GNU recutils is a set of tools for managing human-readable, plain-text databases. Records are stored in
.rec files with a simple field: value syntax.
Quick Reference
Core Commands
| Command | Purpose |
|---|---|
| Select and query records |
| Insert new records |
| Delete records |
| Modify field values |
| Validate, check integrity, sort |
| Format output with templates |
| Print information about rec files |
| Convert to CSV |
| Convert from CSV |
Basic File Format
# Comment line Field_name: field value Another_field: another value Field_name: second record Another_field: its value
Records are separated by blank lines. Field names are case-sensitive and conventionally capitalized.
Multi-line Values
Use
+ continuation for multi-line content:
Description: This is the first line + and this continues on the second line + and a third line too.
Or use backslash at end of line:
Description: This is a long value that \ continues on the next line.
Schema Definitions (%rec Descriptors)
Place schema declarations before records:
%rec: Entity %key: Id %mandatory: Id Name %allowed: Id Name Prototype Description OnLook OnTouch %type: Prototype rec Entity %type: Count int %type: Active bool %unique: Name Id: sword Name: Iron Sword Count: 1 Active: yes
Common Descriptors
| Descriptor | Purpose | Example |
|---|---|---|
| Names the record type | |
| Primary key (unique, mandatory) | |
| Required fields | |
| Whitelist of valid fields | |
| Forbidden fields | |
| Field must be unique | |
| Field type constraint | |
| Auto-generated field | |
| Default sort order | |
Field Types
| Type | Description | Example Values |
|---|---|---|
| Integer | , |
| Floating point | , |
| Boolean | , , , , , |
| Single line (no newlines) | |
| ISO 8601 date | |
| Email address | |
| UUID | |
| Foreign key reference | References another record type |
| Enumeration | One of the listed values |
| Regex pattern | Must match pattern |
| Max size in bytes | String length limit |
| Numeric range | |
Foreign Key References
%rec: Room %key: Id Id: tavern Name: The Rusty Tavern %rec: Entity %key: Id %type: Room rec Room Id: mug Name: Beer Mug Room: tavern
Entity Containment (MUDD)
Entities can be nested using a
Container field:
%rec: Entity %key: Id %type: Prototype rec Entity %type: Container rec Entity Id: table Name: Wooden Table Prototype: furniture Id: lamp Name: Brass Lamp Prototype: object Container: table
The lamp is "on" the table. Recfix validates that Container references exist.
Common Operations
Query Records
# All records recsel data.rec # Filter by field value recsel -e 'Name = "sword"' data.rec # Pattern matching recsel -e 'Name ~ "Iron"' data.rec # Numeric comparison recsel -e 'Count > 5' data.rec # Multiple conditions recsel -e 'Type = "weapon" && Count > 0' data.rec # Select specific fields recsel -p Id,Name data.rec # Count matching records recsel -c -e 'Active = yes' data.rec # Select by record type recsel -t Entity data.rec
Insert Records
# Insert from stdin echo -e "Id: axe\nName: Battle Axe" | recins data.rec # Insert with field values recins -f Id -v sword -f Name -v "Iron Sword" data.rec
Modify Records
# Update field value recset -e 'Id = "sword"' -f Count -s 5 data.rec # Delete field from record recset -e 'Id = "sword"' -f Obsolete -d data.rec
Delete Records
# Delete matching records recdel -e 'Count = 0' data.rec # Delete by record number recdel -n 3 data.rec
Validate
# Check file integrity recfix data.rec # Check and report all errors recfix --check data.rec
Convert Formats
# To CSV rec2csv data.rec > data.csv # From CSV csv2rec data.csv > data.rec
Format Output
# Custom output format recsel data.rec | recfmt '{{Id}}: {{Name}}\n' # Template-based formatting (recfmt reads from stdin) recsel data.rec | recfmt -f template.fmt
Expression Syntax
Used with
-e flag in recsel, recdel, recset:
| Operator | Meaning | Example |
|---|---|---|
| Equals | |
| Not equals | |
, , , | Numeric comparison | |
| Regex match | |
| Logical AND | |
| ` | ` | |
| Logical NOT | |
| Field count (0 if absent) | |
Tips
- Use
before loading data to catch schema violationsrecfix --check - Foreign keys (
) validate references exist%type: Field rec OtherType - Field names start with a letter and contain only
; special fields start with[a-zA-Z0-9_]% - Empty lines separate records; use
continuation for multi-line values+ - Comments start with
at the beginning of a line# - For JSON output, pipe through
and parse with a scriptrecsel -p
MUDD Naming Convention
In this project, entity fields use PascalCase (e.g.,
DescriptionShort, OnAttack). This avoids visual noise from underscores. See data/entities.rec for examples.