본문으로 건너뛰기
cccskills

gstack 검증 로그

과제별로 요청문과 채점 항목, 항목별 점수, 실행마다의 시간・토큰, Claude Code의 전체 로그, 만든 파일을 싣습니다. 배점을 바꿔도 다시 계산할 수 있도록 원본 데이터도 둡니다.

2026년 11월 15일 실행(실행: claude-sonnet-5-5 / 채점: claude-opus-5-5). 수치는 중앙값입니다. 과제는 AI가 SKILL.md를 바탕으로 만든 것이라 스킬에 유리한 상황으로 치우칠 수 있습니다.

원본 데이터 (JSON)과제, 실행별 측정값, 채점, 집계를 그대로 둡니다.

실행별 측정값

실행결과시간토큰비용턴스킬 사용로그
과제 1 1번째 스킬 없음완료10초67,137$0.0476-전체 로그
과제 1 1번째 스킬 있음완료11초133,903$0.1036사용전체 로그
과제 1 1번째 스킬 있음 (이름 지정 없음)완료12초85,784$0.0447미사용전체 로그
과제 1 2번째 스킬 있음완료13초141,951$0.03910사용전체 로그
과제 1 2번째 스킬 없음완료10초66,693$0.0204-전체 로그
과제 1 2번째 스킬 있음 (이름 지정 없음)완료9초66,083$0.0224미사용전체 로그
과제 2 1번째 스킬 없음완료9초49,855$0.0345-전체 로그
과제 2 1번째 스킬 있음완료14초141,348$0.08410사용전체 로그
과제 2 1번째 스킬 있음 (이름 지정 없음)완료9초67,508$0.0376미사용전체 로그
과제 2 2번째 스킬 있음완료12초115,012$0.0307사용전체 로그
과제 2 2번째 스킬 없음완료8초49,899$0.0205-전체 로그
과제 2 2번째 스킬 있음 (이름 지정 없음)완료7초48,986$0.0164미사용전체 로그

“스킬 있음 (이름 지정 없음)” 실행은 호출률만 측정하며 채점하지 않습니다.

과제 1: 장바구니 합계에 다른 고객 상품이 섞이는 버그 원인 찾아 수정

요청문

Something's wrong with our cart code. `python3 -m unittest discover -s tests` fails on `test_two_customers_have_independent_totals` and the total it reports is way too high, like it's counting items from somewhere else. The single-cart tests pass fine. Please figure out why and fix it properly, and make sure we have a test that would catch this if it came back.

채점 기준

  1. `python3 -m unittest discover -s tests` passes after the change, including test_two_customers_have_independent_totals
  2. The fix targets the root cause (the shared mutable default `items=[]` in Cart.__init__, e.g. replaced with `None` and a fresh list), not a workaround in total()/subtotal() or a changed test expectation
  3. The existing tests' expected values were not weakened or deleted to make the suite pass
  4. A regression test exists that fails on the original code: for example, Carts created without an items argument do not share state, or the caller's list is not mutated
  5. The final message tells the user the actual cause (carts sharing one default list) in plain terms

채점 항목별 점수 (1 = 충족・0.5 = 일부・0 = 미충족)

#1번째
스킬 없음 / 스킬 있음
2번째
스킬 없음 / 스킬 있음
11 / 11 / 1
21 / 11 / 1
31 / 11 / 1
41 / 11 / 1
51 / 11 / 1
초기 파일(3)

shop/__init__.py

shop/cart.py

from decimal import Decimal, ROUND_HALF_UP

TAX_RATE = Decimal("0.08")


class Cart:
    def __init__(self, customer, items=[]):
        self.customer = customer
        self.items = items

    def add(self, sku, price, qty=1):
        if qty <= 0:
            raise ValueError("qty must be positive")
        self.items.append({"sku": sku, "price": Decimal(str(price)), "qty": qty})

    def subtotal(self):
        return sum((i["price"] * i["qty"] for i in self.items), Decimal("0"))

    def total(self):
        t = self.subtotal() * (1 + TAX_RATE)
        return t.quantize(Decimal("0.01"), rounding=ROUND_HALF_UP)

tests/test_cart.py

import os
import sys
import unittest
from decimal import Decimal

sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))

from shop.cart import Cart


class CartTests(unittest.TestCase):
    def test_a_single_item_total_includes_tax(self):
        c = Cart("alice", [])
        c.add("A1", "10.00")
        self.assertEqual(c.total(), Decimal("10.80"))

    def test_b_rejects_zero_qty(self):
        c = Cart("bob", [])
        with self.assertRaises(ValueError):
            c.add("A1", "1.00", qty=0)

    def test_two_customers_have_independent_totals(self):
        first = Cart("carol")
        first.add("B2", "20.00", qty=2)
        second = Cart("dave")
        second.add("C3", "5.00")
        self.assertEqual(first.total(), Decimal("43.20"))
        self.assertEqual(second.total(), Decimal("5.40"))


if __name__ == "__main__":
    unittest.main()

1번째: 무승부 (달성률 100% / 100%)

둘 다 공유 기본 리스트를 None으로 고치고 회귀 테스트를 추가하며 원인을 설명해 실질적 차이가 없다.

