Skip to content
completion-criteria logo

validate-operation.sh

completion-criteria

Completion checklist - when is a task truly done

SKILL.md

Full skill instructions

✅ Completion Checklist

Task is ONLY complete when ALL items checked:

API Specification Phase

  • Operation added to api.yml
  • Operation name follows pattern (get/​list/​search/​create/​update/​delete)
  • Summary uses "Retrieve" for get/​list operations
  • Description added from vendor documentation
  • NO error responses (only 200/​201)
  • Properties are camelCase
  • Nested objects use $ref

Code Generation Phase

  • Ran npm run clean && npm run generate
  • Generation succeeded without errors
  • New types created in generated/
  • No InlineResponse types generated

Implementation Phase

  • Method added to producer class
  • Using generated types (NO Promise<any>)
  • Mappers implemented for field conversions
  • Error handling using core types
  • No TypeScript compilation errors

Testing Phase

  • Unit test file created/​updated
  • Integration test file created/​updated
  • At least 3 test cases for the operation
  • Success case tested
  • Error cases tested
  • Mocks properly configured

Validation Phase

  • All tests passing (npm test)
  • No regression in existing tests
  • Build successful (npm run build)
  • Dependencies locked (npm run shrinkwrap)
  • npm-shrinkwrap.json created
  • No linting errors

Documentation Phase

  • Operation documented in code
  • Test names descriptive
  • Any special behavior noted

🚫 Immediate Failure Conditions

Task FAILS if:

  1. Operation name contains 'describe'

    • STOP immediately, use 'get' instead
  2. API spec contains 4xx or 5xx responses

    • DELETE all error responses
    • Framework handles errors automatically
  3. Skipped generation step

    • TASK FAILED - must run npm run clean && npm run generate
  4. No tests written

    • TASK FAILED - tests are mandatory
  5. Tests not run

    • TASK FAILED - must execute npm test
  6. Build not verified

    • TASK FAILED - must execute npm run build
  7. Dependencies not locked

    • TASK FAILED - must execute npm run shrinkwrap
  8. Used Promise<any> in signatures

    • TASK FAILED - use generated types
  9. Stopped before Gate 6

    • TASK INCOMPLETE - continue working
  10. Schema used in both nested and direct contexts without separation

  • If schema has 10+ properties AND is referenced by other schemas AND has its own endpoint
  • CREATE separate {Schema}Summary for nested usage
  • See api-specification.md Rule #19
  1. Hardcoded test values in integration tests
  • ALL test values (IDs, names, etc.) MUST be in .env
  • Export from test/​integration/​Common.ts
  • Import and use in integration tests
  • NEVER hardcode: const userId = '12345' ❌
  • ALWAYS use .env: const userId = TEST_USER_ID ✅
  • See testing.md Rule #7

Red Flags (Incomplete Work)

Watch for these signs:

  1. No mention of tests - MAJOR red flag
  2. "I've added the operation" without test confirmation
  3. No npm test output shown
  4. No build validation
  5. Jumping to "done" after implementation

User Should NEVER Have To Say

  • "Now write tests"
  • "Did you test it?"
  • "Run the tests"
  • "Does it build?"
  • "You forgot the tests"

If user has to remind about tests: TASK HAS FAILED

Complete Execution Example

✅ OPERATION COMPLETE: getAccessToken

Gate 1 - API Specification: ✅
- Operation: getAccessToken (uses 'get', not 'describe')
- Summary: "Retrieve an access token"
- Description from vendor docs included
- Response: 200 only (no error codes)
- All properties camelCase

Gate 2 - Type Generation: ✅
- Ran: npm run clean && npm run generate
- Generated: AccessToken interface
- No InlineResponse types
- Exit code: 0

Gate 3 - Implementation: ✅
- Added to AccessTokenProducer
- Signature: Promise<AccessToken> (not any)
- Mappers handle snake_case → camelCase
- Error handling uses core errors

Gate 4 - Test Creation: ✅
- Unit tests: test/​AccessTokenProducerTest.ts (4 cases)
- Integration: test/​integration/​AccessTokenIntegrationTest.ts (2 cases)
- Mock responses configured

Gate 5 - Test Execution: ✅
- Ran: npm test
- Result: 6 passing
- No regressions
- Exit code: 0

