Commit Graph

189 Commits

Author SHA1 Message Date
Gregory Gauthier
ba8d9b1d7e feat(edit): add markdown file support with tailored prompt
- Introduce check for .md extension and use technical writer system prompt.
- Adjust response cleaning: trim for markdown, use CleanCodeResponse for code.
- Remove nolint comment and unnecessary line skipping in removeLastModifiedComments.
2026-03-30 12:22:50 +01:00
Gregory Gauthier
1c790976ab ci(release): enhance workflow with PowerShell install instructions
All checks were successful
CI / Test (push) Successful in 30s
CI / Lint (push) Successful in 22s
CI / Build (push) Successful in 20s
- Add PowerShell quick install snippet to release notes body
- Update MIME type detection to include .ps1 files as text/plain
- Remove unnecessary comments from workflow script
2026-03-30 12:04:39 +01:00
Gregory Gauthier
c4bc073b35 chore(release): include PowerShell install script in build
All checks were successful
CI / Test (push) Successful in 34s
CI / Lint (push) Successful in 24s
CI / Build (push) Successful in 19s
Add copying of grokkit-install.ps1 to the build directory during release workflow, alongside the existing sh script.
2026-03-30 11:58:55 +01:00
Gregory Gauthier
250aff99ed docs(changelog): add entry for v0.3.4 with Windows support
All checks were successful
CI / Test (push) Successful in 32s
CI / Lint (push) Successful in 24s
CI / Build (push) Successful in 20s
- Introduced Windows installation script and methods
- Updated README with Windows notes and improved formatting
- Ensured cross-platform consistency
2026-03-30 11:50:43 +01:00
Gregory Gauthier
2bfd8bd15f feat(install): add PowerShell installer and update README installation docs
All checks were successful
CI / Test (push) Successful in 37s
CI / Lint (push) Successful in 23s
CI / Build (push) Successful in 19s
Release / Create Release (push) Successful in 34s
- Introduced grokkit-install.ps1 for Windows, mirroring bash installer with auto-detection, checksum verification, and safe installation
- Updated README with one-line and download-first install methods for Bash and PowerShell
- Added Windows-specific notes, improved formatting, tables, and examples in README
- Ensured cross-platform consistency in installation instructions
2026-03-30 11:47:19 +01:00
Gregory Gauthier
509e02b2e8 feat(install): enhance grokkit-install script with checksum verification and version flexibility
All checks were successful
CI / Test (push) Successful in 33s
CI / Lint (push) Successful in 22s
CI / Build (push) Successful in 19s
Release / Create Release (push) Successful in 35s
- Strip leading 'v' from VERSION for flexible invocation
- Add robust checksum download and verification using sha256sum or shasum
- Handle missing checksum tools or entries gracefully with warnings
- Update asset naming to include 'v' prefix consistently
- Improve platform detection formatting and add trap for temp dir cleanup
- Minor echo message updates for better user feedback
2026-03-30 11:06:50 +01:00
Gregory Gauthier
7ffdb2c289 chore(changelog): add v0.3.2 entry documenting install script polishing and past updates
All checks were successful
CI / Test (push) Successful in 32s
CI / Lint (push) Successful in 23s
CI / Build (push) Successful in 20s
- Added debug echoes, changelog entries for v0.3.1
- Changed asset filename, binary handling, commented out checksum and cleanup
- Fixed quoting in case statements and echoes
2026-03-30 10:52:58 +01:00
Gregory Gauthier
8c9df51a9c fix(scripts): update grokkit-install.sh for new asset naming and disable checksum verification
All checks were successful
CI / Test (push) Successful in 42s
CI / Lint (push) Successful in 25s
CI / Build (push) Successful in 19s
Release / Create Release (push) Successful in 36s
- Adjust asset filename to include 'v' prefix for version
- Comment out checksum download and verification
- Fix quoting in case statements and echo commands
- Update binary naming and extraction handling
- Comment out temp dir cleanup trap
- Add debug echo statements for download and extraction
2026-03-30 10:50:45 +01:00
82fe108554 docs(changelog): add entry for v0.3.1 release
All checks were successful
CI / Test (push) Successful in 31s
CI / Lint (push) Successful in 23s
CI / Build (push) Successful in 19s
- Documented additions: directory creation for .grokkit
- Documented changes: default output path, project analysis movement, refinements to analysis, and v0.3.0 changelog update
2026-03-28 18:11:15 +00:00
ea6f22cea4 refactor(analyze): improve default output path and update project analysis
All checks were successful
Release / Create Release (push) Successful in 34s
CI / Test (push) Successful in 30s
CI / Lint (push) Successful in 23s
CI / Build (push) Successful in 19s
- Change default output to .grokkit/analysis.md for project-local storage
- Add directory creation for .grokkit to ensure it exists before writing
- Refine project analysis.md with more accurate tech stack, function refs, and learning path details
2026-03-28 18:10:23 +00:00
099ef6919b docs(analysis): relocate and refine project analysis document
All checks were successful
CI / Test (push) Successful in 32s
CI / Lint (push) Successful in 23s
CI / Build (push) Successful in 18s
Move the project analysis from `analyze.md` to `.grokkit/analysis.md` for better organization under a dedicated directory. Update content with more accurate inferences on tech stack, directory structure, function references, and learning paths based on deeper code review. This improves maintainability and provides a more comprehensive overview for contributors.
2026-03-28 18:01:19 +00:00
c1c58e2738 chore(changelog): add entry for v0.3.0 release
All checks were successful
CI / Test (push) Successful in 26s
CI / Lint (push) Successful in 24s
CI / Build (push) Successful in 19s
Update CHANGELOG.md with added features like analyze command, Go-specific prompts, and language detection; changes to prompts, detection logic, and command handling; fixes for config, imports, and safety checks.
2026-03-28 17:45:45 +00:00
e97457c00f chore(linter): add dummy linter entry for Rexx
All checks were successful
CI / Test (push) Successful in 26s
CI / Lint (push) Successful in 18s
CI / Build (push) Successful in 14s
Release / Create Release (push) Successful in 2m1s
Add a "none" linter configuration for the Rexx language to provide structure,
while noting that no traditional linter is used and it's primarily for grokkit analyze.
2026-03-28 17:43:18 +00:00
269faa6546 fix(cmd): remove misplaced analyze command addition
Some checks failed
CI / Test (push) Failing after 23s
CI / Lint (push) Has been skipped
CI / Build (push) Has been skipped
- Remove `rootCmd.AddCommand(analyzeCmd)` from `cmd/analyze.go` init func
- Add empty `Linters` array for Rexx in `internal/linter/linter.go` with comment for analyze support
2026-03-28 17:37:11 +00:00
3c73b897a6 chore: update analyze command output and add Rexx to linter
Some checks failed
CI / Test (push) Failing after 22s
CI / Lint (push) Has been skipped
CI / Build (push) Has been skipped
- Change default output filename in analyze command from analyze.md to analysis.md
- Add Rexx language detection with extensions .rx, .rex, .rexlib, .rexx, .cls
2026-03-28 17:06:26 +00:00
12bd5f9376 refactor(linter): clean language names in primary detection
All checks were successful
CI / Test (push) Successful in 26s
CI / Lint (push) Successful in 18s
CI / Build (push) Successful in 14s
Update DetectPrimaryLanguage to normalize "C/C++" and "C++" to "c" for consistent counting.
Revise function comment and internal comments for clarity.
Remove redundant comment on finding most common language.
2026-03-28 16:24:26 +00:00
5cb84f44bb Merge pull request 'feat: Introduce analyze Command for Deep Educational Codebase Analysis' (#6) from feature/analyze_cmd into master
All checks were successful
CI / Test (push) Successful in 26s
CI / Lint (push) Successful in 17s
CI / Build (push) Successful in 13s
Reviewed-on: #6
2026-03-28 16:11:38 +00:00
7e5cb7c4d7 docs(analyze): add project analysis Markdown report and refine AI prompt
All checks were successful
CI / Test (pull_request) Successful in 26s
CI / Lint (pull_request) Successful in 18s
CI / Build (pull_request) Successful in 14s
- Introduce analyze.md with comprehensive breakdown of Grokkit project, including tech stack, structure, APIs, data flow, and learning path.
- Update cmd/analyze.go to include detected language in user prompt for more targeted AI analysis.
2026-03-28 14:32:50 +00:00
ba11717476 chore(todo): mark analyze-command as completed
All checks were successful
CI / Test (pull_request) Successful in 25s
CI / Lint (pull_request) Successful in 17s
CI / Build (pull_request) Successful in 13s
Moves the task file from queued to completed directory.
2026-03-28 14:13:53 +00:00
db184bb931 docs(user-guide): add guide for analyze command
Introduced a new documentation page `analyze.md` detailing the `analyze` command, including usage, options, prompt discovery, language support, safety features, best practices, and an example workflow. Updated `index.md` to include a link to the new guide.
2026-03-28 14:08:47 +00:00
4549ab5589 feat(analyze): add project name inference for Go analysis prompts
- Modify Go prompt to include instruction for inferring project name from directory or go.mod.
- Update analyze command to infer project name from directory base and replace placeholder in prompt content.
- Enhance prompt formatting with bold text and rephrased sections for clarity.
2026-03-28 13:44:10 +00:00
4084315dc1 refactor(analyze): improve file discovery and project context in analyze command
- Enhance discoverSourceFiles to skip additional noise directories like "build" and "dist" while descending into source directories.
- Update safety check to use package-level logger without .Get().
- Refine buildProjectContext with better labeling and consistent git remote handling.
- Minor comment and string adjustments for clarity.
2026-03-28 13:23:49 +00:00
fd033b03c7 fix(analyze): correct config, logger, and git usage in analyze command
- Fix config.GetModel to use command name and flag
- Switch to package-level logger functions
- Update git.IsRepo to take no arguments
- Simplify linter language detection comments
- Adjust Grok client creation to NewClient().StreamSilent
- Add error handling for confirmation input
- Remove unnecessary imports and refine comments in linter
2026-03-28 13:16:31 +00:00
09119ded37 refactor(analysis): refine prompts, language detection, and context building
- Updated Go analysis prompt for clarity, structure, and educational focus.
- Improved buildProjectContext to include shallow key files and cleaner Git remote handling.
- Implemented DetectPrimaryLanguage with counting logic and Go bias; added SupportedLanguages.
- Enhanced LoadAnalysisPrompt with better language handling, fallbacks, and error clarity.
2026-03-28 12:46:04 +00:00
b24b86723b feat(analyze): implement educational project analysis with language prompts
- Add Go-specific analysis prompt in .grokkit/prompts/go.md
- Expand cmd/analyze.go to discover files, detect language, load prompts, build context, generate report via Grok, and handle output with preview/confirmation
- Integrate analyzeCmd into root command
- Introduce internal/linter/language.go for primary language detection
- Add internal/prompts/analyze.go for loading analysis prompts from project or global locations
2026-03-28 12:36:06 +00:00
78379aa557 feat(cmd): add analyze command for project analysis
Introduces a new Cobra command `analyze` that performs deep project analysis,
discovers files, builds context, streams to Grok for report generation, and
handles output with confirmation.
2026-03-28 12:16:17 +00:00
643b904db4 docs(analyze): refine grokkit analyze command spec
All checks were successful
CI / Test (push) Successful in 27s
CI / Lint (push) Successful in 17s
CI / Build (push) Successful in 12s
Update the feature description to include educational report details and prompt discovery mechanism.
Add automatic prompt loading from project or global config paths, with error handling for missing prompts.
Revise acceptance criteria, implementation plan, and add proposed CLI usage and flags.
Include default prompt for Go and user-guide updates for custom prompts.
2026-03-28 12:14:33 +00:00
6160ffa8e6 feat(analyze): add feature spec for grokkit analyze command
All checks were successful
CI / Test (push) Successful in 1m12s
CI / Lint (push) Successful in 44s
CI / Build (push) Successful in 37s
Queues a new Markdown spec in todo/queued for the `grokkit analyze` command, including description, acceptance criteria, implementation plan, and priority. This feature enables deep project analysis and generates educational Markdown reports on tech stack, functions, and more.
2026-03-28 11:47:17 +00:00
e2d70667f9 Update .grokkit/recipes/result-refactor.md
All checks were successful
CI / Test (push) Successful in 40s
CI / Lint (push) Successful in 26s
CI / Build (push) Successful in 20s
2026-03-09 13:31:32 +00:00
4e334c7d24 docs(changelog): add entry for v0.2.0
All checks were successful
CI / Test (push) Successful in 33s
CI / Lint (push) Successful in 26s
CI / Build (push) Successful in 21s
Summarize changes including new features like recipe support, safe shell commands, and refactoring improvements; updates to configurations and security; fixes for various bugs and handling.
2026-03-08 12:59:34 +00:00
b0fcd2ce42 docs(readme): update test coverage badge and details
All checks were successful
CI / Test (push) Successful in 35s
CI / Lint (push) Successful in 25s
CI / Build (push) Successful in 21s
Release / Create Release (push) Successful in 41s
- Change coverage badge from 68% (brightgreen) to 54% (orange)
- Update quality section from 68%+ to 54%+
- Lower CI coverage gate from 65% to 50%
2026-03-08 12:58:04 +00:00
d377e6b345 test: add tests for recipe package and disable parallelism in cmd tests
All checks were successful
CI / Test (push) Successful in 41s
CI / Lint (push) Successful in 27s
CI / Build (push) Successful in 21s
- Introduce new test suite in internal/recipe/recipe_test.go covering recipe loading, parameter overrides, safety checks, work dir resolution, file discovery, and unified patch creation.
- Remove t.Parallel() from tests in cmd/changelog_test.go, cmd/root_test.go, and cmd/scaffold_test.go that modify global state (e.g., os.Args, HOME, or use os.Chdir()) to avoid race conditions and ensure test isolation.
2026-03-08 12:53:01 +00:00
ffc840ca5b Merge pull request 'feature/recipe_implementation' (#5) from feature/recipe_implementation into master
All checks were successful
CI / Test (push) Successful in 34s
CI / Lint (push) Successful in 25s
CI / Build (push) Successful in 22s
Reviewed-on: #5
2026-03-07 23:17:53 +00:00
cd47686679 docs: refactor README and docs structure for better organization
All checks were successful
CI / Test (pull_request) Successful in 42s
CI / Lint (pull_request) Successful in 27s
CI / Build (pull_request) Successful in 23s
- Simplified README.md by moving detailed command docs, workflows, and development info to dedicated user-guide/ and developer-guide/ directories.
- Created index.md files for both guides to improve navigation.
- Extracted individual command guides (e.g., chat.md, edit.md) into user-guide/ for focused, maintainable documentation.
- Moved architecture, configuration, and troubleshooting to developer-guide/.
- Updated README links to point to the new docs structure.
2026-03-07 22:42:43 +00:00
2116a62a5a refactor(cmd): remove root command addition from query init
This prevents potential duplicate command registrations if added elsewhere.
2026-03-07 21:17:10 +00:00
bb3f968711 docs(readme): update command list and add new feature descriptions
- Reorganize commit commands into commit-msg and commit
- Add sections for scaffold, recipe, and testgen
- Update PR description base branch example
- Add new features to quality section: AI unit test generation, file scaffolding, transactional recipes
- Update directory structure with .grokkit/recipes and internal/recipe
2026-03-07 21:12:21 +00:00
383d28a91a refactor(recipe): enhance shell command security with global safe list
- Introduce global safeCommands() map for command whitelisting.
- Implement case-insensitive prefix checking for allowed commands.
- Simplify argument handling by removing redundant int conversions.
- Update error messages and comments for clarity on security policies.
- Remove outdated comments and adjust prompt text for consistency.
2026-03-07 19:50:06 +00:00
4603a1ec7a fix(recipe): improve allowed shell command validation
Update the command matching logic to require an exact match or the command followed by a space and arguments. Also normalize case and trim whitespace for safe commands to prevent loose prefix matches that could allow unintended commands.
2026-03-07 19:37:53 +00:00
685b0f40d7 feat(recipe): support numeric arguments in read-only shell commands
Update the executeReadOnlyShell function to handle numbers in command arguments,
such as 'tree -L 3', by changing Args to []interface{} and converting them to strings
before execution. Add strconv import for formatting.
2026-03-07 19:27:15 +00:00
a36f3585f4 refactor(recipe): enhance read-only shell handling and robustness
- Tighten trigger conditions for read-only shell steps to specific phrases
- Add robust JSON extraction with escaped quote handling
- Reorder user confirmation before whitelist check in execution flow
- Relocate FileChange struct and clean up comments
- Update recipe markdown for step title consistency
2026-03-07 19:18:41 +00:00
3d9d1cd722 feat(recipe): add project exploration step with read-only shell support
- Introduce new Step 1 in result-refactor.md for exploring project structure using safe read-only shell commands (e.g., tree, cat).
- Rename subsequent steps accordingly.
- Add handler in runner.go for read-only shell steps triggered by keywords like "explore" or "inspect".
2026-03-07 18:58:40 +00:00
66d52917c0 feat(recipe): add read-only shell execution with user confirmation
Implement executeReadOnlyShell method to safely run whitelisted read-only commands,
prompting for user approval and integrating AI-suggested commands for filesystem context.
2026-03-07 18:50:38 +00:00
d74c613e0f chore(loader): add logging for safe commands config loading
Add debug print statements to indicate when the safe commands config file
is successfully loaded or when falling back to the built-in list.
2026-03-07 18:32:43 +00:00
f9d99527e0 feat(safety): make safe shell commands user-configurable
- Replace hardcoded safeCommands map with sync.OnceValue loading from ~/.config/grokkit/safe_shell_commands.yaml
- Provide fallback built-in safe list if config load fails
- Add safe_shell_commands.yaml.example for user reference
- Update safety check to use loaded map and prefix matching
2026-03-07 18:22:39 +00:00
7e4bdbc21c refactor(recipe/loader): expand safe shell commands and refine validation logic
- Renamed safeReadOnlyCommands to safeCommands for clarity.
- Added support for additional safe commands including GNU utilities (find, grep, which),
  Git commands (diff, branch), and various test runners (go test, make test/lint, pytest, etc.).
- Updated safety check to allow commands prefixed with any safe command for flexibility.
- Improved error message for unsafe commands.
2026-03-07 17:59:59 +00:00
b2172b8546 fix(recipe): improve unsafe shell command error message
Update the error message for unsafe shell commands to be more concise and user-friendly, removing redundant "ERROR:" prefix and "try again" instruction.
2026-03-07 17:41:09 +00:00
64fb748897 refactor(recipe): simplify path resolution and remove shell command execution
- Consolidate resolveWorkDir and remove resolvePackagePath for cleaner path handling.
- Eliminate executeShellCommands and related logic to disable shell execution in recipes.
- Simplify error messaging in loader for unsafe commands.
2026-03-07 17:34:59 +00:00
63e640c022 feat(recipe): add safety whitelist for allowed shell commands
Implement a read-only command whitelist in the recipe loader to reject
potentially dangerous shell commands, ensuring only safe operations like
ls, pwd, cat, etc., are permitted. This enhances security by preventing
execution of unauthorized commands in recipes.
2026-03-07 17:11:13 +00:00
aedf9cdf03 refactor(recipe/runner): enhance working directory resolution and shell command safety
- Rename and expand resolvePackagePath to resolveWorkDir, which now appends project_name if provided
- Update discoverFiles to use workDir and add default search pattern if none specified
- Modify executeShellCommands prompt to include workDir and enforce relative paths only
- Add safety checks to reject shell commands with ".." or absolute paths to prevent directory escapes
- Minor prompt and formatting adjustments for clarity and consistency
2026-03-07 16:18:29 +00:00
8efca62109 refactor(runner): improve package path resolution for consistency
- Introduce resolvePackagePath to handle ~ expansion, relative paths, and absolutization at the start.
- Update discoverFiles and executeShellCommands to use the resolved workDir.
- Remove redundant path logic from discoverFiles and shell execution for better maintainability.
2026-03-07 15:52:56 +00:00