Detects Prettier configuration and formats code. This skill should be used for final cosmetic formatting before commits, after all logic and type fixes have been verified. Returns structured JSON with detection and format results.
Detect Prettier presence in a repository and format code. This skill handles detection of configuration and commands, then executes formatting. Designed for use as the final cosmetic pass before committing changes.
This skill should be invoked:
This skill should NOT be invoked:
Search for Prettier configuration files using Glob tool:
.prettierrc.prettierrc.json.prettierrc.js.prettierrc.yaml.prettierrc.ymlprettier.config.jsprettier.config.cjspackage.json (check for prettier field or dependency)If NO configuration found:
prettierDetected: falseIf configuration found:
prettierDetected: trueSearch for format commands in priority order:
If CLAUDE.md exists:
prettier, format, npm run formatRead package.json and examine the scripts section:
Format commands (look for these script names):
"format""format:write""prettier""prettier:write"npm run <script-name>Record package.json as source if found.
If Makefile exists:
prettier or formatformat, prettier, fmtmake <target-name>If no command found in any source:
npx prettier --write ."fallback"Run the detected format command:
<detected-command>
Capture the output to determine files changed.
Construct JSON object with this structure:
{
"prettierDetected": true,
"configFile": ".prettierrc.json",
"command": {
"format": "npm run format",
"source": "package.json"
},
"result": {
"status": "formatted",
"filesChanged": 5,
"message": "Formatted 5 files"
}
}
Field Specifications:
prettierDetected (boolean): true if config found, false otherwiseconfigFile (string): Path to detected config filecommand (object): Format command details
format (string): Exact command executedsource (string): Where command was foundresult (object): Execution results
status (string): "formatted", "no-changes", or "not-configured"filesChanged (number): Count of files modifiedmessage (string): Human-readable summaryReturn the JSON structure with a summary:
## Prettier Format Results
```json
{
"prettierDetected": true,
...
}
Summary:
## Edge Cases
**No Prettier configuration found:**
```json
{
"prettierDetected": false,
"configFile": null,
"command": {},
"result": {
"status": "not-configured",
"filesChanged": 0,
"message": "Prettier not configured in this repository"
}
}
Prettier configured but no files changed:
{
"prettierDetected": true,
"configFile": ".prettierrc",
"command": {
"format": "npm run format",
"source": "package.json"
},
"result": {
"status": "no-changes",
"filesChanged": 0,
"message": "All files already formatted"
}
}
Command execution error:
"error"Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer