Skip to content

Claude: SRD Creator v2#970

Open
vprashrex wants to merge 1 commit into
mainfrom
chore/claude-srd-creator-v2
Open

Claude: SRD Creator v2#970
vprashrex wants to merge 1 commit into
mainfrom
chore/claude-srd-creator-v2

Conversation

@vprashrex

@vprashrex vprashrex commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Issue

Closes #971

Summary

  • Enhaced the srd guide and templates
  • Now claude maintains checklist during the srd creationg
  • Added the script to create mermaid image

Checklist

Before submitting a pull request, please ensure that you mark these task.

  • Ran fastapi run --reload app/main.py or docker compose up in the repository root and test.
  • If you've fixed a bug or added code that is tested and has test cases.

Notes

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR rewrites the SRD creator skill guidance, matching references, and diagram rendering helper to enforce PRD-based SRD generation and output conventions. It also adds a new SRD for LLM judge correctness, covering flow, endpoints, schema changes, defaults, and limitations.

Changes

SRD Creator Guidance

Layer / File(s) Summary
Core contract and workflow
.claude/skills/srd-creator/SKILL.md
The skill guide now frames SRDs as testable contracts, requires a PRD, and rewrites the workflow for checklist loading, PRD-to-template mapping, optional sections, and output generation.
Checklist and rules
.claude/skills/srd-creator/SKILL.md
The skill guide rewrites the quality checklist and rules to cover traceability, output placement, section completeness, formatting limits, schema conventions, and client-facing content constraints.
Reference guide, template, and renderer
.claude/skills/srd-creator/reference/srd-guide.md, .claude/skills/srd-creator/reference/srd-template.md, .claude/skills/srd-creator/scripts/render-diagram.sh
The reference guide and template now align on resources, execution-flow image placement, tables-only schema formatting, timestamp names, and the pre-output checklist step, and a new shell script renders Mermaid input to PNG.

LLM Judge Correctness SRD

Layer / File(s) Summary
Feature framing and constraints
features/llm-judge-correctness/SRD.md
The SRD introduces a native LLM-as-a-Judge correctness feature, phase scope, and operating constraints around scoring, persistence, and model defaults.
Execution flow and FRs
features/llm-judge-correctness/SRD.md
The SRD adds the judged fast-eval execution flow and FR-1 through FR-14 for scoring behavior, isolation, endpoint expectations, tenant handling, and cost tracking.
Judge-config endpoints
features/llm-judge-correctness/SRD.md
The evaluations router section specifies judge-config CRUD routes, request and response payloads, permissions scope, and documented error codes.
Schema and persistence
features/llm-judge-correctness/SRD.md
The data model section adds evaluation_judge_config and extends evaluation_run with per-row correctness, score payload fields, and a judge cost stage.
Config defaults and limitations
features/llm-judge-correctness/SRD.md
The configuration and decision sections define fallback defaults, constants ownership, and the deferred limitations around retries, errors, and UX.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • kartpop
  • AkhileshNegi

Poem

I hopped by moonlight, nibbling peas,
and found neat SRDs among the trees.
One PNG glowed, one judge said "true,"
while tidy tables lined the view.
Huzzah, said I, with carrot cheer! 🐇

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR adds flow-diagram support and clarity edits, but the template now forbids UML for database schemas despite the issue’s request. Allow UML diagrams for complex schemas and keep tables for simpler ones.
Out of Scope Changes check ❓ Inconclusive The added feature SRD looks like a standalone deliverable, but its purpose as a fixture or example isn’t stated in the objectives. Clarify whether this SRD is an intended example/fixture; otherwise move it to a separate PR.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title identifies the SRD Creator work and matches the PR’s main theme.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/claude-srd-creator-v2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@vprashrex vprashrex requested a review from AkhileshNegi June 26, 2026 07:59
@vprashrex vprashrex self-assigned this Jun 26, 2026
@vprashrex vprashrex added the enhancement New feature or request label Jun 26, 2026
@github-actions

Copy link
Copy Markdown

OpenAPI changes   ⚪ No API surface changes

Note

This PR does not modify the API contract.

main76c4b092 · generated by oasdiff

@vprashrex vprashrex linked an issue Jun 26, 2026 that may be closed by this pull request
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@vprashrex vprashrex changed the title ehnacement(srd): enhance SRD and guide clarity, enforce PRD dependency, and improve quality checklist Claude: SRD Creator v2 Jun 26, 2026
@vprashrex vprashrex requested a review from Prajna1999 June 26, 2026 08:14

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
.claude/skills/srd-creator/SKILL.md (1)

32-32: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Clarify "TodoWrite" intent.

Line 32 says "Load the Quality Checklist into a TodoWrite list". Is "TodoWrite" a specific tool/extension reference (e.g., a VS Code extension), or should this read generically as "todo list"? If it's meant literally, consider lowercase without code formatting; if it's a specific tool, a brief parenthetical would help.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/skills/srd-creator/SKILL.md at line 32, Clarify the meaning of
“TodoWrite” in the Quality Checklist guidance so it is not ambiguous. In the
SKILL.md instruction that references the TodoWrite list, either make it clearly
generic as a todo list or, if it is a specific tool/reference, add a brief
parenthetical explanation; keep the wording consistent with the surrounding
checklist instructions and use the TodoWrite term only in the intended sense.
features/llm-judge-correctness/SRD.md (1)

