Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .claude/commands/automation/aider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
description: Launch Aider with Amplifier presets for targeted regeneration
argument-hint: [files ...] [--options]
allowed-tools: Bash
---

Start an Aider session using the Amplifier CLI wrapper. Arguments are passed directly to the CLI.

Execute: !`python -m amplifier.cli aider $ARGUMENTS 2>&1`

Use this command to open Aider against specific files or with additional flags (for example, `--zen` or `-m "refactor this"`).

Examples:
- `/aider mymodule.py --zen -m "Simplify this module"`
- `/aider --mode chat -m "How should I structure this feature?"`
- `/aider file1.py file2.py -m "Add error handling"`
17 changes: 17 additions & 0 deletions .claude/commands/automation/heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
description: Run the Amplifier auto-healing workflow through the CLI
argument-hint: [--check-only] [--max N] [--threshold SCORE]
allowed-tools: Bash
---

Automate healing of unhealthy modules using the Amplifier CLI.

## Current Status
!`python -m amplifier.cli heal --check-only 2>&1`

## Task
Based on the health analysis above, run the healing process with the provided arguments (or use defaults if no arguments provided).

Execute: !`python -m amplifier.cli heal --yes $ARGUMENTS 2>&1`

Review the reported results and summarize the improvements made to each module.
2 changes: 1 addition & 1 deletion .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
".vscode",
".claude",
".ai",
"~/amplifier"
"~/dev/amplifier"
]
},
"enableAllProjectMcpServers": false,
Expand Down
139 changes: 77 additions & 62 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,62 +1,77 @@
# Private settings
**/certs/*.pem
**/certs/config.json
**/certs/mkcert
.env
*.local
*.user
*__local__*
appsettings.*.json
**/.DS_Store

# Dependencies and build cache
node_modules
.venv
__pycache__
.pytest_cache
.ruff_cache
.cache
*.egg-info
bin
obj
dist
build

# Logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

#azd files
.azure
azure.yaml
next-steps.md

# Generated files
output
logs

# Test files
.coverage

# Working folders
ai_working/tmp
.tmp

# Ignore Windows Alternate Data Streams (ADS) files that may appear in WSL
**/*Zone.Identifier
**/*:Zone.Identifier
**/*sec.endpointdlp
**/*:sec.endpointdlp

# Default data directory
.data/

# .claude-trace Logs
.claude-trace

# Smoke test runtime logs
.smoke_test_data/data
# Private settings
**/certs/*.pem
**/certs/config.json
**/certs/mkcert
.env
*.local
*.user
*__local__*
appsettings.*.json
**/.DS_Store

# Dependencies and build cache
node_modules
.venv
__pycache__
.pytest_cache
.ruff_cache
.cache
*.egg-info
# bin directory for build artifacts (but allow our global command)
# bin
obj
dist
build

# Logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

#azd files
.azure
azure.yaml
next-steps.md

# Generated files
output
logs

# Test files
.coverage

# Working folders
ai_working/tmp
.tmp

# Ignore Windows Alternate Data Streams (ADS) files that may appear in WSL
**/*Zone.Identifier
**/*:Zone.Identifier
**/*sec.endpointdlp
**/*:sec.endpointdlp

# Default data directory
.data/

# .claude-trace Logs
.claude-trace

# Smoke test runtime logs
.smoke_test_data/data

# Aider artifacts
.aider*
.aider.*/

# Test reports and temporary test files
*_TEST_REPORT.md
test_pr*.py
test_cli_*.py

# Temporary files that might be accidentally created
evaluate
repo
this
44 changes: 44 additions & 0 deletions AIDER_PR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Add Aider Tools for AI-Powered Code Regeneration

## Summary

This PR adds standalone Aider tools to Amplifier, enabling AI-powered module regeneration using different development philosophies.

## What's Included

- **`amplifier/tools/aider_regenerator.py`**: Core regeneration tool with support for three philosophies (fractalized, modular, zen)
- **`scripts/setup-aider.sh`**: Installation script for setting up Aider in an isolated environment
- **`docs/aider-tools.md`**: Comprehensive documentation

## Key Features

- **Philosophy-based regeneration**: Choose between fractalized thinking, modular design, or zen simplicity
- **Batch processing**: Regenerate multiple modules at once
- **Specification support**: Regenerate based on explicit specifications
- **Isolated installation**: Aider runs in its own virtual environment to avoid dependency conflicts

## Usage

```bash
# Setup
bash scripts/setup-aider.sh

# Regenerate a module
python amplifier/tools/aider_regenerator.py amplifier/my_module.py --philosophy zen
```

## Why This Matters

