Skip to content

Batteries-included TypeScript starter with strict testing, security scanning, and AI-assisted development workflow. Built for modern Node.js with automated CI/CD.

License

Notifications You must be signed in to change notification settings

sapientpants/agentic-node-ts-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Agentic Node + TypeScript Starter

A batteries-included TypeScript starter template with comprehensive testing, code quality automation, and security scanning. Built for modern Node.js development with AI-assisted (agentic) coding workflow.

Note: This template includes example code to demonstrate its capabilities. These example files are clearly marked with header comments and should be removed when starting your project. See Getting Started for details.

πŸ€” What is Agentic Development?

"Agentic" in this context refers to AI-assisted development workflow, not AI agent runtime. This template is designed to work seamlessly with AI development tools like Claude Code to enhance your productivity through:

  • πŸ€– AI-powered code generation - Let AI assistants help write boilerplate and tests
  • πŸ”„ Automated refactoring - AI tools can safely refactor with comprehensive test coverage
  • πŸ“ Documentation assistance - AI can help maintain docs in sync with code
  • 🎯 Issue-to-implementation workflows - Custom commands for AI-driven development

Important: This is a template repository for starting new projects. No AI agents or chatbots are included - the "agentic" aspect comes from using AI development tools (like Claude) to assist you in building your application faster and with higher quality.

πŸ› οΈ Tech Stack

Core: Node.js 22+ β€’ TypeScript ^5.9.2 (strict) β€’ pnpm 10.15
Testing: Vitest β€’ fast-check (property testing) β€’ 80% coverage minimum
Quality: ESLint 9 β€’ Prettier β€’ Husky β€’ Commitlint
Security: CodeQL β€’ OSV Scanner β€’ SBOM β€’ SLSA attestations
CI/CD: GitHub Actions β€’ Changesets β€’ Automated releases

πŸ“– Documentation

Full Documentation β†’

πŸš€ Quick Start

# Clone and setup
git clone https://github.com/sapientpants/agentic-node-ts-starter.git my-project
cd my-project

# Install dependencies (requires Node.js 22+ and pnpm 10.15)
pnpm install

# Set up configuration (required)
cp .env.example .env
# Edit .env with your configuration
# See docs/CONFIG.md for required environment variables

# Verify everything works
pnpm test
pnpm verify  # Full quality check

# Start developing
pnpm dev     # TypeScript watch mode

Prerequisites: Node.js 22+, pnpm 10.15, GitHub repo (for CI/CD)
Full setup guide: docs/GETTING_STARTED.md

πŸ“š Key Commands

# Development
pnpm dev          # TypeScript watch mode
pnpm build        # Build to dist/
pnpm verify       # Run all quality checks

# Testing (80% coverage required)
pnpm test         # Run tests
pnpm test:watch   # Watch mode
pnpm test:coverage # With coverage report

# Quality
pnpm lint         # Check linting
pnpm lint:fix     # Fix linting issues
pnpm format       # Check formatting
pnpm format:fix   # Fix formatting
pnpm typecheck    # Type check only

# Releases
pnpm changeset    # Create changeset
pnpm sbom         # Generate SBOM

Full command reference: docs/DEVELOPMENT.md

πŸ€– Claude Code Integration

This project includes special configurations for Claude Code:

Custom Commands

  • /analyze-and-fix-github-issue - Complete workflow for fixing GitHub issues
  • /release - Automated release process
  • /update-dependencies - Update dependencies with PR workflow

Git Hooks

  • Prevents bypassing verification with --no-verify flag
  • Ensures all commits pass quality checks

See CLAUDE.md for detailed Claude Code guidance.

πŸ“ Project Structure

.
β”œβ”€β”€ .claude/           # Claude Code configurations
β”‚   β”œβ”€β”€ commands/      # Custom slash commands
β”‚   └── hooks/         # Git hook scripts
β”œβ”€β”€ .github/           # GitHub Actions workflows
β”œβ”€β”€ docs/              # Documentation
β”œβ”€β”€ src/               # Source code
β”œβ”€β”€ tests/             # Test files
β”‚   β”œβ”€β”€ *.spec.ts      # Unit tests
β”‚   └── *.property.spec.ts # Property-based tests
β”œβ”€β”€ mise.toml          # Tool version management
β”œβ”€β”€ package.json       # Dependencies and scripts
└── tsconfig.json      # TypeScript configuration

πŸ”„ Features

Configuration & Environment

  • πŸ” Type-safe configuration with Zod validation
  • πŸ”Œ Configurable logging output - Redirect logs to stderr, files, syslog, or disable entirely (see docs/LOGGING_OUTPUT.md)
  • πŸ” Environment validation at startup with clear errors
  • πŸ” Sensitive value masking in error messages
  • πŸ“ See docs/CONFIG.md for configuration guide

Testing & Quality

  • βœ… Vitest with property-based testing (fast-check)
  • βœ… 80% coverage minimum enforced
  • βœ… Strict TypeScript with type-aware linting
  • βœ… Pre-commit hooks with Husky & lint-staged
  • βœ… Markdown and YAML linting for docs/config consistency

Security & Supply Chain

  • πŸ”’ CodeQL static analysis
  • πŸ”’ OSV Scanner for dependencies
  • πŸ”’ SBOM generation (CycloneDX)
  • πŸ”’ SLSA attestations for artifacts

Automation

  • πŸš€ GitHub Actions CI/CD pipeline
  • πŸš€ Changesets for versioning
  • πŸš€ Automated releases with changelog
  • πŸš€ Claude Code integration

βš™οΈ Required Setup

GitHub Repository Settings

Actions permissions (Settings β†’ Actions β†’ General):

  • βœ… Read and write permissions
  • βœ… Allow GitHub Actions to create and approve pull requests

Auto-merge (Settings β†’ General β†’ Pull Requests):

  • βœ… Allow auto-merge
  • βœ… Automatically delete head branches

For automated releases, add secrets:

  • RELEASE_TOKEN - GitHub PAT with repo/workflow scopes (triggers publish workflow)
  • NPM_TOKEN - For npm publishing (optional)

πŸ“¦ Release Distribution Setup

NPM Publishing

To enable npm publishing:

  1. Add NPM_TOKEN secret in repository settings
  2. Remove "private": true from package.json
  3. Use a scoped package name: @yourorg/package-name

Docker Publishing

⚠️ Important: The default Dockerfile includes a healthcheck that expects a web server with a /health endpoint on port 3000. See Docker Configuration Guide for detailed instructions on configuring healthchecks for different application types (web services, CLI tools, workers).

To enable Docker builds:

  1. Set repository variable ENABLE_DOCKER_RELEASE to true
  2. Add secrets for Docker Hub (optional):
    • DOCKERHUB_USERNAME
    • DOCKERHUB_TOKEN
  3. Images are automatically pushed to GitHub Container Registry

πŸ”’ Security Features

  • Dependency Auditing: Critical vulnerability checks on every CI run
  • SBOM Generation: CycloneDX format for supply chain transparency
  • CodeQL Analysis: Static security analysis
  • OSV Scanning: Open Source Vulnerability detection
  • SLSA Provenance: Build attestations
  • Container Attestations: SBOM and provenance for Docker images

πŸ“š Additional Resources

πŸ“„ License

This is a template repository. Feel free to use it for your projects.

About

Batteries-included TypeScript starter with strict testing, security scanning, and AI-assisted development workflow. Built for modern Node.js with automated CI/CD.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Contributors 5