reskill
CLAUDE.md60 starsChanged 9 months agoMITView on GitHub
reskill is a Git-based package manager for AI agent skills, similar to npm/Go modules. It provides declarative configuration (skills.json), version locking (skills.lock), and seamless synchronization for managing skills across projects and teams. Supported Agents: Cursor, Claude Code, Codex, OpenCode, Windsurf, GitHub Copilot, and more.
- Installs packages
In this repository8 other files it gives its agents.
- .cursor/rules/collaboration.mdcCursor rule
- .cursor/rules/development.mdcCursor rule
- .cursor/rules/testing.mdcCursor rule
- code-confidence-mapSkill
- find-skillsSkill
- reskill-usageSkill
- skill-sync-checkerSkill
- vibe-coding-guardianSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
25 rules. About 0 are common, 11 are distinctive, and 14 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 109
ConfigLoader: Read/write skills.json
- Very specific: line 110
LockManager: Read/write skills.lock for version locking
- Distinctive: line 116
Git as Registry: - No additional service needed, any Git repo is a skill source
- Distinctive: line 119
Zero Invasion: - Does not modify existing project structure
- Distinctive: line 120
Global Cache: - Avoid redundant downloads
- Distinctive: line 126
All comments, variable names, and commit messages in English
- Very specific: line 127
Use node: prefix for Node.js built-in imports
- Distinctive: line 128
Import order: Node built-ins → External deps → Internal modules
- Very specific: line 132
Prefer type over interface for simple type aliases
- Distinctive: line 133
Use explicit return types for public functions
- Very specific: line 134
Avoid any, use unknown with type guards
- Very specific: line 135
Use readonly for immutable properties
- Distinctive: line 138
Use descriptive error messages in English
- Distinctive: line 140
Always clean up resources in error cases
- Very specific: line 143
Use utilities from src/utils/fs.ts: exists, readJson, writeJson, remove, ensureDir, createSymlink
- Very specific: line 146
Use logger from src/utils/logger.ts: info, success, warn, error, debug, package
- Very specific: line 160
Use temp directories for file system tests, clean up in afterEach
- Very specific: line 165
Run with pnpm test:integration (builds first, then runs CLI commands)
- Distinctive: line 172
Reproduce: - Write a failing test that reproduces the bug
- Distinctive: line 174
Verify: - Ensure no regression in other tests
- Very specific: line 207
Use pnpm run version or pnpm changeset version (NOT pnpm version)
- Distinctive: line 244
When creating or modifying CLI commands:
- Very specific: line 267
Do not add registry-url to setup-node.
- Very specific: line 269
Keep permissions.id-token: write on any job that publishes.
- Very specific: line 277
Use conventional commits: type(scope): description
≈ “Common” is an estimate: at least 1 in 5 of the 28,633 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
reskill is a Git-based package manager for AI agent skills, similar to npm/Go modules. It provides declarative configuration (skills.json), version locking (skills.lock), and seamless synchronization for managing skills across projects and teams.
Supported Agents: Cursor, Claude Code, Codex, OpenCode, Windsurf, GitHub Copilot, and more.
Tech Stack
- Language: TypeScript (ES Modules)
- Runtime: Node.js >= 18.0.0 (published package); Node.js >= 22.13 to develop, since pnpm 11 requires it
- Build Tool: Rslib (Rspack-based library bundler)
- Package Manager: pnpm 11 (pinned via
packageManager; settings live inpnpm-workspace.yaml, not thepnpmfield) - Testing: Vitest with @vitest/coverage-v8
- CLI Framework: Commander.js
Development Commands
pnpm install # Install dependencies
pnpm dev # Development mode (watch)
pnpm build # Build with Rslib
pnpm test # Run tests in watch mode
pnpm test:run # Run tests once
pnpm test:coverage # Run tests with coverage
pnpm test:integration # Build and run integration tests
pnpm lint # Lint with Biome
pnpm lint:fix # Lint and auto-fix
pnpm typecheck # TypeScript type checkingArchitecture
System Overview
┌────────────────────────────────────────────────────────────────┐
│ User Interface │
│ │
│ CLI Commands: init, install, list, info, update, outdated │
│ uninstall, link, unlink │
└──────────────────────────────┬─────────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────────────┐
│ SkillManager │
│ (Core Orchestrator) │
│ │
│ - Coordinates all skill operations │
│ - Manages installation workflow │
│ - Handles multi-agent distribution │
└───────────────────────────────┬────────────────────────────────┘
│
┌──────────────────┼────────┼─────────┼──────────────────┐
│ │ │ │
▼ ▼ ▼ ▼
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ GitResolver │ │ CacheManager │ │ Installer │
│ │ │ │ │ │
│ - Parse refs │ │ - Cache ops │ │ - Symlink │
│ - Resolve │ │ - degit │ │ - Copy │
│ versions │ │ - Storage │ │ - Multi- │
│ - Build URLs │ │ │ │ agent │
└──────────────────┘ └──────────────────┘ └──────────────────┘
│ │ │ │
└──────────────────┼──────────────────┼──────────────────┘
│ │
┌──────────────────┼──────────────────┼──────────────────┐
│ │ │ │
▼ ▼ ▼ ▼
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ ConfigLoader │ │ LockManager │ │ AgentRegistry │
│ │ │ │ │ │
│ - skills. │ │ - skills. │ │ - Agent │
│ json │ │ lock │ │ types │
│ - Read/ │ │ - Version │ │ - Paths │
│ Write │ │ tracking │ │ - Detection │
└──────────────────┘ └──────────────────┘ └──────────────────┘Directory Structure
src/
├── cli/ # CLI commands (Commander.js)
│ ├── commands/ # Individual command handlers
│ └── index.ts # CLI entry point
├── core/ # Core business logic
│ ├── skill-manager.ts # Main orchestrator
│ ├── git-resolver.ts # Git URL parsing and version resolution
│ ├── cache-manager.ts # Global cache (~/.reskill-cache)
│ ├── config-loader.ts # skills.json handling
│ ├── lock-manager.ts # skills.lock handling
│ ├── installer.ts # Multi-agent installation (symlink/copy)
│ ├── agent-registry.ts # Agent type definitions and paths
│ └── skill-parser.ts # SKILL.md parsing
├── types/ # TypeScript type definitions
└── utils/ # Shared utilities (fs, git, logger)Core Module Responsibilities
- SkillManager: Main orchestrator integrating all components
- GitResolver: Parse skill refs (
github:user/repo@v1.0.0), resolve versions, build repo URLs - CacheManager: Global cache operations using degit
- ConfigLoader: Read/write
skills.json - LockManager: Read/write
skills.lockfor version locking - Installer: Handle multi-agent installation to paths like
.cursor/skills/,.claude/skills/ - AgentRegistry: Define supported agents and their installation paths
Design Principles
- Git as Registry - No additional service needed, any Git repo is a skill source
- Declarative Config - skills.json clearly expresses project dependencies
- Version Locking - skills.lock ensures team consistency
- Zero Invasion - Does not modify existing project structure
- Global Cache - Avoid redundant downloads
- Multi-Agent Support - One skill, deploy to multiple AI agents
Code Conventions
Language Requirements
- All comments, variable names, and commit messages in English
- Use
node:prefix for Node.js built-in imports - Import order: Node built-ins → External deps → Internal modules
- File names: kebab-case (e.g.,
skill-manager.ts)
TypeScript Standards
- Prefer
typeoverinterfacefor simple type aliases - Use explicit return types for public functions
- Avoid
any, useunknownwith type guards - Use
readonlyfor immutable properties
Error Handling
- Use descriptive error messages in English
- Log errors with appropriate log levels
- Always clean up resources in error cases
File Operations
Use utilities from src/utils/fs.ts: exists, readJson, writeJson, remove, ensureDir, createSymlink
Logging
Use logger from src/utils/logger.ts: info, success, warn, error, debug, package
Testing Requirements
Testing Strategy
reskill uses a two-layer testing strategy:
| Test Type | Purpose | Coverage Target |
| Unit Tests | Code logic correctness | Core: 80%+, Utils: 90%+ |
| Integration Tests | CLI usability guarantee | CLI: 70%+ |
Unit Tests
- Tests use Vitest with
.test.tssuffix alongside source files - Use temp directories for file system tests, clean up in
afterEach - Mock external dependencies (fs, network)
Integration Tests
- Integration tests verify the built CLI behavior
- Run with
pnpm test:integration(builds first, then runs CLI commands) - Tests execute actual CLI commands against a temporary directory
- Location:
src/cli/commands/__integration__/
Bug Fix Protocol (TDD)
MUST follow this workflow for all bug fixes:
- Reproduce - Write a failing test that reproduces the bug
- Fix - Implement minimal code to make the test pass
- Verify - Ensure no regression in other tests
# Manual CLI verification after build
pnpm build
node dist/cli/index.js init -y
node dist/cli/index.js listChangesets
This project uses Changesets for versioning.
When to Add a Changeset
REQUIRED for:
- New features (minor version bump)
- Bug fixes (patch version bump)
- Breaking changes (major version bump)
NOT REQUIRED for:
- Documentation-only changes
- Internal refactoring without behavior change
- Test-only changes
Creating a Changeset
pnpm changeset # Create changeset (interactive)Format Requirements:
- Files should be bilingual (English + Chinese)
- Structure: English content first, then Chinese content, separated by
--- - Use
pnpm run versionorpnpm changeset version(NOTpnpm version)
Version Types
patch: Bug fixes (0.1.0 → 0.1.1)minor: New features (0.1.0 → 0.2.0)major: Breaking changes (0.1.0 → 1.0.0)
CLI Development Workflow
Command Pattern
import { Command } from 'commander';
import { SkillManager } from '../../core/skill-manager.js';
import { logger } from '../../utils/logger.js';
interface MyCommandOptions {
force?: boolean;
}
export const myCommand = new Command('my-command')
.description('Description in English')
.argument('[arg]', 'Argument description')
.option('-f, --force', 'Force operation')
.action(async (arg: string | undefined, options: MyCommandOptions) => {
const manager = new SkillManager(process.cwd());
try {
// Implementation
logger.success('Operation completed');
} catch (error) {
logger.error(`Failed: ${(error as Error).message}`);
process.exit(1);
}
});CLI Testing Requirements
When creating or modifying CLI commands:
- Add integration tests in
src/cli/commands/__integration__/ - Add unit tests alongside the command file
- Test checklist:
--helpshows correct usage- Success case returns exit code 0
- Error case returns exit code 1
- Output messages are correct
- Files are created/modified as expected
Pre-commit Verification
pnpm test:run && pnpm test:integration && pnpm typecheck && pnpm lintReleasing
.github/workflows/publish.yml publishes to npm through trusted publishing (OIDC), not a
static token. pnpm publish exchanges the workflow's OIDC id-token for a short-lived registry
token by itself, so:
- Do not add
registry-urltosetup-node. It writes an.npmrcwith_authToken=${NODE_AUTH_TOKEN}, and a static token takes precedence over the OIDC path. - Keep
permissions.id-token: writeon any job that publishes. - Provenance is set via
pnpm_config_provenance. pnpm ignores thenpm_config_*prefix. - The trust relationship is configured on npmjs.com (package → Settings → Trusted Publisher) and
is pinned to this repository plus the
publish.ymlworkflow filename. Renaming the workflow file breaks publishing until the npm setting is updated to match.
Git Commits
Use conventional commits: type(scope): description
- Types: feat, fix, docs, style, refactor, test, chore
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

