Add openspec-quality-gate skill to prevent AI code generation hallucinations caused by upstream spec gaps

Đang mở
#2,155 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
43/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
ai, developer-experience

Hướng nghiên cứu

Read the attached openspec-quality-gate.md proposal and compare it with the existing openspec-explore skill and the project’s skill conventions. Define how the proposed cross-validation, scoring, and dual outputs fit those conventions; the issue does not name implementation files or tests. Done means a built-in skill can identify specification gaps and produce the described human-readable and JSON reports.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement needs-triage
The problem, in one or two sentences

As we increasingly rely on AI agents (like Codex) to implement features based on OpenSpec, we've hit a critical "efficiency backlash." AI agents are exceptional at execution but lack the human "common sense interruption" mechanism.

If there is a mismatch between the Product Requirements (PRD), UI specs, and API documentation (e.g., UI requires a field the API doesn't provide), an AI agent will blindly generate hundreds of lines of complex React/UI code based on flawed assumptions. Fixing this highly coupled, AI-generated code post-generation is significantly harder than writing it from scratch. Garbage In, Garbage Out is amplified by AI.

Who this affects

everyone

Alternatives you considered

absence

Why it's worth the added complexity

OpenSpec focuses on specification-driven development. Right now, there is a gap between "drafting the spec" and "the AI building the spec." This skill bridges that gap, ensuring that the specification contract is mathematically sound before wasting token limits and developer time on broken implementations.

I have been testing this locally in my own workflow, and it successfully catches edge cases and API field omissions before they ever touch my codebase. I am happy to submit a PR with the skill definition if the maintainers are open to it.

What you have in mind

Title: [Proposal] Add openspec-quality-gate skill to prevent AI code generation hallucinations caused by upstream spec gaps

Description:

Background & Problem
As we increasingly rely on AI agents (like Codex) to implement features based on OpenSpec, we've hit a critical "efficiency backlash." AI agents are exceptional at execution but lack the human "common sense interruption" mechanism.

If there is a mismatch between the Product Requirements (PRD), UI specs, and API documentation (e.g., UI requires a field the API doesn't provide), an AI agent will blindly generate hundreds of lines of complex React/UI code based on flawed assumptions. Fixing this highly coupled, AI-generated code post-generation is significantly harder than writing it from scratch. Garbage In, Garbage Out is amplified by AI.

Proposed Solution
I propose adding a new built-in skill: openspec-quality-gate.
Similar to how openspec-explore acts as a "thinking partner" before a change, quality-gate acts as a strict shift-left Linter for logic and contracts right before the actual implementation phase.

How it Works
Cross-Validation: It takes the PRD, UI specs, and API schema as context and performs a strict cross-validation, grading both PRD and API on a 100-point scale.

Dual-Output Architecture:

Human-Readable: Outputs ASCII diagrams and markdown tables exposing exact mapping gaps (e.g., UI [Avatar] ---> API (Missing)), making it easy to hand back to PMs/Backend engineers.

Machine-Readable: Outputs a strict JSON object separated by a === JSON_REPORT_START === delimiter.

CI/CD Friendly: Because of the strict JSON output, developers can easily hook this into their local scripts to literally block the execution of code-generation commands if the api_score drops below 80.

Why this belongs in OpenSpec
OpenSpec focuses on specification-driven development. Right now, there is a gap between "drafting the spec" and "the AI building the spec." This skill bridges that gap, ensuring that the specification contract is mathematically sound before wasting token limits and developer time on broken implementations.

I have been testing this locally in my own workflow, and it successfully catches edge cases and API field omissions before they ever touch my codebase. I am happy to submit a PR with the skill definition if the maintainers are open to it.

openspec-quality-gate.md

Ngôn ngữ chính
TypeScript
Star
76k
Fork
5.2k
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
58

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Fission-AI/OpenSpec

Tất cả issue của Fission-AI/OpenSpec

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.