Skip to content

Commit 739ed5d

Browse files
committed
Fixes to some plugins
1 parent 8dd0ed7 commit 739ed5d

File tree

15 files changed

+207
-10
lines changed

15 files changed

+207
-10
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "ECA Plugin Marketplace",
4+
"description": "Schema for .eca-plugin/marketplace.json plugin registry",
5+
"type": "object",
6+
"required": ["plugins"],
7+
"additionalProperties": false,
8+
"properties": {
9+
"plugins": {
10+
"type": "array",
11+
"items": {
12+
"type": "object",
13+
"required": ["name", "description", "source", "category", "author", "icon"],
14+
"additionalProperties": false,
15+
"properties": {
16+
"name": {
17+
"type": "string",
18+
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
19+
"description": "Unique kebab-case plugin identifier"
20+
},
21+
"description": {
22+
"type": "string",
23+
"minLength": 10,
24+
"description": "One-sentence plugin description"
25+
},
26+
"source": {
27+
"type": "string",
28+
"pattern": "^plugins/",
29+
"description": "Relative path to the plugin directory"
30+
},
31+
"category": {
32+
"type": "string",
33+
"enum": ["Development", "Productivity", "Workflow", "Security", "Documentation", "DevOps"],
34+
"description": "Plugin category"
35+
},
36+
"tags": {
37+
"type": "array",
38+
"items": { "type": "string", "pattern": "^[a-z0-9-]+$" },
39+
"minItems": 1,
40+
"description": "Searchable tags"
41+
},
42+
"author": {
43+
"type": "string",
44+
"minLength": 1,
45+
"description": "GitHub username of the plugin author"
46+
},
47+
"icon": {
48+
"type": "string",
49+
"minLength": 1,
50+
"description": "Emoji icon for marketplace display"
51+
},
52+
"featured": {
53+
"type": "boolean",
54+
"description": "Whether the plugin is featured in the marketplace"
55+
}
56+
}
57+
}
58+
}
59+
}
60+
}

.github/workflows/validate.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Validate Plugins
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
validate:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Validate marketplace.json against schema
14+
uses: cardinalby/schema-validator-action@v3
15+
with:
16+
file: .eca-plugin/marketplace.json
17+
schema: .eca-plugin/marketplace.schema.json
18+
19+
- name: Check plugin directories exist
20+
run: |
21+
jq -r '.plugins[].source' .eca-plugin/marketplace.json | while read -r dir; do
22+
if [ ! -d "$dir" ]; then
23+
echo "::error::Plugin directory not found: $dir"
24+
exit 1
25+
fi
26+
if [ ! -f "$dir/README.md" ]; then
27+
echo "::warning::Missing README.md in $dir"
28+
fi
29+
done
30+
31+
- name: Validate hook key naming convention
32+
run: |
33+
failed=0
34+
for hooks_file in $(find plugins -path '*/hooks/hooks.json'); do
35+
plugin_name=$(echo "$hooks_file" | cut -d'/' -f2)
36+
for key in $(jq -r 'keys[]' "$hooks_file"); do
37+
if [[ "$key" != "$plugin_name."* ]]; then
38+
echo "::error::Hook key '$key' in $hooks_file must be namespaced as '$plugin_name.<hook-name>'"
39+
failed=1
40+
fi
41+
done
42+
done
43+
exit $failed
44+
45+
- name: Shellcheck hook scripts
46+
uses: ludeeus/action-shellcheck@master
47+
with:
48+
scandir: plugins
49+
additional_files: "*.sh"
50+
severity: warning

CONTRIBUTING.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Add an entry to `.eca-plugin/marketplace.json`:
6565
| `name` | Yes | Unique plugin identifier (kebab-case) |
6666
| `description` | Yes | Short description (one sentence) |
6767
| `source` | Yes | Path to the plugin directory (relative to repo root) |
68-
| `category` | Yes | One of: `Development`, `Productivity`, `Documentation`, `DevOps`, `Data`, `Design` |
68+
| `category` | Yes | One of: `Development`, `Productivity`, `Workflow`, `Security`, `Documentation`, `DevOps` |
6969
| `tags` | Yes | Array of relevant tags for search/filtering |
7070
| `author` | Yes | Author name or organization |
7171
| `icon` | No | Emoji icon for the plugin card |
@@ -82,6 +82,13 @@ Submit a PR with your plugin. We'll review it for:
8282

8383
## Guidelines
8484

85+
### Hook scripts
86+
87+
- **Namespace hook keys** with `<plugin-name>.<hook-name>` (e.g., `secret-guard.scan`, `pomodoro.check`). This avoids collisions when multiple plugins are installed.
88+
- Hook scripts that need to parse JSON should use [`jq`](https://jqlang.github.io/jq/), which is expected as a runtime dependency. If your hook relies on `jq`, check for its availability at the start and degrade gracefully with a clear error message if it's missing.
89+
90+
### General
91+
8592
- Keep plugin names short and descriptive (kebab-case)
8693
- Write clear, concise skill/agent prompts
8794
- Include examples in your README

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ The official plugin marketplace for [ECA](https://eca.dev) — browse, discover,
44

55
**🌐 [plugins.eca.dev](https://plugins.eca.dev)**
66

7+
## Requirements
8+
9+
Some hook-based plugins (e.g., `secret-guard`, `notify-hooks`, `session-journal`) require [`jq`](https://jqlang.github.io/jq/) to be installed and available on your `PATH`.
10+
711
## What is this?
812

913
This repository serves two purposes:

plugins/notify-hooks/hooks/hooks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"notify-finished": {
2+
"notify-hooks.finished": {
33
"type": "postRequest",
44
"visible": false,
55
"actions": [
@@ -9,7 +9,7 @@
99
}
1010
]
1111
},
12-
"notify-approval": {
12+
"notify-hooks.approval": {
1313
"type": "preToolCall",
1414
"visible": false,
1515
"actions": [

plugins/pomodoro/hooks/hooks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"pomodoro-start": {
2+
"pomodoro.start": {
33
"type": "chatStart",
44
"visible": false,
55
"actions": [
@@ -9,7 +9,7 @@
99
}
1010
]
1111
},
12-
"pomodoro-check": {
12+
"pomodoro.check": {
1313
"type": "postRequest",
1414
"visible": true,
1515
"actions": [

plugins/pomodoro/hooks/pomodoro-check.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bash
2+
set -euo pipefail
23

34
TIMER_FILE="/tmp/eca-pomodoro-start"
45

plugins/secret-guard/hooks/hooks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"secret-guard": {
2+
"secret-guard.scan": {
33
"type": "preToolCall",
44
"matcher": "eca__write_file|eca__edit_file",
55
"visible": true,

plugins/session-journal/hooks/hooks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"journal-start": {
2+
"session-journal.start": {
33
"type": "chatStart",
44
"visible": false,
55
"actions": [
@@ -9,7 +9,7 @@
99
}
1010
]
1111
},
12-
"journal-end": {
12+
"session-journal.end": {
1313
"type": "chatEnd",
1414
"visible": false,
1515
"actions": [

plugins/session-journal/hooks/journal-end.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bash
2+
set -euo pipefail
23

34
JOURNAL_DIR="${ECA_JOURNAL_DIR:-$HOME/.eca/journal}"
45
mkdir -p "$JOURNAL_DIR"

0 commit comments

Comments
 (0)