API Reference
API Reference
Section titled “API Reference”This reference provides comprehensive documentation for all agent-init commands, configuration options, and templates.
Makefile Commands
Section titled “Makefile Commands”The Makefile provides automation for common development tasks. All commands should be run from the project root.
Development Commands
Section titled “Development Commands”make dev
Section titled “make dev”Starts the development environment.
Usage:
make dev
Environment Variables:
PORT
: Server port (default: 3000)ENV
: Environment mode (default: development)
make build
Section titled “make build”Builds the project for production.
Usage:
make build
Options:
TARGET
: Build target (default: dist)MINIFY
: Enable minification (default: true)
make test
Section titled “make test”Runs the test suite.
Usage:
make test [ARGS]
Arguments:
ARGS
: Additional test runner arguments--coverage
: Generate coverage report--watch
: Run tests in watch mode
make lint
Section titled “make lint”Runs code quality checks.
Usage:
make lint
Checks:
- Code formatting
- Type checking (if applicable)
- Style guide compliance
Session Management
Section titled “Session Management”make session-start
Section titled “make session-start”Begins a new development session.
Usage:
make session-start
Actions:
- Creates session entry in CLAUDE.md
- Prompts for session goals
- Initializes development environment
- Creates session branch (optional)
make session-end
Section titled “make session-end”Ends the current development session.
Usage:
make session-end
Actions:
- Updates session tracking
- Runs quality checks
- Creates session summary
- Commits session notes
Changelog Management
Section titled “Changelog Management”make changelog-prepare
Section titled “make changelog-prepare”Prepares changelog for a new release.
Usage:
make changelog-prepare VERSION=x.y.z
Parameters:
VERSION
: Target version number (required)
Example:
make changelog-prepare VERSION=1.2.0
make changelog-release
Section titled “make changelog-release”Finalizes changelog for release.
Usage:
make changelog-release
Actions:
- Updates version in CHANGELOG.md
- Sets release date
- Creates git tag
- Commits changes
Git Workflow
Section titled “Git Workflow”make issue
Section titled “make issue”Creates a new GitHub issue.
Usage:
make issue
Interactive prompts for:
- Issue title
- Issue type (bug, feature, chore)
- Description
- Labels
make pr
Section titled “make pr”Creates a pull request.
Usage:
make pr
Requirements:
- Clean working directory
- Current branch != main
- All tests passing
Configuration Files
Section titled “Configuration Files”CLAUDE.md Structure
Section titled “CLAUDE.md Structure”The CLAUDE.md file uses the following structure:
# Project Name
## Overview[Project description and context]
## Current Session- **Date**: YYYY-MM-DD- **Goals**: - [ ] Goal 1 - [ ] Goal 2- **Branch**: feature/description
## Session History[Previous sessions documentation]
## Issues- [ ] #123: Issue description- [x] #122: Completed issue
## Key Decisions[Architecture and design decisions]
## External Repositories[Git submodules documentation]
.gitignore Patterns
Section titled “.gitignore Patterns”Standard patterns included:
# Dependenciesnode_modules/vendor/external/*/
# Build outputsdist/build/*.o*.so
# IDE files.vscode/.idea/*.swp
# Environment.env.env.local
# OS files.DS_StoreThumbs.db
# Logs*.loglogs/
# Testingcoverage/.coverage
Makefile Variables
Section titled “Makefile Variables”Common variables you can override:
# DevelopmentPORT ?= 3000ENV ?= development
# BuildBUILD_DIR ?= distSOURCE_DIR ?= src
# TestingTEST_DIR ?= testsCOVERAGE_DIR ?= coverage
# ToolsPYTHON ?= python3NODE ?= node
Template Files
Section titled “Template Files”Issue Template
Section titled “Issue Template”## Description[Clear description of the issue]
## Expected Behavior[What should happen]
## Current Behavior[What actually happens]
## Steps to Reproduce1. Step one2. Step two3. Step three
## Environment- OS: [e.g., macOS 12.0]- Version: [e.g., 1.0.0]
PR Template
Section titled “PR Template”## Description[Summary of changes]
## Related IssuesFixes #123
## Type of Change- [ ] Bug fix- [ ] New feature- [ ] Breaking change- [ ] Documentation update
## Testing- [ ] Unit tests pass- [ ] Integration tests pass- [ ] Manual testing completed
## Checklist- [ ] Code follows style guidelines- [ ] Self-review completed- [ ] Documentation updated- [ ] Tests added/updated
Environment Variables
Section titled “Environment Variables”Required Variables
Section titled “Required Variables”Variable | Description | Default |
---|---|---|
PROJECT_NAME | Project identifier | (required) |
GIT_REMOTE | Git remote URL | (required) |
Optional Variables
Section titled “Optional Variables”Variable | Description | Default |
---|---|---|
CLAUDE_SESSION | Current session ID | (auto-generated) |
DEBUG | Enable debug output | false |
CI | Continuous integration mode | false |
COVERAGE_THRESHOLD | Minimum test coverage | 80 |
Error Codes
Section titled “Error Codes”Code | Description | Resolution |
---|---|---|
1 | General error | Check error message |
2 | Missing dependency | Install required tools |
3 | Test failure | Fix failing tests |
4 | Lint error | Fix code style issues |
5 | Build failure | Check build configuration |
10 | Git error | Check git status |
11 | No active session | Run make session-start |
12 | Uncommitted changes | Commit or stash changes |
Advanced Usage
Section titled “Advanced Usage”Custom Hooks
Section titled “Custom Hooks”Create custom pre/post hooks for commands:
pre-test: @echo "Running pre-test setup..."
post-build: @echo "Running post-build cleanup..."
Extending Commands
Section titled “Extending Commands”Add project-specific commands:
# Custom command.PHONY: deploydeploy: build test @echo "Deploying to production..." # Your deployment logic