266-268: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add the explicit constant name for the Correctness score.

The SRD notes the score name is "owned in Kaapi code as constants" and mirrors COSINE_SCORE_NAME. For implementation clarity, specify the constant name here (e.g., CORRECTNESS_SCORE_NAME = "Correctness") so the SRD serves as the source of truth for both the string value and its symbol.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@features/llm-judge-correctness/SRD.md` around lines 266 - 268, Add the
explicit constant symbol for the Correctness score in the SRD so it is
unambiguous and mirrors COSINE_SCORE_NAME; update the section describing the
built-in default judge prompt to name the constant (for example,
CORRECTNESS_SCORE_NAME) and state that it owns the "Correctness" string value.
Keep the SRD aligned with the existing constant-based pattern used for score
names so implementation can reference the symbol directly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/skills/srd-creator/SKILL.md:
- Around line 138-150: The workflow instructions conflict with the rules about
diagram generation, so clarify the intended behavior in the SRD-creator skill.
Update the relevant guidance around Workflow step 6 and the diagram-related
rules so they agree on whether the skill actually renders the Mermaid diagram
via render-diagram.sh or only leaves an author placeholder for manual pasting.
Make the behavior explicit using the existing step 6 wording and the diagram
rules section so authors know exactly what to do.

---

Nitpick comments:
In @.claude/skills/srd-creator/SKILL.md:
- Line 32: Clarify the meaning of “TodoWrite” in the Quality Checklist guidance
so it is not ambiguous. In the SKILL.md instruction that references the
TodoWrite list, either make it clearly generic as a todo list or, if it is a
specific tool/reference, add a brief parenthetical explanation; keep the wording
consistent with the surrounding checklist instructions and use the TodoWrite
term only in the intended sense.

In `@features/llm-judge-correctness/SRD.md`:
- Around line 266-268: Add the explicit constant symbol for the Correctness
score in the SRD so it is unambiguous and mirrors COSINE_SCORE_NAME; update the
section describing the built-in default judge prompt to name the constant (for
example, CORRECTNESS_SCORE_NAME) and state that it owns the "Correctness" string
value. Keep the SRD aligned with the existing constant-based pattern used for
score names so implementation can reference the symbol directly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a821e06f-da04-4346-b7c4-21d2a838b73a

📥 Commits

Reviewing files that changed from the base of the PR and between 4c41711 and cc0563d.

⛔ Files ignored due to path filters (1)
  • features/llm-judge-correctness/assets/flow-a.png is excluded by !**/*.png
📒 Files selected for processing (5)
  • .claude/skills/srd-creator/SKILL.md
  • .claude/skills/srd-creator/reference/srd-guide.md
  • .claude/skills/srd-creator/reference/srd-template.md
  • .claude/skills/srd-creator/scripts/render-diagram.sh
  • features/llm-judge-correctness/SRD.md

Comment on lines +138 to +150
- **Diagrams over prose for flows, but the SRD only holds a placeholder.** Both the
execution flow and the data model want a diagram, not a long numbered paragraph.
The skill does not draw it; it leaves an author image placeholder note (Workflow
step 6) and keeps the surrounding prose to what a diagram can't carry (failure
isolation, idempotency, resolution rules). Tell the author what the diagram should
depict so they can draw it:
- **Execution flow at system level, not internals.** The diagram should show the
user and the real systems that talk to each other (e.g. `User`, `Kaapi Backend`,
`OpenAI`, `Langfuse`), each with arrows in and out. It should not turn internal
pipeline steps or in-process helpers into separate lanes (e.g. a "Judge" lane
that is really an OpenAI call), which misleads readers into thinking they're
separate services.
- **Data model** should mark reused vs new entities.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major

Resolve contradiction: does the skill render the diagram or not?

Workflow step 6 (lines 59–72) instructs the skill to "Write a mermaid source for the execution flow, then run the skill's helper script" to render the PNG. But the Rules (lines 138–150) state "The skill does not draw it; it leaves an author image placeholder note."

These two sections contradict each other. Clarify which is correct: does the skill auto-render via render-diagram.sh, or does it only leave the placeholder band for a human author to paste later?

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/skills/srd-creator/SKILL.md around lines 138 - 150, The workflow
instructions conflict with the rules about diagram generation, so clarify the
intended behavior in the SRD-creator skill. Update the relevant guidance around
Workflow step 6 and the diagram-related rules so they agree on whether the skill
actually renders the Mermaid diagram via render-diagram.sh or only leaves an
author placeholder for manual pasting. Make the behavior explicit using the
existing step 6 wording and the diagram rules section so authors know exactly
what to do.

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

Labels

enhancement New feature or request ready-for-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Claude: SRD Creator (Enhancement & Clarity)

2 participants