Commit 9bf98ab
fix(agents): 1.6 — agent frontmatter alignment (name, model, color, description) (#56)
* fix(plugin-dev): validate-agent.sh — arithmetic, SIGPIPE, and shellcheck fixes
Bug 1 — arithmetic (((n++)) with set -e):
Replace all 18 ((n++)) with n=$((n+1)) to prevent premature script exit.
((n++)) returns exit code 1 when n=0 (post-increment evaluates to 0 = false);
set -e treats this as failure and aborts the script before counting is complete.
Pattern already applied in validate-hook-schema.sh; now consistent.
Bug 2 — SIGPIPE in tail | grep -q:
Replace `tail -n +2 | grep -q '^---$'` with `grep -c` check.
grep -q exits immediately on first match while tail is still writing; with
set -o pipefail, tail's SIGPIPE exit (141) propagates as pipeline failure.
The `if !` inversion converts this to a false positive "Frontmatter not
closed" for any agent where the closing --- appears before tail finishes.
grep -c reads all input before exiting, eliminating the race condition.
Affects locally: all plugin-dev agents (177-185 lines) and most other
agents (≥108 lines on WSL). CI (Ubuntu) was unaffected due to different
pipe buffer behaviour.
Shellcheck SC2086 — unquoted integer variables:
Quote $name_length, $desc_length, $prompt_length in numeric comparisons.
Pre-existing issues, fixed while script is open.
ux-reviewer.md — CRLF line endings:
Discovered during investigation: ux-reviewer.md had Windows (CRLF) line
endings causing Check 2 to fail ("File must start with YAML frontmatter")
since head -1 returned '---\r' instead of '---'. Fixed with sed -i 's/\r//'.
plugin-validation.yml — update stale CI comment:
Remove reference to the now-fixed arithmetic bug; keep || true as defensive
programming (tolerates future script regressions).
Note: 4 non-plugin-dev agents (pm-assistant, productivity-assistant,
automation-validator, strategic-analyst) use a different frontmatter format
(no name/model/color fields) and exit silently on validation — pre-existing
behaviour unchanged. Tracked separately for a future frontmatter alignment fix.
Generated by Nuno Salvação
Co-Authored-By: Nexo <nexo.modeling@gmail.com>
* fix(agents): 1.6 — add missing frontmatter and fix descriptions in 4 agents
Four agents were missing `name:`, `model:`, `color:` fields required by
validate-agent.sh, causing the script to silently exit under `set -e` when
grep returned exit 1 on the missing `name:` field. Descriptions also used
multiline YAML `>` blocks which the validator's single-line grep could only
capture as `>` (1 character), triggering false description-too-short warnings
and masking the missing <example> blocks.
Changes per agent:
- pm-assistant (product-management): add name/model:sonnet/color:blue,
convert description to inline with trigger phrases + 2 <example> blocks
- productivity-assistant (productivity): add name/model:sonnet/color:green,
convert description to inline with trigger phrases + 2 <example> blocks
- automation-validator (repo-structure): add name/model:sonnet/color:yellow,
convert description to inline with trigger phrases + 2 <example> blocks
- strategic-analyst (strategy-toolkit): add name/model:sonnet/color:cyan,
convert description to inline with trigger phrases + 2 <example> blocks
Also fixes validate-agent.sh TOOLS grep: `grep '^tools:'` with `set -e`
caused silent exit for agents without a `tools:` field (optional field).
Added `|| true` guard — same safe pattern used for required-field greps.
All 4 agents now complete full validation with ✅ All checks passed or
1 parent 032b417 commit 9bf98ab
5 files changed
Lines changed: 17 additions & 30 deletions
File tree
- plugins
- plugin-dev/skills/agent-development/scripts
- product-management/agents
- productivity/agents
- repo-structure/agents
- strategy-toolkit/agents
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 2 | + | |
| 3 | + | |
10 | 4 | | |
11 | 5 | | |
12 | 6 | | |
13 | 7 | | |
14 | 8 | | |
15 | 9 | | |
16 | 10 | | |
| 11 | + | |
| 12 | + | |
17 | 13 | | |
18 | 14 | | |
19 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 2 | + | |
| 3 | + | |
10 | 4 | | |
11 | 5 | | |
12 | 6 | | |
13 | 7 | | |
14 | 8 | | |
15 | 9 | | |
16 | 10 | | |
| 11 | + | |
| 12 | + | |
17 | 13 | | |
18 | 14 | | |
19 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 2 | + | |
| 3 | + | |
8 | 4 | | |
9 | 5 | | |
10 | 6 | | |
11 | 7 | | |
12 | 8 | | |
13 | 9 | | |
| 10 | + | |
| 11 | + | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 2 | + | |
| 3 | + | |
9 | 4 | | |
10 | 5 | | |
11 | 6 | | |
12 | 7 | | |
13 | 8 | | |
14 | 9 | | |
15 | 10 | | |
| 11 | + | |
| 12 | + | |
16 | 13 | | |
17 | 14 | | |
18 | 15 | | |
| |||
0 commit comments