skills creation page - #96
Conversation
Added console.log statements throughout the validation flow to trace: - WASM initialization process - getYamlSource function calls during WASM startup - onCheckCompleted callback invocations - Validation state changes in React components - Error conversion and display in ValidationPanel This will help identify where the validation errors are being lost between the WASM actionlint execution and the UI display. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixed critical issues in WASM actionlint integration:
1. **Correct WASM file paths**: Changed from '/wasm/actionlint.wasm' to '/main.wasm'
and '/wasm/wasm_exec.js' to '/wasm_exec.js' to match the working playground
implementation.
2. **Explicit path configuration**: Updated CreateSkillPage to explicitly specify
the correct WASM file paths instead of relying on defaults.
3. **Enhanced debugging**: Added comprehensive console logging throughout the
validation flow to trace WASM initialization and error processing.
The issue was that the app was trying to load a different WASM file
('/wasm/actionlint.wasm') than the working playground ('/main.wasm'),
causing validation failures despite identical Go source code.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix WASM initialization timing issues in useActionlint hook - Implement proper runActionlint availability detection with polling - Store validation content correctly in lastValidationContentRef - Add comprehensive debugging for WASM lifecycle and validation flow - Enhance YamlEditor with complete CodeMirror extensions - Simplify ValidationPanel layout and improve error display - Adjust CreateSkillPage layout to 60/40 split for better error visibility - Add proper content tracking and deferred validation - Support real-time validation with debouncing and caching - Display detailed validation errors with line/column locations Now shows same comprehensive errors as POC: syntax-check, runner-label, glob, expression, and action validation with detailed messages. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add click-to-navigate functionality that takes users directly to error locations in the YAML editor when clicking on validation errors, matching the POC behavior. ### Key Features - **Error Navigation**: Click validation errors to jump to exact line/column in editor - **Enhanced UI**: Added tooltips and arrow icons for better user feedback - **Focus Management**: Editor receives focus after navigation for immediate editing - **Accurate Positioning**: Proper coordinate conversion between 1-based and 0-based indexing ### Technical Changes - **YamlEditor**: Added forwardRef with setCursor() and focus() imperative methods - **ValidationPanel**: Enhanced hover effects, tooltips, and visual indicators - **CreateSkillPage**: Integrated error navigation with proper coordinate handling ### Testing - ✅ Navigation to actionlint validation errors (runner-label, syntax-check) - ✅ Navigation to YAML syntax errors - ✅ Proper cursor positioning and focus management - ✅ Visual feedback and accessibility improvements 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Enhance the skills creation page to fully utilize viewport height with a proper 70/30 split layout that fills the remaining screen space after the header. ### Key Improvements - **Full Height Utilization**: Editor and validation panel now fill the entire remaining viewport height - **True 70/30 Split**: Corrected split ratio from 60/40 to proper 70/30 - **Responsive Design**: Stacked layout on mobile (< lg breakpoint) with proper borders - **Improved Scrolling**: Validation panel has proper scrollable content area - **Remove Height Constraints**: Eliminated fixed 400px minimum height from YAML editor ### Technical Changes - **CreateSkillPage**: Use `calc(100vh - 64px)` for main content height calculation - **YamlEditor**: Remove `min-h-[400px]` and CodeMirror minHeight constraints - **ValidationPanel**: Implement flex column layout with scrollable error list - **Responsive**: Mobile-first approach with `lg:` breakpoints for desktop layout ### Layout Structure - Header: Fixed 64px height - Main Content: Calculated remaining viewport height - Editor: 70% width on desktop, full width on mobile - Validation: 30% width on desktop, full width on mobile (stacked) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Implement always-dark theme editor with improved space utilization and better 60/40 split ratio. ### Key Changes - **Always Dark Theme**: Remove theme detection logic, force dark theme regardless of system preference - **60/40 Split Layout**: Change from 70/30 to 60/40 split for better balance - **Reduced Spacing**: Minimize padding from 24px to 12px around panels, 12px to 8px inside editor - **Simplified Theme Logic**: Remove complex theme switching and detection code ### Technical Improvements - **YamlEditor**: Remove useState for isDark, eliminate theme detection useEffect hooks - **Simplified Styling**: Remove light theme overrides, always apply oneDark theme - **Better Space Usage**: Reduced padding provides more content area - **Cleaner Code**: Removed 140+ lines of theme switching logic ### Layout Details - Editor Panel: 60% width with minimal padding - Validation Panel: 40% width with optimal content display - Always dark theme with proper contrast and syntax highlighting - Responsive design maintained for mobile devices 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
… step The handleCommandInsert function was incorrectly inserting new commands at the beginning of the steps section and moving the checkout step to the end. This fix: - Locates the checkout step specifically (by name containing 'checkout') - Inserts new command templates immediately after the checkout step completes - Maintains proper YAML structure and step ordering - Falls back to inserting after 'steps:' line if no checkout step is found This ensures the proper workflow execution order where checkout happens first, followed by any additional commands that depend on the checked-out code.
- Replace basic CI/CD templates with comprehensive DevOps command templates - Add templates for: Deploy Application, GCloud Operations, Kubernetes, Python Scripts, Git Operations, SSH Deployment, API/Webhooks, Database Operations - Change template structure from full YAML to steps-only format for better integration - Update modal UI to show template descriptions and steps preview - Simplify template insertion logic to work with new steps-only format These templates provide ready-to-use GitHub Actions steps for common DevOps tasks, making it easier to build complete workflows.
WalkthroughThis update introduces a comprehensive GitHub Actions YAML editor and validation workflow to the InfraGPT web application. It adds a new skill creation page with a CodeMirror-based YAML editor, WASM-powered actionlint validation, error navigation, command insertion modal, and supporting UI components. Extensive documentation and type definitions for WASM, actionlint integration, and project structure are also included. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CreateSkillPage
participant YamlEditor
participant useActionlint (WASM)
participant WASM (actionlint)
participant ValidationPanel
participant AddCommandModal
User->>CreateSkillPage: Navigates to /skills/create
CreateSkillPage->>YamlEditor: Renders YAML editor
CreateSkillPage->>useActionlint: Initializes WASM validator
User->>YamlEditor: Edits YAML content
YamlEditor-->>CreateSkillPage: onChange(newYaml)
CreateSkillPage->>useActionlint: validateYaml(newYaml)
useActionlint->>WASM (actionlint): runActionlint(newYaml)
WASM (actionlint)-->>useActionlint: Returns validation errors
useActionlint-->>CreateSkillPage: Updates state with errors
CreateSkillPage->>ValidationPanel: Passes errors for display
User->>ValidationPanel: Clicks error
ValidationPanel-->>CreateSkillPage: onErrorClick(error)
CreateSkillPage->>YamlEditor: setCursor(line, column), focus()
User->>AddCommandModal: Opens modal to insert command
AddCommandModal-->>CreateSkillPage: onAddCommand(yamlSteps)
CreateSkillPage->>YamlEditor: Inserts steps into YAML
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new “Create Skill” page with a YAML editor and validation workflow, integrates it into the app, and wires up WASM-based linting and command templates.
- Introduces
CreateSkillPageUI with CodeMirror editor, validation panel, and “Add Command” modal. - Enhances the
useActionlinthook for WebAssembly-driven YAML validation and caching. - Updates routing and sidebar to expose the new skills creation page for debugging.
Reviewed Changes
Copilot reviewed 40 out of 74 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| services/wwwroot/index.html | Adds base HTML scaffold for app deployment |
| services/wwwroot/assets/index-Cx98aQFH.css | Adds Tailwind reset and core styles |
| services/mcp/go.mod | Initializes Go module for MCP tools service |
| services/mcp/PLAN.md | Adds detailed implementation plan for MCP service |
| services/app/src/wasm/actionlint.go | Adds WASM glue code to expose actionlint to JS |
| services/app/src/pages/skills/CreateSkillPage.tsx | Implements the new skills creation page UI |
| services/app/src/hooks/useActionlint.ts | Updates WASM validation hook with debug logging & cache |
| services/app/src/hooks/tests/useActionlint.test.ts | Adds tests for the actionlint hook |
| services/app/src/hooks/README.md | Documents the useActionlint hook API |
| services/app/src/components/ui/textarea.tsx | Adds a reusable textarea UI component |
| services/app/src/components/ui/dialog.tsx | Adds dialog primitives for modals |
| services/app/src/components/app-sidebar.tsx | Registers the “Skills” link in the sidebar |
| services/app/src/components/YamlEditor.tsx | Adds CodeMirror-based YAML editor component |
| services/app/src/components/ValidationPanel.tsx | Adds UI panel to display validation results |
| services/app/src/components/AddCommandModal.tsx | Adds modal for inserting command templates |
| services/app/src/App.tsx | Integrates CreateSkillPage into the routing |
Files not reviewed (1)
- services/app/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
services/app/src/pages/skills/CreateSkillPage.tsx:156
- [nitpick] The heading 'Create a New skill' has inconsistent capitalization; consider using 'Create a New Skill' for clarity and consistency.
<h1 className="text-xl font-semibold">Create a New skill</h1>
| console.log('[DEBUG] CreateSkillPage useEffect - isReady:', isReady, 'content length:', yamlContent.length); | ||
| if (yamlContent.trim()) { | ||
| if (isReady) { | ||
| console.log('[DEBUG] Calling validateYaml from CreateSkillPage'); | ||
| validateYaml(yamlContent); | ||
| } else { | ||
| console.log('[DEBUG] WASM not ready yet, validation will be deferred'); |
There was a problem hiding this comment.
[nitpick] Consider removing or gating verbose debug logs in production code to avoid flooding the console and impacting readability.
| console.log('[DEBUG] CreateSkillPage useEffect - isReady:', isReady, 'content length:', yamlContent.length); | |
| if (yamlContent.trim()) { | |
| if (isReady) { | |
| console.log('[DEBUG] Calling validateYaml from CreateSkillPage'); | |
| validateYaml(yamlContent); | |
| } else { | |
| console.log('[DEBUG] WASM not ready yet, validation will be deferred'); | |
| if (process.env.NODE_ENV === 'development') { | |
| console.log('[DEBUG] CreateSkillPage useEffect - isReady:', isReady, 'content length:', yamlContent.length); | |
| } | |
| if (yamlContent.trim()) { | |
| if (isReady) { | |
| if (process.env.NODE_ENV === 'development') { | |
| console.log('[DEBUG] Calling validateYaml from CreateSkillPage'); | |
| } | |
| validateYaml(yamlContent); | |
| } else { | |
| if (process.env.NODE_ENV === 'development') { | |
| console.log('[DEBUG] WASM not ready yet, validation will be deferred'); | |
| } |
| console.log('[DEBUG] ValidationPanel rendered with:', { | ||
| errorsCount: errors.length, | ||
| isLoading, | ||
| errors: errors.slice(0, 3) // Log first 3 errors for debugging | ||
| }); |
There was a problem hiding this comment.
[nitpick] This render-time debug log could degrade performance; remove it or wrap it in a development-only check.
| console.log('[DEBUG] ValidationPanel rendered with:', { | |
| errorsCount: errors.length, | |
| isLoading, | |
| errors: errors.slice(0, 3) // Log first 3 errors for debugging | |
| }); | |
| if (process.env.NODE_ENV === 'development') { | |
| console.log('[DEBUG] ValidationPanel rendered with:', { | |
| errorsCount: errors.length, | |
| isLoading, | |
| errors: errors.slice(0, 3) // Log first 3 errors for debugging | |
| }); | |
| } |
There was a problem hiding this comment.
Actionable comments posted: 19
🔭 Outside diff range comments (2)
services/app/playground/main.go (1)
1-64: Remove duplicate code - file is identical to services/app/src/wasm/actionlint.go.This file is identical to
services/app/src/wasm/actionlint.go. Having duplicate code creates maintenance overhead and potential inconsistencies.Consider one of these approaches:
- Remove this file and use the one in
services/app/src/wasm/- Create a shared module that both can import
- Clarify the purpose if these files serve different contexts
If this file is specifically for the playground build process, consider updating the Makefile to reference the shared source instead:
-main.wasm: main.go $(LIBSRCS) +main.wasm: ../src/wasm/actionlint.go $(LIBSRCS) + cd ../src/wasm && GOOS=js GOARCH=wasm go build -o ../../../playground/main.wasmservices/app/public/wasm/wasm_exec.js (1)
1-576: Consolidate duplicate wasm_exec.js into a single source of truthBoth of these files are byte-for-byte identical and have no automated sync between them, which will lead to drift over time:
• services/app/playground/lib/js/wasm_exec.js
• services/app/public/wasm/wasm_exec.jsConsider one of the following fixes:
- Move wasm_exec.js to a shared directory (e.g.
services/app/shared/wasm_exec.js) and reference it from both places.- Replace one copy with a symlink to the other.
- Update your build/install scripts to copy the single source into both targets.
🧹 Nitpick comments (29)
services/mcp/PLAN.md (1)
9-21: Add language identifiers to fenced code blocksMarkdown linters flag these blocks (
```) for missing language tags (go,proto,bash, etc.).
Adding them improves syntax highlighting and prevents MD040 violations.Example:
-``` +```goAlso applies to: 33-69
services/wwwroot/index.html (1)
1-21: Solid HTML foundation with opportunity for SEO enhancement.The HTML structure follows best practices with proper DOCTYPE, semantic markup, and appropriate meta tags. The favicon configuration and asset references are correctly implemented.
However, based on the retrieved learnings, consider enhancing SEO with additional meta tags:
<meta name="description" content="AI SRE Copilot for the Cloud" /> + <meta property="og:title" content="InfraGPT - AI SRE Copilot for the Cloud" /> + <meta property="og:description" content="AI SRE Copilot for the Cloud" /> + <meta property="og:type" content="website" /> + <meta property="og:url" content="https://yourdomain.com" /> + <meta property="og:image" content="/og-image.png" /> + <meta name="twitter:card" content="summary_large_image" /> + <meta name="twitter:title" content="InfraGPT - AI SRE Copilot for the Cloud" /> + <meta name="twitter:description" content="AI SRE Copilot for the Cloud" /> <title>InfraGPT</title>services/app/playground/README.md (1)
1-44: Excellent comprehensive documentation with minor style improvements needed.The README provides clear, well-structured documentation covering all aspects of the playground development workflow. The task descriptions, code examples, and deployment instructions are thorough and helpful.
However, please address the minor stylistic issues flagged by static analysis:
-Deployment is automated by [`deploy.bash`](./deploy.bash). See [CONTRIBUTING.md](../CONTRIBUTING.md) for more details. +Deployment is automated by [`deploy.bash`](./deploy.bash). See [CONTRIBUTING.md](../CONTRIBUTING.md) for more details. -To optimize `main.wasm`, `wasm-opt` command is required. Install [Binaryen](https://github.com/WebAssembly/binaryen) in +To optimize `main.wasm`, the `wasm-opt` command is required. Install [Binaryen](https://github.com/WebAssembly/binaryen) inAlso, consider using consistent heading styles throughout the document (either setext or atx style) to address the markdownlint warnings.
services/app/playground/lib/css/codemirror.css (1)
32-32: Consider removing or documenting empty CSS blocks.Several empty CSS blocks are present throughout the file. While some may be intentional placeholders for customization, consider:
- Removing truly unused empty blocks
- Adding comments to document intentional empty placeholders
- Ensuring consistency in the codebase's approach to empty CSS blocks
The static analysis tool flagged these empty blocks:
- Line 32:
.CodeMirror-linenumbers {}- Line 87:
.CodeMirror-overwrite .CodeMirror-cursor {}- Line 120:
.cm-s-default .cm-variable, .cm-s-default .cm-punctuation, .cm-s-default .cm-property, .cm-s-default .cm-operator {}- Line 274:
.CodeMirror-widget {}Also applies to: 87-87, 120-120, 274-274
services/app/playground/lib/js/active-line.js (1)
23-23: Optimize performance by avoiding delete operator.Replace the delete operator with undefined assignment for better performance.
- delete cm.state.activeLines; + cm.state.activeLines = undefined;services/app/src/hooks/__tests__/useActionlint.test.ts (2)
42-49: Optimize cleanup by avoiding delete operator.Replace delete operations with undefined assignments for better performance.
- delete (window as any).runActionlint; - delete (window as any).onCheckCompleted; - delete (window as any).showError; - delete (window as any).dismissLoading; - delete (window as any).Go; + (window as any).runActionlint = undefined; + (window as any).onCheckCompleted = undefined; + (window as any).showError = undefined; + (window as any).dismissLoading = undefined; + (window as any).Go = undefined;
268-269: Remove unnecessary export statement.The empty export at the end is unnecessary and flagged by static analysis.
-export {};services/app/src/components/ValidationPanel.tsx (2)
36-40: Remove debug logging from production code.The console.log statement should be removed or made conditional for development environments only. Debug logs can impact performance and expose potentially sensitive information in production.
- console.log('[DEBUG] ValidationPanel rendered with:', { - errorsCount: errors.length, - isLoading, - errors: errors.slice(0, 3) // Log first 3 errors for debugging - }); + if (process.env.NODE_ENV === 'development') { + console.log('[DEBUG] ValidationPanel rendered with:', { + errorsCount: errors.length, + isLoading, + errors: errors.slice(0, 3) // Log first 3 errors for debugging + }); + }
83-84: Ensure keyboard accessibility for error navigation.The error items are clickable but may not be keyboard accessible. Consider adding keyboard event handlers and proper ARIA attributes for better accessibility.
<div key={index} className="border rounded-lg p-3 cursor-pointer hover:bg-muted/50 hover:border-primary/50 transition-all duration-200 hover:shadow-sm" onClick={() => onErrorClick?.(error)} + onKeyDown={(e) => e.key === 'Enter' && onErrorClick?.(error)} + tabIndex={0} + role="button" + aria-label={`Navigate to error at line ${error.line}, column ${error.column}`} title="Click to navigate to error location in editor" >services/app/playground/Makefile (2)
32-32: Consider adding an "all" target for conventional Make usage.While not strictly required, adding an "all" target is a common convention that makes the Makefile more intuitive for users expecting standard Make patterns.
+all: build + .PHONY: build install serve test clean
28-30: Ensure clean target removes all generated files.The clean target should also remove
test.js.mapif it exists, as TypeScript compilation typically generates source maps.clean: - rm -f ./main.wasm ./index.js ./index.js.map .testtimestamp + rm -f ./main.wasm ./index.js ./index.js.map ./test.js ./test.js.map .testtimestamp rm -rf ./libservices/app/src/wasm/actionlint.go (1)
37-37: Consider making the filename configurable.The hardcoded filename "test.yaml" may not be ideal for all use cases. Consider making it configurable or using a more generic name.
- errs, err := linter.Lint("test.yaml", []byte(source), nil) + errs, err := linter.Lint("workflow.yaml", []byte(source), nil)services/app/playground/test.js (1)
1-1: Remove redundant "use strict" directive.The "use strict" directive is redundant in ES modules as they are automatically in strict mode.
-"use strict";services/app/playground/deploy.bash (1)
84-85: Enhance deployment verification process.Consider adding more comprehensive checks in the manual verification step, such as testing specific playground functionality or WASM loading.
-echo "Successfully prepared deployment. Visit http://localhost:1234 and do the final check before deployment. If it looks good, stop the server with Ctrl+C and deploy it by 'git push'" +echo "Successfully prepared deployment. Visit http://localhost:1234 and verify:" +echo " 1. Playground loads without errors" +echo " 2. YAML validation works" +echo " 3. WASM module initializes properly" +echo "If everything looks good, stop the server with Ctrl+C and deploy with 'git push'"services/app/src/types/wasm.d.ts (1)
28-28: Remove useless empty export.The empty export on line 28 is redundant since there are other exports in the file.
-export {};services/app/src/components/ActionlintExample.tsx (1)
121-128: Consider adding accessibility improvements to the textarea.The textarea has good basic accessibility with proper labeling, but could benefit from additional attributes for better screen reader support.
<textarea id="yaml-editor" value={yamlContent} onChange={handleContentChange} + aria-describedby="yaml-editor-help" + aria-label="GitHub Actions YAML content editor" className="w-full h-64 p-3 font-mono text-sm border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-transparent" placeholder="Enter your GitHub Actions YAML here..." /> + <div id="yaml-editor-help" className="sr-only"> + Enter YAML content for GitHub Actions workflow validation. Changes are automatically validated. + </div>services/app/playground/index.ts (2)
196-224: Consider refactoring the infinite loop for better readability.While the logic is correct, the
while(true)pattern can be harder to understand and maintain.Consider using a more explicit loop condition:
- while (true) { + while (rest.length > 0) { const m = rest.match(reUrl); if (m === null || m.index === undefined) { - if (rest.length > 0) { - ret.push(span(rest)); - } + ret.push(span(rest)); return ret; }
334-338: Consider removing or conditionalizing the alert for better UX.Using both
console.errorandalertfor errors can be intrusive. Consider showing errors in the UI instead.})().catch((err: unknown) => { console.error('ERROR!:', err); - const msg = err instanceof Error ? `${err.name}: ${err.message}\n\n${err.stack}` : `Error: ${err}`; - alert(msg); + // Show error in UI instead of alert + const errorElement = document.getElementById('error-msg'); + if (errorElement) { + const msg = err instanceof Error ? err.message : String(err); + errorElement.textContent = `Failed to initialize: ${msg}`; + errorElement.style.display = 'block'; + } });services/app/playground/index.js (1)
1-1: Remove redundant 'use strict' directive.JavaScript modules are automatically in strict mode, making this directive unnecessary.
-"use strict"; (async function () {services/app/src/pages/skills/CreateSkillPage.tsx (1)
156-156: Fix capitalization in page title.- <h1 className="text-xl font-semibold">Create a New skill</h1> + <h1 className="text-xl font-semibold">Create a New Skill</h1>services/app/playground/test.ts (2)
6-10: Consider using Node.js version detection for better clarity.While the current approach works, you could make the version requirement more explicit by checking the Node.js version directly.
-// This polyfill is necessary for Node.js v18 or earlier. `global.crypto` was added at v19. -// https://github.com/nodejs/node/pull/42083/files -if (typeof globalThis.crypto === 'undefined') { +// This polyfill is necessary for Node.js v18 or earlier. `global.crypto` was added at v19. +// https://github.com/nodejs/node/pull/42083/files +const nodeVersion = process.version.match(/^v(\d+)/); +if (nodeVersion && parseInt(nodeVersion[1]) < 19) { globalThis.crypto = new Crypto(); }
13-13: Consider using path.join for more robust path resolution.The relative path could break if the test file is moved. Consider using Node.js path utilities for better reliability.
Add import at the top:
import * as path from 'path';Then update the require:
-require('./lib/js/wasm_exec.js'); // eslint-disable-line @typescript-eslint/no-require-imports +require(path.join(__dirname, 'lib', 'js', 'wasm_exec.js')); // eslint-disable-line @typescript-eslint/no-require-importsservices/app/playground/lib/js/wasm_exec.js (1)
1-5: Consider documenting that this is a vendored file from the Go project.This file is from the Go project and modifications could break compatibility. Consider adding a header comment to indicate this is a vendored file and should not be modified.
// Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +// This is a vendored file from the Go project's WebAssembly support. +// DO NOT MODIFY - Updates should be fetched from the upstream Go repository. +// Source: https://github.com/golang/go/blob/master/misc/wasm/wasm_exec.js "use strict";services/app/src/components/YamlEditor.tsx (2)
56-56: Remove unused theme-related code.The
isDarkvariable and the empty comment about theme detection are not used and should be removed.- const isDark = true; // Always use dark theme const onChangeRef = useRef(onChange); const errorsRef = useRef(errors); // ... other code ... - // Always use dark theme - no detection needed - // Create stable linter functionAlso applies to: 96-97
256-260: Simplify theme configuration.Since the dark theme is always used, include it directly in the extensions array instead of pushing it separately.
// Line wrapping and tab configuration EditorView.lineWrapping, EditorState.tabSize.of(2), + + // Theme + oneDark, ]; - // Always add dark theme - extensions.push(oneDark); - const startState = EditorState.create({services/app/src/components/AddCommandModal.tsx (1)
402-413: Extract common reset logic to reduce duplication.The form reset logic is duplicated between
onSubmitandhandleClose. Consider extracting to a common function.+ const resetAndClose = () => { + form.reset(); + setSelectedTemplate(''); + onOpenChange(false); + }; const onSubmit = (data: FormData) => { const template = COMMAND_TEMPLATES[data.template as keyof typeof COMMAND_TEMPLATES]; if (template) { // Since we now provide only steps, pass them directly const commandSteps = template.steps; onAddCommand(commandSteps); - // Reset form and close modal - form.reset(); - setSelectedTemplate(''); - onOpenChange(false); + resetAndClose(); } }; const handleClose = () => { - form.reset(); - setSelectedTemplate(''); - onOpenChange(false); + resetAndClose(); };services/app/public/wasm_exec.js (1)
5-5: Remove redundant "use strict" directiveThe "use strict" directive is automatically enabled in ES modules. Since this file will be loaded as a module in the browser environment, the directive is unnecessary.
-"use strict"; -services/app/src/hooks/useActionlint.ts (2)
291-291: Use optional chaining for cleaner codeThe condition can be simplified using optional chaining.
-if (lastValidationContentRef.current && lastValidationContentRef.current.trim()) { +if (lastValidationContentRef.current?.trim()) {
175-176: Consider production logging strategyThe code contains extensive debug logging with
[DEBUG]prefixes. While helpful during development, consider implementing a logging strategy for production:
- Use a logging library or environment variable to control log levels
- Remove or conditionally enable debug logs in production builds
- Consider performance impact of string concatenation in hot paths
Example approach:
const DEBUG = process.env.NODE_ENV === 'development'; const log = DEBUG ? console.log : () => {}; // Then use: log('[DEBUG] Starting WASM initialization with paths:', { wasmPath, wasmExecPath });Also applies to: 200-205, 210-217, 222-223, 270-275, 281-282, 288-289, 344-346, 356-357, 362-362, 382-383, 399-400, 409-410, 412-413
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (27)
.DS_Storeis excluded by!**/.DS_Storeservices/.DS_Storeis excluded by!**/.DS_Storeservices/app/package-lock.jsonis excluded by!**/package-lock.jsonservices/app/playground/index.js.mapis excluded by!**/*.mapservices/app/playground/lib/css/fonts/devicon.eotis excluded by!**/*.eotservices/app/playground/lib/css/fonts/devicon.svgis excluded by!**/*.svgservices/app/playground/lib/css/fonts/devicon.ttfis excluded by!**/*.ttfservices/app/playground/lib/css/fonts/devicon.woffis excluded by!**/*.woffservices/app/playground/lib/js/isMobile.min.jsis excluded by!**/*.min.jsservices/app/playground/lib/js/pako.min.jsis excluded by!**/*.min.jsservices/app/playground/main.wasmis excluded by!**/*.wasmservices/app/playground/package-lock.jsonis excluded by!**/package-lock.jsonservices/app/playground/test.js.mapis excluded by!**/*.mapservices/app/public/main.wasmis excluded by!**/*.wasmservices/app/public/wasm/actionlint.wasmis excluded by!**/*.wasmservices/wwwroot/assets/DineroSans-Bold-BHiEv-xL.woff2is excluded by!**/*.woff2services/wwwroot/assets/DineroSans-Italic-EckgonHc.woff2is excluded by!**/*.woff2services/wwwroot/assets/DineroSans-Regular-CyiJZMaD.woff2is excluded by!**/*.woff2services/wwwroot/assets/DineroSans-Semibold-ZFPm4WVV.woff2is excluded by!**/*.woff2services/wwwroot/favicon.icois excluded by!**/*.icoservices/wwwroot/icons/aws.svgis excluded by!**/*.svgservices/wwwroot/icons/datadog.svgis excluded by!**/*.svgservices/wwwroot/icons/gcp.svgis excluded by!**/*.svgservices/wwwroot/icons/github.svgis excluded by!**/*.svgservices/wwwroot/icons/pagerduty.svgis excluded by!**/*.svgservices/wwwroot/icons/slack.svgis excluded by!**/*.svgservices/wwwroot/logo.svgis excluded by!**/*.svg
📒 Files selected for processing (43)
services/app/package.json(3 hunks)services/app/playground/Makefile(1 hunks)services/app/playground/README.md(1 hunks)services/app/playground/deploy.bash(1 hunks)services/app/playground/eslint.config.mjs(1 hunks)services/app/playground/index.html(1 hunks)services/app/playground/index.js(1 hunks)services/app/playground/index.ts(1 hunks)services/app/playground/lib.d.ts(1 hunks)services/app/playground/lib/css/codemirror.css(1 hunks)services/app/playground/lib/css/material-darker.css(1 hunks)services/app/playground/lib/js/active-line.js(1 hunks)services/app/playground/lib/js/wasm_exec.js(1 hunks)services/app/playground/lib/js/yaml.js(1 hunks)services/app/playground/main.go(1 hunks)services/app/playground/package.json(1 hunks)services/app/playground/post-install.bash(1 hunks)services/app/playground/style.css(1 hunks)services/app/playground/test.js(1 hunks)services/app/playground/test.ts(1 hunks)services/app/playground/tsconfig.eslint.json(1 hunks)services/app/playground/tsconfig.json(1 hunks)services/app/public/wasm/wasm_exec.js(1 hunks)services/app/public/wasm_exec.js(1 hunks)services/app/src/App.tsx(2 hunks)services/app/src/components/ActionlintExample.tsx(1 hunks)services/app/src/components/AddCommandModal.tsx(1 hunks)services/app/src/components/ValidationPanel.tsx(1 hunks)services/app/src/components/YamlEditor.tsx(1 hunks)services/app/src/components/app-sidebar.tsx(2 hunks)services/app/src/components/ui/dialog.tsx(1 hunks)services/app/src/components/ui/textarea.tsx(1 hunks)services/app/src/hooks/README.md(1 hunks)services/app/src/hooks/__tests__/useActionlint.test.ts(1 hunks)services/app/src/hooks/useActionlint.ts(1 hunks)services/app/src/pages/skills/CreateSkillPage.tsx(1 hunks)services/app/src/types/actionlint.d.ts(1 hunks)services/app/src/types/wasm.d.ts(1 hunks)services/app/src/wasm/actionlint.go(1 hunks)services/mcp/PLAN.md(1 hunks)services/mcp/go.mod(1 hunks)services/wwwroot/assets/index-Cx98aQFH.css(1 hunks)services/wwwroot/index.html(1 hunks)
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.236Z
Learning: Applies to services/website/.github/workflows/**/*.yml : Automated deployment must be configured via GitHub Actions for Netlify deployment
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.236Z
Learning: Applies to services/website/.github/workflows/**/*.yml : npm cache optimization must be used for faster CI builds
services/app/playground/tsconfig.eslint.json (1)
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.236Z
Learning: Applies to services/website/**/*.{ts,tsx,astro} : TypeScript path aliases must be used as configured: @lib/*, @utils/*, @components/*, @layouts/*, @assets/*, @pages/*
services/app/src/App.tsx (1)
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.236Z
Learning: Applies to services/website/**/*.{ts,tsx,astro} : TypeScript path aliases must be used as configured: @lib/*, @utils/*, @components/*, @layouts/*, @assets/*, @pages/*
services/app/package.json (3)
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.236Z
Learning: Applies to services/website/**/{package.json,package-lock.json} : Resolved CVE-2025-5889 (ReDoS) in brace-expansion package by updating from 2.0.1 to 2.0.2
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.236Z
Learning: Applies to services/website/**/package-lock.json : Dependency versions must be carefully managed and pinned in package-lock.json
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.236Z
Learning: Applies to services/website/.github/workflows/**/*.yml : npm cache optimization must be used for faster CI builds
services/app/playground/tsconfig.json (1)
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.236Z
Learning: Applies to services/website/**/*.{ts,tsx,astro} : TypeScript path aliases must be used as configured: @lib/*, @utils/*, @components/*, @layouts/*, @assets/*, @pages/*
services/app/playground/style.css (1)
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.236Z
Learning: Applies to services/website/{src/components/**/*.astro,src/layouts/**/*.astro,src/pages/**/*.astro,src/assets/**/*.css,src/styles/**/*.css} : Responsive design must be implemented using Tailwind utilities (mobile-first approach)
services/app/playground/package.json (2)
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.236Z
Learning: Applies to services/website/**/package-lock.json : Dependency versions must be carefully managed and pinned in package-lock.json
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.236Z
Learning: Applies to services/website/**/{package.json,package-lock.json} : Resolved CVE-2025-5889 (ReDoS) in brace-expansion package by updating from 2.0.1 to 2.0.2
services/wwwroot/index.html (1)
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.236Z
Learning: Applies to services/website/{src/pages/**/*.astro,src/layouts/**/*.astro,src/pages/sitemap.xml.ts} : SEO optimization must include meta tags, sitemaps, and OpenGraph integration
services/app/playground/eslint.config.mjs (2)
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.236Z
Learning: Applies to services/website/**/*.{ts,tsx,astro} : TypeScript path aliases must be used as configured: @lib/*, @utils/*, @components/*, @layouts/*, @assets/*, @pages/*
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.236Z
Learning: Applies to services/website/src/content/config.ts : Content validation for blog posts must use Zod schemas defined in src/content/config.ts
services/wwwroot/assets/index-Cx98aQFH.css (3)
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.236Z
Learning: Applies to services/website/**/tailwind.config.cjs : Primary color #0023C4 must be defined in tailwind.config.cjs
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.236Z
Learning: Applies to services/website/{tailwind.config.cjs,src/assets/**/*.css,src/styles/**/*.css} : Typography must use the Inter Variable font for sans-serif text
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.236Z
Learning: Applies to services/website/{src/components/**/*.astro,src/layouts/**/*.astro,src/pages/**/*.astro,src/assets/**/*.css,src/styles/**/*.css} : Responsive design must be implemented using Tailwind utilities (mobile-first approach)
services/app/playground/deploy.bash (1)
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.236Z
Learning: Applies to services/website/.github/workflows/**/*.yml : Build process must run Astro build and deploy to Netlify on main branch pushes
🧬 Code Graph Analysis (5)
services/app/src/components/ui/textarea.tsx (1)
services/app/src/lib/utils.ts (1)
cn(4-6)
services/app/playground/lib.d.ts (4)
services/app/src/hooks/useActionlint.ts (1)
ActionlintError(4-9)services/app/src/types/actionlint.d.ts (1)
ActionlintError(43-52)services/app/src/types/wasm.d.ts (1)
ActionlintError(3-8)services/app/playground/index.js (6)
src(44-44)src(63-87)src(244-244)src(260-260)msg(282-282)mod(276-276)
services/app/src/components/ui/dialog.tsx (1)
services/app/src/lib/utils.ts (1)
cn(4-6)
services/app/src/hooks/__tests__/useActionlint.test.ts (1)
services/app/src/hooks/useActionlint.ts (1)
useActionlint(105-523)
services/app/src/types/actionlint.d.ts (4)
services/app/playground/index.js (4)
src(44-44)src(63-87)src(244-244)src(260-260)services/app/playground/test.js (3)
errors(59-59)errors(80-80)errors(101-101)services/app/src/hooks/useActionlint.ts (4)
ActionlintError(4-9)ActionlintState(11-18)ValidationCache(20-24)UseActionlintOptions(26-62)services/app/src/types/wasm.d.ts (1)
ActionlintError(3-8)
🪛 LanguageTool
services/app/playground/README.md
[uncategorized] ~41-~41: A punctuation mark might be missing here.
Context: ... Deployment Deployment is automated by deploy.bash. See [CONTR...
(AI_EN_LECTOR_MISSING_PUNCTUATION)
[uncategorized] ~42-~42: You might be missing the article “the” here.
Context: ... more details. To optimize main.wasm, wasm-opt command is required. Install [...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
services/mcp/PLAN.md
[typographical] ~73-~73: If specifying a range, consider using an en dash instead of a hyphen.
Context: ...: Foundation & MCP Server Duration: 2-3 days #### Tasks: 1. Project Setup ...
(HYPHEN_TO_EN)
[typographical] ~102-~102: If specifying a range, consider using an en dash instead of a hyphen.
Context: ...ase 2: GitHub Integration Duration: 3-4 days #### GitHub Tools to Implement: -...
(HYPHEN_TO_EN)
[typographical] ~132-~132: If specifying a range, consider using an en dash instead of a hyphen.
Context: ... Phase 3: GCP Integration Duration: 4-5 days #### GCP Tools to Implement: - `g...
(HYPHEN_TO_EN)
[typographical] ~161-~161: If specifying a range, consider using an en dash instead of a hyphen.
Context: ...: Additional Integrations Duration: 3-4 days #### Slack Tools to Implement: - ...
(HYPHEN_TO_EN)
[typographical] ~192-~192: If specifying a range, consider using an en dash instead of a hyphen.
Context: ...Agent Service Integration Duration: 2-3 days #### Tasks: 1. **Python MCP Clien...
(HYPHEN_TO_EN)
[grammar] ~252-~252: It looks like there is a word missing here. Did you mean “listen to address”?
Context: ...les - MCP_LISTEN_ADDRESS - MCP server listen address (default: ":8080") - `CORE_SERVICE_GRPC...
(LISTEN_TO_ME)
[typographical] ~360-~360: If specifying a range, consider using an en dash instead of a hyphen.
Context: ... - 1GB (depending on cache size) - CPU: 1-2 cores (depending on concurrent load) - ...
(HYPHEN_TO_EN)
🪛 markdownlint-cli2 (0.17.2)
services/app/playground/README.md
9-9: Heading style
Expected: setext; Actual: atx
(MD003, heading-style)
28-28: Heading style
Expected: setext; Actual: atx
(MD003, heading-style)
39-39: Heading style
Expected: setext; Actual: atx
(MD003, heading-style)
services/mcp/PLAN.md
9-9: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
33-33: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
75-75: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
96-96: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
104-104: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
111-111: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
126-126: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
134-134: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
140-140: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
155-155: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
163-163: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
169-169: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
175-175: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
186-186: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
194-194: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
210-210: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
🪛 Biome (1.9.4)
services/app/playground/lib/js/active-line.js
[error] 12-12: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.
(lint/suspicious/noRedundantUseStrict)
[error] 23-23: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
services/app/playground/lib/css/codemirror.css
[error] 32-32: An empty block isn't allowed.
Consider removing the empty block or adding styles inside it.
(lint/suspicious/noEmptyBlock)
[error] 71-71: An empty block isn't allowed.
Consider removing the empty block or adding styles inside it.
(lint/suspicious/noEmptyBlock)
[error] 73-73: An empty block isn't allowed.
Consider removing the empty block or adding styles inside it.
(lint/suspicious/noEmptyBlock)
[error] 76-76: An empty block isn't allowed.
Consider removing the empty block or adding styles inside it.
(lint/suspicious/noEmptyBlock)
[error] 78-78: An empty block isn't allowed.
Consider removing the empty block or adding styles inside it.
(lint/suspicious/noEmptyBlock)
[error] 81-81: An empty block isn't allowed.
Consider removing the empty block or adding styles inside it.
(lint/suspicious/noEmptyBlock)
[error] 83-83: An empty block isn't allowed.
Consider removing the empty block or adding styles inside it.
(lint/suspicious/noEmptyBlock)
[error] 87-87: An empty block isn't allowed.
Consider removing the empty block or adding styles inside it.
(lint/suspicious/noEmptyBlock)
[error] 120-120: An empty block isn't allowed.
Consider removing the empty block or adding styles inside it.
(lint/suspicious/noEmptyBlock)
[error] 274-274: An empty block isn't allowed.
Consider removing the empty block or adding styles inside it.
(lint/suspicious/noEmptyBlock)
services/app/src/hooks/__tests__/useActionlint.test.ts
[error] 44-44: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 45-45: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 46-46: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 47-47: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 48-48: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 268-269: This empty export is useless because there's another export or import.
This import makes useless the empty export.
Safe fix: Remove this useless empty export.
(lint/complexity/noUselessEmptyExport)
[error] 268-269: Do not export from a test file.
(lint/suspicious/noExportsInTest)
services/app/playground/test.js
[error] 1-1: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.
(lint/suspicious/noRedundantUseStrict)
services/app/playground/lib/js/yaml.js
[error] 11-12: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.
(lint/suspicious/noRedundantUseStrict)
services/app/playground/index.js
[error] 1-1: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.
(lint/suspicious/noRedundantUseStrict)
services/app/src/types/wasm.d.ts
[error] 27-28: This empty export is useless because there's another export or import.
This export makes useless the empty export.
Safe fix: Remove this useless empty export.
(lint/complexity/noUselessEmptyExport)
services/app/playground/lib/js/wasm_exec.js
[error] 4-5: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.
(lint/suspicious/noRedundantUseStrict)
[error] 241-241: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 242-242: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 243-243: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 244-244: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 245-245: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
services/app/src/types/actionlint.d.ts
[error] 141-142: This empty export is useless because there's another export or import.
This export makes useless the empty export.
Safe fix: Remove this useless empty export.
(lint/complexity/noUselessEmptyExport)
services/app/public/wasm_exec.js
[error] 4-5: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.
(lint/suspicious/noRedundantUseStrict)
[error] 241-241: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 242-242: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 243-243: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 244-244: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 245-245: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
services/app/public/wasm/wasm_exec.js
[error] 4-5: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.
(lint/suspicious/noRedundantUseStrict)
[error] 241-241: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 242-242: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 243-243: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 244-244: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 245-245: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
services/app/src/hooks/useActionlint.ts
[error] 291-291: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 331-331: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 332-332: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 333-333: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 334-334: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
🪛 checkmake (0.2.2)
services/app/playground/Makefile
[warning] 32-32: Missing required phony target "all"
(minphony)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (48)
services/app/src/components/ui/textarea.tsx (1)
5-20: Component implementation looks solid
forwardRefusage, prop typing, class-name merge, anddisplayNameare all correct and consistent with the rest of the UI kit.
No issues found.services/app/src/components/app-sidebar.tsx (1)
24-35: Verify active-state handling for new “Skills” routeOnly the “Dashboard” item is hard-coded with
isActive: true.
IfNavMainrelies on this flag rather than the router path, “Skills” may never show as active.Confirm behaviour and, if needed, switch to route-based detection or provide
isActivedynamically.services/app/playground/tsconfig.eslint.json (1)
1-12: ESLint-specific tsconfig looks goodOptions match common ESLint setups (
noEmit,checkJs,nodenext).
No changes required.services/app/package.json (3)
19-27: LGTM: Comprehensive CodeMirror 6 integration.The CodeMirror 6 packages added provide a complete editor experience with autocomplete, YAML language support, linting, search, theming, and view management. This aligns well with the playground functionality described in the AI summary.
60-61: Good additions for testing infrastructure.The addition of Playwright for testing and TypeScript types for js-yaml enhances the development experience and testing capabilities.
42-42: Security audit passed: codemirror and js-yaml versions are safeBoth newly added dependencies have no outstanding advisories for the versions in use:
• services/app/package.json (line 42):
– codemirror@^6.0.2
• Patched in 5.58.2; no published vulnerabilities affect ≥6.0.2
• services/app/package.json (line 45):
– js-yaml@^4.1.0
• Patched in 3.13.1; no published advisories affect ≥4.1.0No further action required.
services/app/src/App.tsx (1)
11-11: LGTM: Proper import for the new component.The import follows the established pattern and correctly references the CreateSkillPage component.
services/app/playground/post-install.bash (1)
1-23: LGTM! Well-structured build script with proper error handling.The script follows bash best practices with strict error handling (
set -e -o pipefail) and performs clean file operations. The systematic approach to setting up the lib directory structure and copying dependencies is well-organized.services/app/playground/style.css (1)
1-121: LGTM! Well-structured CSS with modern features and responsive design.The stylesheet demonstrates good practices:
- Proper responsive design with mobile-first breakpoints
- Dark mode support using
prefers-color-scheme- CSS custom properties for theming
- Flexbox layout for responsive components
- Modern CSS syntax (
width <= 1200px)Note: The implementation uses custom CSS instead of Tailwind utilities, which differs from the established pattern in the website services but is appropriate for this playground component.
services/app/playground/eslint.config.mjs (1)
1-51: LGTM! Comprehensive ESLint configuration with proper TypeScript integration.The configuration demonstrates best practices:
- Modern flat config format
- Strict TypeScript type checking
- Proper Mocha test framework integration
- Selective rule disabling with clear comments
- Separate parser configuration for different file types
The configuration strikes a good balance between strictness and practicality for the playground environment.
services/app/playground/package.json (2)
7-19: LGTM! Well-structured npm scripts for comprehensive development workflow.The scripts provide a complete development experience:
- Comprehensive linting with multiple tools
- Build and watch functionality
- Local development server
- Testing integration
The script organization follows good practices with granular tasks and a unified
lintcommand.
22-28: Dependencies Verified – No Vulnerabilities Detectednpm audit (with generated package-lock.json) found zero vulnerabilities across all severity levels in the playground app’s runtime dependencies. No further action needed. Approved.
services/app/playground/index.html (4)
1-21: LGTM! Well-structured HTML head section.The head section properly includes all necessary meta tags, external dependencies, and follows HTML5 best practices. The Twitter card integration and external resource loading are correctly implemented.
22-45: LGTM! Good navigation structure with accessibility features.The navigation bar includes proper ARIA labels and semantic structure. The controls are well-organized with appropriate input validation elements.
46-71: LGTM! Well-organized main content layout.The split-pane layout for editor and results is properly structured. The loading states, error messages, and success notifications are appropriately placed.
72-82: LGTM! Proper footer with licensing information.The footer includes appropriate attribution and licensing information with proper external links.
services/app/playground/lib/css/codemirror.css (1)
70-84: LGTM! Well-implemented cursor animations.The keyframe animations for cursor blinking are properly implemented with vendor prefixes for cross-browser compatibility.
services/app/playground/lib/js/yaml.js (3)
4-11: LGTM! Proper UMD module pattern implementation.The UMD (Universal Module Definition) pattern correctly handles CommonJS, AMD, and browser environments. The "use strict" directive flagged by static analysis is actually necessary here since UMD modules may run in non-module contexts where strict mode isn't automatic.
14-115: LGTM! Comprehensive YAML syntax highlighting implementation.The YAML mode properly handles:
- Comments, strings, and document markers
- Array list items and inline structures
- Block literals and references
- Numbers and keywords
- Key-value pairs with proper state tracking
The tokenizer logic is well-structured and follows CodeMirror best practices.
117-119: LGTM! Proper MIME type registration.The mode is correctly registered with both standard YAML MIME types.
services/app/playground/lib/js/active-line.js (3)
4-11: LGTM! Proper UMD module pattern.Similar to the YAML mode, the "use strict" directive is necessary for UMD modules that may run in non-module contexts.
17-30: LGTM! Well-implemented option definition.The plugin properly integrates with CodeMirror's option system, handling initialization, cleanup, and state management correctly.
32-71: LGTM! Efficient line highlighting implementation.The plugin efficiently manages active line highlighting with:
- Proper cleanup of previous highlights
- Array comparison to avoid unnecessary updates
- CodeMirror operation batching for performance
- Support for multiple selections
services/app/src/hooks/__tests__/useActionlint.test.ts (2)
8-40: LGTM! Well-structured test setup with proper mocking.The test setup properly mocks the WASM environment and global functions, providing a solid foundation for testing the hook behavior.
200-267: LGTM! Good integration test examples.The skipped integration tests provide good examples of how to test the hook with real YAML content once the WASM setup is available.
services/app/playground/Makefile (1)
19-20: LGTM: Proper WebAssembly build configuration.The Go WebAssembly build command is correctly configured with the appropriate GOOS and GOARCH settings.
services/app/playground/lib.d.ts (1)
8-14: LGTM: Proper Window interface extension for WASM integration.The Window interface extension correctly defines the methods needed for WASM communication with appropriate optional and required method signatures.
services/app/src/wasm/actionlint.go (1)
58-63: LGTM: Proper WASM lifecycle management.The main function correctly sets up the WASM environment, exposes the JavaScript interface, and uses
select{}to keep the runtime alive.services/app/playground/test.js (2)
11-35: LGTM! Excellent async test helper design.The
CheckResultsclass provides a clean way to handle promise-based async testing for the WASM linting callbacks. The pattern of resolving immediately if errors are already available or storing the resolver for later is well implemented.
58-88: Verify actionlint error message assertions for fragilityThe tests in services/app/playground/test.js (lines 58–88) use strict.equal against full error messages:
"runs-on" section is missing in job "test"unknown Webhook event "foo"These literals come from the upstream actionlint CLI/WASM and may change in future releases. Please confirm they exactly match the output of the actionlint version you’re bundling, or consider using
includes/regex-based assertions to reduce test fragility.services/wwwroot/assets/index-Cx98aQFH.css (1)
1-2: No action needed: generated CSS artifact
– The primary color#0023C4is already defined in services/website/tailwind.config.cjs.
– Inter Variable is configured as the sans-serif font in that Tailwind config.
– The file under services/wwwroot/assets is a compiled build artifact and not hand-edited.services/app/playground/deploy.bash (2)
3-8: LGTM! Excellent error handling and validation.The script properly uses
set -e -o pipefailfor robust error handling and validates that it's run from the repository root. This prevents common deployment mistakes.
33-41: LGTM! Clean array manipulation for conditional file inclusion.The approach to conditionally remove
main.wasmfrom the files array whenSKIP_BUILD_WASMis set is clean and safe. Breaking out of the loop after finding the element is efficient.services/app/src/types/wasm.d.ts (2)
3-12: LGTM! Well-defined interfaces for actionlint integration.The
ActionlintErrorandActionlintResultinterfaces are properly typed with all necessary fields for representing linting results.
14-26: LGTM! Comprehensive global interface extensions.The Window interface extensions properly type all the WASM integration points including the Go constructor and runtime methods.
services/app/src/components/ActionlintExample.tsx (3)
7-35: LGTM! Excellent hook configuration and state management.The component properly configures the
useActionlinthook with sensible defaults for debouncing, caching, and auto-validation. The destructured hook return provides clean access to all necessary state and methods.
37-53: LGTM! Clean event handling implementation.The event handlers are well-structured and properly typed. The immediate validation trigger is a good UX pattern.
170-189: LGTM! Excellent debug information implementation.The collapsible debug section provides valuable development insights while being unobtrusive in the UI. The JSON formatting makes the state inspection clear and useful.
services/app/playground/index.ts (1)
1-12: Good error handling pattern for DOM element access.The helper function provides clear error messages when elements are missing, which will help with debugging.
services/app/src/components/ui/dialog.tsx (1)
1-122: Well-implemented dialog component with excellent accessibility.The component properly uses Radix UI primitives, implements ref forwarding correctly, and includes good accessibility features like screen reader text and keyboard navigation.
services/app/src/hooks/README.md (1)
1-347: Excellent and comprehensive documentation.The README provides thorough coverage of the hook's features, usage patterns, API, and troubleshooting. The examples are clear and practical.
services/app/src/components/AddCommandModal.tsx (1)
89-101: Good security practice in SSH key handling.The SSH deployment properly handles the private key by:
- Writing it to a temporary file with restricted permissions (600)
- Removing the key file after use
- Using StrictHostKeyChecking=no only with proper justification
services/app/public/wasm_exec.js (2)
241-245: Delete operations in cleanup are acceptableWhile the static analysis tool flags these
deleteoperations for potential performance impact, they are appropriate in this context as they're cleaning up references during the WebAssembly exit process. This prevents memory leaks and ensures proper cleanup.
1-576: LGTM - Official Go WASM runtimeThis appears to be the official Go WebAssembly runtime support file (based on the copyright header). The implementation is comprehensive and handles all necessary aspects of running Go WASM in the browser, including memory management, syscalls, and JavaScript interoperability.
services/app/src/hooks/useActionlint.ts (2)
331-334: Delete operations in cleanup are appropriateThe static analysis flags these
deleteoperations, but they are necessary for proper cleanup when the component unmounts. This prevents memory leaks and ensures the global callbacks don't persist.
105-523: Well-structured hook with comprehensive featuresThe
useActionlinthook is well-implemented with:
- Proper state management and cleanup
- Caching with TTL and size limits
- Debounced validation
- Comprehensive error handling
- Clear API surface with good TypeScript types
The implementation follows React best practices and provides a clean interface for WASM integration.
services/app/src/types/actionlint.d.ts (2)
142-142: Empty export is required for global augmentationThe static analysis tool incorrectly flags this empty export as useless. This export is necessary to make the file a module, which enables the global augmentation of the
Windowinterface. Without it, thedeclare globalblock wouldn't work correctly.The empty export should be retained.
1-141: Comprehensive and well-documented type definitionsThe type definitions are thorough and well-documented with JSDoc comments. They correctly match the implementation in
useActionlint.tsand provide a clear contract for consumers of the hook. The global augmentation properly extends the Window interface for WASM integration.
| module github.com/priyanshujain/infragpt/services/mcp | ||
|
|
||
| go 1.24.3 |
There was a problem hiding this comment.
Unsupported Go version specified
go 1.24.3 does not exist (latest stable is 1.22). This will break go commands and CI builds.
-go 1.24.3
+go 1.22🤖 Prompt for AI Agents
In services/mcp/go.mod at lines 1 to 3, the Go version is incorrectly set to
1.24.3, which is unsupported and will cause build failures. Change the Go
version to a valid, stable release such as 1.22 by updating the line to "go
1.22" to ensure compatibility with Go tools and CI pipelines.
| {/* TEMPORARY: Made skills page public for debugging WASM issues */} | ||
| <Route | ||
| path="/skills/create" | ||
| element={ | ||
| <Layout> | ||
| <CreateSkillPage /> | ||
| </Layout> | ||
| } | ||
| /> |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Security concern: Public route bypasses authentication.
Making the /skills/create route public for debugging WASM issues introduces a security risk. This exposes the CreateSkillPage component without authentication, which could potentially leak sensitive functionality or data.
Consider these alternatives for debugging WASM issues:
- Use environment-based routing to only expose this publicly in development
- Implement a feature flag system for debugging
- Use browser developer tools or a dedicated debugging build
- Add a simple authentication check even for debugging
- {/* TEMPORARY: Made skills page public for debugging WASM issues */}
- <Route
- path="/skills/create"
- element={
- <Layout>
- <CreateSkillPage />
- </Layout>
- }
- />
+ <Route
+ path="/skills/create"
+ element={
+ <ProtectedRoute>
+ <Layout>
+ <CreateSkillPage />
+ </Layout>
+ </ProtectedRoute>
+ }
+ />Please confirm this route will not be deployed to production in its current public state.
🏁 Script executed:
#!/bin/bash
# Locate all usages or definitions of ProtectedRoute in the repo
rg -n "ProtectedRoute" -A2 -B2 .
# Show the App.tsx snippet around the /skills/create route
rg -n "/skills/create" -A5 -B5 .
# Check for any environment-based gating around routing (e.g., NODE_ENV checks)
rg -n "process.env.NODE_ENV" -A2 -B2 .Length of output: 3834
Secure /skills/create in non-development environments
The /skills/create route is currently exposed without authentication in all environments. To prevent accidental production exposure, wrap it in a ProtectedRoute (or gate it by NODE_ENV/feature flag) so only authenticated users—or only in development—can access it.
Locations to update:
services/app/src/App.tsx(around lines 109–117)
Suggested diff:
- {/* TEMPORARY: Made skills page public for debugging WASM issues */}
- <Route
- path="/skills/create"
- element={
- <Layout>
- <CreateSkillPage />
- </Layout>
- }
- />
+ {/* TEMPORARY: Made skills page public for debugging WASM issues */}
+ {process.env.NODE_ENV === 'development' ? (
+ <Route
+ path="/skills/create"
+ element={
+ <Layout>
+ <CreateSkillPage />
+ </Layout>
+ }
+ />
+ ) : (
+ <Route
+ path="/skills/create"
+ element={
+ <ProtectedRoute>
+ <Layout>
+ <CreateSkillPage />
+ </Layout>
+ </ProtectedRoute>
+ }
+ />
+ )}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| {/* TEMPORARY: Made skills page public for debugging WASM issues */} | |
| <Route | |
| path="/skills/create" | |
| element={ | |
| <Layout> | |
| <CreateSkillPage /> | |
| </Layout> | |
| } | |
| /> | |
| {/* TEMPORARY: Made skills page public for debugging WASM issues */} | |
| {process.env.NODE_ENV === 'development' ? ( | |
| <Route | |
| path="/skills/create" | |
| element={ | |
| <Layout> | |
| <CreateSkillPage /> | |
| </Layout> | |
| } | |
| /> | |
| ) : ( | |
| <Route | |
| path="/skills/create" | |
| element={ | |
| <ProtectedRoute> | |
| <Layout> | |
| <CreateSkillPage /> | |
| </Layout> | |
| </ProtectedRoute> | |
| } | |
| /> | |
| )} |
🤖 Prompt for AI Agents
In services/app/src/App.tsx around lines 109 to 117, the /skills/create route is
publicly accessible without authentication. To fix this, wrap the
<CreateSkillPage /> component inside a <ProtectedRoute> component or
conditionally render it based on NODE_ENV or a feature flag, so that only
authenticated users or development environments can access this route. This will
secure the route from accidental exposure in production.
| { | ||
| "compilerOptions": { | ||
| "target": "es2019", | ||
| "module": "none", | ||
| "moduleResolution": "node", | ||
| "sourceMap": true, | ||
| "removeComments": true, | ||
| "strict": true, | ||
| "noUnusedLocals": true, | ||
| "noUnusedParameters": true, | ||
| "noImplicitReturns": true, | ||
| "noFallthroughCasesInSwitch": true, | ||
| "noUncheckedIndexedAccess": true, | ||
| "noImplicitOverride": true, | ||
| "esModuleInterop": true, | ||
| "skipLibCheck": true | ||
| }, | ||
| "files": [ | ||
| "index.ts", | ||
| "lib.d.ts", | ||
| "test.ts" | ||
| ] | ||
| } |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Excellent strict TypeScript configuration with one concern.
The configuration enables comprehensive type safety with strict mode and additional safety checks like noUnusedLocals, noImplicitReturns, and noUncheckedIndexedAccess. This promotes high code quality.
However, the "module": "none" setting is unusual and may cause issues with imports/exports. Please verify this is intentional for WASM integration.
🏁 Script executed:
#!/bin/bash
# Description: Verify if TypeScript files in playground use imports/exports that might conflict with module: "none"
echo "Checking for import/export statements in playground TypeScript files..."
# Check for import statements
echo "=== Import statements ==="
fd -e ts -e tsx . services/app/playground/ --exec grep -l "^import\|^export" {} \;
# Check specific files mentioned in tsconfig
echo "=== Checking specific files ==="
if [ -f "services/app/playground/index.ts" ]; then
echo "--- index.ts imports/exports ---"
grep -n "^import\|^export" services/app/playground/index.ts || echo "No imports/exports found"
fi
if [ -f "services/app/playground/test.ts" ]; then
echo "--- test.ts imports/exports ---"
grep -n "^import\|^export" services/app/playground/test.ts || echo "No imports/exports found"
fiLength of output: 992
Fix TS module configuration in playground
The services/app/playground/tsconfig.json sets "module": "none", but test.ts clearly uses ES-style imports (jsdom, fs, assert, @peculiar/webcrypto). With module: "none", TypeScript will leave import/export syntax untransformed, leading to compilation/runtime errors.
Please update the module setting to support imports/exports. For example:
--- services/app/playground/tsconfig.json
+++ services/app/playground/tsconfig.json
@@ compilerOptions
- "module": "none",
+ "module": "commonjs", // or "ESNext" if targeting ESM- File: services/app/playground/tsconfig.json
- Line:
"module": "none"
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| { | |
| "compilerOptions": { | |
| "target": "es2019", | |
| "module": "none", | |
| "moduleResolution": "node", | |
| "sourceMap": true, | |
| "removeComments": true, | |
| "strict": true, | |
| "noUnusedLocals": true, | |
| "noUnusedParameters": true, | |
| "noImplicitReturns": true, | |
| "noFallthroughCasesInSwitch": true, | |
| "noUncheckedIndexedAccess": true, | |
| "noImplicitOverride": true, | |
| "esModuleInterop": true, | |
| "skipLibCheck": true | |
| }, | |
| "files": [ | |
| "index.ts", | |
| "lib.d.ts", | |
| "test.ts" | |
| ] | |
| } | |
| { | |
| "compilerOptions": { | |
| "target": "es2019", | |
| - "module": "none", | |
| + "module": "commonjs", // or "ESNext" if targeting ESM | |
| "moduleResolution": "node", | |
| "sourceMap": true, | |
| "removeComments": true, | |
| "strict": true, | |
| "noUnusedLocals": true, | |
| "noUnusedParameters": true, | |
| "noImplicitReturns": true, | |
| "noFallthroughCasesInSwitch": true, | |
| "noUncheckedIndexedAccess": true, | |
| "noImplicitOverride": true, | |
| "esModuleInterop": true, | |
| "skipLibCheck": true | |
| }, | |
| "files": [ | |
| "index.ts", | |
| "lib.d.ts", | |
| "test.ts" | |
| ] | |
| } |
🤖 Prompt for AI Agents
In services/app/playground/tsconfig.json at the "module" compiler option line,
change the value from "none" to a module system that supports ES-style imports
and exports, such as "commonjs" or "esnext". This will ensure TypeScript
properly transforms import/export syntax used in test.ts and avoid compilation
or runtime errors.
| act(() => { | ||
| result.current.state.errors = [ | ||
| { kind: 'test', message: 'test error', line: 1, column: 1 } | ||
| ]; | ||
| result.current.state.error = 'test error'; | ||
| }); |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Fix test implementation - avoid direct state mutation.
Similar to the previous test, this directly mutates internal state. Use proper hook APIs or mocking patterns instead.
🤖 Prompt for AI Agents
In services/app/src/hooks/__tests__/useActionlint.test.ts around lines 118 to
123, the test directly mutates the hook's internal state, which is not
recommended. Instead of assigning values directly to result.current.state.errors
and result.current.state.error, update the state using the hook's exposed setter
functions or simulate actions that trigger state changes. Refactor the test to
avoid direct state mutation by using the hook's API or mocking mechanisms to set
the desired error state.
| const handleCommandInsert = (commandYaml: string) => { | ||
| const lines = yamlContent.split('\n'); | ||
| let insertIndex = -1; | ||
|
|
||
| // The commandYaml from templates already has proper indentation, so use it as-is | ||
| const commandLines = commandYaml.split('\n').filter(line => line.trim() !== ''); | ||
|
|
||
| // Find the checkout step and insert immediately after it | ||
| for (let i = 0; i < lines.length; i++) { | ||
| const line = lines[i]; | ||
| const trimmed = line.trim(); | ||
|
|
||
| // Look for a step that contains "checkout" in the name | ||
| if (trimmed.includes('- name:') && | ||
| (trimmed.includes('Checkout code') || trimmed.toLowerCase().includes('checkout'))) { | ||
|
|
||
| // Found the checkout step, now find where it ends | ||
| for (let j = i + 1; j < lines.length; j++) { | ||
| const nextLine = lines[j]; | ||
| const nextTrimmed = nextLine.trim(); | ||
|
|
||
| // If we hit another step (starts with "- name:") or the end of the steps section | ||
| if (nextTrimmed.includes('- name:') || | ||
| (!nextTrimmed && j + 1 < lines.length && !lines[j + 1].startsWith(' ')) || | ||
| j === lines.length - 1) { | ||
| insertIndex = j === lines.length - 1 ? lines.length : j; | ||
| break; | ||
| } | ||
| } | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| // If no checkout step found, insert after the "steps:" line | ||
| if (insertIndex === -1) { | ||
| for (let i = 0; i < lines.length; i++) { | ||
| const line = lines[i]; | ||
| if (line.trim().startsWith('steps:')) { | ||
| insertIndex = i + 1; | ||
| break; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // If still no insertion point found, append to the end | ||
| if (insertIndex === -1) { | ||
| insertIndex = lines.length; | ||
| } | ||
|
|
||
| // Insert the new command steps after the checkout step | ||
| const newLines = [ | ||
| ...lines.slice(0, insertIndex), | ||
| ...commandLines, | ||
| ...lines.slice(insertIndex) | ||
| ]; | ||
|
|
||
| setYamlContent(newLines.join('\n')); | ||
| }; |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Extract complex command insertion logic to a utility function.
The command insertion logic is complex with nested loops and multiple conditions. Consider extracting this to a separate utility function for better maintainability and testability.
// In a separate utils file:
export function insertCommandAfterCheckout(yamlContent: string, commandYaml: string): string {
// Move the insertion logic here
}
// Then in the component:
const handleCommandInsert = (commandYaml: string) => {
setYamlContent(insertCommandAfterCheckout(yamlContent, commandYaml));
};🤖 Prompt for AI Agents
In services/app/src/pages/skills/CreateSkillPage.tsx around lines 64 to 121, the
handleCommandInsert function contains complex nested loops and conditions for
inserting commandYaml after the checkout step. Extract this entire insertion
logic into a new utility function named insertCommandAfterCheckout in a separate
utils file, which takes yamlContent and commandYaml as parameters and returns
the updated YAML string. Then simplify handleCommandInsert to just call
setYamlContent with the result of insertCommandAfterCheckout, improving
maintainability and testability.
| const bin = await fs.readFile('./main.wasm'); | ||
| const result = await WebAssembly.instantiate(bin, go.importObject); |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Add error handling for WASM file loading.
The test will fail with an unhelpful error if main.wasm doesn't exist. Consider adding a more descriptive error.
-const bin = await fs.readFile('./main.wasm');
+const bin = await fs.readFile('./main.wasm').catch(err => {
+ throw new Error(`Failed to load main.wasm. Ensure the WASM module is built: ${err.message}`);
+});📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const bin = await fs.readFile('./main.wasm'); | |
| const result = await WebAssembly.instantiate(bin, go.importObject); | |
| const bin = await fs.readFile('./main.wasm').catch(err => { | |
| throw new Error(`Failed to load main.wasm. Ensure the WASM module is built: ${err.message}`); | |
| }); | |
| const result = await WebAssembly.instantiate(bin, go.importObject); |
🤖 Prompt for AI Agents
In services/app/playground/test.ts around lines 65 to 66, the code reads and
instantiates the WASM file without error handling, which leads to unhelpful
errors if the file is missing. Wrap the file reading and instantiation in a
try-catch block, and in the catch block, log or throw a descriptive error
message indicating that loading main.wasm failed, to improve debugging clarity.
| return linter((view) => { | ||
| const doc = view.state.doc; | ||
| const text = doc.toString(); | ||
| const diagnostics: any[] = []; |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Use proper typing for diagnostics array.
Replace any[] with the proper Diagnostic[] type from CodeMirror for better type safety.
Add import:
import { Diagnostic } from '@codemirror/lint';Then update the type:
- const diagnostics: any[] = [];
+ const diagnostics: Diagnostic[] = [];🤖 Prompt for AI Agents
In services/app/src/components/YamlEditor.tsx around lines 100 to 103, the
diagnostics array is currently typed as any[], which lacks type safety. Import
the Diagnostic type from '@codemirror/lint' and update the diagnostics array
declaration to use Diagnostic[] instead of any[] to ensure proper typing and
improve code reliability.
| /** | ||
| * YamlEditor Component | ||
| * | ||
| * A modern YAML editor built with CodeMirror 6 that provides: | ||
| * - Syntax highlighting for YAML | ||
| * - Real-time syntax validation | ||
| * - Error highlighting with gutter indicators | ||
| * - Dark/light theme support that follows the app's theme | ||
| * - Line numbers and auto-indentation with 2-space tabs | ||
| * - Customizable error reporting from external validators | ||
| * | ||
| * Props: | ||
| * - value: The YAML content string | ||
| * - onChange: Callback when content changes | ||
| * - errors: Array of validation errors with line numbers and messages | ||
| * - className: Additional CSS classes | ||
| * - placeholder: Placeholder text when empty | ||
| */ |
There was a problem hiding this comment.
Documentation inconsistency: Remove mention of light theme support.
The documentation mentions "Dark/light theme support that follows the app's theme" but the implementation always uses dark theme (line 56).
* - Syntax highlighting for YAML
* - Real-time syntax validation
* - Error highlighting with gutter indicators
- * - Dark/light theme support that follows the app's theme
+ * - Dark theme
* - Line numbers and auto-indentation with 2-space tabs📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| /** | |
| * YamlEditor Component | |
| * | |
| * A modern YAML editor built with CodeMirror 6 that provides: | |
| * - Syntax highlighting for YAML | |
| * - Real-time syntax validation | |
| * - Error highlighting with gutter indicators | |
| * - Dark/light theme support that follows the app's theme | |
| * - Line numbers and auto-indentation with 2-space tabs | |
| * - Customizable error reporting from external validators | |
| * | |
| * Props: | |
| * - value: The YAML content string | |
| * - onChange: Callback when content changes | |
| * - errors: Array of validation errors with line numbers and messages | |
| * - className: Additional CSS classes | |
| * - placeholder: Placeholder text when empty | |
| */ | |
| /** | |
| * YamlEditor Component | |
| * | |
| * A modern YAML editor built with CodeMirror 6 that provides: | |
| * - Syntax highlighting for YAML | |
| * - Real-time syntax validation | |
| * - Error highlighting with gutter indicators | |
| * - Dark theme | |
| * - Line numbers and auto-indentation with 2-space tabs | |
| * - Customizable error reporting from external validators | |
| * | |
| * Props: | |
| * - value: The YAML content string | |
| * - onChange: Callback when content changes | |
| * - errors: Array of validation errors with line numbers and messages | |
| * - className: Additional CSS classes | |
| * - placeholder: Placeholder text when empty | |
| */ |
🤖 Prompt for AI Agents
In services/app/src/components/YamlEditor.tsx at lines 1 to 18, the component
documentation incorrectly states that it supports both dark and light themes,
but the implementation only applies a dark theme as seen around line 56. Update
the documentation to remove the mention of light theme support and only describe
the dark theme usage to accurately reflect the current behavior.
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (11)
services/website/CLAUDE.md (1)
3-3: Add a missing comma for smoother readability-The public-facing marketing website for the InfraGPT platform built with modern web technologies. +The public-facing marketing website for the InfraGPT platform, built with modern web technologies.CLAUDE.md (1)
3-3: Hyphenate “multi-service” (compound adjective)-InfraGPT is a multi-service AI SRE platform that converts natural language into infrastructure commands and automates DevOps workflows through intelligent integrations. +InfraGPT is a multi-service AI SRE platform that converts natural language into infrastructure commands and automates DevOps workflows through intelligent integrations.services/CLAUDE.md (2)
3-3: Consistent compound adjective-InfraGPT is a multi-service platform providing AI-powered infrastructure management through Slack integration. +InfraGPT is a multi-service platform providing AI-powered infrastructure management through Slack integration.
20-20: Remove redundant “of” in “outside of”-**Role**: Enables users to manage platform settings, view operation history, configure integrations, and access detailed analytics outside of the Slack interface. +**Role**: Enables users to manage platform settings, view operation history, configure integrations, and access detailed analytics outside the Slack interface.services/agent/CLAUDE.md (1)
41-55: Specify a language for the fenced code block (MD040)-``` +```text /services/agent/ ├── src/ @@ └── Dockerfile # Container configuration</blockquote></details> <details> <summary>services/infragpt/CLAUDE.md (3)</summary><blockquote> `122-122`: **Hyphenate “rate-limiting” (compound adjective)** ```diff - - **Rate Limiting**: Built-in Slack SDK rate limiting compliance + - **Rate Limiting**: Built-in Slack SDK rate-limiting compliance
133-133: Prefer X to Y (grammar)- - Self-documenting code: Prefer descriptive names over explanatory comments + - Self-documenting code: Prefer descriptive names to explanatory comments
203-203: Subject–verb agreement- - Do not add json tags to every struct, we only needs json tags when we need to serialize/deserialize the struct to/from json. ex. api handlers, external json api processing etc. + - Do not add JSON tags to every struct; we only need JSON tags when serializing or deserializing (e.g., API handlers, external JSON API processing).services/app/CLAUDE.md (2)
28-43: Add language identifier to fenced code block (violates MD040)Markdown-lint flags this block because the opening fence lacks a language tag. Adding
text(orbash, if you prefer) fixes the warning and enables syntax highlighting in many viewers.-``` +```text src/ ├── components/ # Reusable UI components │ ├── ui/ # shadcn/ui base components ... └── assets/ # Static assets (fonts, icons) -``` +```
103-107: Same MD040 issue for the test-structure snippetRepeating the fix keeps the doc lint-clean and consistent.
-``` +```text src/hooks/__tests__/ # Hook unit tests playwright/ # E2E test specifications (if configured) -``` +```cli/CLAUDE.md (1)
293-309: Missing language tag on code fence (MD040)Add a language identifier (
textfits) to silence markdown-lint and improve readability.-``` +```text cli/ ├── __init__.py # Package initialization ... └── CLAUDE.md # This documentation -``` +```
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
.gitignore(1 hunks)CLAUDE.md(1 hunks)cli/CLAUDE.md(1 hunks)services/CLAUDE.md(1 hunks)services/agent/CLAUDE.md(1 hunks)services/app/CLAUDE.md(1 hunks)services/infragpt/CLAUDE.md(1 hunks)services/website/CLAUDE.md(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- .gitignore
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.266Z
Learning: Applies to services/website/.github/workflows/**/*.yml : Automated deployment must be configured via GitHub Actions for Netlify deployment
services/website/CLAUDE.md (4)
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.266Z
Learning: Applies to services/website/{src/pages/**/*.astro,src/layouts/**/*.astro,src/pages/sitemap.xml.ts} : SEO optimization must include meta tags, sitemaps, and OpenGraph integration
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.266Z
Learning: Applies to services/website/.github/workflows/**/*.yml : Build process must run Astro build and deploy to Netlify on main branch pushes
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.266Z
Learning: Applies to services/website/**/astro.config.* : Markdown processing must be enhanced with rehype plugins for autolinked headings
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.266Z
Learning: Applies to services/website/**/{astro.config.*,vite.config.*} : PWA support must be implemented via @vite-pwa/astro
services/app/CLAUDE.md (4)
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.266Z
Learning: Applies to services/website/**/astro.config.* : Markdown processing must be enhanced with rehype plugins for autolinked headings
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.266Z
Learning: Applies to services/website/{src/pages/**/*.astro,src/layouts/**/*.astro,src/pages/sitemap.xml.ts} : SEO optimization must include meta tags, sitemaps, and OpenGraph integration
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.266Z
Learning: Applies to services/website/**/{astro.config.*,vite.config.*} : PWA support must be implemented via @vite-pwa/astro
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.266Z
Learning: Applies to services/website/{src/components/**/*.astro,src/layouts/**/*.astro,src/pages/**/*.astro,src/assets/**/*.css,src/styles/**/*.css} : Responsive design must be implemented using Tailwind utilities (mobile-first approach)
🪛 LanguageTool
services/website/CLAUDE.md
[uncategorized] ~3-~3: Possible missing comma found.
Context: ...cing marketing website for the InfraGPT platform built with modern web technologies. ##...
(AI_HYDRA_LEO_MISSING_COMMA)
services/infragpt/CLAUDE.md
[uncategorized] ~122-~122: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...- Rate Limiting: Built-in Slack SDK rate limiting compliance ## Code Standards and Best ...
(EN_COMPOUND_ADJECTIVE_INTERNAL)
[grammar] ~133-~133: Consider using “to” with “prefer”.
Context: ...r enumerations - Self-documenting code: Prefer descriptive names over explanatory comments ### Service Layer Design Patterns - **...
(PREFER_OVER_TO)
[grammar] ~203-~203: The pronoun ‘we’ must be used with a non-third-person form of a verb.
Context: ... add json tags to every struct, we only needs json tags when we need to serialize/des...
(NON3PRS_VERB)
cli/CLAUDE.md
[uncategorized] ~20-~20: Loose punctuation mark.
Context: ...ure ### Core Components - cli.py: Main CLI interface with Click framework...
(UNLIKELY_OPENING_PUNCTUATION)
[style] ~20-~20: This phrase is redundant (‘I’ stands for ‘interface’). Use simply “CLI”.
Context: ...# Core Components - cli.py: Main CLI interface with Click framework integration - **`l...
(ACRONYM_TAUTOLOGY)
[style] ~158-~158: This phrase is redundant (‘I’ stands for ‘Interface’). Use simply “CLIInterface”.
Context: ...ltering - Export functionality 5. CLI Interface Tests (test_cli.py) - Click comm...
(ACRONYM_TAUTOLOGY)
CLAUDE.md
[misspelling] ~3-~3: This word is normally spelled as one.
Context: # InfraGPT Platform InfraGPT is a multi-service AI SRE platform that converts natural l...
(EN_COMPOUNDS_MULTI_SERVICE)
services/CLAUDE.md
[misspelling] ~3-~3: This word is normally spelled as one.
Context: # Services Overview InfraGPT is a multi-service platform providing AI-powered infrastru...
(EN_COMPOUNDS_MULTI_SERVICE)
[style] ~20-~20: This phrase is redundant. Consider using “outside”.
Context: ...grations, and access detailed analytics outside of the Slack interface. ## Architecture a...
(OUTSIDE_OF)
services/app/CLAUDE.md
[uncategorized] ~53-~53: You might be missing the article “the” here.
Context: ... Clerk handles OAuth authentication and organization management 2. ProtectedRoute componen...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
🪛 markdownlint-cli2 (0.17.2)
cli/CLAUDE.md
293-293: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
services/agent/CLAUDE.md
41-41: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
services/app/CLAUDE.md
28-28: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
104-104: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🔇 Additional comments (1)
services/app/CLAUDE.md (1)
60-63: Verify practicality of “Node.js ≥ 22.0.0” requirementNode 22 is not released/LTS at the moment. If the project really needs experimental features, call that out explicitly; otherwise consider dropping to the current LTS (20) to reduce contributor friction.
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
services/app/src/components/ValidationPanel.tsx (1)
5-10: Interface consolidation already identified.The duplicate
ValidationErrorinterface issue has already been flagged in previous reviews. This interface should be consolidated with similar definitions across the codebase into a shared type definition.
🧹 Nitpick comments (2)
services/app/src/components/ValidationPanel.tsx (2)
75-105: Consider using a more stable key for error list rendering.Using array index as the key in the
mapfunction may cause unnecessary re-renders if the error list order changes. Consider using a combination of line, column, and message for a more stable key.- <div - key={index} + <div + key={`${error.line}-${error.column}-${error.kind}`}This creates a more stable key based on the error's unique characteristics rather than its position in the array.
101-103: Consider truncating very long error messages.Long error messages could break the layout or overwhelm the UI. Consider adding text truncation with a tooltip for full message display.
- <p className="text-sm text-foreground leading-relaxed"> - {error.message} - </p> + <p + className="text-sm text-foreground leading-relaxed line-clamp-3" + title={error.message} + > + {error.message} + </p>Add the
line-clamp-3utility to limit message display to 3 lines with ellipsis, while preserving the full message in the tooltip.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
services/app/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (4)
services/app/src/components/ValidationPanel.tsx(1 hunks)services/app/src/hooks/__tests__/useActionlint.test.ts(1 hunks)services/app/src/pages/skills/CreateSkillPage.tsx(1 hunks)services/app/src/types/wasm.d.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- services/app/src/hooks/tests/useActionlint.test.ts
- services/app/src/pages/skills/CreateSkillPage.tsx
- services/app/src/types/wasm.d.ts
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
PR: priyanshujain/infragpt#0
File: services/website/CLAUDE.md:0-0
Timestamp: 2025-06-30T17:03:50.266Z
Learning: Applies to services/website/.github/workflows/**/*.yml : Automated deployment must be configured via GitHub Actions for Netlify deployment
🧬 Code Graph Analysis (1)
services/app/src/components/ValidationPanel.tsx (2)
services/app/src/components/ui/skeleton.tsx (1)
Skeleton(15-15)services/app/src/components/ui/badge.tsx (1)
Badge(36-36)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
🔇 Additional comments (1)
services/app/src/components/ValidationPanel.tsx (1)
31-131: Excellent component implementation with strong accessibility and UX.The component demonstrates excellent React practices with:
- Proper TypeScript interfaces and props handling
- Comprehensive accessibility features (ARIA labels, keyboard navigation, focus management)
- Clean separation of concerns with dedicated render methods
- Responsive design with appropriate loading and empty states
- Proper event handling with both click and keyboard interactions
The component integrates well with the broader YAML validation workflow and provides a professional user experience.
Summary by CodeRabbit
New Features
Documentation
Tests
Chores
Style