Skip to main content

Building with Cursor

X-Fidelity includes specialized AI tooling for Cursor IDE that significantly accelerates development. When working on the codebase in Cursor, you have access to slash commands, specialized subagents, and step-by-step skills.

Slash Commands

Use these commands in Cursor chat by typing /xfi-* for guided development workflows:

Development Workflow Commands

CommandDescription
/xfi-reviewComprehensive code review using three expert subagents in parallel (code reviewer, security expert, testing expert)
/xfi-testRun the test suite and automatically diagnose any failures
/xfi-buildBuild the monorepo and diagnose build issues

Creation Commands

CommandDescription
/xfi-create-pluginCreate a new analysis plugin with facts, operators, tests, and sample rules
/xfi-create-ruleCreate a new analysis rule with proper structure and archetype integration
/xfi-create-archetypeCreate a new archetype configuration for a project type

Debug and Fix Commands

CommandDescription
/xfi-debugDebug errors, exceptions, and unexpected behavior
/xfi-fixSmart routing to the appropriate expert subagent based on problem type
/xfi-analyzeTroubleshoot X-Fidelity analysis issues (rules, plugins, output)

Release and Documentation Commands

CommandDescription
/xfi-releasePrepare for release following the unified release workflow
/xfi-docsUpdate documentation to stay in sync with code changes

Quality Assurance Commands

CommandDescription
/xfi-consistencyVerify CLI and VSCode extension produce identical results
/xfi-securityPerform security review of code changes

Specialized Subagents

The AI has access to domain-specific expert subagents that provide deep expertise in different aspects of X-Fidelity:

SubagentExpertiseAuto-triggers
xfi-build-expertTurbo, yarn workspaces, esbuild, TypeScript compilationBuild failures, CI issues
xfi-testing-expertJest, coverage, integration tests, VSCode extension testingTest failures, coverage gaps
xfi-plugin-expertPlugin architecture, facts, operators, AST analysis with tree-sitterPlugin development
xfi-vscode-expertVSCode extension, webviews, tree views, diagnostics, packagingExtension issues
xfi-rules-expertjson-rules-engine, archetypes, conditions, events, exemptionsRule creation
xfi-security-expertPath validation, directory traversal prevention, webhooks, secretsSecurity reviews
xfi-debuggerError analysis, log interpretation, StandardError patternsRuntime errors
xfi-docs-expertREADME, website docs (Docusaurus), CHANGELOGDocumentation updates
xfi-code-reviewerBalanced code review, quality and security assessmentBefore commits, PR reviews

Parallel Subagent Execution

Subagents can run in parallel when their domains are independent. For example, after implementing a feature:

Run in parallel:
├── xfi-code-reviewer (review the changes)
├── xfi-testing-expert (check test coverage)
└── xfi-docs-expert (check documentation needs)

Skills

Skills are step-by-step guides that are automatically loaded when relevant. They provide detailed workflows for common development tasks:

SkillPurpose
xfi-create-pluginComplete plugin creation workflow with templates
xfi-create-ruleRule creation with fact/operator selection guidance
xfi-create-archetypeArchetype configuration with rule and exemption setup
xfi-release-workflowRelease process, conventional commits, version management
xfi-debug-analysisTroubleshooting analysis issues systematically
xfi-consistency-testingCLI-Extension parity verification workflow
xfi-documentation-updateDocumentation sync between README and website
xfi-add-packageAdding new packages to the monorepo

File Locations

ResourceLocation
Slash Commands.cursor/commands/
Subagents.cursor/agents/
Skills.cursor/skills/
Workspace Rules.cursor/rules/

Example Workflows

Creating a New Plugin

  1. Use /xfi-create-plugin command
  2. The AI reads the xfi-create-plugin skill for step-by-step guidance
  3. The xfi-plugin-expert subagent provides architecture expertise
  4. Complete plugin with facts, operators, tests, and sample rules is created

Debugging a Test Failure

  1. Use /xfi-test command
  2. Tests run via yarn test
  3. If failures occur, xfi-testing-expert analyzes the issue
  4. If it's a runtime error, xfi-debugger is also engaged
  5. Fix is applied and verified

Preparing a Release

  1. Use /xfi-release command
  2. xfi-testing-expert and xfi-docs-expert run pre-checks in parallel
  3. The xfi-release-workflow skill guides through conventional commits
  4. Dry run is executed to preview the release

Tips for Effective Use

  1. Let the AI auto-delegate: Subagents are triggered automatically based on context
  2. Use slash commands for complex tasks: They provide structured workflows
  3. Trust subagent expertise: Each subagent is a subject matter expert
  4. Combine insights: Multi-subagent commands synthesize findings from all experts
  5. Check the skills: Skills contain detailed checklists and templates