Skip to content

Commit 8a7ac11

Browse files
committed
fix: address PR review feedback (Copilot + Gemini)
Round-up of 8 unresolved threads on PR #346. Test stability (Copilot ×2) - __tests__/cli-subcommands.test.js: derive expected count from loadMarketplace().plugins.length and assert anchor plugins are present. Old hardcoded '20 plugin(s) found' / 'with 20 plugins' was destined to break on every marketplace addition. Generator parity (Copilot, Gemini HIGH) - scripts/generate-docs.js: generateAgentCounts now uses static fallbacks when local discovery is empty (post-graduation reality). Auto-gen block in docs/reference/AGENTS.md now reports '49 agents across 20 plugins (18 have agents)' instead of the meaningless '10 agents across 0 plugins'. - __tests__/generate-docs.test.js: tests track the same fallback. Count accuracy across docs (Copilot, Gemini MEDIUM) - AGENTS.md, docs/reference/AGENTS.md: prose now says '49 agents across 20 plugins (18 have agents)'. Earlier '47 / 17' prose was a pre-existing inaccuracy that this PR quietly corrects - ship has 1 agent (release-agent.md) so it belongs in the 'have agents' bucket; only gate-and-ship and zig-lsp don't. - docs/reference/AGENTS.md L36: file-based agent count 37 -> 39 (matches sum of STATIC_PLUGIN_AGENT_COUNTS). - site/index.html L752: 'Skills across 20 Plugins' -> '19 Plugins'. zig-lsp contributes 0 skills, so the count of skill-contributing plugins is unchanged. Reverting Gemini's flagged inaccuracy. - docs/ARCHITECTURE.md L277: sync-pipeline language softened to '19 plugin repos today; zig-lsp sync wire-up pending', matching the open checkbox in docs/ORG_ARCHITECTURE.md. - site/ux-spec.md L231: pre-existing typo Skills=40 -> 41. PR description has stale 'deliberately not updated: generate-docs.js' - will update separately as a PR comment once these land.
1 parent 5603694 commit 8a7ac11

8 files changed

Lines changed: 54 additions & 24 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ agentsys # Run installer
152152
<agents>
153153
## Agents
154154

155-
47 agents across 20 plugins (zig-lsp ships as a config-only LSP plugin with no agents). Key agents by model:
155+
49 agents across 20 plugins (18 have agents; gate-and-ship is commands-only; zig-lsp is config-only with no commands or agents). Key agents by model:
156156

157157
| Model | Agents | Use Case |
158158
|-------|--------|----------|

__tests__/cli-subcommands.test.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@ describe('searchPlugins', () => {
107107
const output = logOutput.join('\n');
108108
expect(output).toContain('next-task');
109109
expect(output).toContain('deslop');
110-
expect(output).toContain('20 plugin(s) found');
110+
// Count derived from marketplace.json so this test stays stable as
111+
// the marketplace grows. Asserts the suffix and uses the same
112+
// source-of-truth the production code reads.
113+
const expectedCount = loadMarketplace().plugins.length;
114+
expect(output).toContain(`${expectedCount} plugin(s) found`);
111115
});
112116