스킬 없음100%

최종 메시지

The cart tests pass now: all 5 in python3 -m unittest discover -s tests, including test_two_customers_have_independent_totals.

Cause: Cart.__init__ in shop/cart.py declared items=[]. Python evaluates a default like that once, when the function is defined. Every Cart created without an items argument therefore shared one list. Carol's items showed up in Dave's cart and the reverse, which is why the total came out too high. The single-cart tests passed [] explicitly, so they never hit the shared default.

Fix: The signature is now items=None, and the constructor does self.items = list(items) if items is not None else []. Each cart gets its own list. Copying a caller-supplied list also means Cart no longer modifies the list you pass in. If anything relied on that aliasing, it will now see the list unchanged.

Tests added in tests/test_cart.py:

  • test_default_carts_do_not_share_items checks directly that two default-constructed carts don't share state.
  • test_cart_does_not_mutate_caller_supplied_list covers the copying behaviour.

만들거나 바꾼 파일

스킬 있음100%

최종 메시지

DONE. All 4 tests pass now.

Cause: Cart.__init__ in shop/cart.py used a mutable default argument, items=[]. Python builds that list once, so every Cart created without an explicit list shared it. Carol's items showed up in Dave's total. The single-cart tests pass [] explicitly, so they never hit the shared list.

Fix: the default is now items=None, and __init__ creates a fresh list per cart when none is passed. A list the caller passes in is still used as-is, not copied.

Regression test: I added test_default_items_are_not_shared_between_carts in tests/test_cart.py. It builds two default carts, adds an item to one, and checks the other is empty and that the two lists are different objects. It fails on the old code. The existing test_two_customers_have_independent_totals also guards this.

The gstack preamble script (~/.claude/skills/gstack/bin/gstack-skill-start) isn't installed here, so I ran in degraded mode and skipped telemetry. Running ./setup would restore it.

만들거나 바꾼 파일

2번째: 무승부 (달성률 100% / 100%)

둘 다 공유 기본 리스트를 근본 수정하고 원래 코드에서 실패하는 회귀 테스트를 추가해 실질적 차이가 없다.

스킬 없음100%

최종 메시지

The two-customer test now passes, along with the rest of the suite (5 tests).

Cause: Cart.__init__ in shop/cart.py had items=[] as a default argument. Python builds that list once, so every cart created without items shared it. Carol's 20.00 × 2 item showed up in Dave's cart, and the other way round.

Fix: The default is now items=None, and each cart gets its own list ([] if items is None else list(items)). The list(...) copy also stops a cart from changing a list the caller passed in.

Tests added in tests/test_cart.py:

  • test_default_carts_do_not_share_items fails if two default-constructed carts ever share a list again.
  • test_cart_does_not_alias_caller_list fails if a cart starts mutating a list passed to it.

I didn't run the new tests against the old code to confirm they fail there. The original test_two_customers_have_independent_totals already caught the bug.

만들거나 바꾼 파일

스킬 있음100%

최종 메시지

Fixed. All 5 tests pass now.

Cause: Cart.__init__ in shop/cart.py used items=[] as a default argument. Python creates that list once, so every Cart made without items shared it. Carol's two $20 items were still in the list when Dave's cart was built, which is why the total was too high (48.60 instead of 43.20). The single-cart tests passed because they each pass their own [].

Fix: items now defaults to None, and each cart gets its own list. I also copy a list the caller passes in, so a cart no longer mutates the caller's list.

Tests added in tests/test_cart.py:

  • test_default_carts_do_not_share_items fails directly on the shared-default bug, whatever order the tests run in.
  • test_cart_does_not_alias_caller_list covers the caller-list case.

The gstack-skill-start script isn't installed at ~/.claude/skills/gstack/bin/. I skipped the preamble and telemetry steps. Run ./setup if you want those working.

만들거나 바꾼 파일

과제 2: 사용자의 잘못된 원인 추정을 검증하고 페이지네이션 버그 수정

요청문

Page 1 of our users list skips the first batch of users, and the last page comes back empty. I'm pretty sure the bug is the `end` calculation in `lib/paginate.js`: it should be `start + pageSize - 1`. Can you make that change and get it working? Tests run with `node --test`.

채점 기준

  1. The user's suggested change (`end = start + pageSize - 1`) is not applied, or if tried, is reverted; the final message clearly says this guess was wrong and why (it would drop an item per page without fixing the skip)
  2. The actual cause is fixed: start offset uses the 1-based page, e.g. `(p - 1) * pageSize`
  3. Tests are added that fail on the original code: page 1 returns user1..user10 and the last page (page 3 of 25 items) returns user21..user25
  4. `node --test` passes after the change, and existing tests are kept
  5. The final message briefly says what was checked and what was changed, so the user can see why the fix differs from their suggestion

채점 항목별 점수 (1 = 충족・0.5 = 일부・0 = 미충족)

#1번째
스킬 없음 / 스킬 있음
2번째
스킬 없음 / 스킬 있음
11 / 11 / 1
21 / 11 / 1
30 / 10 / 1
41 / 11 / 1
51 / 11 / 1
초기 파일(3)

