crackerjack 0.28.0__py3-none-any.whl → 0.30.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of crackerjack might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crackerjack
3
- Version: 0.28.0
3
+ Version: 0.30.3
4
4
  Summary: Crackerjack: code quality toolkit
5
5
  Project-URL: documentation, https://github.com/lesleslie/crackerjack
6
6
  Project-URL: homepage, https://github.com/lesleslie/crackerjack
@@ -26,6 +26,7 @@ Requires-Python: >=3.13
26
26
  Requires-Dist: aiofiles>=24.1
27
27
  Requires-Dist: autotyping>=24.9
28
28
  Requires-Dist: hatchling>=1.25
29
+ Requires-Dist: jinja2>=3.1
29
30
  Requires-Dist: keyring>=25.6
30
31
  Requires-Dist: pre-commit>=4.2
31
32
  Requires-Dist: pydantic>=2.11.7
@@ -153,6 +154,7 @@ Crackerjack is built on the following core principles:
153
154
 
154
155
  ### Git Integration
155
156
 
157
+ - **Intelligent Commit Messages:** Analyzes git changes and suggests descriptive commit messages based on file types and modifications
156
158
  - **Commit and Push:** Commits and pushes your changes with standardized commit messages
157
159
  - **Pull Request Creation:** Creates pull requests to upstream repositories on GitHub or GitLab
158
160
  - **Pre-commit Integration:** Ensures code quality before commits
@@ -164,25 +166,106 @@ Crackerjack is built on the following core principles:
164
166
  - **Structured Error Handling:** Clear error messages with error codes, detailed explanations, and recovery suggestions
165
167
  - **Programmatic API:** Can be integrated into your own Python scripts and workflows
166
168
  - **AI Agent Integration:** Structured output format for integration with AI assistants, with complete style rules available in [RULES.md](RULES.md) for AI tool customization
169
+ - **Celebratory Success Messages:** Trophy emoji (🏆) celebrates achieving crackerjack quality when all checks pass
167
170
  - **Verbose Mode:** Detailed output for debugging and understanding what's happening
168
171
  - **Python 3.13+ Features:** Leverages the latest Python language features including PEP 695 type parameter syntax, Self type annotations, and structural pattern matching
169
172
 
170
- ## Pre-commit Hooks
173
+ ## Pre-commit Hooks & Performance Optimization
171
174
 
172
- Crackerjack automatically installs and manages these pre-commit hooks:
175
+ Crackerjack provides dual-mode pre-commit hook configuration optimized for different development scenarios:
173
176
 
