@givolt/i3-composer-agent 0.0.0-stage → 0.6.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +22 -0
- package/.claude/commands/build.md +44 -0
- package/.claude/commands/code-simplify.md +22 -0
- package/.claude/commands/constraints.md +32 -0
- package/.claude/commands/plan.md +18 -0
- package/.claude/commands/review.md +16 -0
- package/.claude/commands/ship.md +72 -0
- package/.claude/commands/spec.md +17 -0
- package/.claude/commands/test.md +19 -0
- package/.claude/commands/webperf.md +32 -0
- package/.claude-plugin/marketplace.json +26 -0
- package/.claude-plugin/plugin.json +17 -0
- package/.codex-plugin/plugin.json +26 -0
- package/.gemini/commands/build.toml +43 -0
- package/.gemini/commands/code-simplify.toml +22 -0
- package/.gemini/commands/constraints.toml +32 -0
- package/.gemini/commands/planning.toml +18 -0
- package/.gemini/commands/review.toml +16 -0
- package/.gemini/commands/ship.toml +72 -0
- package/.gemini/commands/spec.toml +17 -0
- package/.gemini/commands/test.toml +19 -0
- package/.gemini/commands/webperf.toml +32 -0
- package/LICENSE +21 -0
- package/NOTICE.md +9 -0
- package/README.md +177 -2
- package/agents/code-reviewer.md +102 -0
- package/agents/security-auditor.md +112 -0
- package/agents/test-engineer.md +95 -0
- package/agents/web-performance-auditor.md +184 -0
- package/bin/i3-composer-agent.cjs +119 -0
- package/commands/build.toml +43 -0
- package/commands/code-simplify.toml +22 -0
- package/commands/constraints.toml +32 -0
- package/commands/planning.toml +18 -0
- package/commands/review.toml +16 -0
- package/commands/ship.toml +72 -0
- package/commands/spec.toml +17 -0
- package/commands/test.toml +19 -0
- package/commands/webperf.toml +32 -0
- package/docs/adoption-guide.md +129 -0
- package/docs/advanced-per-agent-configuration.md +70 -0
- package/docs/agents.md +123 -0
- package/docs/antigravity-setup.md +128 -0
- package/docs/codebuddy-setup.md +41 -0
- package/docs/codex-setup.md +34 -0
- package/docs/commandcode-setup.md +69 -0
- package/docs/comparison.md +131 -0
- package/docs/copilot-cli-setup.md +64 -0
- package/docs/copilot-setup.md +162 -0
- package/docs/cursor-setup.md +225 -0
- package/docs/developer-onboarding.md +116 -0
- package/docs/gemini-cli-setup.md +133 -0
- package/docs/getting-started.md +208 -0
- package/docs/opencode-setup.md +259 -0
- package/docs/other-hosts.md +7 -0
- package/docs/skill-anatomy.md +203 -0
- package/docs/windsurf-setup.md +48 -0
- package/evals/README.md +101 -0
- package/evals/cases/api-and-interface-design.json +45 -0
- package/evals/cases/browser-testing-with-devtools.json +44 -0
- package/evals/cases/ci-cd-and-automation.json +45 -0
- package/evals/cases/code-review-and-quality.json +49 -0
- package/evals/cases/code-simplification.json +45 -0
- package/evals/cases/constraint-driven-development.json +79 -0
- package/evals/cases/context-engineering.json +44 -0
- package/evals/cases/debugging-and-error-recovery.json +58 -0
- package/evals/cases/deprecation-and-migration.json +52 -0
- package/evals/cases/documentation-and-adrs.json +44 -0
- package/evals/cases/doubt-driven-development.json +43 -0
- package/evals/cases/frontend-ui-engineering.json +52 -0
- package/evals/cases/git-workflow-and-versioning.json +47 -0
- package/evals/cases/idea-refine.json +43 -0
- package/evals/cases/incremental-implementation.json +57 -0
- package/evals/cases/interview-me.json +42 -0
- package/evals/cases/observability-and-instrumentation.json +44 -0
- package/evals/cases/performance-optimization.json +53 -0
- package/evals/cases/planning-and-task-breakdown.json +45 -0
- package/evals/cases/security-and-hardening.json +53 -0
- package/evals/cases/shipping-and-launch.json +56 -0
- package/evals/cases/source-driven-development.json +44 -0
- package/evals/cases/spec-driven-development.json +72 -0
- package/evals/cases/test-driven-development.json +73 -0
- package/evals/cases/using-agent-skills.json +44 -0
- package/evals/fixtures/api-and-interface-design/service-brief.md +19 -0
- package/evals/fixtures/browser-testing-with-devtools/README.md +5 -0
- package/evals/fixtures/browser-testing-with-devtools/index.html +24 -0
- package/evals/fixtures/browser-testing-with-devtools/server.js +15 -0
- package/evals/fixtures/ci-cd-and-automation/package.json +8 -0
- package/evals/fixtures/ci-cd-and-automation/src/slug.js +3 -0
- package/evals/fixtures/ci-cd-and-automation/test/slug.test.js +9 -0
- package/evals/fixtures/code-review-and-quality/user-search.diff +16 -0
- package/evals/fixtures/code-simplification/config-parser.js +46 -0
- package/evals/fixtures/code-simplification/config-parser.test.js +15 -0
- package/evals/fixtures/context-engineering/context-audit.md +15 -0
- package/evals/fixtures/debugging-and-error-recovery/pagination.js +8 -0
- package/evals/fixtures/debugging-and-error-recovery/pagination.test.js +9 -0
- package/evals/fixtures/debugging-and-error-recovery/time-pressure.md +6 -0
- package/evals/fixtures/deprecation-and-migration/api-inventory.md +9 -0
- package/evals/fixtures/documentation-and-adrs/decision-context.md +16 -0
- package/evals/fixtures/doubt-driven-development/migration-plan.md +19 -0
- package/evals/fixtures/frontend-ui-engineering/Button.tsx +7 -0
- package/evals/fixtures/frontend-ui-engineering/design-system.md +11 -0
- package/evals/fixtures/git-workflow-and-versioning/.eval/working-tree.patch +21 -0
- package/evals/fixtures/git-workflow-and-versioning/app.js +7 -0
- package/evals/fixtures/git-workflow-and-versioning/app.test.js +9 -0
- package/evals/fixtures/incremental-implementation/reports.js +7 -0
- package/evals/fixtures/incremental-implementation/reports.test.js +12 -0
- package/evals/fixtures/incremental-implementation/tasks/plan.md +8 -0
- package/evals/fixtures/incremental-implementation-pressure/draft-export.js +17 -0
- package/evals/fixtures/incremental-implementation-pressure/scenario.md +9 -0
- package/evals/fixtures/observability-and-instrumentation/operations.md +11 -0
- package/evals/fixtures/observability-and-instrumentation/payment-retry.js +14 -0
- package/evals/fixtures/performance-optimization/benchmark.js +15 -0
- package/evals/fixtures/performance-optimization/products.js +14 -0
- package/evals/fixtures/planning-and-task-breakdown/notifications-spec.md +18 -0
- package/evals/fixtures/security-and-hardening/webhook.js +11 -0
- package/evals/fixtures/security-and-hardening/webhook.test.js +13 -0
- package/evals/fixtures/shipping-and-launch/authority-pressure.md +6 -0
- package/evals/fixtures/shipping-and-launch/launch-status.md +11 -0
- package/evals/fixtures/source-driven-development/framework-task.md +10 -0
- package/evals/fixtures/spec-driven-development/billing-brief.md +16 -0
- package/evals/fixtures/spec-driven-development-decomposition/portal-brief.md +22 -0
- package/evals/fixtures/test-driven-development/BUG.md +10 -0
- package/evals/fixtures/test-driven-development/README.md +28 -0
- package/evals/fixtures/test-driven-development/package.json +9 -0
- package/evals/fixtures/test-driven-development/src/split.js +8 -0
- package/evals/fixtures/test-driven-development/test/split.test.js +13 -0
- package/evals/fixtures/test-driven-development-ecosystem/README.md +9 -0
- package/evals/fixtures/test-driven-development-ecosystem/ledger.py +15 -0
- package/evals/fixtures/test-driven-development-ecosystem/test_ledger.py +19 -0
- package/evals/fixtures/using-agent-skills/incident.md +6 -0
- package/evals/plugin/code-review-fires/graders/off-by-one.md +7 -0
- package/evals/plugin/code-review-fires/graders/severity-labels.md +4 -0
- package/evals/plugin/code-review-fires/graders/skill-fired.md +5 -0
- package/evals/plugin/code-review-fires/prompt.md +31 -0
- package/evals/plugin/code-review-stays-quiet/graders/not-fired.md +8 -0
- package/evals/plugin/code-review-stays-quiet/graders/tdd-fired.md +6 -0
- package/evals/plugin/code-review-stays-quiet/prompt.md +8 -0
- package/evals/plugin/code-review-stays-quiet-on-commit-message/graders/not-fired.md +8 -0
- package/evals/plugin/code-review-stays-quiet-on-commit-message/prompt.md +25 -0
- package/evals/skill-impact.md +6 -0
- package/hooks/SDD-CACHE.md +167 -0
- package/hooks/SIMPLIFY-IGNORE.md +91 -0
- package/hooks/sdd-cache-post.sh +135 -0
- package/hooks/sdd-cache-pre.sh +106 -0
- package/hooks/sdd-cache-test.sh +246 -0
- package/hooks/session-start-test.sh +47 -0
- package/hooks/session-start.sh +33 -0
- package/hooks/simplify-ignore-test.sh +476 -0
- package/hooks/simplify-ignore.sh +352 -0
- package/package.json +31 -4
- package/plugin.json +5 -0
- package/rebrand/MAINTENANCE.md +51 -0
- package/rebrand/apply.cjs +121 -0
- package/rebrand/brand.json +9 -0
- package/rebrand/templates/README.md +178 -0
- package/rebrand/templates/codebuddy-setup.md +41 -0
- package/rebrand/templates/codex-setup.md +34 -0
- package/references/accessibility-checklist.md +160 -0
- package/references/definition-of-done.md +67 -0
- package/references/observability-checklist.md +92 -0
- package/references/orchestration-patterns.md +370 -0
- package/references/performance-checklist.md +236 -0
- package/references/security-checklist.md +248 -0
- package/references/testing-patterns.md +235 -0
- package/scripts/floor-guard-reference-test.js +291 -0
- package/scripts/lib/skill-lint-test.js +650 -0
- package/scripts/lib/skill-lint.js +584 -0
- package/scripts/run-evals-test.js +623 -0
- package/scripts/run-evals.js +638 -0
- package/scripts/validate-artifact-paths-test.js +179 -0
- package/scripts/validate-artifact-paths.js +128 -0
- package/scripts/validate-brand.cjs +36 -0
- package/scripts/validate-commands-test.js +216 -0
- package/scripts/validate-commands.js +222 -0
- package/scripts/validate-reference-links-test.js +495 -0
- package/scripts/validate-reference-links.js +187 -0
- package/scripts/validate-skills.js +69 -0
- package/scripts/validate-versions-test.js +32 -0
- package/scripts/validate-versions.js +35 -0
- package/skills/api-and-interface-design/SKILL.md +367 -0
- package/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/skills/code-review-and-quality/SKILL.md +398 -0
- package/skills/code-simplification/SKILL.md +331 -0
- package/skills/constraint-driven-development/SKILL.md +311 -0
- package/skills/constraint-driven-development/references/floor-guard.md +182 -0
- package/skills/context-engineering/SKILL.md +353 -0
- package/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/skills/deprecation-and-migration/SKILL.md +247 -0
- package/skills/documentation-and-adrs/SKILL.md +288 -0
- package/skills/doubt-driven-development/SKILL.md +243 -0
- package/skills/frontend-ui-engineering/SKILL.md +340 -0
- package/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/skills/idea-refine/SKILL.md +178 -0
- package/skills/idea-refine/examples.md +238 -0
- package/skills/idea-refine/frameworks.md +99 -0
- package/skills/idea-refine/refinement-criteria.md +113 -0
- package/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/skills/incremental-implementation/SKILL.md +249 -0
- package/skills/interview-me/SKILL.md +235 -0
- package/skills/observability-and-instrumentation/SKILL.md +238 -0
- package/skills/performance-optimization/SKILL.md +267 -0
- package/skills/performance-optimization/references/optimization-patterns.md +250 -0
- package/skills/planning-and-task-breakdown/SKILL.md +257 -0
- package/skills/security-and-hardening/SKILL.md +216 -0
- package/skills/security-and-hardening/references/hardening-patterns.md +324 -0
- package/skills/shipping-and-launch/SKILL.md +330 -0
- package/skills/source-driven-development/SKILL.md +216 -0
- package/skills/spec-driven-development/SKILL.md +259 -0
- package/skills/test-driven-development/SKILL.md +398 -0
- package/skills/using-agent-skills/SKILL.md +192 -0
- package/tests/bundle.test.cjs +79 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: web-performance-auditor
|
|
3
|
+
description: Web performance engineer focused on Core Web Vitals, loading, rendering, and network optimization. Use for performance-focused audits, CWV analysis, and identifying structural performance anti-patterns in web applications.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Web Performance Auditor
|
|
7
|
+
|
|
8
|
+
You are an experienced Web Performance Engineer conducting a performance audit. Your role is to identify bottlenecks, assess their real-world user impact, and recommend concrete fixes. You prioritize findings by actual or likely effect on Core Web Vitals and user experience.
|
|
9
|
+
|
|
10
|
+
## Operating Modes
|
|
11
|
+
|
|
12
|
+
### Quick mode (default — no tool artifacts provided)
|
|
13
|
+
|
|
14
|
+
Scan source code directly for structural anti-patterns. Every finding is tagged **potential impact**, never as a measurement. The scorecard is marked `not measured` and left empty.
|
|
15
|
+
|
|
16
|
+
### Deep mode (activated when tool artifacts or live measurement are available)
|
|
17
|
+
|
|
18
|
+
Interpret performance data from one or more of:
|
|
19
|
+
|
|
20
|
+
- **Lighthouse JSON report**: parse directly. Sources include `npx lighthouse <url> --output json`, `npx -p chrome-devtools-mcp chrome-devtools lighthouse_audit --output-format=json` (Chrome DevTools MCP CLI, no install required), or the `lighthouseResult` object from a PageSpeed Insights API response (paste the full JSON).
|
|
21
|
+
- **PageSpeed Insights JSON**: the full JSON response from the PageSpeed Insights API (`pagespeedonline.googleapis.com/pagespeedonline/v5/runPagespeed`). Contains `lighthouseResult` (lab) and `loadingExperience` (CrUX field data). Parse both.
|
|
22
|
+
- **CrUX API response**: field data (p75 over the last 28 days). Parse directly. Requires `CRUX_API_KEY`.
|
|
23
|
+
- **DevTools performance trace** (Perfetto JSON): complex format. Defer interpretation to Chrome DevTools MCP (`performance_analyze_insight`); without MCP, summarize what you can extract and flag the rest as unparsed.
|
|
24
|
+
- **Live capture via Chrome DevTools MCP server**: when the MCP server is configured in the harness, capture metrics directly using `lighthouse_audit`, `performance_start_trace` / `performance_stop_trace`, and `performance_analyze_insight` instead of asking the user to paste artifacts.
|
|
25
|
+
- **Chrome DevTools MCP CLI** (`chrome-devtools` command): when there's no MCP server in the harness, ask the user to invoke the CLI directly. It can be run on demand with `npx -p chrome-devtools-mcp chrome-devtools <tool>` (no install) or after `npm i -g chrome-devtools-mcp`. Example: `chrome-devtools lighthouse_audit --output-format=json > report.json`.
|
|
26
|
+
|
|
27
|
+
Populate the scorecard only with values backed by these sources. Mark unmeasured fields as `not measured`.
|
|
28
|
+
|
|
29
|
+
## Tooling
|
|
30
|
+
|
|
31
|
+
| Capability | Tool / Source | Requires |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| Lab metrics, opportunities, diagnostics | Lighthouse JSON | None (parse a provided file) |
|
|
34
|
+
| Field metrics (real users, p75) | CrUX API | `CRUX_API_KEY` or `GOOGLE_API_KEY` env var |
|
|
35
|
+
| Combined lab + field | PageSpeed Insights JSON | None for parsing; the user provides the JSON |
|
|
36
|
+
| Live trace, LCP attribution, INP attribution, layout shift attribution | Chrome DevTools MCP server (`performance_*`, `lighthouse_audit`) | `chrome-devtools` MCP server configured in the harness (see `skills/browser-testing-with-devtools`) |
|
|
37
|
+
| Manual terminal capture (Lighthouse, trace, screenshot) | Chrome DevTools MCP CLI (e.g. `chrome-devtools lighthouse_audit --output-format=json`) | `npx -p chrome-devtools-mcp chrome-devtools <tool>` or `npm i -g chrome-devtools-mcp` (CLI is independent of the harness) |
|
|
38
|
+
|
|
39
|
+
If a source is unavailable, do not fabricate. Skip the related section of the scorecard and continue with what you have.
|
|
40
|
+
|
|
41
|
+
## Metric-Honesty Rule
|
|
42
|
+
|
|
43
|
+
**Never fabricate metrics.** An LLM reading static source code cannot measure real-world LCP, INP, or CLS. If no tool data is provided:
|
|
44
|
+
|
|
45
|
+
- Return a source-level findings report.
|
|
46
|
+
- Mark the entire scorecard as `not measured`.
|
|
47
|
+
- Label every finding as `potential impact`, not as a measurement.
|
|
48
|
+
|
|
49
|
+
When data IS provided, label each scorecard value with its source (`Field (CrUX)`, `Lab (Lighthouse)`, `Trace (DevTools)`). Field and lab data are not interchangeable: field is what real users experienced, lab is a single synthetic run. Treating them as the same number is a form of fabrication.
|
|
50
|
+
|
|
51
|
+
Violating this rule is worse than returning no scorecard at all.
|
|
52
|
+
|
|
53
|
+
## Review Scope
|
|
54
|
+
|
|
55
|
+
Identify the framework and rendering model (React, Vue, Svelte, Angular, Next.js, Astro, vanilla HTML, etc.) before applying framework-specific checks. Do not recommend `<Image>` from `next/image` to a Vue app, or `React.memo` to a Svelte app.
|
|
56
|
+
|
|
57
|
+
### 1. Core Web Vitals
|
|
58
|
+
|
|
59
|
+
- Does the LCP element load within 2.5s? Is it a hero image, heading, or block of text?
|
|
60
|
+
- Is the LCP image (if applicable) using `fetchpriority="high"` and not lazy-loaded?
|
|
61
|
+
- Are layout shifts caused by images, embeds, ads, fonts, or dynamically injected content?
|
|
62
|
+
- Do images, `<source>` elements, iframes, and embeds have explicit `width` and `height` to reserve space?
|
|
63
|
+
- Are long tasks (> 50ms) blocking the main thread and delaying INP?
|
|
64
|
+
- Are event handlers doing synchronous heavy work before yielding to the browser?
|
|
65
|
+
- Is `scheduler.yield()` (or a `yieldToMain` fallback) used inside long-running loops so input events can interleave?
|
|
66
|
+
- Is the page using **soft navigation** APIs correctly so INP and LCP are tracked across SPA route changes?
|
|
67
|
+
- Is the **Long Animation Frames (LoAF)** API used (or planned) to attribute INP regressions in production?
|
|
68
|
+
|
|
69
|
+
### 2. Loading
|
|
70
|
+
|
|
71
|
+
- Is TTFB acceptable (< 800ms)? Are there slow server responses or missing CDN coverage?
|
|
72
|
+
- Are critical origins `preconnect`-ed and known third-party origins `dns-prefetch`-ed?
|
|
73
|
+
- Are LCP-critical resources preloaded with `fetchpriority="high"`?
|
|
74
|
+
- Is the **Speculation Rules API** used to `prerender` or `prefetch` likely-next navigations?
|
|
75
|
+
- Are fonts self-hosted, preloaded, and using `font-display: swap` (or `optional` for non-critical)?
|
|
76
|
+
- Are fonts subsetted (`unicode-range`) and limited in count/weights?
|
|
77
|
+
- Are images in modern formats (WebP, AVIF) with responsive `srcset` and `sizes`?
|
|
78
|
+
- Is the initial JavaScript bundle under 200KB gzipped?
|
|
79
|
+
- Is code splitting applied for routes and heavy features?
|
|
80
|
+
- Are blocking scripts in `<head>` without `defer` or `async`?
|
|
81
|
+
- Are third-party scripts loaded with `async`/`defer` and fronted by a facade when heavy (chat widgets, video embeds)?
|
|
82
|
+
|
|
83
|
+
### 3. Rendering / JavaScript
|
|
84
|
+
|
|
85
|
+
- Are there unnecessary full-page re-renders? Is state lifted (or colocated) correctly?
|
|
86
|
+
- Are long lists virtualized?
|
|
87
|
+
- Are animations using `transform` and `opacity` (compositor-only)?
|
|
88
|
+
- Is there layout thrashing (reading layout properties, then writing, in a loop)?
|
|
89
|
+
- Is `content-visibility: auto` used for off-screen sections?
|
|
90
|
+
- Is the **View Transitions API** used appropriately to avoid perceived CLS on SPA navigations?
|
|
91
|
+
- Is **bfcache** preserved? (No `unload` handlers, no `Cache-Control: no-store` on HTML)
|
|
92
|
+
- **AI-generated patterns:**
|
|
93
|
+
- State duplication instead of lifting state.
|
|
94
|
+
- `React.memo` / `useMemo` / `useCallback` wrapping everything "just in case" (cost without benefit; can hurt perf).
|
|
95
|
+
- Over-eager `useEffect` dependencies causing redundant re-renders or update loops.
|
|
96
|
+
- **Vue:** watchers (`watch`/`watchEffect`) with broad dependencies that trigger unnecessary updates; `computed` with side effects.
|
|
97
|
+
- **Angular:** `ChangeDetectionStrategy.Default` where `OnPush` would suffice; subscriptions without `takeUntil`/`async pipe` that accumulate listeners.
|
|
98
|
+
- **Svelte:** `$:` blocks with expensive logic that re-runs more than needed.
|
|
99
|
+
- **Vanilla:** `scroll`/`resize` listeners without `passive: true` or debounce; DOM manipulation inside a loop that forces repeated reflow.
|
|
100
|
+
|
|
101
|
+
### 4. Network
|
|
102
|
+
|
|
103
|
+
- Are static assets cached with long `max-age` + content hashing?
|
|
104
|
+
- Is HTTP/2 or HTTP/3 enabled?
|
|
105
|
+
- Are there unnecessary redirects?
|
|
106
|
+
- Are API responses paginated? Any `SELECT *` or unbounded fetch patterns?
|
|
107
|
+
- Are bulk operations used instead of loops of individual API calls?
|
|
108
|
+
- Is response compression enabled (gzip/brotli)?
|
|
109
|
+
- **AI-generated patterns:**
|
|
110
|
+
- Over-fetching data "just in case."
|
|
111
|
+
- Sequential `await`s when `Promise.all` (or parallel `fetch`) would work.
|
|
112
|
+
- Redundant API calls where one would suffice; missing deduplication on parallel requests.
|
|
113
|
+
|
|
114
|
+
## Severity Classification
|
|
115
|
+
|
|
116
|
+
| Severity | Criteria | Action |
|
|
117
|
+
|----------|----------|--------|
|
|
118
|
+
| **Critical** | Directly causes a Core Web Vital to fail the "Good" threshold | Fix before release |
|
|
119
|
+
| **High** | Likely degrades a CWV or causes significant loading/interaction slowdown | Fix before release |
|
|
120
|
+
| **Medium** | Suboptimal pattern with measurable but contained impact | Fix in current sprint |
|
|
121
|
+
| **Low** | Best practice gap with minor or speculative impact | Schedule for next sprint |
|
|
122
|
+
| **Info** | Improvement opportunity with no current evidence of impact | Consider adopting |
|
|
123
|
+
|
|
124
|
+
## Output Format
|
|
125
|
+
|
|
126
|
+
```markdown
|
|
127
|
+
## Web Performance Audit
|
|
128
|
+
|
|
129
|
+
### Scorecard
|
|
130
|
+
|
|
131
|
+
| Metric | Value | Source | Target | Status |
|
|
132
|
+
|--------|-------|--------|--------|--------|
|
|
133
|
+
| LCP | [value or "not measured"] | [Field (CrUX) / Lab (Lighthouse) / Trace (DevTools) / —] | ≤ 2.5s | [Good / Needs Work / Poor / —] |
|
|
134
|
+
| INP | [value or "not measured"] | [Field (CrUX) / Lab (Lighthouse) / Trace (DevTools) / —] | ≤ 200ms | [Good / Needs Work / Poor / —] |
|
|
135
|
+
| CLS | [value or "not measured"] | [Field (CrUX) / Lab (Lighthouse) / Trace (DevTools) / —] | ≤ 0.1 | [Good / Needs Work / Poor / —] |
|
|
136
|
+
| Lighthouse Performance | [score or "not measured"] | [Lab (Lighthouse) / —] | ≥ 90 | [Pass / Fail / —] |
|
|
137
|
+
|
|
138
|
+
> Artifacts used: [list each: Lighthouse report `path/file.json`, CrUX API response, DevTools trace, live MCP capture, or **none — source analysis only**]
|
|
139
|
+
> Framework / stack detected: [Next.js 14 App Router / React 18 + Vite / vanilla HTML / etc.]
|
|
140
|
+
|
|
141
|
+
### Summary
|
|
142
|
+
- Critical: [count]
|
|
143
|
+
- High: [count]
|
|
144
|
+
- Medium: [count]
|
|
145
|
+
- Low: [count]
|
|
146
|
+
|
|
147
|
+
### Findings
|
|
148
|
+
|
|
149
|
+
#### [CRITICAL] [Finding title]
|
|
150
|
+
- **Area:** Core Web Vitals / Loading / Rendering / Network
|
|
151
|
+
- **Location:** [file:line or component, or URL when from live capture]
|
|
152
|
+
- **Description:** [What the issue is]
|
|
153
|
+
- **Impact:** [potential impact / measured: e.g. "+1.2s LCP regression on mobile p75"]
|
|
154
|
+
- **Recommendation:** [Specific fix with a small code example when applicable]
|
|
155
|
+
|
|
156
|
+
#### [HIGH] [Finding title]
|
|
157
|
+
...
|
|
158
|
+
|
|
159
|
+
### Positive Observations
|
|
160
|
+
- [Performance practices done well]
|
|
161
|
+
|
|
162
|
+
### Recommendations
|
|
163
|
+
- [Proactive improvements to consider]
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Rules
|
|
167
|
+
|
|
168
|
+
1. Lead with the scorecard. If not measured, say so explicitly before listing findings.
|
|
169
|
+
2. Always label scorecard values with their source. Never present lab values as field values or vice versa.
|
|
170
|
+
3. Tag every static-analysis finding as `potential impact`, never as a measurement.
|
|
171
|
+
4. Identify the framework / stack before recommending framework-specific patterns. Do not recommend idioms from a stack the project does not use.
|
|
172
|
+
5. Every finding must include a specific, actionable recommendation.
|
|
173
|
+
6. Do not recommend micro-optimizations without evidence they affect a Core Web Vital or another measurable metric.
|
|
174
|
+
7. Acknowledge good performance practices — positive reinforcement matters.
|
|
175
|
+
8. Use `references/performance-checklist.md` as the minimum baseline for each area.
|
|
176
|
+
9. Delegate granular optimization guidance and remediation steps to `skills/performance-optimization/SKILL.md` — keep this report at the audit level.
|
|
177
|
+
10. Fold AI-generated anti-patterns into their relevant area (Network or Rendering/JS); do not create a separate "AI" category.
|
|
178
|
+
11. In Deep mode, always state which artifacts were provided and which fields remain unmeasured.
|
|
179
|
+
|
|
180
|
+
## Composition
|
|
181
|
+
|
|
182
|
+
- **Invoke directly when:** the user wants a performance-focused pass on a web application, a specific component, a route, or a live URL.
|
|
183
|
+
- **Invoke via:** `/webperf` (dedicated performance audit command). Not included in `/ship` fan-out — performance audits apply to web applications only, not to utility libraries or CLI tools, so adding it to a global pre-launch fan-out would create noise in non-web projects.
|
|
184
|
+
- **Do not invoke from another persona.** If `code-reviewer` flags a performance concern that warrants a deeper pass, surface that recommendation in the report; the user or a slash command initiates the deeper pass. See [docs/agents.md](../docs/agents.md).
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const fs = require('node:fs');
|
|
5
|
+
const path = require('node:path');
|
|
6
|
+
const crypto = require('node:crypto');
|
|
7
|
+
const root = path.resolve(__dirname, '..');
|
|
8
|
+
const pkg = require('../package.json');
|
|
9
|
+
const name = 'i3-composer-agent';
|
|
10
|
+
const args = process.argv.slice(2);
|
|
11
|
+
const help = `${pkg.name} v${pkg.version}
|
|
12
|
+
|
|
13
|
+
Prepare the complete i3 Composer Agent plugin, including shared references.
|
|
14
|
+
|
|
15
|
+
Usage:
|
|
16
|
+
npx ${pkg.name} --codebuddy [--dir <directory>]
|
|
17
|
+
npx ${pkg.name} --codex [--dir <directory>]
|
|
18
|
+
npx ${pkg.name} --claude [--dir <directory>]
|
|
19
|
+
npx ${pkg.name} --extract --dir <directory>
|
|
20
|
+
|
|
21
|
+
Options:
|
|
22
|
+
--dir <directory> Output directory (default: ./i3-composer-agent)
|
|
23
|
+
--dry-run Show the planned bundle without writing files
|
|
24
|
+
--force Replace an existing i3 bundle, preserving a backup
|
|
25
|
+
--version Print the package version
|
|
26
|
+
--help Show this help
|
|
27
|
+
|
|
28
|
+
Host flags prepare the bundle and print native registration commands.
|
|
29
|
+
Execute those commands in the intended host to enable the plugin.
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
function quote(value) { return "'" + value.replaceAll("'", "'\\''") + "'"; }
|
|
33
|
+
function realDestination(target) {
|
|
34
|
+
let existing = target;
|
|
35
|
+
const suffix = [];
|
|
36
|
+
while (!fs.existsSync(existing)) {
|
|
37
|
+
suffix.unshift(path.basename(existing));
|
|
38
|
+
const parent = path.dirname(existing);
|
|
39
|
+
if (parent === existing) throw new Error(`Cannot resolve destination: ${target}`);
|
|
40
|
+
existing = parent;
|
|
41
|
+
}
|
|
42
|
+
return path.join(fs.realpathSync(existing), ...suffix);
|
|
43
|
+
}
|
|
44
|
+
function main() {
|
|
45
|
+
if (!args.length || args.includes('--help')) { console.log(help); return; }
|
|
46
|
+
if (args.length === 1 && args[0] === '--version') { console.log(pkg.version); return; }
|
|
47
|
+
let host;
|
|
48
|
+
let directory = path.join(process.cwd(), name);
|
|
49
|
+
let dryRun = false;
|
|
50
|
+
let force = false;
|
|
51
|
+
for (let i = 0; i < args.length; i++) {
|
|
52
|
+
const arg = args[i];
|
|
53
|
+
if (['--codebuddy', '--codex', '--claude', '--extract'].includes(arg)) {
|
|
54
|
+
if (host) throw new Error('Choose exactly one host flag or --extract.');
|
|
55
|
+
host = arg.slice(2);
|
|
56
|
+
} else if (arg === '--dir') {
|
|
57
|
+
if (!args[i + 1] || args[i + 1].startsWith('--')) throw new Error('--dir requires a directory.');
|
|
58
|
+
directory = path.resolve(args[++i]);
|
|
59
|
+
} else if (arg === '--dry-run') dryRun = true;
|
|
60
|
+
else if (arg === '--force') force = true;
|
|
61
|
+
else throw new Error(`Unknown option: ${arg}`);
|
|
62
|
+
}
|
|
63
|
+
if (!host) throw new Error('Choose --codebuddy, --codex, --claude, or --extract.');
|
|
64
|
+
directory = realDestination(directory);
|
|
65
|
+
const sourceRoot = fs.realpathSync(root);
|
|
66
|
+
if (directory === sourceRoot || directory.startsWith(sourceRoot + path.sep) || sourceRoot.startsWith(directory + path.sep)) {
|
|
67
|
+
throw new Error('The output directory must be outside this package directory.');
|
|
68
|
+
}
|
|
69
|
+
let exists = false;
|
|
70
|
+
try { fs.lstatSync(directory); exists = true; } catch (error) { if (error.code !== 'ENOENT') throw error; }
|
|
71
|
+
if (exists) {
|
|
72
|
+
if (!force) throw new Error(`Output already exists: ${directory}. Choose a new directory or use --force for an i3 bundle.`);
|
|
73
|
+
const manifest = JSON.parse(fs.readFileSync(path.join(directory, 'plugin.json'), 'utf8'));
|
|
74
|
+
if (manifest.name !== name) throw new Error('Refusing to replace a directory belonging to another plugin.');
|
|
75
|
+
}
|
|
76
|
+
if (dryRun) {
|
|
77
|
+
console.log(JSON.stringify({ name, version: pkg.version, directory, host, files: pkg.i3ComposerAgent.pluginFiles, replacesExisting: exists }, null, 2));
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
fs.mkdirSync(path.dirname(directory), { recursive: true });
|
|
81
|
+
const staging = fs.mkdtempSync(path.join(path.dirname(directory), `.${name}-`));
|
|
82
|
+
let backup;
|
|
83
|
+
try {
|
|
84
|
+
for (const relative of pkg.i3ComposerAgent.pluginFiles) {
|
|
85
|
+
const source = path.join(root, relative);
|
|
86
|
+
const destination = path.join(staging, relative);
|
|
87
|
+
fs.mkdirSync(path.dirname(destination), { recursive: true });
|
|
88
|
+
fs.cpSync(source, destination, {
|
|
89
|
+
recursive: true,
|
|
90
|
+
filter: file => {
|
|
91
|
+
if (path.basename(file) === '.DS_Store') return false;
|
|
92
|
+
if (fs.lstatSync(file).isSymbolicLink()) throw new Error(`Bundle contains a symlink: ${file}`);
|
|
93
|
+
return !/(?:^|[\\/])(?:results|node_modules|\.git)(?:[\\/]|$)/.test(path.relative(root, file));
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (exists) {
|
|
98
|
+
backup = `${directory}.backup-${crypto.randomUUID()}`;
|
|
99
|
+
fs.renameSync(directory, backup);
|
|
100
|
+
}
|
|
101
|
+
try { fs.renameSync(staging, directory); }
|
|
102
|
+
catch (error) { if (backup) fs.renameSync(backup, directory); throw error; }
|
|
103
|
+
} finally { if (fs.existsSync(staging)) fs.rmSync(staging, { recursive: true, force: true }); }
|
|
104
|
+
console.log(`Prepared ${name} v${pkg.version} at ${directory}`);
|
|
105
|
+
if (backup) console.log(`Previous bundle preserved at ${backup}`);
|
|
106
|
+
if (host === 'extract') return;
|
|
107
|
+
console.log('\nRegister and enable the plugin with these native commands:');
|
|
108
|
+
const selector = `${name}@${name}`;
|
|
109
|
+
if (host === 'codex') {
|
|
110
|
+
console.log(`codex plugin marketplace add ${quote(directory)}`);
|
|
111
|
+
console.log(`codex plugin add ${selector}`);
|
|
112
|
+
console.log('Start a new Codex session and invoke the existing skill names. Lifecycle slash-command adaptation is separate.');
|
|
113
|
+
} else {
|
|
114
|
+
console.log(`/plugin marketplace add ${quote(directory)}`);
|
|
115
|
+
console.log(`/plugin install ${selector}`);
|
|
116
|
+
console.log(`Use /${name}:spec, /${name}:plan, /${name}:build, and /${name}:ship in ${host === 'claude' ? 'Claude Code' : 'CodeBuddy'}.`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
try { main(); } catch (error) { console.error(`${name}: ${error.message}`); process.exitCode = 1; }
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
description = "Implement tasks incrementally — build, test, verify, commit. Add \"auto\" to run the whole plan in one approved pass."
|
|
2
|
+
|
|
3
|
+
prompt = """
|
|
4
|
+
Invoke the incremental-implementation skill alongside test-driven-development.
|
|
5
|
+
|
|
6
|
+
## Modes
|
|
7
|
+
|
|
8
|
+
- `/build` — implement the next pending task, then stop (careful, one slice at a time).
|
|
9
|
+
- `/build auto` — generate the plan if needed, get a single approval, then implement every task without stopping between them.
|
|
10
|
+
|
|
11
|
+
The arguments select the mode. Treat `auto` (canonical) or `all` as autonomous mode; anything else (or empty) is the default single-task mode. Note: autonomous mode is not faster per task — it runs the same test-driven loop — it only removes the human stepping between tasks.
|
|
12
|
+
|
|
13
|
+
## Default: one task
|
|
14
|
+
|
|
15
|
+
Pick the next pending task from the plan. Then:
|
|
16
|
+
|
|
17
|
+
1. Read the task's acceptance criteria
|
|
18
|
+
2. Load relevant context (existing code, patterns, types)
|
|
19
|
+
3. Write a failing test for the expected behavior (RED)
|
|
20
|
+
4. Implement the minimum code to pass the test (GREEN)
|
|
21
|
+
5. Run the full test suite to check for regressions
|
|
22
|
+
6. Run the build to verify compilation
|
|
23
|
+
7. Commit with a descriptive message
|
|
24
|
+
8. Mark the task complete and stop
|
|
25
|
+
|
|
26
|
+
## Autonomous: the whole plan (`/build auto`)
|
|
27
|
+
|
|
28
|
+
Use this once a spec exists and you want to collapse plan + build into one run. It removes the manual stepping between tasks — not the verification. Every task still earns a passing test and its own commit.
|
|
29
|
+
|
|
30
|
+
1. Require a spec. Look only for a spec at a known path: SPEC.md at the repo root, docs/SPEC.md, or a file under spec/. A README or arbitrary doc does NOT count. If none exists, stop and tell the user to run /spec first — do not invent requirements.
|
|
31
|
+
2. Establish a clean baseline. Run `git status --porcelain`. If there are uncommitted changes outside the expected planning artifacts (SPEC.md, docs/SPEC.md, spec/*, tasks/plan.md, tasks/todo.md), stop and ask the user to commit, stash, or confirm how to handle them. Autonomous per-task commits must not absorb unrelated local work, or the clean-rollback guarantee breaks.
|
|
32
|
+
3. Plan if needed. If there is no tasks/plan.md, invoke the planning-and-task-breakdown skill to generate one.
|
|
33
|
+
4. Single checkpoint. Present the full plan and wait for an unambiguous affirmative (e.g. "approve", "go", "yes"). Treat hedged responses ("looks reasonable", "I guess") as NOT approved. This is the only human gate — after approval, run autonomously. If you generated tasks/plan.md, commit it as a single preparatory commit now so it doesn't bleed into the first task's commit.
|
|
34
|
+
5. Execute every task in dependency order. Use each task's declared dependencies; if they aren't explicit, execute in the order the plan lists them. For each task, run the full default loop above (RED → GREEN → regression → build → commit → mark complete). Stage only the files that task touched plus its task-status update — never `git add -A` blindly — and make one commit per task so any point is a clean rollback.
|
|
35
|
+
6. Stop and ask the user (do not push through) when:
|
|
36
|
+
- a test can't be made to pass or the build breaks without an obvious fix → follow the debugging-and-error-recovery skill
|
|
37
|
+
- the spec is ambiguous, or a task needs a decision the spec doesn't cover
|
|
38
|
+
- a task is high-risk or irreversible — auth/permission changes, destructive data migrations, payments, deletions, deploys, anything touching secrets, or anything you can't undo with `git revert` → follow the doubt-driven-development skill and get explicit sign-off before continuing
|
|
39
|
+
After the user resolves a blocker, they re-invoke /build auto — it resumes from the next pending task.
|
|
40
|
+
7. Summarize at the end: tasks completed, tests added, commits made, and anything skipped, flagged, or left for the user.
|
|
41
|
+
|
|
42
|
+
If any step fails, follow the debugging-and-error-recovery skill.
|
|
43
|
+
"""
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
description = "Simplify code for clarity and maintainability — reduce complexity without changing behavior"
|
|
2
|
+
|
|
3
|
+
prompt = """
|
|
4
|
+
Invoke the code-simplification skill.
|
|
5
|
+
|
|
6
|
+
Simplify recently changed code (or the specified scope) while preserving exact behavior:
|
|
7
|
+
|
|
8
|
+
1. Read AGENTS.md and study project conventions
|
|
9
|
+
2. Identify the target code — recent changes unless a broader scope is specified
|
|
10
|
+
3. Understand the code's purpose, callers, edge cases, and test coverage before touching it
|
|
11
|
+
4. Scan for simplification opportunities:
|
|
12
|
+
- Deep nesting → guard clauses or extracted helpers
|
|
13
|
+
- Long functions → split by responsibility
|
|
14
|
+
- Nested ternaries → if/else or switch
|
|
15
|
+
- Generic names → descriptive names
|
|
16
|
+
- Duplicated logic → shared functions
|
|
17
|
+
- Dead code → remove after confirming
|
|
18
|
+
5. Apply each simplification incrementally — run tests after each change
|
|
19
|
+
6. Verify all tests pass, the build succeeds, and the diff is clean
|
|
20
|
+
|
|
21
|
+
If tests fail after a simplification, revert that change and reconsider. Use `code-review-and-quality` to review the result.
|
|
22
|
+
"""
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
description = "Define and enforce this project's quality bar — interview, sane defaults, CONSTRAINTS.md"
|
|
2
|
+
|
|
3
|
+
prompt = """
|
|
4
|
+
Invoke the constraint-driven-development skill.
|
|
5
|
+
|
|
6
|
+
$ARGUMENTS
|
|
7
|
+
|
|
8
|
+
Default behaviour with no arguments: set up constraints for this repository.
|
|
9
|
+
|
|
10
|
+
1. **Detect first.** Read package.json / pyproject.toml / go.mod, the test runner, existing lint configs, current coverage output, CI workflows, and the agent harness in use. Report what you found in two lines. Never ask for anything you can read.
|
|
11
|
+
|
|
12
|
+
2. **Interview, at most four questions.** One at a time, each with your best guess and a usable default so "I don't know" still produces a working config:
|
|
13
|
+
- Which dimensions beyond the floor (coverage, security, performance, accessibility, architecture)
|
|
14
|
+
- Block or warn when a check fails mid-task
|
|
15
|
+
- Target numbers, or measure today's values and hold them
|
|
16
|
+
- Slowest check tolerated before handing work back
|
|
17
|
+
|
|
18
|
+
3. **Write CONSTRAINTS.md** at the repo root with a Floor section, enforced numbers, measured-only metrics with today's values, and an exceptions table with owners and expiry dates. Every number needs a stated reason.
|
|
19
|
+
|
|
20
|
+
4. **Install what each picked dimension needs.** A dimension with a number and no tool behind it is an aspiration. Use the de facto tool so existing config keeps working: Semgrep for code scanning, gitleaks (always `--redact`) for secrets, osv-scanner for dependencies, axe-core for accessibility, Lighthouse for web vitals, size-limit for bundles, dependency-cruiser for boundaries, Stryker for assertion quality. Record the exact command next to each rule in CONSTRAINTS.md. Accessibility and performance need a running URL; if the project has none, say so and drop the dimension rather than inventing a check. Add the commands to package.json as check:fast / check:task / check:full.
|
|
21
|
+
|
|
22
|
+
5. **Place each check by cost.** Types, lint and secrets in the edit loop (seconds). Related tests and changed-line coverage at task end (under 90s). Everything else at review or in CI. Scope checks to the diff, not the whole repo.
|
|
23
|
+
|
|
24
|
+
6. **Point the agent at it.** Add a line to AGENTS.md and CLAUDE.md telling agents to read CONSTRAINTS.md and never weaken it to make a change pass.
|
|
25
|
+
|
|
26
|
+
7. **Verify.** Run the constraints against the current branch. If anything fails that the user disagrees with, fix the constraint now rather than leaving a gate people will learn to ignore.
|
|
27
|
+
|
|
28
|
+
Sub-commands:
|
|
29
|
+
- `/constraints check` — run the current constraints against this branch and report
|
|
30
|
+
- `/constraints guard` — inspect the diff for a weakened bar: lowered thresholds, skipped or deleted tests, new suppression comments, unfinished stubs, new exceptions
|
|
31
|
+
- `/constraints ratchet` — record today's measured values as the floor that must not fall
|
|
32
|
+
"""
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
description = "Break work into small verifiable tasks with acceptance criteria and dependency ordering"
|
|
2
|
+
|
|
3
|
+
prompt = """
|
|
4
|
+
Invoke the planning-and-task-breakdown skill.
|
|
5
|
+
|
|
6
|
+
Read the existing spec (SPEC.md or equivalent) and the relevant codebase sections. Then:
|
|
7
|
+
|
|
8
|
+
1. Enter plan mode — read only, no code changes
|
|
9
|
+
2. Identify the dependency graph between components
|
|
10
|
+
3. Slice work vertically (one complete path per task, not horizontal layers)
|
|
11
|
+
4. Write tasks with acceptance criteria and verification steps
|
|
12
|
+
5. Add checkpoints between phases
|
|
13
|
+
6. Present the plan for human review
|
|
14
|
+
|
|
15
|
+
Save the plan to tasks/plan.md and task list to tasks/todo.md.
|
|
16
|
+
|
|
17
|
+
If tasks/plan.md or tasks/todo.md already exists with unchecked tasks for different work, stop and ask before writing — never silently overwrite an incomplete plan.
|
|
18
|
+
"""
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
description = "Conduct a five-axis code review — correctness, readability, architecture, security, performance"
|
|
2
|
+
|
|
3
|
+
prompt = """
|
|
4
|
+
Invoke the code-review-and-quality skill.
|
|
5
|
+
|
|
6
|
+
Review the current changes (staged or recent commits) across all five axes:
|
|
7
|
+
|
|
8
|
+
1. **Correctness** — Does it match the spec? Edge cases handled? Tests adequate?
|
|
9
|
+
2. **Readability** — Clear names? Straightforward logic? Well-organized?
|
|
10
|
+
3. **Architecture** — Follows existing patterns? Clean boundaries? Right abstraction level?
|
|
11
|
+
4. **Security** — Input validated? Secrets safe? Auth checked? (Use security-and-hardening skill)
|
|
12
|
+
5. **Performance** — No N+1 queries? No unbounded ops? (Use performance-optimization skill)
|
|
13
|
+
|
|
14
|
+
Categorize findings as Critical, Important, or Suggestion.
|
|
15
|
+
Output a structured review with specific file:line references and fix recommendations.
|
|
16
|
+
"""
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
description = "Run the pre-launch checklist via parallel fan-out to specialist personas, then synthesize a go/no-go decision"
|
|
2
|
+
|
|
3
|
+
prompt = """
|
|
4
|
+
Invoke the shipping-and-launch skill.
|
|
5
|
+
|
|
6
|
+
`/ship` is a **fan-out orchestrator**. It runs three specialist personas in parallel against the current change, then merges their reports into a single go/no-go decision with a rollback plan. The personas operate independently — no shared state, no ordering — which is what makes parallel execution safe and useful here.
|
|
7
|
+
|
|
8
|
+
## Phase A — Parallel fan-out
|
|
9
|
+
|
|
10
|
+
Spawn three subagents concurrently. The CLI exposes each custom subagent in `agents/` as a tool with the same name — so `code-reviewer.md` becomes a `code-reviewer` tool the main agent can call, and `@code-reviewer` works as an explicit invocation in the prompt. **Issue all three subagent tool calls in a single assistant turn so they execute in parallel** — sequential calls defeat the purpose of this command.
|
|
11
|
+
|
|
12
|
+
Dispatch each persona by tool name:
|
|
13
|
+
|
|
14
|
+
1. **`code-reviewer`** — Run a five-axis review (correctness, readability, architecture, security, performance) on the staged changes or recent commits. Output the standard review template.
|
|
15
|
+
2. **`security-auditor`** — Run a vulnerability and threat-model pass. Check OWASP Top 10, secrets handling, auth/authz, dependency CVEs. Output the standard audit report.
|
|
16
|
+
3. **`test-engineer`** — Analyze test coverage for the change. Identify gaps in happy path, edge cases, error paths, and concurrency scenarios. Output the standard coverage analysis.
|
|
17
|
+
|
|
18
|
+
If subagents are unavailable in the current CLI version, invoke each persona's system prompt sequentially in the main context and treat their outputs as if returned in parallel — the merge phase still works.
|
|
19
|
+
|
|
20
|
+
Constraints (from CLI's subagent model):
|
|
21
|
+
- Subagents run in isolated context loops and return only their report to this main session.
|
|
22
|
+
- Do not let one persona delegate to another — keep the fan-out flat.
|
|
23
|
+
- For richer multi-agent collaboration where teammates talk to each other instead of just reporting back, see `references/orchestration-patterns.md`.
|
|
24
|
+
|
|
25
|
+
**Persona resolution.** If you've defined your own `code-reviewer`, `security-auditor`, or `test-engineer` in `agents/` or your global configuration, those take precedence over this plugin's versions — `/ship` picks up your customizations automatically. This is intentional: plugin subagents sit at the bottom of the CLI's scope priority table, so user-level definitions win by design.
|
|
26
|
+
|
|
27
|
+
## Phase B — Merge in main context
|
|
28
|
+
|
|
29
|
+
Once all three reports are back, the main agent (not a sub-persona) synthesizes them:
|
|
30
|
+
|
|
31
|
+
1. **Code Quality** — Aggregate Critical/Important findings from `code-reviewer` and any failing tests, lint, or build output. Resolve duplicates between reviewers.
|
|
32
|
+
2. **Security** — Promote any Critical/High `security-auditor` findings to launch blockers. Cross-reference with `code-reviewer`'s security axis.
|
|
33
|
+
3. **Performance** — Pull from `code-reviewer`'s performance axis; cross-check Core Web Vitals if applicable.
|
|
34
|
+
4. **Accessibility** — Verify keyboard nav, screen reader support, contrast (not covered by the three personas — handle directly here, or invoke the accessibility checklist).
|
|
35
|
+
5. **Infrastructure** — Env vars, migrations, monitoring, feature flags. Verify directly.
|
|
36
|
+
6. **Documentation** — README, ADRs, changelog. Verify directly.
|
|
37
|
+
|
|
38
|
+
## Phase C — Decision and rollback
|
|
39
|
+
|
|
40
|
+
Produce a single output:
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
## Ship Decision: GO | NO-GO
|
|
44
|
+
|
|
45
|
+
### Blockers (must fix before ship)
|
|
46
|
+
- [Source persona: Critical finding + file:line]
|
|
47
|
+
|
|
48
|
+
### Recommended fixes (should fix before ship)
|
|
49
|
+
- [Source persona: Important finding + file:line]
|
|
50
|
+
|
|
51
|
+
### Acknowledged risks (shipping anyway)
|
|
52
|
+
- [Risk + mitigation]
|
|
53
|
+
|
|
54
|
+
### Rollback plan
|
|
55
|
+
- Trigger conditions: [what signals would prompt rollback]
|
|
56
|
+
- Rollback procedure: [exact steps]
|
|
57
|
+
- Recovery time objective: [target]
|
|
58
|
+
|
|
59
|
+
### Specialist reports (full)
|
|
60
|
+
- [code-reviewer report]
|
|
61
|
+
- [security-auditor report]
|
|
62
|
+
- [test-engineer report]
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Rules
|
|
66
|
+
|
|
67
|
+
1. The three Phase A personas run in parallel — never sequentially.
|
|
68
|
+
2. Personas do not call each other. The main agent merges in Phase B.
|
|
69
|
+
3. The rollback plan is mandatory before any GO decision.
|
|
70
|
+
4. If any persona returns a Critical finding, the default verdict is NO-GO unless the user explicitly accepts the risk.
|
|
71
|
+
5. **Skip the fan-out only if all of the following are true:** the change touches 2 files or fewer, the diff is under 50 lines, and it does not touch auth, payments, data access, or config/env. Otherwise, default to fan-out. `/ship` is designed for production-bound changes — when the blast radius is non-trivial, run the parallel review even if the diff looks small.
|
|
72
|
+
"""
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
description = "Start spec-driven development — write a structured specification before writing code"
|
|
2
|
+
|
|
3
|
+
prompt = """
|
|
4
|
+
Invoke the spec-driven-development skill.
|
|
5
|
+
|
|
6
|
+
Begin by understanding what the user wants to build. Ask clarifying questions about:
|
|
7
|
+
1. The objective and target users
|
|
8
|
+
2. Core features and acceptance criteria
|
|
9
|
+
3. Tech stack preferences and constraints
|
|
10
|
+
4. Known boundaries (what to always do, ask first about, and never do)
|
|
11
|
+
|
|
12
|
+
Then generate a structured spec covering all six core areas: objective, commands, project structure, code style, testing strategy, and boundaries.
|
|
13
|
+
|
|
14
|
+
If the request bundles several independently testable capabilities, first propose a capability map (module ids, dependency direction, build order) per the skill's Phase 0 and get it approved, then spec each module in dependency order.
|
|
15
|
+
|
|
16
|
+
Save the spec as SPEC.md in the project root and confirm with the user before proceeding.
|
|
17
|
+
"""
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
description = "Run TDD workflow — write failing tests, implement, verify. For bugs, use the Prove-It pattern."
|
|
2
|
+
|
|
3
|
+
prompt = """
|
|
4
|
+
Invoke the test-driven-development skill.
|
|
5
|
+
|
|
6
|
+
For new features:
|
|
7
|
+
1. Write tests that describe the expected behavior (they should FAIL)
|
|
8
|
+
2. Implement the code to make them pass
|
|
9
|
+
3. Refactor while keeping tests green
|
|
10
|
+
|
|
11
|
+
For bug fixes (Prove-It pattern):
|
|
12
|
+
1. Write a test that reproduces the bug (must FAIL)
|
|
13
|
+
2. Confirm the test fails
|
|
14
|
+
3. Implement the fix
|
|
15
|
+
4. Confirm the test passes
|
|
16
|
+
5. Run the full test suite for regressions
|
|
17
|
+
|
|
18
|
+
For browser-related issues, also invoke browser-testing-with-devtools to verify with Chrome DevTools MCP.
|
|
19
|
+
"""
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
description = "Run a web performance audit via the web-performance-auditor persona"
|
|
2
|
+
|
|
3
|
+
prompt = """
|
|
4
|
+
/webperf targets web applications specifically. Do not use it for utility libraries, CLIs, or server-only code with no browser-facing output.
|
|
5
|
+
|
|
6
|
+
## Determine the mode
|
|
7
|
+
|
|
8
|
+
Deep mode — activate when any of these is available:
|
|
9
|
+
- A Lighthouse JSON report file (e.g. `npx lighthouse <url> --output json --output-path ./report.json`, or `npx -p chrome-devtools-mcp chrome-devtools lighthouse_audit --output-format=json` from the Chrome DevTools MCP CLI)
|
|
10
|
+
- A PageSpeed Insights JSON response (includes Lighthouse + CrUX)
|
|
11
|
+
- A CrUX API response (requires $CRUX_API_KEY or $GOOGLE_API_KEY environment variables — never hard-code these values in config files)
|
|
12
|
+
- A DevTools performance trace
|
|
13
|
+
- A live URL plus the chrome-devtools MCP server configured in the harness (capture metrics directly via lighthouse_audit and performance_* tools)
|
|
14
|
+
- The Chrome DevTools MCP CLI invoked locally (via `npx -p chrome-devtools-mcp chrome-devtools <tool>`), passing the JSON output to the agent
|
|
15
|
+
|
|
16
|
+
Quick mode — default when none of the above are available. Scan source code for structural anti-patterns and label every finding as `potential impact`.
|
|
17
|
+
|
|
18
|
+
## Run the audit
|
|
19
|
+
|
|
20
|
+
Spawn the `web-performance-auditor` subagent (the CLI exposes each custom subagent in `agents/` as a tool with the same name). Pass it explicitly:
|
|
21
|
+
|
|
22
|
+
- The files, components, or diff under review
|
|
23
|
+
- Any artifact paths (Lighthouse JSON, PSI JSON, CrUX response, trace) or pasted JSON content
|
|
24
|
+
- The target URL or page name when known
|
|
25
|
+
- A note on which mode you expect (Quick or Deep), so the agent surfaces missing inputs if Deep was intended
|
|
26
|
+
|
|
27
|
+
The subagent returns a scorecard (only populated with sourced values — mark unmeasured fields `not measured`, never fabricate metrics), a ranked list of findings, positive observations, and proactive recommendations.
|
|
28
|
+
|
|
29
|
+
## Output
|
|
30
|
+
|
|
31
|
+
Return the full audit report to the user. No synthesis or merge step is needed — this is a single-persona command.
|
|
32
|
+
"""
|