format-code

Format Python and C/C++ files by removing unused imports and variables.

260|104|Updated Nov 23, 2025
One-click install
npx skills add https://github.com/ROCm/FlyDSL --skill format-code-rocm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: format-code
Source: https://github.com/ROCm/FlyDSL/tree/main/.claude/skills/format-code
Command: npx skills add https://github.com/ROCm/FlyDSL --skill format-code-rocm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers format and clean code before committing by removing unused imports and variables in Python files and applying standard formatting across Python and C/C++ files.

Core Features & Use Cases

  • Automated cleanup: removes unused imports and variables in Python files (autoflake) to reduce noise.
  • Code formatting: formats Python code with Black and C/C++ code with clang-format (Google style).
  • Scoped changes: operates only on changed or staged files to avoid unintended edits.

Quick Start

Run the format-code skill to remove unused imports and variables, format Python with Black, and format C/C++ with clang-format on staged or modified files.

Frequently Asked Questions about format-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I format Python and C/C++ code before committing?

To format code before committing, run the format-code skill to apply Black for Python, clang-format for C/C++, and autoflake to remove unused imports on staged or modified files.

Can I automatically remove unused imports and variables from staged git files?

Yes, you can remove unused imports and variables from staged files by running the format-code skill, which uses autoflake to target Python files in the current working directory.

What is the best way to clean up Python code for pre-commit formatting?

The best way to clean up Python code for pre-commit formatting is to run the format-code skill, which uses autoflake to remove unused imports and Black to apply standard style formatting.

Does this code formatting skill process all files or only changed files?

This code formatting skill only processes changed or staged files in your current working directory, operating on scoped changes to avoid unintended edits across your project.

What C/C++ formatting style does the format-code skill apply?

The format-code skill applies the Google style formatting standard to C/C++ files using clang-format during the pre-commit cleanup process.