174
- 1. **uv-lock:** Ensures the `uv.lock` file is up to date.
175
- 1. **Core pre-commit-hooks:** Essential hooks from [pre-commit-hooks](https://github.com/pre-commit/pre-commit-hooks) (e.g., `trailing-whitespace`, `end-of-file-fixer`).
176
- 1. **Ruff:** [Ruff](https://github.com/astral-sh/ruff) for linting, code formatting, and general code style enforcement.
177
- 1. **Vulture:** [Vulture](https://github.com/jendrikseipp/vulture) to identify dead code.
178
- 1. **Creosote:** [Creosote](https://github.com/fredrikaverpil/creosote) to detect unused dependencies.
179
- 1. **Complexipy:** [Complexipy](https://github.com/rohaquinlop/complexipy-pre-commit) for analyzing code complexity.
180
- 1. **Codespell:** [Codespell](https://github.com/codespell-project/codespell) for correcting typos in the code.
181
- 1. **Autotyping:** [Autotyping](https://github.com/JelleZijlstra/autotyping) for adding type hints.
182
- 1. **Refurb:** [Refurb](https://github.com/dosisod/refurb) to suggest code improvements.
183
- 1. **Bandit:** [Bandit](https://github.com/PyCQA/bandit) to identify potential security vulnerabilities.
184
- 1. **Pyright:** [Pyright](https://github.com/RobertCraigie/pyright-python) for static type checking.
185
- 1. **Ruff (again):** A final Ruff pass to ensure all changes comply with the enforced style.
177
+ ### Fast Development Mode (Default)
178
+
179
+ **Target Execution Time: \<5 seconds**
180
+
181
+ Uses `.pre-commit-config-fast.yaml` for regular development work:
182
+
183
+ - **Structure Validation**: Basic file structure checks
184
+ - **UV Lock Updates**: Keeps dependency lock files current
185
+ - **Security Checks**: Essential security scanning with detect-secrets
186
+ - **Quick Formatting**: Fast formatting with codespell and ruff
187
+ - **Markdown Formatting**: mdformat with ruff integration
188
+
189
+ ```bash
190
+ # Default fast mode (automatically selected)
191
+ python -m crackerjack
192
+
193
+ # Explicitly use fast mode
194
+ python -m crackerjack --fast # Uses fast pre-commit configuration
195
+ ```
196
+
197
+ ### 🔍 Comprehensive Analysis Mode
198
+
199
+ **Target Execution Time: \<30 seconds**
200
+
201
+ Uses `.pre-commit-config.yaml` for thorough analysis before releases or important commits:
202
+
203
+ - **All Fast Mode Checks**: Includes everything from fast mode
204
+ - **Type Checking**: Complete static analysis with Pyright
205
+ - **Code Modernization**: Advanced suggestions with Refurb
206
+ - **Security Scanning**: Comprehensive vulnerability detection with Bandit
207
+ - **Dead Code Detection**: Unused code identification with Vulture
208
+ - **Dependency Analysis**: Unused dependency detection with Creosote
209
+ - **Complexity Analysis**: Code complexity checking with Complexipy
210
+ - **Auto Type Hints**: Automatic type annotation with Autotyping
211
+
212
+ ```bash
213
+ # Run comprehensive analysis
214
+ python -m crackerjack --comprehensive
215
+
216
+ # Use comprehensive mode for releases
217
+ python -m crackerjack --comprehensive -a patch
218
+ ```
219
+
220
+ ### 📦 Pre-push Hooks (CI/CD Integration)
221
+
222
+ For expensive operations that should run before pushing to remote repositories:
223
+
224
+ ```bash
225
+ # Install pre-push hooks for comprehensive checks
226
+ pre-commit install --hook-type pre-push
227
+
228
+ # Manual pre-push validation
229
+ python -m crackerjack --comprehensive --test
230
+ ```
231
+
232
+ ### Performance Comparison
233
+
234
+ | Mode | Execution Time | Use Case | Hooks Count |
235
+ |------|---------------|----------|-------------|
236
+ | **Fast** | \<5s | Regular development | 8 essential hooks |
237
+ | **Comprehensive** | \<30s | Pre-release, important commits | 15+ thorough hooks |
238
+ | **Pre-push** | Variable | CI/CD, remote push | All hooks + extended analysis |
239
+
240
+ ### Hook Categories
241
+
242
+ **Fast Mode Hooks:**
243
+
244
+ 1. **uv-lock:** Ensures the `uv.lock` file is up to date
245
+ 1. **Core pre-commit-hooks:** Essential hooks (trailing-whitespace, end-of-file-fixer)
246
+ 1. **Ruff:** Fast linting and formatting
247
+ 1. **Detect-secrets:** Security credential detection
248
+ 1. **Codespell:** Spelling mistake correction
249
+ 1. **mdformat:** Markdown formatting
250
+
251
+ **Additional Comprehensive Mode Hooks:**
252
+ 7\. **Vulture:** Dead code detection
253
+ 8\. **Creosote:** Unused dependency detection
254
+ 9\. **Complexipy:** Code complexity analysis
255
+ 10\. **Autotyping:** Automatic type hint generation
256
+ 11\. **Refurb:** Code modernization suggestions
257
+ 12\. **Bandit:** Security vulnerability scanning
258
+ 13\. **Pyright:** Static type checking
259
+ 14\. **Extended Ruff:** Additional formatting passes
260
+
261
+ ### Smart Hook Selection
262
+
263
+ Crackerjack automatically selects the appropriate hook configuration based on:
264
+
265
+ - **Operation Type**: Fast for regular development, comprehensive for releases
266
+ - **User Preference**: Explicit `--fast` or `--comprehensive` flags
267
+ - **CI/CD Context**: Pre-push hooks for remote operations
268
+ - **Project Size**: Larger projects may benefit from fast mode during development
186
269
 
187
270
  ## The Crackerjack Style Guide
188
271
 
@@ -240,36 +323,105 @@ python -m crackerjack -t --test-timeout=300
240
323
  python -m crackerjack -t --test-workers=2 --test-timeout=600
241
324
  ```
242
325
 
243
- ### Benchmark Testing
326
+ ### Benchmark Testing & Performance Monitoring
244
327
 
245
- Crackerjack includes benchmark testing capabilities:
328
+ Crackerjack includes comprehensive benchmark testing capabilities designed for continuous performance monitoring and regression detection:
246
329
 
247
- - **Performance Measurement:** Run tests with `--benchmark` to measure execution time and performance
248
- - **Regression Testing:** Use `--benchmark-regression` to detect performance regressions
249
- - **Configurable Thresholds:** Set custom regression thresholds with `--benchmark-regression-threshold`
250
- - **Compatibility Management:** Automatically disables parallel execution when running benchmarks
251
- - **CI Integration:** Track performance across commits with benchmark history
330
+ #### 📊 Core Benchmark Features
252
331
 
253
- When benchmarks are run, Crackerjack:
332
+ - **Performance Measurement:** Accurately measure execution time, memory usage, and function calls
333
+ - **Regression Detection:** Automatic detection of performance degradation between code changes
334
+ - **Statistical Analysis:** Statistical validation of performance differences with confidence intervals
335
+ - **Historical Tracking:** Track performance trends across commits and releases
336
+ - **CI/CD Integration:** Seamless integration with continuous integration pipelines
337
+ - **AI Agent Output:** JSON format benchmark results for automated analysis
254
338
 
255
- 1. Disables parallel test execution (as pytest-benchmark is incompatible with pytest-xdist)
256
- 1. Configures the pytest-benchmark plugin with optimized settings
257
- 1. Compares benchmark results against previous runs when regression testing is enabled
258
- 1. Fails tests if performance decreases beyond the specified threshold
339
+ #### 🚀 Benchmark Execution Modes
259
340
 
260
- Example benchmark usage:
341
+ **Basic Benchmarking:**
261
342
 
262
343
  ```bash
263
- # Run benchmarks
344
+ # Run tests with performance measurement
264
345
  python -m crackerjack -t --benchmark
265
346
 
266
- # Run benchmarks with regression testing (fail if >5% slower)
347
+ # Combine with AI agent mode for structured output
348
+ python -m crackerjack -t --benchmark --ai-agent
349
+ ```
350
+
351
+ **Regression Testing:**
352
+
353
+ ```bash
354
+ # Run benchmarks with regression detection (5% threshold)
267
355
  python -m crackerjack -t --benchmark-regression
268
356
 
269
- # Run benchmarks with custom regression threshold (10%)
357
+ # Custom regression threshold (fail if >10% slower)
270
358
  python -m crackerjack -t --benchmark-regression --benchmark-regression-threshold=10.0
359
+
360
+ # Strict regression testing for critical performance paths (2% threshold)
361
+ python -m crackerjack -t --benchmark-regression --benchmark-regression-threshold=2.0
362
+ ```
363
+
364
+ #### 📈 Strategic Benchmark Scheduling
365
+
366
+ **🚀 Critical Scenarios (Always Run Benchmarks):**
367
+
368
+ - Before major releases
369
+ - After significant algorithmic changes
370
+ - When performance-critical code is modified
371
+
372
+ **📊 Regular Monitoring (Weekly):**
373
+
374
+ - Automated CI/CD pipeline execution
375
+ - Performance drift detection
376
+ - Long-term trend analysis
377
+
378
+ **🎲 Random Sampling (10% of commits):**
379
+
380
+ - Stochastic performance monitoring
381
+ - Gradual performance regression detection
382
+ - Statistical baseline maintenance
383
+
384
+ #### ⚙️ Technical Implementation
385
+
386
+ When benchmarks are executed, Crackerjack:
387
+
388
+ 1. **Disables Parallel Execution**: Ensures accurate timing measurements (pytest-benchmark incompatible with pytest-xdist)
389
+ 1. **Optimizes Configuration**: Configures pytest-benchmark with performance-optimized settings
390
+ 1. **Baseline Comparison**: Compares results against previous runs for regression detection
391
+ 1. **Statistical Validation**: Uses statistical methods to determine significant performance changes
392
+ 1. **JSON Export**: Generates machine-readable results for automated analysis (with `--ai-agent`)
393
+
394
+ #### 🎯 Benchmark Best Practices
395
+
396
+ **Threshold Guidelines:**
397
+
398
+ - **2-5% threshold**: For release candidates and critical performance paths
399
+ - **5-10% threshold**: For regular development and monitoring
400
+ - **10%+ threshold**: For experimental features and early development
401
+
402
+ **Execution Strategy:**
403
+
404
+ ```bash
405
+ # Development workflow with benchmarks
406
+ python -m crackerjack -t --benchmark --test-workers=1
407
+
408
+ # Release validation with strict thresholds
409
+ python -m crackerjack -t --benchmark-regression --benchmark-regression-threshold=2.0
410
+
411
+ # CI/CD integration with structured output
412
+ python -m crackerjack --ai-agent -t --benchmark-regression --benchmark-regression-threshold=5.0
271
413
  ```
272
414
 
415
+ #### 📁 Benchmark Output Files
416
+
417
+ When using `--ai-agent` mode, benchmark results are exported to:
418
+
419
+ - **`benchmark.json`**: Detailed performance metrics and statistical analysis
420
+ - **`test-results.xml`**: JUnit XML format with benchmark integration
421
+ - **`ai-agent-summary.json`**: Summary including benchmark status and regression analysis
422
+
423
+ This comprehensive approach ensures that performance regressions are caught early while maintaining development velocity.
424
+
273
425
  ## Installation
274
426
 
275
427
  1. **Python:** Ensure you have Python 3.13 or higher installed.
@@ -369,28 +521,183 @@ runner = create_crackerjack_runner(
369
521
  runner.process(MyOptions())
370
522
  ```
371
523
 
524
+ ## Intelligent Commit Messages
525
+
526
+ Crackerjack includes a smart commit message generation system that analyzes your git changes and suggests descriptive commit messages based on the files modified and the type of changes made.
527
+
528
+ ### How It Works
529
+
530
+ When you use the `-c` (commit) flag, Crackerjack automatically:
531
+
532
+ 1. **Analyzes Changes**: Scans `git diff` to understand what files were added, modified, deleted, or renamed
533
+ 1. **Categorizes Files**: Groups changes by type (documentation, tests, core functionality, configuration, dependencies)
534
+ 1. **Suggests Message**: Generates a descriptive commit message with appropriate action verbs and categorization
535
+ 1. **Interactive Choice**: Offers options to use the suggestion, edit it, or write a custom message
536
+
537
+ ### Message Format
538
+
539
+ Generated commit messages follow this structure:
540
+
541
+ ```
542
+ [Action] [primary changes] and [secondary changes]
543
+
544
+ - Added N file(s)
545
+ * path/to/new/file.py
546
+ * path/to/another/file.py
547
+ - Modified N file(s)
548
+ * path/to/changed/file.py
549
+ - Deleted N file(s)
550
+ - Renamed N file(s)
551
+ ```
552
+
553
+ ### Examples
554
+
555
+ **Documentation Updates:**
556
+
557
+ ```
558
+ Update documentation
559
+
560
+ - Modified 3 file(s)
561
+ * README.md
562
+ * CLAUDE.md
563
+ * docs/guide.md
564
+ ```
565
+
566
+ **New Feature Addition:**
567
+
568
+ ```
569
+ Add core functionality and tests
570
+
571
+ - Added 2 file(s)
572
+ * src/new_feature.py
573
+ * tests/test_feature.py
574
+ - Modified 1 file(s)
575
+ * README.md
576
+ ```
577
+
578
+ **Configuration Changes:**
579
+
580
+ ```
581
+ Update configuration
582
+
583
+ - Modified 2 file(s)
584
+ * pyproject.toml
585
+ * .pre-commit-config.yaml
586
+ ```
587
+
588
+ ### Usage Options
589
+
590
+ When committing, you'll see:
591
+
592
+ ```bash
593
+ 🔍 Analyzing changes...
594
+
595
+ README.md | 10 ++++
596
+ tests/test_new.py | 50 ++++
597
+ 2 files changed, 60 insertions(+)
598
+
599
+ 📋 Suggested commit message:
600
+ Update documentation and tests
601
+
602
+ - Modified 1 file(s)
603
+ * README.md
604
+ - Added 1 file(s)
605
+ * tests/test_new.py
606
+
607
+ Use suggested message? [Y/n/e to edit]:
608
+ ```
609
+
610
+ **Options:**
611
+
612
+ - **Y** or **Enter**: Use the suggested message as-is
613
+ - **n**: Enter a completely custom commit message
614
+ - **e**: Edit the suggested message in your default editor (`$EDITOR`)
615
+
616
+ ### Smart Categorization
617
+
618
+ The system intelligently categorizes files:
619
+
620
+ - **Documentation**: `README.md`, `CLAUDE.md`, `docs/`, `.md` files
621
+ - **Tests**: `test_`, `tests/`, `conftest.py`
622
+ - **Configuration**: `pyproject.toml`, `.yaml`, `.yml`, `.json`, `.gitignore`
623
+ - **CI/CD**: `.github/`, `ci/`, `.pre-commit`
624
+ - **Dependencies**: `requirements`, `pyproject.toml`, `uv.lock`
625
+ - **Core**: All other Python files and application code
626
+
627
+ This intelligent commit message system helps maintain consistent, descriptive commit history while saving time during development workflows.
628
+
372
629
  ### Command-Line Options
373
630
 
374
- - `-c`, `--commit`: Commit changes to Git.
375
- - `-i`, `--interactive`: Run pre-commit hooks interactively when possible.
376
- - `-n`, `--no-config-updates`: Skip updating configuration files (e.g., `pyproject.toml`).
377
- - `-u`, `--update-precommit`: Update pre-commit hooks to the latest versions.
378
- - `-v`, `--verbose`: Enable verbose output.
379
- - `-p`, `--publish <patch|minor|major>`: Bump the project version and publish to PyPI using UV.
380
- - `-b`, `--bump <patch|minor|major>`: Bump the project version without publishing.
381
- - `-r`, `--pr`: Create a pull request to the upstream repository.
382
- - `-s`, `--skip-hooks`: Skip running pre-commit hooks (useful with `-t`).
383
- - `-x`, `--clean`: Clean code by removing docstrings, line comments, and extra whitespace.
384
- - `-t`, `--test`: Run tests using `pytest`.
385
- - `--test-workers`: Set the number of parallel workers for testing (0 = auto-detect, 1 = disable parallelization).
386
- - `--test-timeout`: Set the timeout in seconds for individual tests (0 = use default based on project size).
387
- - `--benchmark`: Run tests in benchmark mode (disables parallel execution).
388
- - `--benchmark-regression`: Fail tests if benchmarks regress beyond threshold.
389
- - `--benchmark-regression-threshold`: Set threshold percentage for benchmark regression (default 5.0%).
390
- - `-a`, `--all`: Run with `-x -t -p <patch|minor|major> -c` development options.
391
- - `-i`, `--interactive`: Enable the interactive Rich UI for a more user-friendly experience with visual progress tracking and interactive prompts.
392
- - `--ai-agent`: Enable AI agent mode with structured output (see [AI Agent Integration](#ai-agent-integration)).
393
- - `--help`: Display help.
631
+ #### Core Workflow Options
632
+
633
+ - `-c`, `--commit`: Commit changes to Git
634
+ - `-i`, `--interactive`: Launch the interactive Rich UI with visual progress tracking
635
+ - `-v`, `--verbose`: Enable detailed verbose output for debugging
636
+ - `-a`, `--all <patch|minor|major>`: Run complete workflow: clean, test, publish, commit
637
+
638
+ #### Configuration & Setup
639
+
640
+ - `-n`, `--no-config-updates`: Skip updating configuration files (e.g., `pyproject.toml`)
641
+ - `-u`, `--update-precommit`: Update pre-commit hooks to the latest versions
642
+ - `--update-docs`: Create CLAUDE.md and RULES.md templates (only if they don't exist)
643
+ - `--force-update-docs`: Force update CLAUDE.md and RULES.md even if they exist
644
+
645
+ #### Code Quality & Testing
646
+
647
+ - `-x`, `--clean`: Clean code by removing docstrings, line comments, and extra whitespace
648
+ - `-t`, `--test`: Run tests using pytest with intelligent parallelization
649
+ - `-s`, `--skip-hooks`: Skip running pre-commit hooks (useful with `-t`)
650
+ - `--comprehensive`: Use comprehensive pre-commit analysis mode (\<30s, thorough)
651
+
652
+ #### Test Execution Control
653
+
654
+ - `--test-workers <N>`: Set parallel workers (0=auto-detect, 1=disable, N=specific count)
655
+ - `--test-timeout <seconds>`: Set timeout per test (0=auto-detect based on project size)
656
+
657
+ #### Performance & Benchmarking
658
+
659
+ - `--benchmark`: Run tests in benchmark mode (disables parallel execution)
660
+ - `--benchmark-regression`: Fail tests if benchmarks regress beyond threshold
661
+ - `--benchmark-regression-threshold <percentage>`: Set regression threshold (default: 5.0%)
662
+
663
+ #### Version Management & Publishing
664
+
665
+ - `-p`, `--publish <patch|minor|major>`: Bump version and publish to PyPI with enhanced authentication
666
+ - `-b`, `--bump <patch|minor|major>`: Bump version without publishing
667
+
668
+ #### Git Integration
669
+
670
+ - `-r`, `--pr`: Create a pull request to the upstream repository
671
+
672
+ #### Session Management
673
+
674
+ - `--track-progress`: Enable session progress tracking with automatic recovery
675
+ - `--progress-file <path>`: Custom path for progress file (default: SESSION-PROGRESS-{timestamp}.md)
676
+ - `--resume-from <file>`: Resume session from existing progress file
677
+
678
+ #### AI & Integration
679
+
680
+ - `--ai-agent`: Enable AI agent mode with structured JSON output
681
+ - `--help`: Display comprehensive help information
682
+
683
+ #### Example Flag Combinations
684
+
685
+ ```bash
686
+ # Complete development workflow with session tracking
687
+ python -m crackerjack --track-progress -a patch
688
+
689
+ # Fast development cycle
690
+ python -m crackerjack -x -t -c
691
+
692
+ # Comprehensive pre-release validation
693
+ python -m crackerjack --comprehensive --benchmark-regression -p minor
694
+
695
+ # AI-optimized workflow with progress tracking
696
+ python -m crackerjack --ai-agent --track-progress -t --benchmark
697
+
698
+ # Interactive mode with comprehensive analysis
699
+ python -m crackerjack -i --comprehensive
700
+ ```
394
701
 
395
702
  ### Example Workflows
396
703
 
@@ -449,7 +756,79 @@ runner.process(MyOptions())
449
756
  python -m crackerjack -t --test-workers=2 --test-timeout=300
450
757
  ```
451
758
 
452
- #### Version Management
759
+ #### Version Management & PyPI Publishing
760
+
761
+ Crackerjack provides comprehensive PyPI publishing with enhanced authentication and validation.
762
+
763
+ **🔐 PyPI Authentication Setup**
764
+
765
+ Crackerjack automatically validates your authentication setup before publishing and provides helpful error messages. Choose one of these authentication methods:
766
+
767
+ **Method 1: Environment Variable (Recommended)**
768
+
769
+ ```bash
770
+ # Set PyPI token as environment variable
771
+ export UV_PUBLISH_TOKEN=pypi-your-token-here
772
+
773
+ # Publish with automatic token authentication
774
+ python -m crackerjack -p patch
775
+ ```
776
+
777
+ **Method 2: Keyring Integration**
778
+
779
+ ```bash
780
+ # Install keyring globally or in current environment
781
+ uv tool install keyring
782
+
783
+ # Store PyPI token in keyring (you'll be prompted for the token)
784
+ keyring set https://upload.pypi.org/legacy/ __token__
785
+
786
+ # Ensure keyring provider is configured in pyproject.toml
787
+ [tool.uv]
788
+ keyring-provider = "subprocess"
789
+
790
+ # Publish with keyring authentication
791
+ python -m crackerjack -p patch
792
+ ```
793
+
794
+ **Method 3: Environment Variable for Keyring Provider**
795
+
796
+ ```bash
797
+ # Set keyring provider via environment
798
+ export UV_KEYRING_PROVIDER=subprocess
799
+
800
+ # Publish (will use keyring for authentication)
801
+ python -m crackerjack -p patch
802
+ ```
803
+
804
+ **Authentication Validation**
805
+
806
+ Crackerjack automatically validates your authentication setup before publishing:
807
+
808
+ - ✅ **Token Found**: When `UV_PUBLISH_TOKEN` is set
809
+ - ✅ **Keyring Ready**: When keyring is configured and token is stored
810
+ - ⚠️ **Setup Needed**: When authentication needs configuration
811
+
812
+ If publishing fails due to authentication issues, crackerjack displays helpful setup instructions.
813
+
814
+ **PyPI Token Best Practices**
815
+
816
+ 1. **Generate Project-Specific Tokens**: Create separate PyPI tokens for each project
817
+ 1. **Use Scoped Tokens**: Limit token scope to the specific package you're publishing
818
+ 1. **Secure Storage**: Use environment variables or keyring - never hardcode tokens
819
+ 1. **Token Format**: PyPI tokens start with `pypi-` (e.g., `pypi-AgEIcHlwaS5vcmcCJGZm...`)
820
+
821
+ **Troubleshooting Authentication**
822
+
823
+ If you encounter authentication issues:
824
+
825
+ 1. **Check Token Format**: Ensure your token starts with `pypi-`
826
+ 1. **Verify Environment Variable**: `echo $UV_PUBLISH_TOKEN` should show your token
827
+ 1. **Test Keyring**: `keyring get https://upload.pypi.org/legacy/ __token__` should return your token
828
+ 1. **Check Configuration**: Ensure `keyring-provider = "subprocess"` in pyproject.toml
829
+ 1. **Install Keyring**: `uv tool install keyring` if using keyring authentication
830
+
831
+ **Version Management Commands**
453
832
 
454
833
  - **Bump and Publish** - Bump version and publish to PyPI:
455
834
 
@@ -465,6 +844,36 @@ runner.process(MyOptions())
465
844
  python -m crackerjack -b major
466
845
  ```
467
846
 
847
+ #### Documentation Template Management
848
+
849
+ Crackerjack can automatically propagate its quality standards to other Python projects by creating or updating their CLAUDE.md and RULES.md files. This ensures consistent AI code generation across all projects.
850
+
851
+ **📄 Template Propagation Commands**
852
+
853
+ ```bash
854
+ # Update CLAUDE.md and RULES.md with latest quality standards (only if they don't exist)
855
+ python -m crackerjack --update-docs
856
+
857
+ # Force update CLAUDE.md and RULES.md even if they already exist
858
+ python -m crackerjack --force-update-docs
859
+ ```
860
+
861
+ **When to Use Documentation Templates**
862
+
863
+ - **New Projects**: Use `--update-docs` to create initial documentation templates
864
+ - **Quality Standard Updates**: Use `--force-update-docs` weekly to keep standards current
865
+ - **AI Integration**: Ensures Claude Code generates compliant code on first pass across all projects
866
+ - **Team Synchronization**: Keeps all team projects using the same quality standards
867
+
868
+ **How Template Management Works**
869
+
870
+ - **Quality Standards**: Copies the latest Refurb, Pyright, Complexipy, and Bandit standards from Crackerjack
871
+ - **Project Customization**: Customizes project-specific sections (project name, overview)
872
+ - **Standard Preservation**: Preserves the core quality standards and AI generation guidelines
873
+ - **Git Integration**: Automatically adds files to git for easy committing
874
+
875
+ This feature is particularly valuable for teams maintaining multiple Python projects, ensuring that AI assistants generate consistent, high-quality code across all repositories.
876
+
468
877
  #### Configuration Management
469
878
 
470
879
  - **Skip Config Updates** - Run checks without updating configuration files:
@@ -535,6 +944,106 @@ python -m crackerjack --ai-agent --test
535
944
 
536
945
  For detailed information about using Crackerjack with AI agents, including the structured output format and programmatic usage, see [README-AI-AGENT.md](README-AI-AGENT.md).
537
946
 
947
+ ## Session Progress Tracking
948
+
949
+ Crackerjack includes robust session progress tracking to maintain continuity during long-running development sessions and enable seamless collaboration with AI assistants.
950
+
951
+ ### Key Features
952
+
953
+ - **Automatic Progress Logging:** Tracks each step of the crackerjack workflow with detailed timestamps and status information
954
+ - **Markdown Output:** Generates human-readable progress files with comprehensive task status and file change tracking
955
+ - **Session Recovery:** Automatically detects and resumes interrupted sessions from where they left off
956
+ - **Task Status Tracking:** Monitors pending, in-progress, completed, failed, and skipped tasks with detailed context
957
+ - **File Change Tracking:** Records which files were modified during each task for easy debugging and rollback
958
+ - **Error Recovery:** Provides detailed error information with recovery suggestions and continuation instructions
959
+ - **AI Assistant Integration:** Optimized for AI workflows with structured progress information and session continuity
960
+
961
+ ### Usage Examples
962
+
963
+ **Enable automatic session tracking:**
964
+
965
+ ```bash
966
+ # Basic session tracking with automatic detection
967
+ python -m crackerjack --track-progress -x -t -c
968
+
969
+ # Session tracking with custom progress file
970
+ python -m crackerjack --track-progress --progress-file my-session.md -a patch
971
+
972
+ # Resume from interrupted session (automatic detection)
973
+ python -m crackerjack --track-progress -a patch
974
+ # 📋 Found incomplete session: SESSION-PROGRESS-20240716-143052.md
975
+ # ❓ Resume this session? [y/N]: y
976
+
977
+ # Manual session resumption
978
+ python -m crackerjack --resume-from SESSION-PROGRESS-20240716-143052.md
979
+
980
+ # Combine with AI agent mode for maximum visibility
981
+ python -m crackerjack --track-progress --ai-agent -x -t -c
982
+ ```
983
+
984
+ ### Automatic Session Detection
985
+
986
+ **🚀 Smart Recovery:** Crackerjack automatically detects interrupted sessions and offers to resume them! When you use `--track-progress`, crackerjack will:
987
+
988
+ 1. **Scan for incomplete sessions** in the current directory (last 24 hours)
989
+ 1. **Analyze session status** to determine if resumption is possible
990
+ 1. **Prompt for user confirmation** with detailed session information
991
+ 1. **Automatically resume** from the most recent incomplete task
992
+
993
+ ### Progress File Structure
994
+
995
+ Progress files are generated in markdown format with comprehensive information:
996
+
997
+ ````markdown
998
+ # Crackerjack Session Progress: abc123def
999
+
1000
+ **Session ID**: abc123def
1001
+ **Started**: 2024-07-16 14:30:52
1002
+ **Status**: In Progress
1003
+ **Progress**: 3/8 tasks completed
1004
+
1005
+ ## Task Progress Overview
1006
+ | Task | Status | Duration | Details |
1007
+ |------|--------|----------|---------|
1008
+ | Setup | ✅ completed | 0.15s | Project structure initialized |
1009
+ | Clean | ⏳ in_progress | - | Removing docstrings and comments |
1010
+ | Tests | ⏸️ pending | - | - |
1011
+
1012
+ ## Detailed Task Log
1013
+ ### ✅ Setup - COMPLETED
1014
+ - **Started**: 2024-07-16 14:30:52
1015
+ - **Completed**: 2024-07-16 14:30:52
1016
+ - **Duration**: 0.15s
1017
+ - **Files Changed**: None
1018
+ - **Details**: Project structure initialized
1019
+
1020
+ ## Files Modified This Session
1021
+ - src/main.py
1022
+ - tests/test_main.py
1023
+
1024
+ ## Session Recovery Information
1025
+ If this session was interrupted, you can resume from where you left off:
1026
+ ```bash
1027
+ python -m crackerjack --resume-from SESSION-PROGRESS-20240716-143052.md
1028
+ ````
1029
+
1030
+ ### Benefits for Development Workflows
1031
+
1032
+ - **Long-running Sessions:** Perfect for complex development workflows that may be interrupted
1033
+ - **Team Collaboration:** Share session files with team members to show exactly what was done
1034
+ - **Debugging Support:** Detailed logs help diagnose issues and understand workflow execution
1035
+ - **AI Assistant Continuity:** AI assistants can read progress files to understand current project state
1036
+ - **Audit Trail:** Complete record of all changes and operations performed during development
1037
+
1038
+ ### Integration with Other Features
1039
+
1040
+ Session progress tracking works seamlessly with:
1041
+
1042
+ - **AI Agent Mode:** Structured output files reference progress tracking for enhanced AI workflows
1043
+ - **Interactive Mode:** Progress is displayed in the Rich UI with real-time updates
1044
+ - **Benchmark Mode:** Performance metrics are included in progress files for analysis
1045
+ - **Version Bumping:** Version changes are tracked in session history for rollback support
1046
+
538
1047
  ## Interactive Rich UI
539
1048
 
540
1049
  Crackerjack now offers an enhanced interactive experience through its Rich UI:
@@ -592,6 +1101,82 @@ For the most comprehensive error details with visual formatting, combine verbose
592
1101
  python -m crackerjack -i -v
593
1102
  ```
594
1103
 
1104
+ ## Performance Optimization
1105
+
1106
+ Crackerjack is optimized for performance across different project sizes and development scenarios:
1107
+
1108
+ ### ⚡ Development Speed Optimization
1109
+
1110
+ **Fast Mode Execution:**
1111
+
1112
+ - **Target Time**: \<5 seconds for most operations
1113
+ - **Smart Hook Selection**: Essential hooks only during development
1114
+ - **Parallel Processing**: Intelligent worker allocation based on system resources
1115
+ - **Incremental Updates**: Only processes changed files when possible
1116
+
1117
+ **Adaptive Configuration:**
1118
+
1119
+ ```bash
1120
+ # Automatic optimization based on project size
1121
+ python -m crackerjack # Auto-detects and optimizes
1122
+
1123
+ # Force fast mode for development
1124
+ python -m crackerjack --fast
1125
+
1126
+ # Override for large projects
1127
+ python -m crackerjack --test-workers=2 --test-timeout=300
1128
+ ```
1129
+
1130
+ ### 🔍 Quality vs Speed Balance
1131
+
1132
+ | Operation | Fast Mode (\<5s) | Comprehensive Mode (\<30s) | Use Case |
1133
+ |-----------|----------------|---------------------------|----------|
1134
+ | **Pre-commit** | Essential hooks | All hooks + analysis | Development vs Release |
1135
+ | **Testing** | Parallel execution | Full suite + benchmarks | Quick check vs Validation |
1136
+ | **Code Cleaning** | Basic formatting | Deep analysis + refactoring | Daily work vs Refactoring |
1137
+
1138
+ ### 📊 Project Size Adaptation
1139
+
1140
+ **Small Projects (\<1000 lines):**
1141
+
1142
+ - Default: Maximum parallelization
1143
+ - Fast hooks with minimal overhead
1144
+ - Quick test execution
1145
+
1146
+ **Medium Projects (1000-10000 lines):**
1147
+
1148
+ - Balanced worker allocation
1149
+ - Selective comprehensive checks
1150
+ - Optimized timeout settings
1151
+
1152
+ **Large Projects (>10000 lines):**
1153
+
1154
+ - Conservative parallelization
1155
+ - Extended timeouts
1156
+ - Strategic hook selection
1157
+ - Session progress tracking recommended
1158
+
1159
+ ### 🚀 CI/CD Optimization
1160
+
1161
+ **Pre-push Hooks:**
1162
+
1163
+ ```bash
1164
+ # Install optimized pre-push hooks
1165
+ pre-commit install --hook-type pre-push
1166
+
1167
+ # Comprehensive validation before push
1168
+ python -m crackerjack --comprehensive --ai-agent -t
1169
+ ```
1170
+
1171
+ **Performance Monitoring:**
1172
+
1173
+ - Benchmark regression detection
1174
+ - Statistical performance analysis
1175
+ - Automated performance alerts
1176
+ - Long-term trend tracking
1177
+
1178
+ This multi-layered optimization approach ensures that Crackerjack remains fast during development while providing thorough analysis when needed.
1179
+
595
1180
  ## Python 3.13+ Features
596
1181
 
597
1182
  Crackerjack is designed to leverage the latest Python 3.13+ language features: