home / skills / redisearch / redisearch / read-unmodified-c-module

read-unmodified-c-module skill

/.skills/read-unmodified-c-module

This skill reads unmodified C module sources from a redis search engine project, enabling quick inspection before changes.

npx playbooks add skill redisearch/redisearch --skill read-unmodified-c-module

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
762 B
---
name: read-unmodified-c-module
description: Read the source of the C module we are working on, before we made any changes.
---

# Read Unmodified C Module

Read the source of the C module(s) we are working on, as they were before we made any changes.

## Arguments
- `<module path>`: Module name to read (e.g., `src/numeric_range_tree` or `src/aggregate/aggregate_debug`), without extension
- `<module path 1> <module path 2>`: Multiple module names to read

If the path doesn't include `src/`, assume it to be in the `src` directory. E.g. `numeric_range_tree` becomes `src/numeric_range_tree`.

## Instructions

For each module path:

```bash
# Read header file
git show master:<module path>.h
# Read implementation file
git show master:<module path>.c
```

Overview

This skill reads the original C module source as it existed on the master branch before any local edits. It fetches both the header (.h) and implementation (.c) files for one or more module paths so you can inspect the unmodified code. It normalizes paths by assuming the src/ directory when not specified.

How this skill works

For each provided module path the skill runs two git show commands against master to stream the header and implementation files. If a path lacks an explicit src/ prefix, the skill prepends src/ automatically. Multiple module paths can be supplied and each pair of files is retrieved in sequence.

When to use it

  • Verify original implementation before starting edits or refactors
  • Compare current workspace changes to the repository baseline
  • Audit function signatures, data structures, and comments from master
  • Recover lost content after accidental local modifications or resets

Best practices

  • Provide module names without file extensions; the skill fetches .h and .c automatically
  • Use paths relative to the project root; omit src/ to use the default src/ prefix
  • Query a small number of modules at a time to keep output manageable
  • Run this before creating branches or writing unit tests to ensure a correct baseline

Example use cases

  • Inspect src/numeric_range_tree.h and .c before changing tree balancing logic
  • Read src/aggregate/aggregate_debug files to understand aggregation internals
  • Quickly fetch headers and implementations for multiple modules to prepare a code review
  • Confirm original vector search data structures exist before modifying indexing routines

FAQ

What input formats are accepted?

Supply one or more module paths without extensions. If you omit src/, the skill prepends src/ automatically.

What happens if a file is missing on master?

The git show command will fail for that file; handle missing files by verifying the exact module path or checking branch availability.