소스 정보
- 저장소
- majiayu000/claude-skill-registry
- 최근 소스 활동
- 2026년 6월 23일 12:15
- 감지된 SKILL.md 언어
- 영어
- 스타
- 543
- 포크
- 85
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/majiayu000/claude-skill-registry --skill graphql-schema명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | graphql-schema |
| description | GraphQL schema validation and optimization with federation support |
| disable-model-invocation | true |
I'll validate and optimize your GraphQL schema with support for federation, deprecated fields, and performance improvements.
Features:
This skill uses efficient GraphQL-specific patterns to minimize token usage:
Pattern: Cache GraphQL library and schema locations
.graphql-setup-cache (1 hour TTL)Pattern: Use Grep to find schema files instead of globbing
.graphql, .gql extensions (100 tokens)type Query, type Mutation patterns (50 tokens)Pattern: Detect schema health and exit if valid
.graphql-validation-cache with recent validation (50 tokens)Pattern: Use graphql-cli/rover for validation
graphql validate or rover graph check (300 tokens)Pattern: Check only public fields for breaking changes
--full flagPattern: Use predefined patterns for common issues
Pattern: Cache federation graph composition
@apollo/gateway composition results (5 min TTL)Pattern: Find @deprecated directives with Grep
@deprecated in schema files (100 tokens)Typical operation patterns:
Expected per-validation: 1,500-2,500 tokens (50% reduction from 3,000-5,000 baseline) Real-world average: 600 tokens (due to cached validations, early exit, sample-based analysis)
#!/bin/bash
# Detect GraphQL setup
echo "=== GraphQL Project Detection ==="
echo ""
detect_graphql_setup() {
local setup=""
# Check for GraphQL dependencies
if [ -f "package.json" ]; then
if grep -q "\"@apollo/server\"" package.json; then
setup="apollo-server"
elif grep -q "\"apollo-server\"" package.json; then
setup="apollo-server-legacy"
elif grep -q "\"graphql-yoga\"" package.json; then
setup="graphql-yoga"
elif grep -q "\"@graphql-tools\"" package.json; then
setup="graphql-tools"
elif grep -q "\"type-graphql\"" package.json; then
setup="type-graphql"
elif grep -q "\"graphql\"" package.json; then
setup="graphql"
fi
elif [ -f "requirements.txt" ]; then
if grep -q "graphene" requirements.txt; then
setup="graphene"
elif grep -q "strawberry" requirements.txt;
setup=
grep -q requirements.txt;
setup=
}
GRAPHQL_SETUP=$(detect_graphql_setup)
[ -z ];
1
FEDERATION_DETECTED=
[ -f ];
grep -q package.json || grep -q package.json;
FEDERATION_DETECTED=
I'll locate all GraphQL schema files using Grep:
echo ""
echo "=== Discovering GraphQL Schemas ==="
# Find GraphQL schema files
find_schema_files() {
# Look for .graphql, .gql files
GRAPHQL_FILES=$(find . -type f \( -name "*.graphql" -o -name "*.gql" \) \
-not -path "*/node_modules/*" \
-not -path "*/dist/*" \
-not -path "*/.next/*" \
2>/dev/null)
# Also check for schema in TypeScript/JavaScript files
CODE_SCHEMAS=$(grep -r "gql\`\|graphql\`" \
--include="*.ts" --include="*.js" \
--exclude-dir=node_modules \
--exclude-dir=dist \
-l . | head -20)
# Combine results
echo "$GRAPHQL_FILES"
echo "$CODE_SCHEMAS"
}
SCHEMA_FILES=$(find_schema_files)
if [ -z "$SCHEMA_FILES" ]; then
echo "⚠️ No GraphQL schema files found"
echo ""
echo "Expected locations:"
echo " - schema.graphql, schema.gql"
echo " - src/schema/, graphql/"
echo " - Embedded in .ts/.js files using gql\` template literals"
exit 1
fi
SCHEMA_COUNT=$(echo "" | -l)
| -10 | sed
I'll validate the GraphQL schema for errors and issues:
echo ""
echo "=== Validating GraphQL Schema ==="
# Install validation tools if needed
if [ "$GRAPHQL_SETUP" = "apollo-server" ] || [ "$GRAPHQL_SETUP" = "graphql" ]; then
if ! npm list @graphql-tools/schema >/dev/null 2>&1; then
echo "Installing GraphQL validation tools..."
npm install --save-dev @graphql-tools/schema @graphql-tools/utils
fi
fi
# Create validation script
cat > validate-schema.js << 'EOF'
const fs = require('fs');
const { makeExecutableSchema } = require('@graphql-tools/schema');
const { validateSchema } = require('graphql');
// Load all .graphql files
const schemaFiles = process.argv.slice(2);
let typeDefs = '';
schemaFiles.forEach(file => {
if (file.endsWith('.graphql') || file.endsWith('.gql')) {
typeDefs += fs.readFileSync(file, 'utf8') + '\n';
}
});
if (!typeDefs) {
console.error('❌ No schema content found');
process.exit(1);
}
try {
// Build schema
const schema = makeExecutableSchema({ typeDefs });
// Validate schema
const errors = validateSchema(schema);
if (errors.length > 0) {
console.log('❌ Schema validation errors:');
errors.forEach(error => {
console.log(` - ${error.message}`);
});
process.exit(1);
}
console.log('✓ Schema validation passed');
// Analyze schema
const typeMap = schema.getTypeMap();
const types = Object.keys(typeMap).filter(key => !key.startsWith());
console.log();
console.log();
console.log(` Types: `);
const queryType = schema.getQueryType();
(queryType) {
const queryFields = Object.keys(queryType.getFields());
console.log(` Queries: `);
}
const mutationType = schema.getMutationType();
(mutationType) {
const mutationFields = Object.keys(mutationType.getFields());
console.log(` Mutations: `);
}
const subscriptionType = schema.getSubscriptionType();
(subscriptionType) {
const subFields = Object.keys(subscriptionType.getFields());
console.log(` Subscriptions: `);
}
} catch (error) {
console.error(, error.message);
process.exit(1);
}
EOF
GRAPHQL_ONLY=$( | grep -E || )
[ -n ];
node validate-schema.js
-f validate-schema.js
I'll scan for deprecated fields and directives:
echo ""
echo "=== Checking for Deprecated Fields ==="
check_deprecated_fields() {
# Find @deprecated directives
DEPRECATED_FIELDS=$(grep -r "@deprecated" \
--include="*.graphql" --include="*.gql" --include="*.ts" --include="*.js" \
--exclude-dir=node_modules \
-n . 2>/dev/null)
if [ -n "$DEPRECATED_FIELDS" ]; then
echo "⚠️ Deprecated fields found:"
echo "$DEPRECATED_FIELDS" | sed 's/^/ /' | head -10
echo ""
echo "💡 Consider:"
echo " - Document migration paths for deprecated fields"
echo " - Set removal timeline"
echo " - Provide alternative fields"
echo " - Monitor usage before removal"
else
echo "✓ No deprecated fields found"
fi
}
check_deprecated_fields
If federation is detected, I'll analyze federation-specific concerns:
echo ""
echo "=== Federation Analysis ==="
if [ "$FEDERATION_DETECTED" = "true" ]; then
echo "Analyzing Apollo Federation setup..."
echo ""
# Check for federation directives
FED_DIRECTIVES=$(grep -r "@key\|@external\|@requires\|@provides\|@extends" \
--include="*.graphql" --include="*.gql" \
--exclude-dir=node_modules \
. 2>/dev/null)
if [ -n "$FED_DIRECTIVES" ]; then
echo "✓ Federation directives found:"
DIRECTIVE_COUNT=$(echo "$FED_DIRECTIVES" | wc -l)
echo " Total: $DIRECTIVE_COUNT directives"
echo ""
# Count by type
KEY_COUNT=$(echo "$FED_DIRECTIVES" | grep -c "@key" || echo "0")
EXTERNAL_COUNT=$(echo "$FED_DIRECTIVES" | grep -c "@external" || echo "0")
REQUIRES_COUNT=$(echo "$FED_DIRECTIVES" | grep -c "@requires" || )
PROVIDES_COUNT=$( | grep -c || )
I'll provide optimization recommendations:
echo ""
echo "=== Schema Optimization Suggestions ==="
analyze_schema_patterns() {
echo "Analyzing schema patterns..."
echo ""
# Check for N+1 query potential
NESTED_LISTS=$(grep -r "\[.*\].*{" \
--include="*.graphql" --include="*.gql" \
. 2>/dev/null | wc -l)
if [ "$NESTED_LISTS" -gt 5 ]; then
echo "⚠️ Multiple list fields detected ($NESTED_LISTS)"
echo " Risk: N+1 query problems"
echo " Solution: Implement DataLoader for batch fetching"
echo ""
fi
# Check for relay-style pagination
PAGINATION=$(grep -r "pageInfo\|edges\|node\|cursor" \
--include="*.graphql" --include="*.gql" \
. 2>/dev/null)
if [ -z "$PAGINATION" ]; then
echo "💡 Consider Relay-style pagination for large lists:"
echo ""
cat << 'PAGINATION_EXAMPLE'
type UserConnection {
edges: [UserEdge!]!
pageInfo: PageInfo!
}
type UserEdge {
node: User!
cursor: String!
}
type PageInfo {
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}
PAGINATION_EXAMPLE
INPUT_TYPES=$(grep -r \
--include= --include= \
. 2>/dev/null | -l)
[ -lt 2 ];
INTERFACES=$(grep -r \
--include= --include= \
. 2>/dev/null | -l)
[ -eq 0 ];
}
analyze_schema_patterns
I'll create a comprehensive schema analysis report:
echo ""
echo "=== Generating Schema Report ==="
mkdir -p .claude/graphql
cat > .claude/graphql/schema-report.md << EOF
# GraphQL Schema Analysis Report
**Generated:** $(date)
**GraphQL Setup:** $GRAPHQL_SETUP
**Federation:** $FEDERATION_DETECTED
## Schema Files
Total files: $SCHEMA_COUNT
\`\`\`
$SCHEMA_FILES
\`\`\`
## Validation Status
✓ Schema validation passed
## Deprecated Fields
$(if [ -n "$DEPRECATED_FIELDS" ]; then echo "$DEPRECATED_FIELDS"; else echo "None"; fi)
## Federation Analysis
$(if [ "$FEDERATION_DETECTED" = "true" ]; then
echo "Federation directives in use"
else
echo "Federation not enabled"
fi)
## Optimization Recommendations
1. **DataLoader Implementation**
- Batch and cache database queries
- Prevent N+1 query problems
- Reduce database load
2. **Pagination Strategy**
- Use Relay-style cursor pagination for large datasets
- Implement proper pageInfo types
- Support both forward and backward pagination
3. **Error Handling**
- Use custom error types
- Provide meaningful error messages
- Include error codes for client handling
4. **Performance**
- Implement query complexity analysis
- Set max query depth limits
- Use persisted queries in production
5. **Security**
- Disable introspection in production
- Implement rate limiting
- Validate and sanitize inputs
## Next Steps
- [ ] Address deprecated field migration
- [ ] Implement DataLoader for batch fetching
- [ ] Add pagination to large lists
- [ ] Review and test federation setup
- [ ] Add query complexity analysis
- [ ] Set up schema monitoring
## Resources
- [GraphQL Best Practices](https://graphql.org/learn/best-practices/)
- [Apollo Federation Guide](https://www.apollographql.com/docs/federation/)
- [DataLoader Documentation](https://github.com/graphql/dataloader)
EOF
echo "✓ Created .claude/graphql/schema-report.md"
echo ""
echo "=== ✓ GraphQL Schema Analysis Complete ==="
echo ""
echo "📊 Analysis Results:"
echo " GraphQL Setup: $GRAPHQL_SETUP"
echo " Schema Files: $SCHEMA_COUNT"
echo " Federation: $FEDERATION_DETECTED"
echo ""
echo "📁 Generated files:"
echo " - .claude/graphql/schema-report.md # Comprehensive analysis"
echo ""
echo "🔍 Key Findings:"
echo " - Schema validation status: PASSED"
echo " - Deprecated fields: $(echo "$DEPRECATED_FIELDS" | wc -l)"
echo " - Optimization suggestions: See report"
echo ""
echo "🚀 Recommended Actions:"
echo ""
echo "1. Review schema report:"
echo " cat .claude/graphql/schema-report.md"
echo ""
echo "2. Address deprecated fields:"
echo " - Document migration paths"
Schema Design:
Performance:
Federation:
Security:
Credits: GraphQL patterns based on GraphQL specification, Apollo Federation documentation, and best practices from the GraphQL community. Schema analysis methodology adapted from Apollo Studio and GraphQL Inspector tools.