| name | plugin-self-improve |
| description | Audit and improve the Elastic Cursor Plugin itself โ analyze coverage gaps, identify missing tools/skills/rules, assess quality, and implement improvements. Use when asked to improve, extend, audit, or enhance the plugin. |
Plugin Self-Improve
Systematic workflow for auditing and improving the Elastic Cursor Plugin. Analyzes the current state across all component types, identifies gaps against the Elastic product surface, and implements targeted improvements.
Trigger
Use when the user asks to:
- Improve, extend, or enhance the plugin
- Audit plugin quality or coverage
- Find gaps in Elastic product coverage
- Add new capabilities to the plugin
- Review the plugin before a release
Steps
1. Inventory Current State
Read the plugin manifest and enumerate all components:
Plugin manifest: .cursor-plugin/plugin.json
MCP Tools โ read packages/tools-smart/src/index.ts and list every registered tool:
- Gateway tools:
elasticsearch_api, kibana_api, cloud_api, esql_query
- Smart tools: every
register* import in packages/tools-smart/src/index.ts
- Workflow tools:
list_workflows, run_workflow, save_workflow
Skills โ list all skills/*/SKILL.md files, read each frontmatter for name + description.
Rules โ list all rules/*.mdc files, read each frontmatter for description + scope.
Agents โ list all agents/*.md files, read each frontmatter for name + description.
Commands โ list all commands/*.md files, read each frontmatter for name + description.
Docs resources โ read packages/docs-provider/src/index.ts for registered elastic://docs/* URIs.
Present the full inventory as a structured table:
| Component Type | Count | Names |
|---|---|---|
| MCP Tools | N | tool1, tool2, ... |
| Skills | N | skill1, skill2, ... |
| Rules | N | rule1, rule2, ... |
| Agents | N | agent1, agent2, ... |
| Commands | N | cmd1, cmd2, ... |
| Doc Resources | N | uri1, uri2, ... |
2. Map Against Elastic Product Surface
Compare the inventory against the full Elastic product offering:
Search:
- Index management (create, mappings, templates, lifecycle)
- Query DSL (full-text, vector/kNN, hybrid, semantic)
- ES|QL
- Search applications and relevance tuning
- Inference endpoints (embeddings, rerank, completion)
Observability:
- APM (services, transactions, errors, dependencies)
- Infrastructure monitoring (hosts, containers, pods)
- Log management (shipping, parsing, correlation)
- Synthetics and uptime
- SLOs and burn rate alerts
- Universal Profiling
Security:
- SIEM (detection rules, alerts, timelines)
- Endpoint security (Elastic Defend)
- Cloud security posture (CSPM, KSPM, CNVM)
- Threat intelligence
- Investigation (cases, osquery, response actions)
- Entity analytics (risk scoring, asset criticality)
Platform:
- Fleet and agent management
- Connectors and actions (Slack, PagerDuty, email, webhook)
- Spaces and RBAC
- Transforms and rollups
- Cross-cluster search and replication
- Machine learning (anomaly detection, data frame analytics)
For each area, classify coverage as:
- Full โ dedicated tools + skill + rule guidance
- Partial โ some tools but no skill, or skill without dedicated tools
- Mentioned โ referenced in docs/rules but no tools or skills
- Missing โ not covered at all
3. Identify Improvement Opportunities
Rank gaps by impact:
High impact โ core Elastic use cases with no plugin coverage:
- Missing tools for frequently used Kibana/ES APIs
- Elastic product areas with no skills or commands
- Important workflows with no guided experience
Medium impact โ existing coverage that could be deeper:
- Skills that reference tools that don't exist yet
- Tools that exist but have no corresponding skill workflow
- Rules that could be more specific or actionable
Low impact โ polish and completeness:
- Missing doc resources for covered areas
- Commands that duplicate skill functionality
- Agents that overlap with existing skills
4. Quality Audit
For each existing component, check:
Tools:
- Does the tool connect to the right Elastic service? (ES via
esFetch, Kibana via kibanaFetch โ never ES transport for Kibana routes)
- Does the input schema cover the most useful parameters?
- Does the output format give actionable information?
- Are error cases handled with clear messages?
Skills:
- Does the skill reference only tools that actually exist in
packages/tools-smart/src/index.ts?
- Are the API References URIs valid (
elastic://docs/api/*)?
- Does the workflow have clear user decision points?
- Is the step sequence logical and complete?
Rules:
- Does each rule have proper frontmatter (
description, alwaysApply: true or globs)?
- Is the guidance specific and actionable (not generic)?
- Does it reference real tool names and API patterns?
Agents:
- Does the agent list only tools that exist?
- Is the trigger description clear about when to use it?
- Does it cover a coherent workflow, not a grab-bag?
Commands:
- Does the command have
name, description, and argument-hint?
- Is the workflow achievable with the tools that exist?
5. Present Findings
Present to the user:
- Coverage map โ which Elastic areas are fully covered, partially covered, or missing
- Top 5 high-impact gaps โ with suggested implementations
- Quality issues found โ mismatches between skills and tools, broken references, etc.
- Recommended improvements โ prioritized list with estimated effort (small/medium/large)
6. User Decision Point
Ask the user which improvements to implement:
- Numbered list of suggested improvements
- Allow "all high-impact" or specific selections
- For each selection, confirm the approach before implementing
7. Implement Improvements
For each approved improvement:
New MCP tool:
- Create
packages/tools-smart/src/<tool-name>.ts following existing patterns (zod schema, textResponse/errorResponse, esFetch/kibanaFetch)
- Add
register<ToolName> export and import in packages/tools-smart/src/index.ts
- Run
npm run build -w @elastic-cursor-plugin/tools-smart and npm run typecheck -w @elastic-cursor-plugin/tools-smart
New skill:
- Create
skills/<skill-name>/SKILL.md with name, description frontmatter
- Follow the Steps / Tools Used / API References / Prerequisites structure
- Reference only tools that exist
New rule:
- Create
rules/<rule-name>.mdc with description and alwaysApply: true frontmatter
- Keep guidance specific and actionable
New agent:
- Create
agents/<agent-name>.md with name, description frontmatter
- Include Trigger, Workflow, Tools Used, Output sections
New command:
- Create
commands/<command-name>.md with name, description, argument-hint frontmatter
- Include concise workflow steps
New doc resource:
- Add the content constant to
packages/docs-provider/src/content.ts
- Register the URI in
packages/docs-provider/src/index.ts
- Add the path mapping in
getDocByPath()
8. Validate
After implementing:
- Run
npm run build โ all packages must compile
- Run
npm run typecheck โ no type errors
- Run
npx eslint <changed-files> โ no lint errors
- Verify all skill tool references point to real registered tools
- Verify all doc resource URIs resolve
9. Summary
Present:
- Components added/modified (by type)
- Coverage improvement (before โ after)
- Remaining gaps for future work
- Suggested next round of improvements
Plugin Structure Reference
elastic-cursor-plugin/
โโโ .cursor-plugin/
โ โโโ plugin.json โ manifest with component path declarations
โ โโโ marketplace.json
โโโ skills/ โ skills/<name>/SKILL.md
โโโ rules/ โ rules/<name>.mdc
โโโ agents/ โ agents/<name>.md
โโโ commands/ โ commands/<name>.md
โโโ packages/
โ โโโ mcp-server/ โ MCP server entry point
โ โโโ tools-smart/ โ smart MCP tools (register pattern)
โ โโโ tools-gateway/ โ REST API gateways (ES, Kibana, Cloud, ES|QL)
โ โโโ tools-workflows/ โ workflow engine
โ โโโ docs-provider/ โ MCP doc resources (elastic://docs/*)
โ โโโ knowledge-base/ โ cluster knowledge caching
โ โโโ shared-types/ โ shared TS types
โ โโโ shared-http/ โ HTTP clients (esFetch, kibanaFetch)
โโโ examples/ โ demo apps
โโโ mcp.json โ MCP server command config
Build Commands
npm run build โ build all packages in order
npm run typecheck โ type check all workspaces
npm run lint:fix โ eslint with auto-fix
npm run build -w @elastic-cursor-plugin/tools-smart โ build single package
Prerequisites
- Node.js 20+
- npm workspaces configured (root
package.json)
- TypeScript, tsup, zod available
Related Skills
security-full-setup โ audit security coverage gaps
o11y-full-setup โ audit observability coverage gaps
agent-builder-skill-builder โ audit Agent Builder tool coverage
security-detection-engineering โ audit detection rule quality
o11y-slo-setup โ audit SLO coverage