code-style

Enforce repository-specific Nix code style guidelines with formatting and naming conventions.

18|1|Updated Jun 2, 2023
One-click install
npx skills add https://github.com/DaRacci/nix-config --skill code-style-daracci
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-style
Source: https://github.com/DaRacci/nix-config/tree/main/.opencode/skills/code-style
Command: npx skills add https://github.com/DaRacci/nix-config --skill code-style-daracci

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures that all Nix code within the repository adheres to established formatting, naming, and structural conventions, leading to more readable, maintainable, and consistent codebases.

Core Features & Use Cases

  • Automated Formatting: Applies nix fmt to ensure consistent indentation and spacing.
  • Naming Convention Enforcement: Guides developers on using kebab-case for files/directories and camelCase for Nix attributes and option paths.
  • Import Standardization: Promotes the use of relative imports and structured import lists.
  • Structured Data Generation: Encourages defining structured data in Nix before conversion to formats like JSON.
  • Use Case: Before committing changes, run this skill to automatically format your Nix files and catch any deviations from the project's style guide.

Quick Start

Run the code-style skill to format all Nix files in the current directory.

Frequently Asked Questions about code-style

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

FAQPage Schema
How do I enforce Nix code conventions and formatting in my repository?

This skill enforces Nix code conventions by applying `nix fmt` for indentation and spacing, while validating kebab-case file naming and camelCase attributes across all source files.

What is the correct naming convention for Nix attributes and file directories?

The correct Nix naming convention requires kebab-case for files and directories, while Nix attributes and option paths must use camelCase to maintain structural consistency.

How do I standardize Nix import structure and patterns?

To standardize Nix import structure, this skill promotes using relative imports and structured import lists to maintain clear dependencies and readability across your project.

Can I use nix fmt to automatically format all Nix files before committing?

Yes, you can run this skill before committing to automatically format all Nix files using `nix fmt`, catching deviations from your project's style guide and ensuring readable code.

Does this Nix linter support generating structured data before converting to JSON?

Yes, this Nix linter encourages defining structured data natively in Nix before conversion to formats like JSON, ensuring type safety and consistency within your configuration codebase.