Skip to content

chore: add run-emulate skill with curl smoke driver#17

Merged
amondnet merged 2 commits into
mainfrom
amondnet/run
Jul 4, 2026
Merged

chore: add run-emulate skill with curl smoke driver#17
amondnet merged 2 commits into
mainfrom
amondnet/run

Conversation

@amondnet

@amondnet amondnet commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a Claude Code "run skill" for driving the emulate CLI locally: builds the monorepo, seeds via emulate init, starts all 7 service emulators (Kakao, Naver, Toss Payments, Firebase, Supabase, Asana, Linear), exercises one real flow per service, and the programmatic createEmulator() API, then shuts everything down.

Changes

  • .claude/skills/run-emulate/SKILL.md — agent-facing instructions for running/driving the emulators, plus documented gotchas verified during testing
  • .claude/skills/run-emulate/smoke.sh — curl-based smoke driver exercising: Kakao OAuth authorize→token→/v2/user/me, Toss payment create→confirm DONE, Firebase accounts:signUp, Supabase PostgREST select, Asana workspaces, Linear GraphQL teams

Verified Gotchas (documented in SKILL.md)

  • Unseeded server returns Kakao KOE101 HTML 401
  • Kakao token exchange requires client_secret (otherwise KOE010)
  • Linear auth uses the seeded api_keys value, with or without Bearer
  • Workspace imports only resolve inside the repo (root node_modules doesn't link workspace packages)

Test Plan

  • Ran smoke.sh twice locally on base ports 4300 and 5300 — 8 passed / 0 failed each run

Summary by cubic

Adds a run-emulate skill and curl smoke driver to build, seed, start, and verify the @pleaseai/emulate CLI end to end. One command runs real flows across Kakao, Naver, Toss Payments, Firebase, Supabase, Asana, and Linear, plus the createEmulator() API.

  • New Features
    • Added .claude/skills/run-emulate/SKILL.md with usage, gotchas, and troubleshooting for @pleaseai/emulate.
    • Added .claude/skills/run-emulate/smoke.sh that builds, runs emulate init, starts all 7 services, exercises one flow per service and createEmulator(), then shuts down.
    • Adds readiness wait and keeps the temp workdir and server.log on failure; supports base port arg (default 4300), prints pass/fail, and exits non-zero on failure.

Written for commit 50f6e3f. Summary will update on new commits.

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@amondnet, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 16 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f74c26a5-3fbd-4a6c-83ea-bd5617eb03ff

📥 Commits

Reviewing files that changed from the base of the PR and between a5adeba and 50f6e3f.

📒 Files selected for processing (2)
  • .claude/skills/run-emulate/SKILL.md
  • .claude/skills/run-emulate/smoke.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch amondnet/run

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

❤️ Share

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

@codacy-production

codacy-production Bot commented Jul 4, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 2 files

Architecture diagram
sequenceDiagram
    participant Dev as Developer / CI
    participant Smoke as smoke.sh
    participant Build as bun run build
    participant CLI as emulate CLI (init/start)
    participant Emulators as 7 Service Emulators
    participant API as createEmulator() API
    participant Stdout as stdout / result

    Note over Dev,Stdout: NEW: smoke driver orchestration

    Dev->>Smoke: execute smoke.sh [BASE_PORT]

    Smoke->>Build: bun run build (turbo)
    Build-->>Smoke: dist/index.js ready
    alt Build fails
        Smoke-->>Dev: exit 1 (build failed)
    end

    Smoke->>CLI: bun emulate init (in temp dir)
    CLI->>CLI: generate emulate.config.yaml with seeds
    CLI-->>Smoke: seed file written

    Smoke->>CLI: bun emulate start --port BASE_PORT --seed emulate.config.yaml &
    CLI->>Emulators: start 7 HTTP servers on sequential ports
    Emulators-->>CLI: listening

    Smoke->>Emulators: poll GET / on last port (Linear) up to 30×0.5s
    loop poll every 0.5s
        alt port responds 404 (expected)
            Emulators-->>Smoke: 404 (ready)
        else timeout
            Smoke-->>Dev: exit 1 (server not up)
        end
    end

    Note over Smoke,Emulators: ---- Smoke Tests ----

    Smoke->>Emulators: Kakao OAuth: authorize → token → /v2/user/me
    Emulators-->>Smoke: access_token + user email
    Smoke->>Stdout: check "kakao token" / "kakao /v2/user/me"

    Smoke->>Emulators: Toss: create internal payment → confirm DONE
    Emulators-->>Smoke: paymentKey + status DONE
    Smoke->>Stdout: check "toss confirm"

    Smoke->>Emulators: Firebase: accounts:signUp
    Emulators-->>Smoke: idToken
    Smoke->>Stdout: check "firebase signUp"

    Smoke->>Emulators: Supabase: PostgREST select todos
    Emulators-->>Smoke: rows with title
    Smoke->>Stdout: check "supabase todos"

    Smoke->>Emulators: Asana: GET workspaces
    Emulators-->>Smoke: workspaces list
    Smoke->>Stdout: check "asana workspaces"

    Smoke->>Emulators: Linear: GraphQL query teams
    Emulators-->>Smoke: teams with key ENG
    Smoke->>Stdout: check "linear teams"

    Note over Smoke,API: ---- Programmatic API ----

    Smoke->>API: createEmulator({service:'supabase', port:PORT+100, seed:...})
    API->>API: start in-process Supabase emulator
    API-->>Smoke: Emulator URL
    Smoke->>API: GET /rest/v1/todos?select=*
    API-->>Smoke: JSON with title "prog"
    Smoke->>Smoke: close emulator
    Smoke->>Stdout: check "createEmulator supabase"

    Smoke->>Smoke: tally PASS/FAIL
    alt all passed
        Smoke-->>Dev: passed: 8  failed: 0  (server log path)
    else any fail
        Smoke-->>Dev: exit 1 (non-zero)
    end
Loading

Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Jul 4, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds a run-emulate Claude Code skill consisting of a SKILL.md agent guide and a smoke.sh curl driver that builds the monorepo, seeds via emulate init, starts all 7 service emulators, runs 10 end-to-end checks, and shuts down cleanly.

  • SKILL.md documents prerequisites, invocation patterns, seeded credentials, and verified gotchas (unseeded 401, Kakao client_secret requirement, Linear auth format, workspace import scope).
  • smoke.sh exercises Kakao OAuth (authorize→token→/v2/user/me), Naver OAuth (authorize→token→/v1/nid/me), Toss payment create→confirm, Firebase accounts:signUp, Supabase PostgREST select, Asana workspaces, Linear GraphQL teams, and the programmatic createEmulator() API; uses exec inside the background subshell so $! correctly identifies the bun process for cleanup.

Confidence Score: 5/5

Safe to merge — adds a local developer/agent skill with no impact on production code paths.

Both files are purely additive tooling under .claude/skills/. The smoke driver is well-structured: it guards the build step, guards emulate init, uses exec to correctly track the server PID for cleanup, preserves the workdir on check failures, and covers all 7 emulator services with 10 distinct assertions. The only open items are a stale check-count reference in the PR description (the SKILL.md itself is accurate) and a subtle bun CWD concern in the createEmulator() step that is unlikely to surface in normal usage.

No files require special attention; the minor observation in smoke.sh around the prog.ts invocation CWD is low risk for typical repo-root invocations.

Important Files Changed

Filename Overview
.claude/skills/run-emulate/SKILL.md New agent-facing documentation for the run-emulate skill; well-structured with accurate gotchas and credential references. Minor: the "passed: 10" count in SKILL.md is correct but conflicts with the stale "8 passed" in the PR description.
.claude/skills/run-emulate/smoke.sh Curl-based smoke driver exercising all 7 emulator services; includes liveness wait, cleanup on failure, and exec trick for proper PID tracking. The bun prog.ts call lacks an explicit cd $ROOT, which could cause config-resolution issues when invoked from outside the repo.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant S as smoke.sh
    participant B as bun build
    participant I as emulate init
    participant E as emulate start (ports BASE–BASE+6)
    participant K as Kakao :BASE
    participant N as Naver :BASE+1
    participant T as Toss :BASE+2
    participant F as Firebase :BASE+3
    participant SB as Supabase :BASE+4
    participant A as Asana :BASE+5
    participant L as Linear :BASE+6
    participant P as createEmulator() :BASE+100

    S->>B: bun run build
    B-->>S: dist/index.js
    S->>I: bun emulate init → emulate.config.yaml
    S->>E: bun emulate start --seed (background)
    S->>L: curl GET / (liveness poll, up to 15 s)
    L-->>S: 404 (server up)
    S->>K: GET /oauth/authorize → redirect w/ code
    S->>K: POST /oauth/token → access_token
    S->>K: GET /v2/user/me → email check
    S->>N: GET /oauth2.0/authorize → redirect w/ code
    S->>N: GET /oauth2.0/token → access_token
    S->>N: GET /v1/nid/me → email check
    S->>T: POST /internal/payments → paymentKey
    S->>T: POST /v1/payments/confirm → DONE
    S->>F: POST /v1/accounts:signUp → idToken
    S->>SB: GET /rest/v1/todos → title check
    S->>A: GET /api/1.0/workspaces → resource_type check
    S->>L: POST /graphql teams query → key check
    S->>P: createEmulator() supabase → todos JSON
    S->>E: kill SERVER_PID (cleanup trap)
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant S as smoke.sh
    participant B as bun build
    participant I as emulate init
    participant E as emulate start (ports BASE–BASE+6)
    participant K as Kakao :BASE
    participant N as Naver :BASE+1
    participant T as Toss :BASE+2
    participant F as Firebase :BASE+3
    participant SB as Supabase :BASE+4
    participant A as Asana :BASE+5
    participant L as Linear :BASE+6
    participant P as createEmulator() :BASE+100

    S->>B: bun run build
    B-->>S: dist/index.js
    S->>I: bun emulate init → emulate.config.yaml
    S->>E: bun emulate start --seed (background)
    S->>L: curl GET / (liveness poll, up to 15 s)
    L-->>S: 404 (server up)
    S->>K: GET /oauth/authorize → redirect w/ code
    S->>K: POST /oauth/token → access_token
    S->>K: GET /v2/user/me → email check
    S->>N: GET /oauth2.0/authorize → redirect w/ code
    S->>N: GET /oauth2.0/token → access_token
    S->>N: GET /v1/nid/me → email check
    S->>T: POST /internal/payments → paymentKey
    S->>T: POST /v1/payments/confirm → DONE
    S->>F: POST /v1/accounts:signUp → idToken
    S->>SB: GET /rest/v1/todos → title check
    S->>A: GET /api/1.0/workspaces → resource_type check
    S->>L: POST /graphql teams query → key check
    S->>P: createEmulator() supabase → todos JSON
    S->>E: kill SERVER_PID (cleanup trap)
Loading

Reviews (2): Last reviewed commit: "chore: apply AI code review suggestions" | Re-trigger Greptile

Comment thread .claude/skills/run-emulate/smoke.sh
Comment thread .claude/skills/run-emulate/smoke.sh
Comment thread .claude/skills/run-emulate/smoke.sh
Comment thread .claude/skills/run-emulate/smoke.sh
@sonarqubecloud

sonarqubecloud Bot commented Jul 4, 2026

Copy link
Copy Markdown

@amondnet
amondnet merged commit 838efed into main Jul 4, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant