Community라이팅 & 에디팅github.com

croct-tech/agent-skills

Croct의 상황별 쿼리 언어(CQL)를 작성, 읽기, 검토 및 디버깅할 때 사용합니다.

agent-skills란 무엇인가요?

이 스킬은 Croct의 상황별 쿼리 언어(CQL)를 사용하는 AI 에이전트가 CQL 쿼리 작성, 읽기, 검토 및 디버깅을 정확하게 수행할 수 있도록 지원합니다. 대상 플랫폼에는 Claude Code, Cursor, Codex 등이 포함되며, CQL이 사용되는 모든 환경(오디언스, SDK 평가, HTTP API 평가, 동적 콘텐츠 값)에서 작동합니다. 제공되는 SKILL.md 문서에는 워크플로우, 치트 시트, 컨텍스트 변수 설명, 일반적인 코드 평가 방법, 함정 및 디버깅 가이드, 유용한 레시피 참조, 그리고 라이브 문서 링크가 포함되어 있어, AI가 CQL을 사용할 때 발생할 수 있는 대부분의 문제를 자체적으로 해결할 수 있습니다. 특히 CQL 문법 오류, 오디언스 매칭 안됨, 이용 불가능한 예측, 데이터 유형 불일치 등 다양한 문제 상황에 대한 명확한 원인과 해결책을 제시하여, 개발자와 AI 에이전트 모두에게 생산성을 크게 향상시킵니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/croct-tech/agent-skills/tree/HEAD/skills/croct-cql

Installed? Explore more 라이팅 & 에디팅 skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

CQL 작성 및 디버깅

CQL은 Croct의 영어 기반 쿼리 언어입니다. 동일한 표현식 문법이 오디언스, SDK 및 HTTP API를 통한 실시간 평가, 동적 콘텐츠 값에 사용됩니다. 모든 내용은 docs.croct.com에서 가져온 것입니다; 여기에 없는 내용은 (이 파일 하단의) 라이브 문서를 확인하고 추측하지 마세요.

