Add Docker support and documentation updates

- Add Dockerfile for containerized builds
- Add .dockerignore for cleaner builds
- Add CLAUDE.md for development guidance
- Update README and docs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
This commit is contained in:
rob
2025-12-23 23:40:13 -04:00
co-authored by Claude Opus 4.5
parent 7e9bd0d533
commit 65279bd8c8
9 changed files with 471 additions and 5 deletions
+44
View File
@@ -317,6 +317,50 @@ Tool names must:
- Contain only letters, numbers, underscores, and dashes
- Not contain spaces or shell-problematic characters (`/\|&;$`"'<>(){}[]!?*#~`)
## Tool Composition
SmartTools are designed to chain together like any Unix command.
### External Pipelines (Tool-to-Tool)
```bash
# Chain multiple SmartTools
cat logs.txt | log-errors | summarize | translate --lang Japanese
# Mix with standard Unix tools
git log --oneline | head -20 | changelog | tee CHANGELOG.md
# Build complex workflows
cat *.py | review-code --focus security | json-extract --fields "issue, severity, file" | json2csv
```
Each tool reads stdin and writes stdout. No special integration needed.
### Internal Pipelines (Multi-Step)
Within a single tool, chain steps for preprocessing/validation:
```yaml
steps:
- type: code # Preprocess
code: |
filtered = '\n'.join(l for l in input.split('\n') if 'ERROR' in l)
output_var: filtered
- type: prompt # AI processes filtered input
prompt: "Explain these errors: {filtered}"
provider: claude-haiku
output_var: explanation
- type: code # Post-process
code: |
result = f"Found {len(filtered.split(chr(10)))} errors:\n\n{explanation}"
output_var: result
output: "{result}"
```
**When to use which:**
- **External pipelines**: Reusable tools, different providers per stage, standard Unix interop
- **Internal pipelines**: Tightly coupled steps, shared context, validation of AI output
## What This Design Doesn't Include
Intentionally omitted (not needed for personal use):
+98
View File
@@ -958,3 +958,101 @@ output: "{result}"
2. **Use code steps** to validate AI output
3. **Preprocess large inputs** to reduce tokens
4. **Test with mock** before using real AI: `--provider mock`
---
## Pipeline Recipes
SmartTools chain together like Unix commands. Here are practical examples:
### Development Workflows
```bash
# Quick PR review: extract changes, review, summarize
git diff main | diff-focus | review-code --focus "bugs and security" | tldr
# Explain and fix an error in one pipeline
python script.py 2>&1 | explain-error | tee error_analysis.txt
# Generate tests for changed files only
git diff --name-only | grep '\.py$' | xargs cat | gen-tests > new_tests.py
# Create release notes from commits
git log v1.0..v1.1 --oneline | changelog | translate --lang French > RELEASE_FR.md
```
### Data Processing
```bash
# Extract, transform, analyze
curl -s api.example.com/data | json-extract --fields "users, revenue" | json2csv | csv-insights
# Process multiple files
for f in reports/*.txt; do
cat "$f" | json-extract --fields "total, date"
done | json2csv > summary.csv
# Clean and deduplicate contacts
cat *.vcf | extract-contacts | sort -u -t',' -k2 > contacts.csv
```
### Text Processing Pipelines
```bash
# Translate technical docs for international team
cat API.md | simplify --level "non-technical" | translate --lang Spanish > API_ES.md
# Process customer feedback
cat feedback.txt | summarize --length "10 points" | tone-shift --tone analytical | json-extract --fields "themes, sentiment"
# Prepare content for different audiences
cat whitepaper.txt | eli5 > simple_version.txt
cat whitepaper.txt | summarize > executive_summary.txt
```
### Shell Functions
Add these to `~/.bashrc` for common workflows:
```bash
# Review recent changes
review-recent() {
git diff HEAD~"${1:-1}" | diff-focus | review-code | tldr
}
# Quick translate with summary
translate-summary() {
cat "$1" | summarize | translate --lang "${2:-Spanish}"
}
# Analyze any log file
analyze-log() {
cat "$1" | log-errors | summarize --length "5 key issues"
}
# Generate commit message and commit
auto-commit() {
msg=$(git diff --staged | commit-msg)
echo "Commit message: $msg"
read -p "Commit? [y/N] " confirm
[[ $confirm == [yY] ]] && git commit -m "$msg"
}
```
### Combining with Standard Unix Tools
```bash
# Filter before AI processing (saves tokens)
cat huge.log | grep -i error | tail -100 | explain-error
# Post-process AI output
cat doc.txt | summarize | fmt -w 80 > formatted_summary.txt
# Parallel processing
find . -name "*.py" | parallel -j4 'cat {} | review-code > {}.review'
# Watch and process
tail -f app.log | grep --line-buffered ERROR | while read line; do
echo "$line" | explain-error
done
```