Skip to content

Commit f94f558

Browse files
aRustyDevclaude
andcommitted
docs(rules): add plugin-output-styles rule to prevent directory paths
Documents that outputStyles must use explicit file paths, not directory paths like "./styles/". Includes examples of correct vs incorrect format and explains the validation error. Prevents recurrence of the bug fixed in 82e0eaa. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 82e0eaa commit f94f558

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Plugin outputStyles Format
2+
3+
When defining `outputStyles` in a plugin's `plugin.json`, use explicit file paths only.
4+
5+
## Rule
6+
7+
**DO NOT** use directory paths in the `outputStyles` array:
8+
9+
```json
10+
// WRONG - causes validation errors
11+
"outputStyles": [
12+
"./styles/",
13+
"../../output-styles/feedback-submission.md"
14+
]
15+
```
16+
17+
**DO** use explicit file paths:
18+
19+
```json
20+
// CORRECT
21+
"outputStyles": [
22+
"./styles/swift-code.md",
23+
"./styles/swiftui-view.md",
24+
"../../output-styles/feedback-submission.md"
25+
]
26+
```
27+
28+
## Why
29+
30+
Directory paths like `"./styles/"` cause plugin validation errors:
31+
32+
```text
33+
Plugin has an invalid manifest file. Validation errors: outputStyles: Invalid input
34+
```
35+
36+
The validator expects each entry to be a path to a specific `.md` file.
37+
38+
## When Scaffolding Plugins
39+
40+
1. If the plugin has custom styles in `./styles/`, list each `.md` file explicitly
41+
2. If no custom styles exist, only include the shared feedback style:
42+
43+
```json
44+
"outputStyles": ["../../output-styles/feedback-submission.md"]
45+
```
46+
47+
3. Never copy `outputStyles` from existing plugins without verifying the format
48+
49+
## Template Reference
50+
51+
The correct template format is in `context/plugins/.template/.claude-plugin/plugin.json`:
52+
53+
```json
54+
"outputStyles": ["../../output-styles/feedback-submission.md"]
55+
```

0 commit comments

Comments
 (0)