Imported from aiiware/aii-leetcode (
AGENTS.md). Install upstream withnpx skills add aiiware/aii-leetcode. Copyright stays with the author.
leetcode
Project Overview
This is a LeetCode solutions repository written in Go. The project organizes coding challenge solutions by algorithm and data structure categories (e.g., arrays, graphs, dynamic programming). It includes command-line entrypoints, utilities, documentation, and build scripts.
Directory Structure
cmd/ — Command entrypoints (Go)
docs/ — Documentation
scripts/ — Build and utility scripts
utils/ — Utility functions
advanced-algorithms/
arrays/
benchmarks/
data/
data_structures/
design/
dp/
explanations/
graphs/
indexes/
linked-lists/
File Patterns
- Source Files: Primarily use
.goextension (552 files). A small number of.pyfiles (15) are present. - Test Files: Follow the Go convention
*_test.go(e.g.,handler_test.go). - Naming: Files and directories predominantly use
snake_case. - Organization: Solutions are grouped into thematic directories like
arrays/,graphs/,dp/, etc.
Core Commands
- Build:
go build ./... - Test:
go test ./...
Git Conventions
- Convention: Conventional Commits.
- Default Branch:
main. - Common Commit Types & Scopes:
feat: (test, leetcode, design, graphs, benchmarks)refactor: (organization, test, leetcode, tests, graph)docs: (plan, agents, readme)fix: (organization, reorganization, bit-manipulation, algorithm, binary)test: (binary-tree, leetcode)chore: (gitignore)
Example Commit Messages:
feat(test): add comprehensive test suite for length of last word algorithmdocs(plan): implement Phase 2 documentation system with templates and category overviewsfix(organization): Fix build issues and update documentationrefactor(organization): Refactor folder structure for better organizationtest(binary-tree): simplify test case tree representations
Coding Standards
- Language: Go.
- Linting/Testing: Uses the standard Go toolchain (
go test,go build). - File Naming: Adheres to Go conventions: lowercase, snake_case for multi-word names, with
_test.gosuffix for test files. - Structure: Solution code is organized into packages by category (e.g.,
arrays/,dp/). Thecmd/directory contains application entry points.
Safety Rules
- Do NOT modify:
- The
go.modandgo.sumfiles without explicit approval. - Any existing
AGENTS.mdor other instruction files. - The
LICENSEfile. - CI/CD configuration files (if any are added in the future).
- The
- Require confirmation for:
- Any changes to the root-level directory structure (e.g., moving
cmd/,utils/). - Modifying the
scripts/directory, as these may affect builds. - Deleting or significantly refactoring entire solution categories.
- Any changes to the root-level directory structure (e.g., moving
Permissions
- Allowed without prompt:
- Adding new solution files within existing category directories (e.g.,
arrays/,graphs/). - Updating documentation in
docs/. - Creating or updating Go test files (
*_test.go). - Making minor refactors within a single file or package.
- Adding new solution files within existing category directories (e.g.,
- Requires confirmation:
- Creating new top-level directories.
- Modifying files in
cmd/orutils/. - Running commands that affect dependencies (
go get,go mod tidy). - Changing the project's
AGENTS.mdfile.
- Never allowed:
- Modifying
go.modorgo.sumlock files. - Deleting the
LICENSEfile. - Changing the Git commit convention.
- Modifying
Generated by Aii CLI /init command with LLM enhancement (~961 tokens, 86 lines)