contract-generation

Generate API contracts, TypeScript types, and Azure infrastructure definitions from Gherkin scenarios.

Updated May 6, 2026
One-click install
npx skills add https://github.com/crgarcia12/compy --skill contract-generation-crgarcia12
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: contract-generation
Source: https://github.com/crgarcia12/compy/tree/main/.github/skills/contract-generation
Command: npx skills add https://github.com/crgarcia12/compy --skill contract-generation-crgarcia12

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill automates the creation of API contracts, shared TypeScript types, and infrastructure definitions from Gherkin scenarios and test files, streamlining the development process.

Core Features & Use Cases

  • API Contract Generation: Automatically produce API contracts from Gherkin scenarios and test files.
  • Shared TypeScript Types: Generate TypeScript types for API specifications, ensuring frontend and backend synchronization.
  • Infrastructure Definition: Create infrastructure resource definitions for Azure services.
  • Use Case: For a new feature increment, use this Skill to generate the necessary API contracts, TypeScript types, and infrastructure definitions, enabling parallel development.

Quick Start

Run the contract-generation skill with the current increment's scope and approved FRDs: contract-generation run --increment <increment-id> --frds <frd-filenames>.

Frequently Asked Questions about contract-generation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate API contracts from Gherkin scenarios automatically?

To generate API contracts from Gherkin scenarios, you need a tool that parses behavior-driven test files and extracts endpoint definitions. This process translates Given-When-Then steps into an OpenAPI-inspired YAML format, producing a structured API specification for development.

Can I create TypeScript types and Azure infrastructure definitions from Gherkin test files?

Yes, you can generate shared TypeScript types and Azure infrastructure definitions directly from Gherkin test files. This automation synchronizes frontend and backend type definitions while configuring necessary Azure infrastructure resources.

What is the best way to synchronize frontend and backend TypeScript types during feature development?

The best way to synchronize frontend and backend TypeScript types is by deriving them from a shared API contract. Using Gherkin scenarios as the source, you can automatically generate consistent TypeScript type definitions across your entire stack.

Do I need to know OpenAPI and Gherkin syntax to automate infrastructure definition generation?

Yes, you need working knowledge of both Gherkin syntax and the OpenAPI-inspired YAML format. This prerequisite knowledge is required to properly structure behavior scenarios and define the resulting infrastructure resource configurations.

How does generating Azure infrastructure definitions from Gherkin scenarios work?

Generating Azure infrastructure definitions from Gherkin scenarios works by parsing behavior scenarios to identify required resources, then translating those requirements into infrastructure configuration files. This enables parallel development of features and their deployment environments.

Are there limitations to generating API contracts from behavior-driven test scenarios?

A key limitation is that API contract generation from behavior-driven test scenarios requires strict adherence to Gherkin syntax and an OpenAPI-inspired YAML format. If test files lack clear endpoint definitions, the generated infrastructure and type definitions may be incomplete.