Add SKILLS.md documentation for Claude Code slash commands#312
Add SKILLS.md documentation for Claude Code slash commands#312
Conversation
Documents the seven Claude Code slash-command skills available in this repo, with usage guidance, examples, and a hooks-vs-asking-Claude clarification section. https://claude.ai/code/session_01KTsbYTi2RdaKZTR6HKd7KF
There was a problem hiding this comment.
Pull request overview
Adds a new top-level SKILLS.md reference document describing Claude Code slash-command “skills” intended for use by agents working in the libCacheSim repository.
Changes:
- Introduces
SKILLS.mdwith a quick-reference table and detailed sections for seven skills. - Adds guidance on hooks vs one-off Claude interactions, with libCacheSim-oriented examples.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
SKILLS.md
Outdated
|
|
||
| **libCacheSim example hook:** | ||
| ```bash | ||
| cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build -j$(nproc) |
There was a problem hiding this comment.
The libCacheSim example hook uses -j$(nproc), which won’t work on macOS (CI includes macOS). Consider using a cross-platform parallel build flag (e.g., CMake’s --parallel) or documenting an OS-specific alternative so the example runs on all supported platforms.
| cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build -j$(nproc) | |
| cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build --parallel |
SKILLS.md
Outdated
| Sets up a `SessionStart` hook so every new Claude Code session begins by verifying the project is in a known-good state: dependencies installed, build passing, tests green. | ||
|
|
||
| ``` | ||
| /session-start-hook | ||
| ``` |
There was a problem hiding this comment.
This section says the SessionStart hook verifies dependencies and that tests are green, but the provided example hook only configures and builds. Either adjust the description to match what the example does, or extend the example to also cover dependency setup and running ctest so the guidance is consistent.
There was a problem hiding this comment.
Code Review
This pull request introduces a new documentation file, SKILLS.md, which provides a comprehensive guide to Claude Code slash-commands for the libCacheSim repository. The review identified three areas for improvement: updating the quick reference table for the /loop command to reflect that it accepts prompts, standardizing the build directory naming to _build for consistency and portability, and clarifying that the traces in the data/ directory are intended for functional smoke tests rather than performance regression checks.
SKILLS.md
Outdated
| | `update-config` | `/update-config` | Configure the Claude Code harness via `settings.json` | | ||
| | `session-start-hook` | `/session-start-hook` | Set up `SessionStart` hooks (build checks, linters) | | ||
| | `simplify` | `/simplify` | Review changed code for quality, reuse, and efficiency | | ||
| | `loop` | `/loop [interval] [cmd]` | Run a command repeatedly on a timed interval | |
There was a problem hiding this comment.
The syntax description for the /loop command in the quick reference table is inconsistent with the detailed section (line 76) and the examples (line 82), which show that it can accept a natural language prompt as well as a command.
| | `loop` | `/loop [interval] [cmd]` | Run a command repeatedly on a timed interval | | |
| | loop | /loop [interval] [command/prompt] | Run a command or prompt repeatedly on a timed interval | |
SKILLS.md
Outdated
|
|
||
| **libCacheSim example hook:** | ||
| ```bash | ||
| cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build -j$(nproc) |
There was a problem hiding this comment.
The example uses build as the build directory, but the README.md (line 104) and other parts of the documentation use _build. For consistency and to avoid confusion with .gitignore rules, it's better to use _build. Additionally, nproc is not available on macOS; using cmake --build _build -j is a more portable way to enable parallel builds across the platforms supported by this project.
| cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build -j$(nproc) | |
| cmake -S . -B _build -DCMAKE_BUILD_TYPE=Release && cmake --build _build -j |
SKILLS.md
Outdated
| ``` | ||
|
|
||
| **When to use:** | ||
| - Nightly performance regression checks against reference traces in `data/` |
There was a problem hiding this comment.
The README.md (line 364) explicitly states that the traces in data/ are small samples and should not be used for evaluating performance or miss ratios. Suggesting "performance regression checks" against these traces might lead to misleading results due to their small size and high variance. It would be more accurate to describe these as functional regression checks or smoke tests.
| - Nightly performance regression checks against reference traces in `data/` | |
| - Nightly functional regression checks (smoke tests) against sample traces in data/ |
Documents what agents can actually do in this repo: build, simulate, analyze traces, profile MRCs, plot results, use the C API, add algorithms, write plugins, and run tests. https://claude.ai/code/session_01KTsbYTi2RdaKZTR6HKd7KF
| # libCacheSim Skills for Agents | ||
|
|
||
| What you can do in this repository. Each section maps to a concrete capability, the tool or API that provides it, and the commands to invoke it. |
There was a problem hiding this comment.
Following the doc https://code.claude.com/docs/en/skills
We can change it with standard frontmatter
e.g.
---
name: libcachesim
description: Build, run, profile, and extend libCacheSim in this repository. Use this skill when the task involves cache simulation, miss ratio analysis, trace inspection, MRC profiling, trace conversion, synthetic trace generation, or adding a new eviction algorithm.
---
# libCacheSim Skill
| ./build/test_plugin trace.oracleGeneral oracleGeneral 1073741824 | ||
| ``` | ||
|
|
||
| Implement the six hooks in your plugin: `plugin_init`, `plugin_hit`, `plugin_miss`, `plugin_eviction`, `plugin_remove`, `plugin_free`. See `example/plugin_v2/myPlugin.cpp`. |
There was a problem hiding this comment.
Hallucination happens: file name and hook name mismatching
|
|
||
| ## Trace formats | ||
|
|
||
| | Format | Description | |
There was a problem hiding this comment.
Do we want to add lcs format?
| ## Add a new eviction algorithm | ||
|
|
||
| 1. Create `libCacheSim/cache/eviction/MyAlgo.c` — implement `init`, `get`, `find`, `insert`, `evict`, `remove`, `free`. | ||
| 2. Register it in `libCacheSim/cache/cacheObj.c` and the algo name map. |
There was a problem hiding this comment.
Halluciation happens:
Extra metadata should be registered in libCacheSim/include/libCacheSim/cacheObj.h and algo name map should be added via libCacheSim/bin/cachesim/cache_init.h
Summary
This PR adds comprehensive documentation for Claude Code slash-command skills available to agents working in the libCacheSim repository. The new
SKILLS.mdfile serves as a reference guide for developers and automated agents using Claude Code features.Changes
SKILLS.md: A new documentation file that catalogs seven Claude Code skills with:Notable Details
/simplify,/loop) and persistent infrastructure (/schedule,/session-start-hook)SessionStarthook for libCacheSim (CMake configuration and build)settings.jsonhttps://claude.ai/code/session_01KTsbYTi2RdaKZTR6HKd7KF