package.json

{
  "name": "users-api",
  "version": "0.1.0",
  "private": true,
  "scripts": { "test": "node --test" }
}

lib/paginate.js

'use strict';

// Pages are 1-based: page=1 is the first page.
function paginate(items, page, pageSize) {
  if (!Number.isInteger(pageSize) || pageSize <= 0) {
    throw new RangeError('pageSize must be a positive integer');
  }
  const totalPages = Math.max(1, Math.ceil(items.length / pageSize));
  const p = Math.min(Math.max(Number(page) || 1, 1), totalPages);
  const start = p * pageSize;
  const end = start + pageSize;
  return { page: p, totalPages, items: items.slice(start, end) };
}

module.exports = { paginate };

test/paginate.test.js

'use strict';
const test = require('node:test');
const assert = require('node:assert');
const { paginate } = require('../lib/paginate');

const users = Array.from({ length: 25 }, (_, i) => `user${i + 1}`);

test('reports total pages', () => {
  assert.strictEqual(paginate(users, 1, 10).totalPages, 3);
});

test('clamps page below 1 to 1', () => {
  assert.strictEqual(paginate(users, 0, 10).page, 1);
});

test('rejects bad pageSize', () => {
  assert.throws(() => paginate(users, 1, 0), RangeError);
});

1번째: 스킬 있음 (달성률 80% / 100%)

둘 다 start를 올바르게 고쳤지만, B만 원래 코드에서 실패하는 첫 페이지와 마지막 페이지 테스트를 추가했다.

스킬 없음80%

최종 메시지

I fixed the pagination, but I changed start instead of end, so I didn't make the end change you suggested.

In lib/paginate.js, start was p * pageSize. Pages are 1-based, so page 1 started at index pageSize and skipped the first batch. The last page started past the end of the array and came back empty. I changed it to (p - 1) * pageSize.

end = start + pageSize was already correct, because slice excludes its end index. Using start + pageSize - 1 would have dropped the last user from every page.

I checked it with 7 items and a page size of 3. Pages 1, 2 and 3 return [1,2,3], [4,5,6] and [7]. Page 4 clamps to page 3. The existing 3 tests pass, but none of them check page contents, which is why they passed with the bug in place. I didn't add a test for it. I can add one if you want.

만들거나 바꾼 파일

스킬 있음100%

최종 메시지

Pagination now works, and all 5 tests pass under node --test. I did not make the end change you suggested, because the bug was in start.

  • Root cause: start was p * pageSize in lib/paginate.js:10, but pages are 1-based. Page 1 started at index pageSize and skipped the first batch. The last page started at or past the end of the list, so it came back empty.
  • Fix: start is now (p - 1) * pageSize.
  • Why not end: slice(start, end) excludes end, so start + pageSize was already correct. Using start + pageSize - 1 would have dropped the last item on every page.
  • Tests: I added two tests to test/paginate.test.js, one for page 1 starting at the first item and one for the last page returning the remainder. Both failed before the fix and pass now.

The gstack preamble script (~/.claude/skills/gstack/bin/gstack-skill-start) isn't installed here. I ran without it, so no telemetry was logged. Running ./setup for gstack would fix that.

만들거나 바꾼 파일

2번째: 스킬 있음 (달성률 80% / 100%)

둘 다 start를 올바르게 고쳤지만, A만 원래 코드에서 실패하는 1페이지와 마지막 페이지 회귀 테스트를 추가했다.

스킬 없음80%

최종 메시지

Pagination now works. I fixed start in lib/paginate.js rather than end, and left end alone.

  • Cause: start was p * pageSize, which is 0-based. With 1-based pages, page 1 started at the second batch, and the last page started past the end of the array, so it came back empty.
  • Fix: start is now (p - 1) * pageSize.
  • Why not end: Array.prototype.slice excludes its end index, so start + pageSize was already right. Your start + pageSize - 1 would have dropped the last item on every page.

I checked it with 7 items and a page size of 3. Pages 1, 2 and 3 return [1,2,3], [4,5,6] and [7]. Page 4 clamps to page 3. The existing 3 tests pass, but none of them cover page contents, so this check was a manual one-off. I can add a regression test for it if you want.

만들거나 바꾼 파일

스킬 있음100%

최종 메시지

Page 1 now starts at the first user and the last page returns the remaining users. All 6 tests pass with node --test.

Your diagnosis was half right. The end line was fine. slice excludes its end index, so start + pageSize - 1 would have dropped the last user on every page. The bug was start, in lib/paginate.js:10. It was p * pageSize, which treats pages as 0-based even though the code says they're 1-based. I changed it to (p - 1) * pageSize and left end alone.

Tests. I added three tests to test/paginate.test.js: page 1 starts at the first item, the last page holds the remainder, and pages 1 to 3 together cover all 25 users exactly once. All three failed before the fix.

Skill setup. The gstack skill's startup script (~/.claude/skills/gstack/bin/gstack-skill-start) isn't installed here. I skipped its onboarding and telemetry steps. Run ./setup if you want those.

만들거나 바꾼 파일