Gate 6 - Build: ✅
- Ran: npm run build
- Result: Success
- No errors
- Exit code: 0
- Ran: npm run shrinkwrap
- npm-shrinkwrap.json created
- Dependencies locked

Operation is fully implemented, tested, and verified.

Enforcement Rules Summary

RuleViolation = Task Failure
NEVER use 'describe' prefix✅ Yes
ONLY 200/​201 responses✅ Yes
ALWAYS run generate after API changes✅ Yes
ALWAYS write tests✅ Yes
ALWAYS run tests✅ Yes
ALWAYS build and verify✅ Yes
ALWAYS run shrinkwrap✅ Yes
NO Promise<any> types✅ Yes

Quick Validation Script

#!/​bin/​bash
# validate-operation.sh

echo "🚦 Validating operation completion..."

FAILED=0

# Gate 1: API Spec
if grep -E "describe[A-Z]" api.yml > /​dev/​null 2>&1; then
  echo "❌ Gate 1 FAILED: 'describe' found in api.yml"
  FAILED=1
fi

if grep "nullable:" api.yml > /​dev/​null 2>&1; then
  echo "❌ Gate 1 FAILED: 'nullable' found in api.yml"
  FAILED=1
fi

# Check for schema context separation issues
nested_schemas=$(yq eval '.components.schemas[] | .. | select(type == "string" and test("#/​components/​schemas/")) | capture("#/​components/​schemas/(?<schema>.+)").schema' api.yml 2>/​dev/​null | sort -u)
endpoint_schemas=$(yq eval '.paths.*.*.responses.*.content.*.schema["$ref"]' api.yml 2>/​dev/​null | grep -o '[^/]*$' | sort -u)
for schema in $nested_schemas; do
  if echo "$endpoint_schemas" | grep -q "^${schema}$"; then
    prop_count=$(yq eval ".components.schemas.${schema}.properties | length" api.yml 2>/​dev/​null)
    if [ "$prop_count" -gt 10 ] 2>/​dev/​null; then
      echo "⚠️  WARNING: Schema '${schema}' used in BOTH nested and direct contexts with ${prop_count} properties"
      echo "   Consider creating '${schema}Summary' for nested usage (see api-specification.md Rule #19)"
    fi
  fi
done

# Gate 2: Generation
if [ ! -d "generated" ]; then
  echo "❌ Gate 2 FAILED: No generated directory"
  FAILED=1
fi

# Gate 3: Implementation
if grep "Promise<any>" src/​*.ts > /​dev/​null 2>&1; then
  echo "❌ Gate 3 FAILED: Promise<any> found"
  FAILED=1
fi

# Gate 4: Tests exist
if ! find test -name "*Test.ts" | grep -q .; then
  echo "❌ Gate 4 FAILED: No test files"
  FAILED=1
fi

# Gate 4b: No hardcoded test values in integration tests
if [ -d "test/​integration" ]; then
  if grep -E "(const|let|var) [a-zA-Z]*[Ii]d = ['\"][0-9]+['\"]" test/​integration/​*.ts > /​dev/​null 2>&1; then
    echo "❌ Gate 4 FAILED: Hardcoded test values in integration tests"
    echo "   All test values must be in .env and imported from Common.ts"
    FAILED=1
  fi
fi

# Gate 5: Tests pass
if ! npm test > /​dev/​null 2>&1; then
  echo "❌ Gate 5 FAILED: Tests failing"
  FAILED=1
fi

# Gate 6: Build passes
if ! npm run build > /​dev/​null 2>&1; then
  echo "❌ Gate 6 FAILED: Build failing"
  FAILED=1
fi

# Gate 6b: Shrinkwrap dependencies
if ! npm run shrinkwrap > /​dev/​null 2>&1; then
  echo "❌ Gate 6 FAILED: Shrinkwrap failing"
  FAILED=1
fi

if [ ! -f "npm-shrinkwrap.json" ]; then
  echo "❌ Gate 6 FAILED: npm-shrinkwrap.json not created"
  FAILED=1
fi

if [ $FAILED -eq 0 ]; then
  echo "✅ ALL GATES PASSED - Operation complete!"
else
  echo "🚨 FAILED - Fix issues and re-validate"
  exit 1
fi

Remember

GATES ARE NOT OPTIONAL

Every operation MUST pass through ALL gates sequentially. No shortcuts. No exceptions. Complete or fail.

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View