Skip to content

feat: add data quality issue detector kit#276

Open
donallsiby wants to merge 3 commits into
Lamatic:mainfrom
donallsiby:data-quality-detector
Open

feat: add data quality issue detector kit#276
donallsiby wants to merge 3 commits into
Lamatic:mainfrom
donallsiby:data-quality-detector

Conversation

@donallsiby

@donallsiby donallsiby commented Jul 20, 2026

Copy link
Copy Markdown

PR Checklist

1. Select Contribution Type

  • Kit (kits/<category>/<kit-name>/)
  • Bundle (bundles/<bundle-name>/)
  • Template (templates/<template-name>/)

2. General Requirements

  • PR is for one project only (no unrelated changes)
  • No secrets, API keys, or real credentials are committed
  • Folder name uses kebab-case and matches the flow ID
  • All changes are documented in README.md (purpose, setup, usage)

3. File Structure (Check what applies)

  • config.json present with valid metadata (name, description, tags, steps, author, env keys)
  • All flows in flows/<flow-name>/ (where applicable) include:
    • config.json (Lamatic flow export)
    • inputs.json
    • meta.json
    • README.md
  • .env.example with placeholder values only (kits only)
  • No hand‑edited flow config.json node graphs (changes via Lamatic Studio export)

4. Validation

  • npm install && npm run dev works locally (kits: UI runs; bundles/templates: flows are valid)
  • PR title is clear (e.g., [kit] Add <name> for <use case>)
  • GitHub Actions workflows pass (all checks are green)
  • All CodeRabbit or other PR review comments are addressed and resolved
  • No unrelated files or projects are modified
  • Added kits/dq-issue-detector/.env.example (Lamatic API placeholders + DATA_QUALITY_AGENT flow id).

  • Added kits/dq-issue-detector/.gitignore (ignores .lamatic/, node_modules/, local env files).

  • Added kits/dq-issue-detector/README.md, kits/dq-issue-detector/agent.md.

  • Added kits/dq-issue-detector/constitutions/default.md (evidence-based, concise output guidance).

  • Added kits/dq-issue-detector/prompts/data-quality_analysis.md (quality score + issue-by-issue explanations/severity/fixes + business impact).

  • Added kits/dq-issue-detector/lamatic.config.ts (kit config with a data-quality-agent workflow step using FLOW_ID).

  • Added kits/dq-issue-detector/flows/data-quality-agent.ts defining the flow:

    • Input: required file accepted types .csv and .xlsx
    • Nodes (types): extract_data (script) → analyze_quality (llm) → format_report (script)
    • Edges: sequential execution extract_data → analyze_quality → format_report
    • References: prompt/script mappings for the llm prompt and the two script nodes.
  • Added kits/dq-issue-detector/scripts/data-quality-extract.ts and kits/dq-issue-detector/scripts/data-quality-format.ts.

  • Added kits/dq-issue-detector/assets/sample-dataset.csv.

  • Added kits/dq-issue-detector/apps/.env.example and kits/dq-issue-detector/apps/.gitignore.

  • Added Next.js app:

    • apps/actions/orchestrate.ts (server action to upload a dataset file, resolve workflow id from lamatic.config.ts/env fallbacks, execute the Lamatic GraphQL workflow, and return { success, data|error }).
    • apps/lib/lamatic-client.ts (GraphQL fetch client with env-based configuration, timeout, and error handling).
    • apps/app/page.tsx (CSV paste/input UI + sample, preview, run analysis via orchestrateAnalysis, render/copy Markdown report).
    • apps/app/layout.tsx, apps/app/globals.css (layout + styling).
    • Tooling/config: apps/package.json, apps/package-lock.json, apps/next.config.mjs, apps/postcss.config.mjs, apps/tailwind.config.ts, apps/tsconfig.json, apps/next-env.d.ts.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Changes

The kit adds a Lamatic data-quality workflow and a Next.js interface for entering CSV data, previewing rows, requesting analysis, and displaying formatted reports with setup documentation and runtime configuration.

Data Quality Detector

