Skip to content

community: Add SpecTestGeneratorTool and APIGovernorTool#499

Open
akz4ol wants to merge 1 commit intolangchain-ai:mainfrom
akz4ol:add-spec-test-generator-api-governor-tools
Open

community: Add SpecTestGeneratorTool and APIGovernorTool#499
akz4ol wants to merge 1 commit intolangchain-ai:mainfrom
akz4ol:add-spec-test-generator-api-governor-tools

Conversation

@akz4ol
Copy link

@akz4ol akz4ol commented Jan 10, 2026

Description

Add two new tools to langchain-community for requirements/test generation and API governance:

SpecTestGeneratorTool

Converts PRDs (Product Requirements Documents) into formal requirements and test cases with stable, traceable IDs. Uses fingerprint-based IDs that persist across regeneration.

Features:

  • PRD parsing from markdown
  • Requirements generation with stable IDs (REQ-xxxx)
  • Test case generation linked to requirements (TEST-xxxx)
  • Multiple output formats: markdown, json, gherkin

Requires: pip install spec-test-generator

Links:

APIGovernorTool

Validates OpenAPI specifications against governance policies. Performs automated API governance checks including security validation, naming conventions, and documentation requirements.

Features:

  • Policy-driven linting (lenient, standard, strict)
  • Security validation (missing auth, weak schemes)
  • Naming convention checks
  • Multiple output formats: markdown, json, sarif

Requires: pip install api-governor

Links:

Why These Tools?

These tools enable LangChain agents to:

  1. Convert natural language PRDs into structured requirements and test cases
  2. Validate API specifications against governance policies before deployment
  3. Automate compliance and traceability workflows

Testing

Added unit tests for both tools verifying initialization, schema, and graceful handling when underlying packages are not installed.

Checklist

  • Tools inherit from BaseTool
  • Type hints and docstrings included
  • Unit tests added
  • Tools registered in __init__.py
  • Follows existing tool patterns (see arxiv, pubmed tools)

This PR was developed with assistance from AI agents (Claude Code).

Add two new tools to langchain-community:

## SpecTestGeneratorTool
Converts PRDs (Product Requirements Documents) into formal requirements
and test cases with stable, traceable IDs. Uses fingerprint-based IDs
that persist across regeneration.

Features:
- PRD parsing from markdown
- Requirements generation with stable IDs (REQ-xxxx)
- Test case generation linked to requirements (TEST-xxxx)
- Multiple output formats: markdown, json, gherkin

Requires: pip install spec-test-generator

## APIGovernorTool
Validates OpenAPI specifications against governance policies. Performs
automated API governance checks including security validation, naming
conventions, and documentation requirements.

Features:
- Policy-driven linting (lenient, standard, strict)
- Security validation
- Naming convention checks
- Multiple output formats: markdown, json, sarif

Requires: pip install api-governor

## Testing
Added unit tests for both tools verifying initialization and schema.

---

This PR was developed with assistance from AI agents (Claude Code).
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