Skip to content

Conversation

@akz4ol
Copy link

@akz4ol akz4ol commented Jan 11, 2026

Summary

Add two new community-contributed tools for CrewAI agents:

1. SpecTestGeneratorTool

Converts PRDs (Product Requirements Documents) into formal requirements and test cases with stable, traceable IDs.

Features:

  • Fingerprint-based stable IDs that persist across regeneration (REQ-xxxx, TEST-xxxx)
  • Multiple output formats: markdown, JSON, Gherkin/BDD
  • Traceability matrices linking requirements to tests
  • Acceptance criteria and edge case generation

Installation: pip install spec-test-generator

Usage:

from crewai_tools import SpecTestGeneratorTool

tool = SpecTestGeneratorTool()
result = tool.run(prd_content="# Feature: User Authentication\n...")

2. APIGovernorTool

Validates OpenAPI specifications against governance policies for automated API review.

Features:

  • Security checks (missing auth, weak schemes)
  • Naming convention validation
  • Documentation gap detection
  • Multiple policy levels: lenient, standard, strict
  • Output formats: markdown, JSON, SARIF (for IDE/CI integration)

Installation: pip install api-governor

Usage:

from crewai_tools import APIGovernorTool

tool = APIGovernorTool()
result = tool.run(spec_content="openapi: 3.0.0\n...", policy="strict")

Test Plan

  • Import test: verify tools can be imported from crewai_tools
  • Basic functionality test with sample inputs
  • Error handling for missing dependencies

Links

🤖 Generated with Claude Code


Note

Introduces two new tools and wires them into crewai_tools exports.

  • APIGovernorTool: Validates OpenAPI specs against policy levels (lenient/standard/strict); outputs markdown/json/sarif; handles temp spec files and missing dependency messaging
  • SpecTestGeneratorTool: Converts PRDs to requirements and test cases with stable IDs; outputs markdown/json/gherkin (with optional Gherkin generation); handles temp files and missing dependency messaging
  • Updates tools/__init__.py and adds package __init__ files to export APIGovernorTool and SpecTestGeneratorTool

Written by Cursor Bugbot for commit 67cbdaf. This will update automatically on new commits. Configure here.

Add two new tools for CrewAI agents:

1. SpecTestGeneratorTool - Converts PRDs (Product Requirements Documents)
   into formal requirements and test cases with stable, traceable IDs.
   Features:
   - Fingerprint-based stable IDs (REQ-xxxx, TEST-xxxx)
   - Multiple output formats: markdown, JSON, Gherkin/BDD
   - Traceability matrices linking requirements to tests

2. APIGovernorTool - Validates OpenAPI specifications against governance
   policies. Features:
   - Security checks (missing auth, weak schemes)
   - Naming convention validation
   - Documentation gap detection
   - Multiple policy levels: lenient, standard, strict
   - Output formats: markdown, JSON, SARIF

Both tools are available on PyPI:
- pip install spec-test-generator
- pip install api-governor

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

mode="w", suffix=ext, delete=False
) as tmp_file:
tmp_file.write(spec_content)
tmp_path = Path(tmp_file.name)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temp file leaks if exception during write phase

Low Severity

The temporary file creation with NamedTemporaryFile(..., delete=False) occurs outside the try/finally block that handles cleanup. If an exception occurs during tmp_file.write() (e.g., disk full), the file is already created on disk but tmp_path is never assigned, so the finally block at line 150/165 that calls tmp_path.unlink() will never execute. This causes the temp file to remain on disk as a resource leak. Moving the with block inside the try block would ensure cleanup runs regardless of where the exception occurs.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants