Comprehensive developer toolkit providing reusable skills for Java/Spring Boot, TypeScript/NestJS/React/Next.js, Python, PHP, AWS CloudFormation, AI/RAG, DevOps, and more.
90
90%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Risky
Do not use without reviewing
Optimization strategies and performance characteristics for Knowledge Graph operations.
Time Complexity:
Typical Performance:
| KG Size | Read Time | Query Time |
|---|---|---|
| < 100 KB | < 10ms | < 5ms |
| 100-500 KB | 10-50ms | 5-20ms |
| 500 KB - 1 MB | 50-200ms | 20-100ms |
| > 1 MB | > 200ms | > 100ms |
Optimization:
Time Complexity:
Typical Performance:
| Update Size | Write Time |
|---|---|
| < 10 KB | < 50ms |
| 10-50 KB | 50-200ms |
| 50-100 KB | 200-500ms |
| > 100 KB | > 500ms |
Optimization:
Time Complexity:
Typical Performance:
| Validation Type | Time |
|---|---|
| Component validation (10 items) | < 20ms |
| API validation (5 items) | < 15ms |
| Contract validation (5 files) | < 100ms |
| Full validation (100 items) | < 500ms |
Optimization:
Time Complexity:
Typical Performance:
| Files | Total Size | Time |
|---|---|---|
| 1-5 files | < 100 KB | < 100ms |
| 5-20 files | 100-500 KB | 100-500ms |
| 20-50 files | 500 KB - 1 MB | 500ms-2s |
| > 50 files | > 1 MB | > 2s |
Optimization:
Strategy: Only load KG when explicitly requested.
Implementation:
read-knowledge-graph calledBenefit: Reduces memory usage and I/O for operations that don't need KG.
Example:
# Bad: Load KG on skill init
class KnowledgeGraphSkill:
def __init__(self):
self.kg = self.load_kg() # Always loads
# Good: Load on demand
class KnowledgeGraphSkill:
def read(self, path):
return self.load_kg(path) # Only loads when calledStrategy: Merge changes, don't rewrite entire file.
Implementation:
Benefit: Reduces I/O for small updates.
Example:
# Bad: Replace entire KG
def update(path, updates):
kg = {"metadata": {}, ...} # New empty KG
kg.update(updates) # Only updates
write(path, kg) # Writes everything
# Good: Merge into existing
def update(path, updates):
kg = read(path) # Read existing
merged = deep_merge(kg, updates) # Merge
write(path, merged) # Write mergedStrategy: Check timestamp, re-explore if KG is stale.
Freshness thresholds:
Implementation:
def is_kg_fresh(kg_path):
kg = read_kg(kg_path)
if not kg['metadata']['updated_at']:
return False
updated = datetime.fromisoformat(kg['metadata']['updated_at'])
age = (datetime.now() - updated).days
if age < 7:
return True # Fresh
elif age < 30:
logger.warning(f"KG is {age} days old, consider updating")
return True # Still usable
else:
logger.error(f"KG is very stale ({age} days)")
return False # Should regenerateBenefit: Prevents using outdated analysis.
Strategy: Monitor KG size, split if too large.
Thresholds:
Implementation:
def check_kg_size(kg_path):
size_kb = os.path.getsize(kg_path) / 1024
if size_kb > 1024: # > 1 MB
logger.warning(f"KG is large ({size_kb:.0f} KB), consider splitting")
return False
return TrueSplitting strategy:
Strategy: Don't keep KG in memory when not needed.
Implementation:
Example:
# Bad: Keep KG in memory
class KnowledgeGraphSkill:
def __init__(self):
self.cached_kg = None
def get_kg(self, path):
if not self.cached_kg:
self.cached_kg = load(path)
return self.cached_kg
# Good: Load on demand, don't cache
class KnowledgeGraphSkill:
def get_kg(self, path):
return load(path) # Always freshStrategy: Use parallel operations for independent tasks.
Use cases:
Implementation:
from concurrent.futures import ThreadPoolExecutor
def extract_provides_parallel(files):
with ThreadPoolExecutor(max_workers=4) as executor:
results = executor.map(extract_provides, files)
return list(results)Benefit: Reduces wall-clock time for multi-file operations.
| Metric | How to Measure | Target |
|---|---|---|
| Read latency | Time from request to parsed KG | < 100ms |
| Write latency | Time from update to disk write | < 500ms |
| Query latency | Time for filtered query | < 50ms |
| Validation time | Time for full validation | < 1s |
| File size | KB on disk | < 1000 KB |
| Cache hit rate | Queries served from cache | > 80% |
import time
from functools import wraps
def timed(operation):
@wraps(operation)
def wrapper(*args, **kwargs):
start = time.time()
result = operation(*args, **kwargs)
elapsed = (time.time() - start) * 1000 # ms
logger.info(f"{operation.__name__} took {elapsed:.0f}ms")
return result
return wrapper
@timed
def read_knowledge_graph(path):
# ... implementation
pass| Need | Best Operation |
|---|---|
| Get everything | read-knowledge-graph |
| Get specific items | query-knowledge-graph |
| Add findings | update-knowledge-graph |
| Check dependencies | validate-against-knowledge-graph |
| Get what code provides | extract-provides |
Bad:
for component in components:
kg = query_kg(path, "components", component) # N readsGood:
kg = read_kg(path) # 1 read
for component in components:
result = find_in_kg(kg, component) # Memory lookupToo coarse: Read entire KG for one component (slow) Too fine: Query KG 100 times for 100 components (slow) Just right: Read KG once, filter in memory
Don't guess, measure:
import cProfile
def profile_operation():
cProfile.run('knowledge_graph.update(path, data)')# Bad: Read KG in a loop
for component in components:
kg = read_kg(path) # N reads
process(kg, component)# Good: Read once, process many
kg = read_kg(path) # 1 read
for component in components:
process(kg, component) # Memory operations# Bad: Write after every small update
for item in items:
update_kg(path, item) # N writes# Good: Collect updates, write once
updates = collect_updates(items)
update_kg(path, updates) # 1 write# Bad: Check file existence every time
def validate(file_path):
if not os.path.exists(file_path): # System call
raise Error(f"File not found: {file_path}")# Good: Cache existence checks
_file_cache = {}
def validate(file_path):
if file_path not in _file_cache:
_file_cache[file_path] = os.path.exists(file_path)
if not _file_cache[file_path]:
raise Error(f"File not found: {file_path}")Symptoms:
Solutions:
# Instead of one large KG:
docs/specs/001-feature/knowledge-graph.json # 2 MB
# Split into feature-specific KGs:
docs/specs/001-feature/kg-auth.json # 300 KB
docs/specs/001-feature/kg-database.json # 400 KB
docs/specs/001-feature/kg-api.json # 500 KBUse aggregate-knowledge-graphs to create project-wide summary:
# Creates: docs/specs/.global-knowledge-graph.json
# Contains: Patterns and conventions from all specs
# Updates: Run periodically (daily/weekly)Target performance:
Key performance principles:
Performance targets:
When to optimize:
docs
plugins
developer-kit-ai
developer-kit-aws
agents
docs
skills
aws
aws-cli-beast
aws-cost-optimization
aws-drawio-architecture-diagrams
aws-sam-bootstrap
aws-cloudformation
aws-cloudformation-auto-scaling
aws-cloudformation-bedrock
aws-cloudformation-cloudfront
aws-cloudformation-cloudwatch
aws-cloudformation-dynamodb
aws-cloudformation-ec2
aws-cloudformation-ecs
aws-cloudformation-elasticache
references
aws-cloudformation-iam
references
aws-cloudformation-lambda
aws-cloudformation-rds
aws-cloudformation-s3
aws-cloudformation-security
aws-cloudformation-task-ecs-deploy-gh
aws-cloudformation-vpc
references
developer-kit-core
agents
commands
skills
developer-kit-devops
developer-kit-java
agents
commands
docs
skills
aws-lambda-java-integration
aws-rds-spring-boot-integration
aws-sdk-java-v2-bedrock
aws-sdk-java-v2-core
aws-sdk-java-v2-dynamodb
aws-sdk-java-v2-kms
aws-sdk-java-v2-lambda
aws-sdk-java-v2-messaging
aws-sdk-java-v2-rds
aws-sdk-java-v2-s3
aws-sdk-java-v2-secrets-manager
clean-architecture
graalvm-native-image
langchain4j-ai-services-patterns
references
langchain4j-mcp-server-patterns
references
langchain4j-rag-implementation-patterns
references
langchain4j-spring-boot-integration
langchain4j-testing-strategies
langchain4j-tool-function-calling-patterns
langchain4j-vector-stores-configuration
references
qdrant
references
spring-ai-mcp-server-patterns
spring-boot-actuator
spring-boot-cache
spring-boot-crud-patterns
spring-boot-dependency-injection
spring-boot-event-driven-patterns
spring-boot-openapi-documentation
spring-boot-project-creator
spring-boot-resilience4j
spring-boot-rest-api-standards
spring-boot-saga-pattern
spring-boot-security-jwt
assets
references
scripts
spring-boot-test-patterns
spring-data-jpa
references
spring-data-neo4j
references
unit-test-application-events
unit-test-bean-validation
unit-test-boundary-conditions
unit-test-caching
unit-test-config-properties
references
unit-test-controller-layer
unit-test-exception-handler
references
unit-test-json-serialization
unit-test-mapper-converter
references
unit-test-parameterized
unit-test-scheduled-async
references
unit-test-service-layer
references
unit-test-utility-methods
unit-test-wiremock-rest-api
references
developer-kit-php
developer-kit-project-management
developer-kit-python
developer-kit-specs
commands
docs
hooks
test-templates
tests
skills
developer-kit-tools
developer-kit-typescript
agents
docs
hooks
rules
skills
aws-cdk
aws-lambda-typescript-integration
better-auth
clean-architecture
drizzle-orm-patterns
dynamodb-toolbox-patterns
references
nestjs
nestjs-best-practices
nestjs-code-review
nestjs-drizzle-crud-generator
nextjs-app-router
nextjs-authentication
nextjs-code-review
nextjs-data-fetching
nextjs-deployment
nextjs-performance
nx-monorepo
react-code-review
react-patterns
shadcn-ui
tailwind-css-patterns
tailwind-design-system
references
turborepo-monorepo
typescript-docs
typescript-security-review
zod-validation-utilities
references
github-spec-kit