Markdown Converter
Agent skill for markdown-converter
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
For comprehensive project information, refer to the following documents:
λ¬Έμν μμΉ (μ€μ!):
λΉ λ₯Έ μ°Έμ‘°:
8G is a visual workflow automation platform that enables users to design complex web scraping and data extraction workflows through a drag-and-drop interface. The platform executes workflows via the 8G Extension (browser extension SDK). The project was recently refactored to focus purely on workflow builder functionality (branch:
only-builder).
μμΈ μ 보: PRD - Section 1: Product Overview
# Development server (port 3000) pnpm run dev # Production build and start pnpm run start # Build only pnpm run build # Type checking pnpm run typecheck # Code formatting pnpm run format pnpm run format:check # Generate database entities from schema pnpm run db:generate-entities
Create a
.env file with database configuration:
DB_HOST=localhost DB_PORT=3306 DB_USER=myuser DB_PASSWORD=mypassword DB_NAME=payplo_staging NEXT_PUBLIC_CARD_SIGN_KEY=spurstodo
Create the workflow metadata table manually (no migration tool currently):
CREATE TABLE IF NOT EXISTS integration_app_workflow_metadata ( id INT NOT NULL AUTO_INCREMENT, description VARCHAR(255), meta JSON NOT NULL, created_at DATETIME(6) DEFAULT CURRENT_TIMESTAMP(6), updated_at DATETIME(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
μμΈ μν€ν μ² μ 보: PRD - Section 2: System Architecture
Loading a workflow:
loader() in app/routes/workflow-builder.tsx calls findWorkflowMetadata(id)meta: FormWorkflow JSON structure from databaseconvertWorkflowToNodesAndEdges() in app/client/admin/workflowBuilder/utils/workflowConverter.ts transforms workflow JSON β React Flow nodes/edgesSaving a workflow:
buildWorkflowJson() in app/models/workflow/WorkflowBuilder.ts converts React Flow graph β Workflow JSONaction() with FormDataupsertWorkflowMetadata() in app/.server/services/workflow/ creates or updates database recordExecuting a workflow:
vars field sent to Extension via EightGClient.collectWorkflow()${vars.varName} template syntaxResultPanel.tsx componentAll workflow blocks are defined by Zod v3 schemas from the
scordi-extension package (AllBlockSchemas). The GenericBlockNode component dynamically renders any block type by:
schema-parser.ts to extract field definitionsThis allows adding new block types in the SDK without modifying the UI code.
The core workflow format (
FormWorkflow type):
{ version: "1.0", start: "step_id", // Starting step steps: [ { id: "step_id", block: { name: "block-name", /* block config */ }, repeat?: { forEach: "$.path", count: 5 }, // Optional loops switch?: [ // Conditional branching { when: { equals: {...} }, next: "other_step" } ], next: "next_step", delayAfterMs: 500, retry?: { attempts: 3 }, timeoutMs: 5000 } ], targetUrl: "https://example.com", parser?: { expression: "$.steps.final.result" }, // Output transformation vars?: { key: "value" } // Variables for ${vars.key} substitution }
Edges between workflow nodes can have conditional logic stored in
edge.data.when. The EdgeConfigDialog component provides a UI for building complex conditions:
Conditions are evaluated at runtime by the workflow engine.
The Express server (
server.js) integrates React Router's server handler:
This project uses config-based routing (not file-based). Routes are defined in
app/routes.ts with explicit layout nesting:
route("/workflow-builder/:workflowId?", "./routes/workflow-builder.tsx");
Route files in
app/routes/*.tsx export:
loader() - Server-side data fetchingaction() - Form submission handlersdefault - React componentAll workflow execution happens through the 8G browser extension. The client-side code:
EightGClient.collectWorkflow({ targetUrl, workflow })Important: The extension must be installed and connected for workflow execution to work.
Data extraction: get-text, attribute-value, get-element-data, get-value-form Interaction: event-click, keypress, scroll Control flow: wait, element-exists Integration: fetch-api, ai-parse-data, transform-data Loops: forEach (iterate arrays), count (fixed repetitions) Branching: switch conditions with JSON expressions
μμΈ λΈλ‘ λͺ μΈ: Feature Specs - F-002: Block System See
WORKFLOW_EXECUTION_ARCHITECTURE.md for complete block documentation (if exists).
Variables use
${vars.varName} template syntax. The Extension handles variable resolution:
workflow.vars field$.forEach.item, $.loop.index)Code in
app/.server/ is never bundled to the client. This includes:
app/models/: Business logic, data transformation, execution logic (WorkflowBuilder, WorkflowRunner)app/components/: Reusable UI componentsapp/client/: Page-level components organized by section (admin, private, public)The workflow builder maintains type safety through:
scordi-extension package (external SDK)GenericBlockNode auto-generates UI from schemaapp/client/admin/workflowBuilder/nodes/index.ts if neededWorkflowBuilder.ts for JSON conversionWorkflowRunner.ts for client-side orchestrationworkflow.vars field to Extension/workflow-builder)ResultPaneltransform-data block to your workflow${steps.node_xxx.result.data})*.data.data.results[membershipType = "owner"]*.data.data.results[].{ "id": id, "name": name }$distinct(data.users.*.user_root.*.value.space_view_pointers[].spaceId)data.users.*.user_root.*.value.space_view_pointers[]app/client/admin/workflowBuilder/WorkflowBuilderPage.tsx - Main builder componentapp/models/workflow/WorkflowBuilder.ts - Converts React Flow graph β Workflow JSONapp/models/workflow/WorkflowRunner.ts - Executes workflows via SDKapp/client/admin/workflowBuilder/utils/workflowConverter.ts - Bidirectional workflow β nodes/edges conversionapp/client/admin/workflowBuilder/utils/autoLayout.ts - Dagre hierarchical layout algorithmapp/.server/db/config.ts - TypeORM DataSource configurationapp/.server/db/entities/IntegrationAppWorkflowMetadata.ts - Workflow entityapp/.server/services/workflow/ - Workflow CRUD servicesapp/routes.ts - React Router configurationapp/routes/workflow-builder.tsx - Builder route with loader/actionapp/routes/workflows.tsx - Workflows list routeapp/client/admin/workflowBuilder/edges/EdgeConfigDialog/ - Condition builder UIapp/client/admin/workflowBuilder/utils/conditionUtils.ts - Condition rendering helpersapp/client/admin/workflowBuilder/nodes/fieldBlock/ExpressionFieldBlock.tsx - JSONata expression testing UI for transform-data blocks
context.steps and result.steps data structuresapp/client/admin/workflowBuilder/nodes/BlockActionHandlerModal.tsx - Block configuration modal with dynamic field rendering(No test framework currently configured)
pnpm run build NODE_ENV=production node server.js
pnpm run typecheck
[8G Extension]result object returned from collectWorkflow()Connection is established via TypeORM using
.env credentials. Use TypeORM query builder or raw SQL via DataSource.