new-file

Validate file necessity and generate language-specific headers before creating new files.

1|Updated Dec 17, 2016
One-click install
npx skills add https://github.com/vm-wylbur/pb-dotfiles --skill new-file
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: new-file
Source: https://github.com/vm-wylbur/pb-dotfiles/tree/main/ai/claude-code/skills/new-file
Command: npx skills add https://github.com/vm-wylbur/pb-dotfiles --skill new-file

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creating new files often involves tedious boilerplate, ensuring correct headers, and verifying the file's necessity. This can lead to inconsistent file structures, missing attribution, or unnecessary file creation, wasting developer time.

Core Features & Use Cases

  • Necessity Verification: Automatically checks if a file already exists or if existing functionality could be modified instead, preventing redundant file creation.
  • Automated Header Generation: Creates language-specific headers with author, date, license, and relative path, ensuring consistency and proper attribution across your codebase.
  • Format Awareness: Automatically determines the correct comment syntax (e.g., # for Python, // for TypeScript, <!-- --> for Markdown) for seamless integration into any project.
  • Use Case: When asked to "create a new Python script called data_processor.py", the skill will first check if such a file or similar functionality exists. If not, it will generate the file with a proper Python header including author, date, license, and the correct relative path, then add the user's requested content.

Quick Start

Create a new Python file named 'utils.py' with a function called 'format_date'. The skill will create the file with the correct header and function stub.

Frequently Asked Questions about new-file

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

FAQPage Schema
How do I automatically add headers to new files when creating them?

File headers with author, date, license, and relative path are automatically generated based on your file's language. The skill detects comment syntax (e.g., `#` for Python, `//` for TypeScript) and applies the correct format, ensuring consistency across your codebase without manual effort.

Can I prevent creating duplicate files or unnecessary boilerplate?

The skill validates whether a file already exists or if similar functionality could be modified instead before creation. This prevents redundant files and prompts for clarification if uncertain, reducing wasted time and maintaining a cleaner project structure.

What comment syntax does the skill use for different programming languages?

The skill automatically determines language-specific comment syntax: `#` for Python, `//` for TypeScript and JavaScript, `<!-- -->` for Markdown, and equivalent formats for other languages. This ensures headers integrate seamlessly without manual syntax selection.

How do I ensure new files follow consistent formatting standards?

New files are created with standardized headers containing author, date, license, and relative path in language-appropriate comment format. This enforces consistency across your entire codebase without requiring manual header entry for each file.

Does the skill work across multiple programming languages?

Yes, the skill applies format awareness to determine correct comment syntax for any language in your project. Whether creating Python, TypeScript, Markdown, or other file types, appropriate headers and separators are automatically applied.