From b3bb5877273b05bdd0994dd1a60876b6817c065f Mon Sep 17 00:00:00 2001 From: leonrxy Date: Mon, 13 Jul 2026 02:51:18 +0000 Subject: [PATCH] docs: update project structure diagram to match codebase Update CONTRIBUTING.md project structure to include all files: - Add git/hook.ts to git/ section - Add individual command files (completion.ts, config.ts) - Add individual provider files - Match AGENTS.md architecture reference Closes #220 --- CONTRIBUTING.md | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a0753ca..bc3111c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,14 +34,34 @@ ``` src/ -├── index.ts # CLI entry point (Commander) -├── types.ts # Shared types -├── commands/ # Command implementations (init, suggest, history, completion, batch) -├── config/ # Config persistence -├── git/ # Git operations (diff) -├── history/ # History JSONL + style learner -├── llm/ # Prompt builder + API client -└── providers/ # LLM provider adapters +├── index.ts # CLI entry point (Commander) — registers all commands +├── types.ts # Shared TypeScript interfaces (Config, Provider, Suggestion, etc.) +├── commands/ +│ ├── init.ts # Interactive setup wizard (clack/prompts) — provider, model, API key +│ ├── suggest.ts # Core suggestion flow: diff → LLM → display → optional commit +│ ├── history.ts # View learned style profile and recent commit history +│ ├── config.ts # View current config +│ ├── batch.ts # Process multiple git repos in batch mode +│ └── completion.ts # Generate shell completion scripts (bash, zsh, fish) +├── providers/ +│ ├── index.ts # Provider factory: createProvider(), complete(), completeStream(), fetchModels() +│ ├── registry.ts # BUILTIN_PROVIDERS array (OpenAI, Anthropic, Google, Mistral, etc.) +│ ├── openai-compatible.ts # Default adapter for OpenAI-compatible APIs (most providers) +│ ├── anthropic.ts # Anthropic-specific adapter (Messages API) +│ ├── cohere.ts # Cohere-specific adapter +│ ├── example.ts # No-op example provider for testing +│ ├── request.ts # Shared HTTP request helpers +│ └── sse.ts # Server-Sent Events streaming parser +├── llm/ +│ ├── client.ts # generateSuggestions() — orchestrates config → prompt → LLM → parse +│ └── prompt.ts # buildSystemPrompt(), buildUserPrompt(), template vars, diff truncation +├── git/ +│ ├── diff.ts # Git ops: getStagedDiff(), getUnstagedDiff(), commit(), checkGitRepo() +│ └── hook.ts # Git hook management: prepare-commit-msg, post-commit +├── history/ +│ └── store.ts # JSONL history: loadEntries(), appendEntry(), buildProfile(), formatProfile() +└── config/ + └── store.ts # Config persistence: loadConfig(), saveConfig(), env var overrides ``` ## Code Conventions