diff --git a/README.md b/README.md index 2ee8fb0..8c0c4ec 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,8 @@ grokkit version - [chat](#-grokkit-chat) - [query](#-grokkit-query) - [edit](#-grokkit-edit-file-instruction) - - [commit / commitmsg](#-grokkit-commitmsg) + - [commit-msg](#-grokkit-commit-msg) + - [commit](#-grokkit-commit) - [review](#-grokkit-review) - [pr-describe](#-grokkit-pr-describe) - [history](#-grokkit-history) @@ -48,6 +49,8 @@ grokkit version - [lint](#-grokkit-lint-file) - [docs](#-grokkit-docs-file) - [testgen](#-grokkit-testgen) + - [scaffold](#-grokkit-scaffold-file-description) + - [recipe](#-grokkit-recipe-run-recipe) - [agent](#-grokkit-agent) - [Configuration](#configuration) - [Workflows](#workflows) @@ -114,13 +117,13 @@ grokkit edit utils.go "add detailed docstrings to all exported functions" - Requires confirmation before applying - Uses silent streaming (no console spam) -### ๐Ÿ“ `grokkit commitmsg` +### ๐Ÿ“ `grokkit commit-msg` Generate conventional commit messages from staged changes. ```bash git add . -grokkit commitmsg # Generate message only -grokkit commitmsg -m grok-4 # Use specific model +grokkit commit-msg # Generate message only +grokkit commit-msg -m grok-4 # Use specific model ``` Output format: `type(scope): subject\n\nbody` @@ -158,9 +161,12 @@ Output includes: Generate comprehensive PR descriptions. ```bash -# From current branch vs main +# From current branch vs master grokkit pr-describe +# Compare against a specific base branch +grokkit pr-describe --base main + # With specific model grokkit pr-describe -m grok-4 ``` @@ -231,27 +237,70 @@ grokkit docs app.py -m grok-4 - Requires confirmation (unless `--auto-apply`) ### ๐Ÿงช `grokkit testgen PATHS...` - + **Description**: Generate comprehensive unit tests for Go/Python/C/C++ files using AI. - + **Benefits**: - Go: Table-driven `t.Parallel()` matching codebase. - Python: Pytest with `@parametrize`. - C: Check framework suites. - C++: Google Test `EXPECT_*`. - Boosts coverage; safe preview. - + **CLI examples**: ```bash grokkit testgen internal/grok/client.go grokkit testgen app.py --yes grokkit testgen foo.c bar.cpp ``` - + **Safety features**: - Lang detection via `internal/linter`. - Unified diff preview. - Y/N (--yes auto). + +### ๐Ÿ—๏ธ `grokkit scaffold FILE "DESCRIPTION"` + +**Description**: Scaffold a new file with Grok using project context for style matching. + +**CLI examples**: +```bash +# Basic usage +grokkit scaffold internal/git/utils.go "git wrapper for listing tags" + +# Scaffold with a basic test file +grokkit scaffold app.py "Flask route for health checks" --with-tests + +# Preview without writing +grokkit scaffold main.go "simple CLI entrypoint" --dry-run +``` + +**Features**: +- Project context harvesting (siblings/style matching). +- Optional test generation (`--with-tests`). +- Safety checks (won't overwrite without `--force`). +- Language detection and overrides (`--lang`). + +### ๐Ÿ‘จโ€๐Ÿณ `grokkit recipe run [name|path]` + +**Description**: Execute transactional "recipes" for complex, multi-step AI workflows. + +**CLI examples**: +```bash +# Run a project-local recipe +grokkit recipe run result-refactor + +# Pass parameters to the recipe +grokkit recipe run result-refactor -p package_path=internal/git -p dry_run=false + +# Run a specific recipe file +grokkit recipe run ./my-custom-recipe.md +``` + +**Recipe System**: +- **Local Recipes**: Stored in `.grokkit/recipes/*.md`. +- **Global Recipes**: Stored in `~/.local/share/grokkit/recipes/*.md`. +- Recipes are markdown-based with YAML frontmatter for parameters and configuration. ### ๐Ÿค– `grokkit agent` Multi-file agent for complex refactoring (experimental). @@ -523,6 +572,9 @@ grokkit review -v - โœ… **Git workflow integration** - Commit messages, reviews, PR descriptions - โœ… **Multi-language linting** - 9 languages supported with AI-powered fixes - โœ… **AI documentation generation** - 8 doc styles (godoc, PEP 257, Doxygen, JSDoc, rustdoc, YARD, Javadoc, shell) +- โœ… **AI unit test generation** - Go (table-driven), Python (pytest), C (Check), C++ (GTest) +- โœ… **AI file scaffolding** - Create new files with project-aware style matching +- โœ… **Transactional Recipes** - Markdown-based multi-step AI workflows ### Quality & Testing - โœ… **Test coverage 68%+** - Comprehensive unit tests including all command message builders @@ -594,9 +646,13 @@ grokkit/ โ”œโ”€โ”€ cmd/ # CLI commands (Cobra) โ”‚ โ”œโ”€โ”€ docs.go # grokkit docs โ€” AI documentation generation โ”‚ โ”œโ”€โ”€ lint.go # grokkit lint โ€” AI-powered linting +โ”‚ โ”œโ”€โ”€ recipe.go # grokkit recipe โ€” transactional recipe runner +โ”‚ โ”œโ”€โ”€ scaffold.go # grokkit scaffold โ€” project-aware file generation โ”‚ โ””โ”€โ”€ ... # chat, edit, commit, review, history, pr-describe, agent โ”œโ”€โ”€ config/ # Viper configuration โ”œโ”€โ”€ docs/ # Documentation +โ”œโ”€โ”€ .grokkit/ # Project-local Grokkit data +โ”‚ โ””โ”€โ”€ recipes/ # Custom AI workflows (recipes) โ”œโ”€โ”€ todo/ # TODO tracking: queued/ (pending) and completed/ (historical record) โ”‚ โ”œโ”€โ”€ queued/ # Pending TODO items โ”‚ โ””โ”€โ”€ completed/ # Completed TODO items with history @@ -606,6 +662,7 @@ grokkit/ โ”‚ โ”œโ”€โ”€ grok/ # xAI Grok API client โ”‚ โ”œโ”€โ”€ linter/ # Multi-language linting โ”‚ โ”œโ”€โ”€ logger/ # Structured slog logging +โ”‚ โ”œโ”€โ”€ recipe/ # Recipe loading and execution engine โ”‚ โ””โ”€โ”€ version/ # Build/version info โ”œโ”€โ”€ main.go # Application entrypoint โ”œโ”€โ”€ go.mod # Dependencies