AI-powered code regeneration allows for:
- Consistent code quality improvements
- Philosophy-aligned refactoring
- Automated technical debt reduction
- Faster iteration on module design

## Testing

The tool has been tested with:
- Single module regeneration
- Batch processing
- Different philosophy modes
- Error handling (missing files, timeout scenarios)
66 changes: 66 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ default: ## Show essential commands
@echo ""
@echo "Quick Start:"
@echo " make install Install all dependencies"
@echo " make install-global Install global 'amplifier' command"
@echo ""
@echo "Knowledge Base:"
@echo " make knowledge-update Full pipeline: extract & synthesize"
Expand Down Expand Up @@ -54,6 +55,7 @@ help: ## Show ALL available commands
@echo ""
@echo "QUICK START:"
@echo " make install Install all dependencies"
@echo " make install-global Install global 'amplifier' command"
@echo ""
@echo "KNOWLEDGE BASE:"
@echo " make knowledge-update Full pipeline: extract & synthesize"
Expand Down Expand Up @@ -140,6 +142,9 @@ install: ## Install all dependencies
@echo ""
@echo "βœ… All dependencies installed!"
@echo ""
@echo "πŸ’‘ For global access to Amplifier from any directory:"
@echo " make install-global"
@echo ""
@if [ -n "$$VIRTUAL_ENV" ]; then \
echo "βœ“ Virtual environment already active"; \
elif [ -f .venv/bin/activate ]; then \
Expand All @@ -148,6 +153,67 @@ install: ## Install all dependencies
echo "βœ— No virtual environment found. Run 'make install' first."; \
fi

# Global installation
install-global: ## Install global 'amplifier' command for system-wide access
@echo "Installing global Amplifier command..."
@if [ ! -f .venv/bin/activate ]; then \
echo "❌ Please run 'make install' first to create the virtual environment"; \
exit 1; \
fi
@mkdir -p ~/bin
@cp bin/amplifier ~/bin/amplifier
@chmod +x ~/bin/amplifier
@echo "βœ… Global 'amplifier' command installed to ~/bin/amplifier"
@echo ""
@if echo "$$PATH" | grep -q "$$HOME/bin"; then \
echo "βœ“ ~/bin is already in your PATH"; \
else \
echo "πŸ’‘ Add ~/bin to your PATH for global access:"; \
if [ -n "$$ZSH_VERSION" ] || [ "$$SHELL" = "/bin/zsh" ] || [ -f ~/.zshrc ]; then \
echo ' echo "export PATH="\$$HOME/bin:\$$PATH"" >> ~/.zshrc'; \
echo " source ~/.zshrc"; \
else \
echo ' echo "export PATH="\$$HOME/bin:\$$PATH"" >> ~/.bashrc'; \
echo " source ~/.bashrc"; \
fi; \
fi
@echo ""
@echo "Usage: amplifier [project-dir] [claude-options]"
@echo "Example: amplifier ~/my-project --model sonnet"

install-global-system: ## Install global 'amplifier' command system-wide (requires sudo)
@echo "Installing system-wide Amplifier command..."
@if [ ! -f .venv/bin/activate ]; then \
echo "❌ Please run 'make install' first to create the virtual environment"; \
exit 1; \
fi
@echo "This will install to /usr/local/bin and requires sudo privileges."
@read -p "Continue? [y/N] " -n 1 -r; echo; \
if [[ $$REPLY =~ ^[Yy]$$ ]]; then \
sudo cp bin/amplifier /usr/local/bin/amplifier; \
sudo chmod +x /usr/local/bin/amplifier; \
echo "βœ… Global 'amplifier' command installed to /usr/local/bin/amplifier"; \
else \
echo "Installation cancelled."; \
fi

uninstall-global: ## Remove global 'amplifier' command
@echo "Removing global Amplifier command..."
@if [ -f ~/bin/amplifier ]; then \
rm ~/bin/amplifier; \
echo "βœ… Removed ~/bin/amplifier"; \
else \
echo "βœ“ ~/bin/amplifier not found"; \
fi
@if [ -f /usr/local/bin/amplifier ]; then \
echo "System-wide installation found at /usr/local/bin/amplifier"; \
read -p "Remove it? (requires sudo) [y/N] " -n 1 -r; echo; \
if [[ $$REPLY =~ ^[Yy]$$ ]]; then \
sudo rm /usr/local/bin/amplifier; \
echo "βœ… Removed /usr/local/bin/amplifier"; \
fi; \
fi

# Code quality
check: ## Format, lint, and type-check all code
@# Handle worktree virtual environment issues by unsetting mismatched VIRTUAL_ENV
Expand Down
Loading