Layer / File(s) Summary
Workflow definition and reporting contract
kits/dq-issue-detector/flows/data-quality-agent.ts, kits/dq-issue-detector/scripts/*, kits/dq-issue-detector/prompts/data-quality_analysis.md, kits/dq-issue-detector/agent.md, kits/dq-issue-detector/constitutions/default.md, kits/dq-issue-detector/lamatic.config.ts
Defines the file input, extraction, analysis, and formatting steps, along with quality-report requirements and kit metadata.
Next.js application configuration
kits/dq-issue-detector/apps/package.json, kits/dq-issue-detector/apps/tsconfig.json, kits/dq-issue-detector/apps/next.config.mjs, kits/dq-issue-detector/apps/postcss.config.mjs, kits/dq-issue-detector/apps/tailwind.config.ts, kits/dq-issue-detector/apps/next-env.d.ts, kits/dq-issue-detector/apps/.env.example, kits/dq-issue-detector/apps/.gitignore, kits/dq-issue-detector/.env.example, kits/dq-issue-detector/.gitignore
Adds scripts, dependencies, compiler and build settings, styling configuration, environment placeholders, and ignored local artifacts.
Lamatic execution boundary
kits/dq-issue-detector/apps/lib/lamatic-client.ts, kits/dq-issue-detector/apps/actions/orchestrate.ts
Adds the Lamatic GraphQL client and a server action that validates uploaded data, executes the configured workflow, normalizes the result, and returns success or error objects.
Analysis interface and documentation
kits/dq-issue-detector/apps/app/layout.tsx, kits/dq-issue-detector/apps/app/globals.css, kits/dq-issue-detector/apps/app/page.tsx, kits/dq-issue-detector/README.md
Adds the page layout, theme and Markdown styling, CSV preview and analysis controls, report rendering and copying, plus setup and programmatic usage instructions.

Suggested reviewers: amanintech, d-pamneja

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: adding a data quality issue detector kit.
Description check ✅ Passed The description matches the required checklist template and includes all required sections and items.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

:robot_face: AgentKit Structural Validation

New Contributions Detected

  • Kit: kits/dq-issue-detector

Check Results

Check Status
No edits to existing kits ✅ Pass
Required root files present ✅ Pass
Flow .ts files present ✅ Pass
lamatic.config.ts valid ✅ Pass
No changes outside kits/ ✅ Pass
Flow asset references valid ✅ Pass

🎉 All checks passed! This contribution follows the AgentKit structure.

@github-actions

Copy link
Copy Markdown
Contributor

Failure recorded at 2026-07-20T12:46:33Z UTC. If this PR is not fixed within 4 weeks it will be automatically closed.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🤖 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 `@kits/dq-issue-detector/apps/actions/orchestrate.ts`:
- Around line 1-10: Update orchestrateAnalysis to import ../../lamatic.config
and use its flow step definitions before executing the Lamatic flow request.
Replace the current placeholder return with the configured extraction sequence,
while preserving the existing required-file validation.

In `@kits/dq-issue-detector/apps/app/globals.css`:
- Line 64: Replace the invalid `rounded` declaration in the `.prose code` rule
with the standard `border-radius` property while preserving its existing
`0.25rem` value and all other declarations.

In `@kits/dq-issue-detector/apps/app/page.tsx`:
- Line 182: Replace outline-none with outline-hidden on the textarea at
kits/dq-issue-detector/apps/app/page.tsx lines 182-182 and the input field at
lines 195-195, preserving all other classes.
- Around line 29-35: Refactor the form in the Home component to use shadcn/ui
components and react-hook-form with a zod schema for validation instead of raw
form controls and primitive field state. Preserve the existing submission,
analysis, error, and copy behaviors while routing field values and validation
through the form setup.
- Line 16: Align the payload orchestration contract across all affected sites:
in kits/dq-issue-detector/apps/app/page.tsx:16-16, import the actual exported
orchestrateAnalysis function (or update the upstream export); in
kits/dq-issue-detector/apps/app/page.tsx:92-92, invoke it with the required
FormData payload instead of raw strings; and in
kits/dq-issue-detector/README.md:64-79, update programmatic usage to document
orchestrateAnalysis and the FormData structure.

In `@kits/dq-issue-detector/apps/package.json`:
- Line 27: Remove the obsolete autoprefixer dev dependency from
kits/dq-issue-detector/apps/package.json at lines 27-27 and remove the
autoprefixer plugin from kits/dq-issue-detector/apps/postcss.config.mjs at lines
4-4, leaving the remaining PostCSS configuration intact.
🪄 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: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 279b8723-40ae-4278-8cd2-c0daa8a5dabd

📥 Commits

Reviewing files that changed from the base of the PR and between 69b0fc6 and 4507bdf.

⛔ Files ignored due to path filters (2)
  • kits/dq-issue-detector/apps/package-lock.json is excluded by !**/package-lock.json
  • kits/dq-issue-detector/assets/sample-dataset.csv is excluded by !**/*.csv
📒 Files selected for processing (21)
  • kits/dq-issue-detector/.env.example
  • kits/dq-issue-detector/.gitignore
  • kits/dq-issue-detector/README.md
  • kits/dq-issue-detector/agent.md
  • kits/dq-issue-detector/apps/.env.example
  • kits/dq-issue-detector/apps/.gitignore
  • kits/dq-issue-detector/apps/actions/orchestrate.ts
  • kits/dq-issue-detector/apps/app/globals.css
  • kits/dq-issue-detector/apps/app/layout.tsx
  • kits/dq-issue-detector/apps/app/page.tsx
  • kits/dq-issue-detector/apps/lib/lamatic-client.ts
  • kits/dq-issue-detector/apps/next-env.d.ts
  • kits/dq-issue-detector/apps/next.config.mjs
  • kits/dq-issue-detector/apps/package.json
  • kits/dq-issue-detector/apps/postcss.config.mjs
  • kits/dq-issue-detector/apps/tailwind.config.ts
  • kits/dq-issue-detector/apps/tsconfig.json
  • kits/dq-issue-detector/constitutions/default.md
  • kits/dq-issue-detector/flows/data-quality-agent.ts
  • kits/dq-issue-detector/lamatic.config.ts
  • kits/dq-issue-detector/prompts/data-quality_analysis.md

Comment thread kits/dq-issue-detector/apps/actions/orchestrate.ts
Comment thread kits/dq-issue-detector/apps/app/globals.css
Comment thread kits/dq-issue-detector/apps/app/page.tsx Outdated
Comment thread kits/dq-issue-detector/apps/app/page.tsx
Comment thread kits/dq-issue-detector/apps/app/page.tsx
Comment thread kits/dq-issue-detector/apps/package.json

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@kits/dq-issue-detector/apps/app/page.tsx`:
- Around line 92-96: The custom instructions state is not included in the
analysis request or accepted by the underlying flow. Update handleAnalyze and
orchestrateAnalysis to propagate instructions through FormData and action
parsing, then add it to the data-quality-agent flow inputs and use the
established value; alternatively remove the instructions state and UI field
entirely.
🪄 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: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: c4cab809-4b56-49b3-a195-b16d911f044e

📥 Commits

Reviewing files that changed from the base of the PR and between 4507bdf and 78e9476.

📒 Files selected for processing (5)
  • kits/dq-issue-detector/apps/actions/orchestrate.ts
  • kits/dq-issue-detector/apps/app/page.tsx
  • kits/dq-issue-detector/flows/data-quality-agent.ts
  • kits/dq-issue-detector/scripts/data-quality-extract.ts
  • kits/dq-issue-detector/scripts/data-quality-format.ts

Comment on lines +92 to +96
const formData = new FormData();
const csvFile = new File([csvContent], "dataset.csv", { type: "text/csv" });
formData.append("file", csvFile);

const res = await orchestrateAnalysis(formData);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Mission Compromised: Abandoned Intel (instructions).

Agent, you're gathering critical intel from the field but leaving it at the drop site. The custom instructions state is completely ignored during the payload dispatch in handleAnalyze. Furthermore, central intelligence (your flow definition in data-quality-agent.ts) doesn't even accept an instructions parameter.

Your mission, should you choose to accept it, is to either plumb this data all the way through (updating your FormData, orchestrateAnalysis action, and flow inputs), or scrub the field entirely from this UI to avoid confusing our operatives.

🤖 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 `@kits/dq-issue-detector/apps/app/page.tsx` around lines 92 - 96, The custom
instructions state is not included in the analysis request or accepted by the
underlying flow. Update handleAnalyze and orchestrateAnalysis to propagate
instructions through FormData and action parsing, then add it to the
data-quality-agent flow inputs and use the established value; alternatively
remove the instructions state and UI field entirely.

@github-actions

Copy link
Copy Markdown
Contributor

Hi @donallsiby! 👋

Before this PR can be reviewed by maintainers, please resolve all comments and requested changes from the CodeRabbit automated review.

Steps to follow:

  1. Read through all CodeRabbit comments carefully
  2. Address each issue raised (or reply explaining why you disagree)
  3. Push your fixes as new commits
  4. Once all issues are resolved, comment here so we can re-review

This helps keep the review process efficient for everyone. Thank you! 🙏

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant