Comprehensive developer toolkit providing reusable skills for Java/Spring Boot, TypeScript/NestJS/React/Next.js, Python, PHP, AWS CloudFormation, AI/RAG, DevOps, and more.
89
89%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Risky
Do not use without reviewing
#!/usr/bin/env python3
"""TypeScript Rules Verifier Hook.
Fires before Claude generates its next response. Reads the pending-verification
state written by ts-rules-tracker.py and injects an explicit verification
directive so Claude actively checks each written file against the matching
project rules — and fixes any violations before continuing.
Hook event: Prompt
Input: JSON via stdin { "prompt": "...", ... }
Output: Exit 0 = nothing pending | Exit 1 = inject verification directive to Claude
Zero external dependencies — pure Python 3 standard library only.
"""
import hashlib
import json
import os
import sys
from pathlib import Path
from typing import Optional
# Must match ts-rules-tracker.py
_STATE_FILENAME_PREFIX = ".ts-rules-pending-"
# ─── State File ───────────────────────────────────────────────────────────────
def _session_key() -> str:
cwd = os.environ.get("CLAUDE_CWD", os.getcwd())
return hashlib.sha256(cwd.encode()).hexdigest()[:12]
def _state_path() -> Path:
cwd = Path(os.environ.get("CLAUDE_CWD", os.getcwd()))
state_dir = cwd / ".claude"
state_dir.mkdir(parents=True, exist_ok=True)
return state_dir / f"{_STATE_FILENAME_PREFIX}{_session_key()}.json"
def _consume_state() -> list[dict]:
"""Read and delete the pending-verification state."""
sp = _state_path()
if not sp.exists():
return []
try:
entries = json.loads(sp.read_text(encoding="utf-8"))
sp.unlink(missing_ok=True)
return entries
except Exception:
return []
# ─── Prompt Builder ───────────────────────────────────────────────────────────
def _build_directive(entries: list[dict]) -> str:
"""Build the verification directive injected into Claude's context."""
lines: list[str] = [
"## Project Rules Verification — Action Required",
"",
"You have written the following TypeScript file(s) this session.",
"Before responding to the user, **verify each file against its matching",
"project rules** (listed below). If any violation is found, **fix the file",
"immediately** using the Write tool, then confirm what was corrected.",
"",
]
for entry in entries:
written = entry.get("written_file", "")
rules: list[dict] = entry.get("rules", [])
lines.append(f"### File: `{Path(written).name}` (`{written}`)")
lines.append("")
for rule in rules:
lines.append(f"#### Rule: {rule.get('title', rule.get('file', ''))}")
lines.append(rule.get("body", ""))
lines.append("")
lines += [
"---",
"After verifying (and fixing if needed), continue with the user's request.",
]
return "\n".join(lines)
# ─── Entry Point ─────────────────────────────────────────────────────────────
def main() -> None:
try:
json.load(sys.stdin) # consume input
except (json.JSONDecodeError, ValueError):
pass
entries = _consume_state()
if not entries:
sys.exit(0)
directive = _build_directive(entries)
# Output JSON format required by Claude Code hooks
output = {
"hookSpecificOutput": {
"hookEventName": "UserPromptSubmit",
"additionalContext": directive
}
}
print(json.dumps(output))
sys.exit(0)
if __name__ == "__main__":
main()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