From super-dev
Core development rules and philosophy. Use at the start of any development task to establish coding standards, git practices, and quality guidelines. Triggers on any implementation, fix, or refactoring task.
How this skill is triggered — by the user, by Claude, or both
Slash command
/super-dev:dev-rulesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
These rules define coding standards and practices that MUST be followed for all development work.
These rules define coding standards and practices that MUST be followed for all development work.
At the start of every super-dev session, check for context from the previous completed spec.
specification/ and extract the numeric prefix from each directory name (e.g., 20 from 20-bdd-integration)11-handoff.md exists
The handoff context from the previous session informs:
In addition to handoff documents, check ${CLAUDE_PLUGIN_DATA} for persistent state:
${CLAUDE_PLUGIN_DATA}/session-history.log — previous workflow summaries${CLAUDE_PLUGIN_DATA}/patterns.json — conventions discovered across sessions${CLAUDE_PLUGIN_DATA}/stats.json — track skill/agent usageIf these files exist, read them silently and apply learned patterns. If missing, skip silently (first run or pre-state sessions).
When implementing designs from Figma:
get_design_context first to fetch the structured representation for the exact node(s)get_metadata to get the high-level node map, then re-fetch only required node(s)get_screenshot for a visual reference of the node variant being implementedget_design_context and get_screenshot, download any assets needed and start implementationUse wrapper scripts via Bash instead of direct MCP tool calls.
Prerequisites:
mcp-cli installed: curl -fsSL https://raw.githubusercontent.com/philschmid/mcp-cli/main/install.sh | bashjq installed: sudo apt-get install jq (Ubuntu) or brew install jq (macOS)Exception: mcp__time-mcp__current_time is allowed (no script available)
# Web search
${CLAUDE_PLUGIN_ROOT}/scripts/exa/exa_search.sh --query "[query]" --type auto --results 10
# Code context search
${CLAUDE_PLUGIN_ROOT}/scripts/exa/exa_code.sh --query "[query]" --tokens 5000
# Get repo docs structure
${CLAUDE_PLUGIN_ROOT}/scripts/deepwiki/deepwiki_structure.sh --repo "[owner/repo]"
# Get repo docs contents
${CLAUDE_PLUGIN_ROOT}/scripts/deepwiki/deepwiki_contents.sh --repo "[owner/repo]"
# Ask questions about a repo
${CLAUDE_PLUGIN_ROOT}/scripts/deepwiki/deepwiki_ask.sh --repo "[owner/repo]" --question "[question]"
# Resolve library ID
${CLAUDE_PLUGIN_ROOT}/scripts/context7/context7_resolve.sh --library "[library-name]"
# Get library documentation
${CLAUDE_PLUGIN_ROOT}/scripts/context7/context7_docs.sh --library-id "[/org/project]" --mode code --topic "[topic]"
# Search code across repos
${CLAUDE_PLUGIN_ROOT}/scripts/github/github_search_code.sh --query "[query]" --per-page 10
# Search repositories
${CLAUDE_PLUGIN_ROOT}/scripts/github/github_search_repos.sh --query "[query]" --sort stars
# Get file/directory contents
${CLAUDE_PLUGIN_ROOT}/scripts/github/github_file_contents.sh --owner "[owner]" --repo "[repo]" --path "[path]"
See ${CLAUDE_PLUGIN_ROOT}/scripts/README.md for full documentation.
When searching the local codebase for code patterns, structures, or specific constructs:
useState hooks, all API calls)git add -A - use git add file1 file2 (only files you edited/created/deleted)ALL development work MUST be done in a git worktree. This is NOT optional.
Before ANY development work, ALWAYS check:
# Check if we're in a worktree
git worktree list
# Check current git directory
git rev-parse --git-common-dir
# Check if .git is a file (indicating worktree)
test -f .git && echo "In worktree" || test -d .git && echo "In main repo"
You are in a worktree if:
.git is a file (not a directory) containing gitdir: path/to/main/.gitgit worktree list shows the current path as a worktree.worktree/[spec-index]-[spec-name]/You are NOT in a worktree if:
.git is a directory (main repository, not isolated)git worktree list does NOT show the current pathIf NOT in a worktree, automatically create one:
.worktree/ directory under project root (no confirmation required)[spec-index]-[spec-name]# Create worktree automatically
git worktree add .worktree/[spec-index]-[spec-name] -b [spec-index]-[spec-name]
cd .worktree/[spec-index]-[spec-name]
Note: Worktree creation is automatic and does not require user confirmation. The default location is always .worktree/ in the project root.
To prevent losing work during context compaction or errors:
Stash Before Major Operations
git stash push -m "checkpoint: [phase name]"git stash list to verify stashes existCommit After Every Completed Task
Verification Before Phase Transitions
git status to check for uncommitted changesEnd-of-Session Cleanup
git status - should show "nothing to commit, working tree clean"Create a checkpoint (commit or stash) when:
If files are lost, use:
git stash list # List all stashes
git stash pop # Restore most recent stash
git reflog # Find lost commits
git checkout -- <file> # Restore file from last commit
All features, bug fixes, error fixes, improvements, and code refactoring should have a spec directory under specification/
specification/ using the pattern [index]-[feature-name or fix-name].specification/, increment the index by one each time.All specification documents MUST be updated as work progresses:
IMPORTANT: Files within each spec directory should start from 01, not use the spec directory index.
Task List (01-task-list.md)
- [x] Task descriptionImplementation Summary (06-implementation-summary.md)
Specification (03-specification.md)
[UPDATED: YYYY-MM-DD] marker for changed sectionsBefore moving to next task/phase:
FORBIDDEN: ❌ Completing tasks without updating task list ❌ Finishing milestones without updating implementation summary ❌ Implementing differently than spec without documenting deviation ❌ Committing code changes without corresponding doc updates
When a user reports a bug or error, ALWAYS ask for reproduction steps before attempting to fix:
Ask user to provide:
To help fix this bug, please provide:
1. What steps trigger this error? (e.g., "Run `npm test`, click button X, enter value Y")
2. What did you expect to happen?
3. What actually happened? (paste full error message if available)
4. Any relevant environment details?
Only skip reproduction steps if:
The rules/ directory contains modular always-follow guidelines:
| Rule | Focus | Key Points |
|---|---|---|
security.md | Security | No hardcoded secrets, input validation, XSS/CSRF protection |
coding-style.md | Code Quality | Immutability, 200-400 line files, proper error handling |
testing.md | Testing | TDD, 80% coverage, unit/integration/E2E tests |
patterns.md | Patterns | Common patterns (API format, custom hooks, repository) |
performance.md | Performance | Model selection (Haiku/Sonnet/Opus), context management |
git-workflow.md | Git | Commit format, PR process |
agents.md | Delegation | When to delegate to subagents |
Rules are automatically referenced by:
Always follow applicable rules during development.
For all Rust projects, ALWAYS use a workspace structure:
Cargo.toml workspace at the project rootExample workspace Cargo.toml:
[workspace]
members = [
"crate1",
"crate2",
"binaries/my-binary",
]
Crate-level Cargo.toml:
[package]
name = "crate-name"
version = "0.1.0"
edition = "2021"
[dependencies]
# Crate-specific dependencies
tokio = { version = "1", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
[dev-dependencies]
# Test-only dependencies
Always run from workspace root:
# Check code (faster than build)
cargo check
# Build the entire workspace
cargo build
# Build a specific crate
cargo build -p crate-name
# Run tests for entire workspace
cargo test --workspace
# Run tests for specific crate
cargo test -p crate-name
# Run tests with output
cargo test --workspace -- --nocapture
# Check formatting
cargo fmt
# Run linter
cargo clippy
# Update dependencies
cargo update
thiserror for error types and anyhow for contexttokio runtime, avoid spawn_blocking unless necessary#[test] attributes, organize tests in tests/ directory/// doc comments, run cargo doc to verifytracing for structured logging with spansunsafe: Avoid unsafe code unless absolutely necessary and documented| Use Case | Recommended Crates |
|---|---|
| Async runtime | tokio |
| Error handling | thiserror, anyhow |
| Serialization | serde, serde_json |
| HTTP client | reqwest |
| HTTP server | axum |
| CLI | clap |
| Logging | tracing, tracing-subscriber |
| Configuration | config, serde_yaml |
git add -A instead of selective file staging: This stages every file in the repository, including untracked files, build artifacts, and files modified by other processes. Always use git add file1 file2 with only the files you explicitly changed in the current session.git stash push -m "checkpoint: [description]" before starting a new phase or risky operation..worktree/[spec-name]/). Working directly in the main repo breaks branch isolation and can corrupt the main branch with in-progress changes.specification/, always search for existing specs that match the current task. Duplicate specs fragment documentation and create confusion about which is authoritative..github/workflows/ files. If they already exist in the repo, exclude them from staging, commits, and pushes.Announce at the start of any development task: "I'm applying the dev-rules skill to ensure we follow project standards and best practices."
These rules should be referenced throughout the development workflow, especially during:
npx claudepluginhub jenningsloy318/claude-skill-artifacts --plugin super-devUniversal project workflow guide that reads the existing codebase, keeps changes small, and explains technical decisions in plain language. Use when starting, modifying, debugging, or deploying software projects.
Guides GitHub Spec-Kit CLI integration for 7-phase constitution-based spec-driven feature development, managing .specify/specs/ directories with phases: Constitution, Specify, Clarify, Plan, Tasks, Analyze, Implement.
Provides structured workflow packs for 7 common Claude Code tasks: codebase exploration, bug fixing, safe refactoring, TDD, repo review before merge, CLAUDE.md generation, and migration planning.