워크플로우

  1. 쿼리가 실행되는 위치 식별: 오디언스 (반드시 불리언여야 함), evaluate/API (모든 JSON 값, 최대 500자), 또는 동적 값 (결과가 속성 유형에 맞아야 하며, 그렇지 않으면 default 사용).
  2. 데이터 소스 선택: 현재 컨텍스트 (page, cart, location, campaign, device), 저장된 프로필 (user's ..., user's stats), 세션 (session's ...), 또는 히스토리 (user has ... 이벤트 표현식, Scale 플랜).
  3. 데이터가 수집되었는지 확인: 통합 필요로 표시된 모든 것 (프로필 속성, 장바구니, 관심사, 목표, 로그인 상태)은 앱에서 전송하지 않으면 절대 일치하지 않습니다.
  4. 아래 치트 시트를 사용하여 작성하고, 정확한 속성은 context-and-data-types.md에서 확인하세요.
  5. 함정 체크리스트를 실행한 다음 croct.evaluate() 또는 대시보드 예측기로 테스트하세요.

치트 시트

// 자연어, 기술어, 혼합 스타일 모두 상호 교환 가능
user's score is greater than 90
user.score > 90
user's score > 90
필요문법
속성user's address's city, user's stats' orders, property city of user's address, user.address.city
특수 키 / 인덱스page.query['coupon-code'], list[0], (user's interests)[0]
선택자cart.items[1st], [:first], [:last(2)], items[*].price, data[...].price
리터럴null, true, 42, 3.14 (10진수), 3.14f, 51%, "str", 'raw', ~/re/i, [1, 2], ["k": "v"]
날짜리터럴 없음: "2026-01-01" as date, "2026-01-01T12:00" as datetime; today + 1 day
논리and or not (&& || !); and가 or보다 더 강하게 바인딩
비교== != > >= < <=; 1 < x < 3; is equal to X ignoring case
리터럴 약어X is "value", X is not 0 (오른쪽은 반드시 리터럴)
문자열starts with, ends with, matches "sub" / matches ~/re/i (대소문자 구분), is like "sub" (대소문자 구분 안 함)
컬렉션contains X, X is in [..], contains all of [..], contains either [..], contains neither [..]
존재 여부is defined / is known, is empty
사용자/세션user is returning, user is anonymous, user is identified, session is starting
날짜is before, is after, is at "12:00", is between A and B [exclusive], today's weekday is "monday"
수량 한정자some x in C satisfies P, every, no, not every, at least 2 of any [distinct] x in C satisfies P
매크로count of, sum of, average of, min of, max of, first of, last of, keys of, length of, number of days between A and B, this month
수정자as number, rounded [down], in title case, sorted descending, without duplicates, replacing "a" with "b", today at "12:00"
대체 값user's name or else "Anonymous" (??)
조건부"A" if cond otherwise "B", cond ? "A" : "B"
변수let orders = user's stats' orders; orders >= 5
이벤트 (Scale)user has <event> [with prop value] [at least N times] [in last 7 days]
주석// line, # line, /* block */

키워드와 식별자는 대소문자를 구분하지 않습니다; 문자열 리터럴은 대소문자를 구분합니다.

한눈에 보는 컨텍스트

변수공통 속성
userid, firstName, email, age, company, jobTitle, interests, activities, stats' sessions, stats' orders, 모든 사용자 정의 속성
sessionstart, duration, landingPage, referrer, stats' pageviews, stats' orders, audiences, experiences, experiments, 사용자 정의 속성
page (웹)title, url, path, query, anchor, referrer
locationcontinentCode, countryCode, countryName, stateCode/regionCode (state's code의 별칭), stateName, cityName, timeZone, tags
device / browsercategory (desktop, tablet, mobile, bot, ...), vendor, name, os; browser's name, type
campaignname, source, medium, content, term (UTM)
cartstage (browsing, shopping, checkout), items, total, subtotal, coupon, discount
contexttimeZone, 평가 시 전달된 속성
now, today, yesterday, tomorrowweekday, day, month, year, hour...

가장 유용한 패턴

user is returning
user is not returning
session is starting
device's category is "mobile"
device's category is not "bot"
location's countryCode is "US"
location's state's code is in ["NY", "CA"]
location's cityName is "New York" and today's weekday is "monday"
campaign's source is "google" and campaign's medium is "cpc"
campaign's name matches "sale"
page's path is in ["/pricing", "/plans"]
page's query's newsletter is "daily-news"
page.query['coupon-code'] is defined
session's referrer matches "google"
session's landingPage starts with "https://example.com/promo"
session's duration > 5 minutes and session's stats' orders is 0
user's interests contains either ["marketing", "sales"]
user's age is between 18 and 30
user's stats' orders is 0
user's plan is "premium"
cart's stage is "checkout" and cart's total is greater than 100
some item in cart's items satisfies item's brand is "Apple"
(no item in cart's items satisfies item's name is like "smartphone") and user is returning
user has abandoned a cart at least 2 times
user has viewed a product with category "Shoes" in last 7 days
user has completed goal "demo-requested" last session
user's firstName or else "there"

사용 사례별 더 많은 내용 (캠페인, 위치, 기술, 세션, 프로필, 장바구니, 주문, 값 쿼리): references/recipes.md.

코드에서 평가하기

import croct from '@croct/plug';

const isReturning = await croct.evaluate<boolean>('user is returning').catch(() => false);
const inList = await croct.evaluate<boolean>(
  "context's countries include location's countryName",
  {attributes: {countries: ['United States', 'Canada']}}, // `context's countries`로 읽힘
);

Next.js 서버: @croct/plug-next/server에서 await evaluate(query) 또는 await cql\user's persona is in ${roles}`. React:useEvaluation(query). HTTP: POST https://api.croct.io/client/web/evaluate` with {"query": "..."}. 세부 정보, 속성 제한, 동적 값 및 예측: references/evaluation.md.

함정 및 디버깅

증상예상 원인해결책
x is y에서 구문 오류is 약어는 오른쪽에 리터럴이 필요합니다x is equal to y 또는 x == y
location city is "Berlin"에서 구문 오류접근자 누락: 변수와 해당 속성 사이의 일반 단어location's cityName, property cityName of location, 또는 location.cityName
"1" > 0 또는 session's start > "2026-01-01" 비교 오류관계 연산자는 유형을 변환하지 않습니다변환: "1" as number > 0, ... > "2026-01-01" as datetime, 또는 is after 사용
위치/코드가 절대 일치하지 않음잘못된 대소문자: 코드는 대문자 ("US", "NA", "CA")이고 문자열은 대소문자 구분대문자 사용, is like, is equal to ... ignoring case, 또는 ~/.../i 사용
matches "Sale"가 "sale"을 찾지 못함matches, starts with, ends with는 대소문자 구분is like "sale" 또는 matches ~/sale/i 사용
수량 한정자가 다음 조건을 삼킴수량 한정자 술어가 끝까지 확장됨수량 한정자 전체를 괄호로 묶으세요
a or b and c가 이상하게 동작함and가 or보다 더 강하게 바인딩괄호 추가
조건부 결과가 잘못 곱해짐조건부는 탐욕적입니다(A if c otherwise B) * price
프로필/장바구니/관심사 조건이 절대 true가 아님통합 필요한 데이터가 전송되지 않음이벤트를 추적하거나 속성 설정 (croct-track-events 스킬 참조)
X is greater than 30과 X is not greater than 30 모두 false정의되지 않은 값: 불리언 오류 허용 범위로 false 반환X is defined and ... 또는 X or else 0 사용
user is identified가 항상 false로그인/가입/로그아웃 이벤트가 추적되지 않음추적하세요; 그렇지 않으면 사용자는 항상 익명입니다
cart.items[2nd], first of, average of, min of 오류요소 누락 또는 빈 컬렉션or else null / or else 0 추가
contains none of [] vs contains neither []빈 오른쪽: none은 false, neither은 true"겹침 없음"은 contains neither 사용
's와 대괄호 혼합 오류소유격/소유 표시와 대괄호는 괄호가 필요(cart's items)[1st] 또는 점 표기법 cart.items[*]
이벤트 표현식을 사용할 수 없음Scale 플랜 기능입니다가능하면 프로필/세션 통계 사용 (user's stats' orders)
"예측 불가"page, 현재 컨텍스트 또는 now/today/yesterday 사용예상됨; 오디언스는 런타임에 여전히 작동
범위 오류.. 범위는 최대 30개 항목범위 좁히기
변수/매개변수 이름 오류변수는 재정의할 수 없습니다; 이름은 식별자여야 합니다이름 바꾸기; 내장 이름(user, page) 및 일반 단어 피하기

해야 할 일:

  • 비개발자와 공유하는 오디언스에서는 명시적인 is equal to, is greater than을 선호합니다; 더 읽기 쉬울 때는 기술 스타일을 사용하세요.
  • 선택적 데이터는 is defined 또는 or else로 보호하세요.
  • and 체인에서 비용이 적게 드는 조건을 먼저 넣으세요 (단락 평가로 나머지를 건너<0xEB><0x9B><0x84>).
  • contains all / contains none을 부정하는 대신 contains either / contains neither을 사용하세요.

하지 말아야 할 일:

  • 테스트, 변수 또는 이벤트 표현을 지어내지 마세요. user is new 또는 user has made purchase와 같은 예는 문서 본문에 나타나지만 문서화된 구성은 아닙니다; user is not returning과 user's stats' orders is not 0 (또는 user has placed an order)을 사용하세요.
  • location's countryName을 코드와 비교하지 마세요; "US"에는 countryCode를 사용하세요.
  • 산술 연산에서 암시적 날짜 변환에 의존하지 마세요: "2021-01-01" as date + 1 day.

참조

파일읽어야 할 때
references/syntax.md어휘 규칙, let, 함수, 리터럴, 접근자 및 선택자, 우선순위 표, 조건부, 기간
references/context-and-data-types.md모든 변수 및 속성, 가용성 플래그, 열거형 (기기 카테고리, 장바구니 단계, 대륙, 위치 태그), 변환
references/expressions.md모든 테스트, 연산자, 오류 허용 범위, 수량 한정자, 매크로, 수정자
references/events.md이벤트 표현식, 기준 연산자, 개수 수량 한정자, 시간 창, 추적 요구 사항
references/evaluation.mdSDK evaluate / cql / 훅, Evaluation API, 컨텍스트 속성, 동적 값, 오디언스 예측
references/recipes.md사용 사례별 바로 사용 가능한 오디언스 및 값 쿼리

관련 스킬: croct-integrate-sdk (SDK 설정), croct-track-events (쿼리가 읽는 이벤트 및 속성 전송), croct-use-api (HTTP API), croct-model-content (콘텐츠 정의의 동적 값), croct-personalize-and-test (오디언스를 사용하는 경험 및 실험), croct-use-croct (개념 및 오리엔테이션).

라이브 문서

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

croct-tech/agent-skills

>- Use when connecting Croct to a third-party platform or migrating to Croct from another personalization or experimentation tool. Covers Storyblok (Optimize by Croct app, @croct/plug-storyblok, Storyblok withCroct, resolveContent, croct/plug-storyblok, CroctStoriesApi), Sanity and Strapi (slot fallback, dynamic zones, metadata.contentSource), Shopify Hydrogen storefront events, Shopify custom pixel (croctPixel, PUBLIC_CROCT_SHOPIFY_PIXEL, checkout and order tracking), VTEX, Google Tag Manager data layer, Microsoft Clarity tags, HubSpot forms (hbspt.forms.create, hs-form-event), firmographic providers 6sense, Demandbase, Clearbit Reveal, and ZoomInfo WebSights (firmographics attributes, account-based audiences in CQL), and migrations from Mutiny and Ninetailed (Experience component, Contentful sunset). Triggers include cdn.croct.io/plug-integration scripts, "personalize Storyblok blocks", "track Shopify checkout", "send VTEX events", "ABM personalization", "replace Mutiny".

croct-tech/agent-skills

>- Use when installing or using a Croct SDK in application code: rendering slot content, evaluating CQL queries, server or client fetching, prerendering, identifying users, app ID / API key env vars, testing, or debugging. Covers JavaScript (`@croct/plug`, `croct.fetch`, `croct.evaluate`), React (`@croct/plug-react`, `<CroctProvider>`, `useContent`, `<Slot>`, `useEvaluation`, `useCroct`), Next.js (`@croct/plug-next`, `fetchContent`, `cql`, middleware/proxy, `NEXT_PUBLIC_CROCT_APP_ID`, `CROCT_API_KEY`), Vue (`@croct/plug-vue`), Nuxt (`@croct/plug-nuxt`), Shopify Hydrogen (`@croct/plug-hydrogen`), PHP (`croct/plug-php`), Laravel, Symfony, and Drupal. Triggers: slot IDs like `home-hero@1`, `SlotContent`, "Croct is not plugged in", "initial content is required for server-side rendering", "Did you forget to configure Croct's middleware?", CORS errors.

croct-tech/agent-skills

>- Use when designing or changing Croct content models: regular vs union components, what becomes a component, slot, structure, or primitive attribute; writing component schema JSON (`structure`, `union`, `reference`, `text`, `number`, `boolean`, `list`, `@croct/file`, `@croct/richText` rich text, `format`, `choices`, `optional`, `private`, `position`); writing content definition JSON (`static`/`dynamic` values, `nullable`, `default`, `{{placeholder}}` paths); slot default, localized, experience, experiment, or content group content; schema limit errors (30 attributes, 6 nesting levels, 10 union members, complexity score 50); component versioning and breaking changes (`home-hero@2`); refactoring (duplicate and modify, duplicate and replace, flatten and merge); Markdown in text attributes with `@croct/md-lite`. Phrasings: "model content for a hero", "add an attribute to the banner component", "support variations", "component is too complex", "localize the hero", "translations", `preferredLocale`.

croct-tech/agent-skills

>- Use when planning or implementing personalization or A/B testing with Croct: creating an experience (audience, slots, content, priority, scheduling, drafts), adding an experiment (A/B/n, primary goal ID, traffic allocation, variants, cross-device consistency), wiring the code it needs (slots, `croct.track('goalCompleted', {goalId})`, `orderPlaced`, `leadGenerated`, `userSignedUp`), server-side feature-flag experiments, redirect experiments, personalization recipes (UTM campaigns, ABM, search terms, location, free shipping, interests, blog readers, leads, customers, organic intent, HubSpot forms), or reading the experience, experiment, application, or workspace dashboards (probability to be best, potential loss, "Experiment in progress", "Recommended winner", "No clear winner", "Track your goal"). Phrasings: "personalize the hero for LinkedIn visitors", "A/B test this CTA", "which variant won?", "why does my experiment show no conversions?".

관련 스킬