113117
test('filters by name', () => {
@@ -366,10 +370,17 @@ describe('granular install recording', () => {
366370
});
367371

368372
describe('loadMarketplace', () => {
369-
test('loads marketplace.json with 20 plugins', () => {
373+
test('loads marketplace.json with at least one plugin including the canonical core set', () => {
370374
const marketplace = loadMarketplace();
371375
expect(marketplace.plugins).toBeDefined();
372-
expect(marketplace.plugins.length).toBe(20);
376+
expect(marketplace.plugins.length).toBeGreaterThan(0);
377+
// Spot-check a few plugins that anchor the marketplace identity.
378+
// These are unlikely to ever be removed - if any of them is, the
379+
// change deserves an explicit, visible test update.
380+
const names = marketplace.plugins.map(p => p.name);
381+
for (const required of ['next-task', 'ship', 'agnix']) {
382+
expect(names).toContain(required);
383+
}
373384
});
374385

375386
test('all plugins have name, source, version', () => {

__tests__/generate-docs.test.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,20 +166,28 @@ describe('generate-docs', () => {
166166
});
167167

168168
describe('generateAgentCounts', () => {
169+
// Mirrors the production fallback in generateAgentCounts: when local
170+
// discovery is empty (post-graduation, plugins live in standalone repos)
171+
// the function reports the canonical project-wide STATIC_AGENT_COUNT
172+
// instead of just the locally-discoverable agents.
173+
function expectedTotalAgents(agents) {
174+
return agents.length > 0
175+
? agents.length + genDocs.ROLE_BASED_AGENT_COUNT
176+
: genDocs.STATIC_AGENT_COUNT;
177+
}
178+
169179
test('includes total agent count', () => {
170180
const agents = discovery.discoverAgents(REPO_ROOT);
171181
const plugins = discovery.discoverPlugins(REPO_ROOT);
172182
const counts = genDocs.generateAgentCounts(agents, plugins);
173-
const totalAgents = agents.length + genDocs.ROLE_BASED_AGENT_COUNT;
174-
expect(counts).toContain(`${totalAgents} agents`);
183+
expect(counts).toContain(`${expectedTotalAgents(agents)} agents`);
175184
});
176185

177186
test('includes AGENT_COUNT_TOTAL comment', () => {
178187
const agents = discovery.discoverAgents(REPO_ROOT);
179188
const plugins = discovery.discoverPlugins(REPO_ROOT);
180189
const counts = genDocs.generateAgentCounts(agents, plugins);
181-
const totalAgents = agents.length + genDocs.ROLE_BASED_AGENT_COUNT;
182-
expect(counts).toContain(`<!-- AGENT_COUNT_TOTAL: ${totalAgents} -->`);
190+
expect(counts).toContain(`<!-- AGENT_COUNT_TOTAL: ${expectedTotalAgents(agents)} -->`);
183191
});
184192

185193
test('counts plugins with agents correctly', () => {

docs/ARCHITECTURE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ Research documents informing the implementation (in `agent-docs/`):
275275

276276
**Update workflow:**
277277
1. Edit files in `lib/` (canonical source in this repo)
278-
2. Push to main — agent-core sync pipeline automatically opens PRs in all 20 plugin repos
278+
2. Push to main — agent-core sync pipeline automatically opens PRs in 19 plugin repos today (`zig-lsp` sync wire-up still pending; tracked in docs/ORG_ARCHITECTURE.md)
279279
3. Merge those PRs in each plugin repo
280280
4. Publish agentsys: `npm version patch && npm publish`
281281

docs/reference/AGENTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Complete reference for all agents in AgentSys.
44

55
<!-- GEN:START:agents-counts -->
6-
**TL;DR:** 10 agents across 0 plugins (1 have agents). opus for reasoning, sonnet for patterns, haiku for execution. Each agent does one thing well. <!-- AGENT_COUNT_TOTAL: 10 -->
6+
**TL;DR:** 49 agents across 20 plugins (18 have agents). opus for reasoning, sonnet for patterns, haiku for execution. Each agent does one thing well. <!-- AGENT_COUNT_TOTAL: 49 -->
77
<!-- GEN:END:agents-counts -->
88

99
---
@@ -24,7 +24,7 @@ Complete reference for all agents in AgentSys.
2424

2525
## Overview
2626

27-
AgentSys uses 47 specialized agents across 20 plugins (17 have agents; ship and gate-and-ship are commands-only; zig-lsp is a config-only LSP plugin with no commands or agents). Each agent is optimized for a specific task and assigned a model based on complexity:
27+
AgentSys uses 49 specialized agents across 20 plugins (18 have agents; gate-and-ship is commands-only; zig-lsp is a config-only LSP plugin with no commands or agents). Each agent is optimized for a specific task and assigned a model based on complexity:
2828

2929
| Model | Use Case | Cost |
3030
|-------|----------|------|
@@ -33,7 +33,7 @@ AgentSys uses 47 specialized agents across 20 plugins (17 have agents; ship and
3333
| haiku | Mechanical execution, no judgment | Low |
3434

3535
**Agent types:**
36-
- **File-based agents** (37) - Defined in `plugins/*/agents/*.md` with frontmatter <!-- AGENT_COUNT_FILE_BASED: 37 -->
36+
- **File-based agents** (39) - Defined in `plugins/*/agents/*.md` with frontmatter <!-- AGENT_COUNT_FILE_BASED: 39 -->
3737
- **Role-based agents** (10) - Defined inline via Task tool with specialized prompts <!-- AGENT_COUNT_ROLE_BASED: 10 -->
3838

3939
---

scripts/generate-docs.js

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -373,20 +373,31 @@ function generateAgentNavTable(agents, plugins) {
373373

374374
/**
375375
* Generate the agents count summary line for docs/reference/AGENTS.md.
376+
*
377+
* Uses static fallbacks when local discovery returns nothing — the agentsys
378+
* monorepo no longer contains plugins/, so discovery is empty in CI. Static
379+
* counts are derived from STATIC_PLUGIN_AGENT_COUNTS so they stay in sync as
380+
* plugins are added.
376381
*/
377382
function generateAgentCounts(agents, plugins) {
378-
const fileBasedAgents = agents.length;
379-
const totalAgents = fileBasedAgents + ROLE_BASED_AGENT_COUNT;
380-
381-
// Count plugins with agents (file-based or role-based)
382-
const pluginsWithAgents = new Set();
383-
for (const agent of agents) {
384-
pluginsWithAgents.add(agent.plugin);
383+
const totalAgents = agents.length > 0
384+
? agents.length + ROLE_BASED_AGENT_COUNT
385+
: STATIC_AGENT_COUNT;
386+
const totalPlugins = plugins.length > 0 ? plugins.length : STATIC_PLUGIN_COUNT;
387+
388+
let pluginsWithAgentsCount;
389+
if (agents.length > 0) {
390+
const pluginsWithAgents = new Set(agents.map(a => a.plugin));
391+
pluginsWithAgents.add('audit-project'); // role-based
392+
pluginsWithAgentsCount = pluginsWithAgents.size;
393+
} else {
394+
// Static fallback: file-based plugins (count > 0 in static map) plus
395+
// audit-project (role-based, count is 0 in the map but still has agents).
396+
const fileBasedPluginsWithAgents = Object.values(STATIC_PLUGIN_AGENT_COUNTS).filter(c => c > 0).length;
397+
pluginsWithAgentsCount = fileBasedPluginsWithAgents + 1;
385398
}
386-
pluginsWithAgents.add('audit-project'); // role-based
387-
const pluginCount = pluginsWithAgents.size;
388399

389-
return `**TL;DR:** ${totalAgents} agents across ${plugins.length} plugins (${pluginCount} have agents). opus for reasoning, sonnet for patterns, haiku for execution. Each agent does one thing well. <!-- AGENT_COUNT_TOTAL: ${totalAgents} -->`;
400+
return `**TL;DR:** ${totalAgents} agents across ${totalPlugins} plugins (${pluginsWithAgentsCount} have agents). opus for reasoning, sonnet for patterns, haiku for execution. Each agent does one thing well. <!-- AGENT_COUNT_TOTAL: ${totalAgents} -->`;
390401
}
391402

392403
// ---------------------------------------------------------------------------

site/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ <h2 class="agents-skills__title anim-fade-up" id="as-title">49 Agents. 41 Skills
749749
</div>
750750

751751
<!-- Skills grid -->
752-
<h3 class="agents-skills__skills-title anim-fade-up" data-delay="300">41 Skills across 20 Plugins</h3>
752+
<h3 class="agents-skills__skills-title anim-fade-up" data-delay="300">41 Skills across 19 Plugins</h3>
753753
<div class="skills-grid anim-fade-up" data-delay="350">
754754
<div class="skill-group">
755755
<span class="skill-group__label">prepare-delivery</span>

site/ux-spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ Done. Task to merged PR in 12 minutes.
228228
|------|-------|-------|
229229
| 1 | 20 | Plugins |
230230
| 2 | 49 | Agents |
231-
| 3 | 40 | Skills |
231+
| 3 | 41 | Skills |
232232
| 4 | 3,507 | Tests Passing |
233233

234234
### Styling

0 commit comments

Comments
 (0)