Skip to content

Commit b84c2fa

Browse files
GeneAIclaude
authored andcommitted
feat: Enterprise-ready workflows with formatted reports
Major enhancements for v3.2.x release: ## Formatted Reports for All Workflows - Added consistent `formatted_report` output to all 10 workflows - Professional structure with status icons and actionable summaries - Workflows: health-check, security-audit, perf-audit, dependency-check, code-review, release-prep, refactor-plan, secure-release, doc-gen, test-gen ## Enterprise Doc-Gen Features - Auto-scaling tokens based on section count (2k tokens/section) - Chunked generation for large documents (sections_per_chunk=3) - Chunked polish for documents over 10k tokens - Cost guardrails with configurable max_cost ($5 default) - Graceful degradation with partial results on errors - File export to docs/generated/ directory - Output chunking for display (avoids terminal truncation) ## README Updates - Added "Enterprise-Ready Workflows" to What's New section - New "Enterprise Doc-Gen" section with usage examples - Updated workflow table with formatted reports mention 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 134e9ad commit b84c2fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+6666
-729
lines changed

.claude/CLAUDE.md

Lines changed: 8 additions & 404 deletions
Large diffs are not rendered by default.

.claude/python-standards.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Python Coding Standards
2+
3+
- Use type hints
4+
- Follow PEP 8
5+
- Write docstrings
6+
- Target 90%+ test coverage

.pre-commit-config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,22 @@ repos:
5050
args: ['-c', '.bandit', '-r', 'src/', 'empathy_software_plugin/', 'empathy_llm_toolkit/', 'coach_wizards/', '--severity-level', 'medium', '--confidence-level', 'medium']
5151
pass_filenames: false
5252

53+
# Detect-secrets - Prevent secrets from being committed
54+
- repo: https://github.com/Yelp/detect-secrets
55+
rev: v1.5.0
56+
hooks:
57+
- id: detect-secrets
58+
args: ['--baseline', '.secrets.baseline']
59+
exclude: |
60+
(?x)^(
61+
\.env\.example$|
62+
tests/test_secrets_detector\.py$|
63+
tests/test_secure_memdocs\.py$|
64+
empathy_llm_toolkit/security/secrets_detector\.py$|
65+
empathy_llm_toolkit/security/secure_memdocs_example\.py$|
66+
anthropic-cookbook/
67+
)
68+
5369
# Standard pre-commit hooks
5470
- repo: https://github.com/pre-commit/pre-commit-hooks
5571
rev: v5.0.0

.secrets.baseline

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{
2+
"version": "1.5.0",
3+
"plugins_used": [
4+
{
5+
"name": "ArtifactoryDetector"
6+
},
7+
{
8+
"name": "AWSKeyDetector"
9+
},
10+
{
11+
"name": "AzureStorageKeyDetector"
12+
},
13+
{
14+
"name": "Base64HighEntropyString",
15+
"limit": 4.5
16+
},
17+
{
18+
"name": "BasicAuthDetector"
19+
},
20+
{
21+
"name": "CloudantDetector"
22+
},
23+
{
24+
"name": "DiscordBotTokenDetector"
25+
},
26+
{
27+
"name": "GitHubTokenDetector"
28+
},
29+
{
30+
"name": "HexHighEntropyString",
31+
"limit": 3.0
32+
},
33+
{
34+
"name": "IbmCloudIamDetector"
35+
},
36+
{
37+
"name": "IbmCosHmacDetector"
38+
},
39+
{
40+
"name": "JwtTokenDetector"
41+
},
42+
{
43+
"name": "KeywordDetector",
44+
"keyword_exclude": ""
45+
},
46+
{
47+
"name": "MailchimpDetector"
48+
},
49+
{
50+
"name": "NpmDetector"
51+
},
52+
{
53+
"name": "OpenAIDetector"
54+
},
55+
{
56+
"name": "PrivateKeyDetector"
57+
},
58+
{
59+
"name": "SendGridDetector"
60+
},
61+
{
62+
"name": "SlackDetector"
63+
},
64+
{
65+
"name": "SoftlayerDetector"
66+
},
67+
{
68+
"name": "SquareOAuthDetector"
69+
},
70+
{
71+
"name": "StripeDetector"
72+
},
73+
{
74+
"name": "TelegramBotTokenDetector"
75+
},
76+
{
77+
"name": "TwilioKeyDetector"
78+
}
79+
],
80+
"filters_used": [
81+
{
82+
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
83+
},
84+
{
85+
"path": "detect_secrets.filters.common.is_baseline_file",
86+
"filename": ".secrets.baseline"
87+
},
88+
{
89+
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
90+
"min_level": 2
91+
},
92+
{
93+
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
94+
},
95+
{
96+
"path": "detect_secrets.filters.heuristic.is_likely_id_string"
97+
},
98+
{
99+
"path": "detect_secrets.filters.heuristic.is_lock_file"
100+
},
101+
{
102+
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
103+
},
104+
{
105+
"path": "detect_secrets.filters.heuristic.is_potential_uuid"
106+
},
107+
{
108+
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
109+
},
110+
{
111+
"path": "detect_secrets.filters.heuristic.is_sequential_string"
112+
},
113+
{
114+
"path": "detect_secrets.filters.heuristic.is_swagger_file"
115+
},
116+
{
117+
"path": "detect_secrets.filters.heuristic.is_templated_secret"
118+
}
119+
],
120+
"results": {},
121+
"generated_at": "2025-12-25T00:00:00Z"
122+
}

README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ pip install empathy-framework[full]
1414

1515
## What's New in v3.2.x
1616

17+
### Enterprise-Ready Workflows
18+
19+
- **Formatted Reports for All Workflows** — Every workflow now includes `formatted_report` with consistent structure, status icons, and actionable summaries
20+
- **Enterprise-Safe Doc-Gen** — Auto-scaling tokens, chunked generation, cost guardrails ($5 default limit), graceful degradation, and file export
21+
- **Output Chunking** — Large reports automatically split into displayable sections to avoid truncation
22+
1723
### Unified CLI & Developer Experience
1824

1925
- **Unified Typer CLI** — One `empathy` command with Rich output, subcommand groups, and cheatsheet
@@ -225,6 +231,41 @@ print(result.summary, result.findings, result.checklist)
225231

226232
---
227233

234+
## Enterprise Doc-Gen
235+
236+
Generate comprehensive documentation for large projects with enterprise-safe defaults:
237+
238+
```python
239+
from empathy_os.workflows import DocumentGenerationWorkflow
240+
241+
# Enterprise-safe configuration
242+
workflow = DocumentGenerationWorkflow(
243+
export_path="docs/generated", # Auto-save to disk
244+
max_cost=5.0, # Cost guardrail ($5 default)
245+
chunked_generation=True, # Handle large projects
246+
graceful_degradation=True, # Partial results on errors
247+
)
248+
249+
result = await workflow.execute(
250+
source_code=your_code,
251+
doc_type="api_reference",
252+
audience="developers"
253+
)
254+
255+
# Access the formatted report
256+
print(result.final_output["formatted_report"])
257+
258+
# Large outputs are chunked for display
259+
if "output_chunks" in result.final_output:
260+
for chunk in result.final_output["output_chunks"]:
261+
print(chunk)
262+
263+
# Full docs saved to disk
264+
print(f"Saved to: {result.final_output.get('export_path')}")
265+
```
266+
267+
---
268+
228269
## Smart Router
229270

230271
Route natural language requests to the right wizard automatically:
@@ -391,7 +432,7 @@ cd empathy-framework && pip install -e .[dev]
391432
| **Multi-Model Router** | Smart routing across providers and tiers |
392433
| **Memory System** | Redis short-term + encrypted long-term patterns |
393434
| **17 Coach Wizards** | Security, performance, testing, docs, prompt engineering |
394-
| **10 Cost-Optimized Workflows** | Multi-tier pipelines with XML prompts |
435+
| **10 Cost-Optimized Workflows** | Multi-tier pipelines with formatted reports & XML prompts |
395436
| **Healthcare Suite** | SBAR, SOAP notes, clinical protocols (HIPAA) |
396437
| **Code Inspection** | Unified pipeline with SARIF/GitHub Actions support |
397438
| **VSCode Extension** | Visual dashboard for memory and workflows |

SECURITY.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,43 @@ The Empathy Framework includes several security features:
9595
3. **API Key Protection**: Environment variable-based configuration
9696
4. **Audit Trail**: Optional logging of all wizard invocations
9797
5. **Rate Limiting**: Built-in protection against service abuse
98+
6. **Command Injection Prevention**: All file paths and user inputs are validated before subprocess execution
99+
7. **Secrets Detection**: Pre-commit hooks using detect-secrets to prevent accidental credential exposure
100+
101+
### Pre-commit Security Hooks
102+
103+
Run `pre-commit install` to enable:
104+
105+
```bash
106+
pre-commit install
107+
```
108+
109+
Security hooks include:
110+
111+
- **detect-secrets**: Scans for potential API keys and credentials
112+
- **bandit**: Python security linter for common vulnerabilities
113+
114+
### Built-in Security Tools
115+
116+
```python
117+
from empathy_llm_toolkit.security import SecretsDetector, PIIScrubber
118+
119+
# Detect secrets in content
120+
detector = SecretsDetector()
121+
findings = detector.scan(content)
122+
123+
# Scrub PII before storage
124+
scrubber = PIIScrubber()
125+
clean_content = scrubber.scrub(content)
126+
```
127+
128+
### Test Credentials
129+
130+
All test files use obviously fake credentials:
131+
132+
- Prefix with `TEST_`, `FAKE_`, or `EXAMPLE_`
133+
- Use placeholder patterns like `abc123xyz789...`
134+
- AWS example keys: `AKIAIOSFODNN7EXAMPLE`
98135

99136
## Known Security Considerations
100137

backend/api/requirements.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1-
fastapi==0.104.1
2-
uvicorn[standard]==0.24.0
1+
# API-specific requirements
2+
#
3+
# For full installation, use from project root:
4+
# pip install -e .[backend]
5+
#
6+
# This file is for minimal API-only deployments.
7+
8+
# FastAPI (CVE-fixed versions aligned with pyproject.toml)
9+
fastapi>=0.109.1,<1.0.0
10+
uvicorn[standard]>=0.20.0,<1.0.0

backend/api/wizard_api.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,35 +58,35 @@
5858
from empathy_llm_toolkit.wizards.retail_wizard import RetailWizard # noqa: E402
5959
from empathy_llm_toolkit.wizards.sales_wizard import SalesWizard # noqa: E402
6060
from empathy_llm_toolkit.wizards.technology_wizard import TechnologyWizard # noqa: E402
61-
from empathy_software_plugin.wizards.advanced_debugging_wizard import ( # noqa: E402
61+
from empathy_software_plugin.wizards.advanced_debugging_wizard import (
6262
AdvancedDebuggingWizard,
63-
)
64-
from empathy_software_plugin.wizards.agent_orchestration_wizard import ( # noqa: E402
63+
) # noqa: E402
64+
from empathy_software_plugin.wizards.agent_orchestration_wizard import (
6565
AgentOrchestrationWizard,
66-
)
67-
from empathy_software_plugin.wizards.ai_collaboration_wizard import ( # noqa: E402
66+
) # noqa: E402
67+
from empathy_software_plugin.wizards.ai_collaboration_wizard import (
6868
AICollaborationWizard,
69-
)
69+
) # noqa: E402
7070
from empathy_software_plugin.wizards.ai_context_wizard import AIContextWindowWizard # noqa: E402
71-
from empathy_software_plugin.wizards.ai_documentation_wizard import ( # noqa: E402
71+
from empathy_software_plugin.wizards.ai_documentation_wizard import (
7272
AIDocumentationWizard,
73-
)
74-
from empathy_software_plugin.wizards.enhanced_testing_wizard import ( # noqa: E402
73+
) # noqa: E402
74+
from empathy_software_plugin.wizards.enhanced_testing_wizard import (
7575
EnhancedTestingWizard,
76-
)
76+
) # noqa: E402
7777

7878
# AI wizards (12 total)
7979
from empathy_software_plugin.wizards.multi_model_wizard import MultiModelWizard # noqa: E402
80-
from empathy_software_plugin.wizards.performance_profiling_wizard import ( # noqa: E402
80+
from empathy_software_plugin.wizards.performance_profiling_wizard import (
8181
PerformanceProfilingWizard as AIPerformanceWizard,
82-
)
83-
from empathy_software_plugin.wizards.prompt_engineering_wizard import ( # noqa: E402
82+
) # noqa: E402
83+
from empathy_software_plugin.wizards.prompt_engineering_wizard import (
8484
PromptEngineeringWizard,
85-
)
85+
) # noqa: E402
8686
from empathy_software_plugin.wizards.rag_pattern_wizard import RAGPatternWizard # noqa: E402
87-
from empathy_software_plugin.wizards.security_analysis_wizard import ( # noqa: E402
87+
from empathy_software_plugin.wizards.security_analysis_wizard import (
8888
SecurityAnalysisWizard,
89-
)
89+
) # noqa: E402
9090

9191
logging.basicConfig(level=logging.INFO)
9292
logger = logging.getLogger(__name__)

backend/requirements.txt

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
# Backend requirements for Empathy Framework API
2+
#
3+
# For development, install from the project root:
4+
# pip install -e .[backend,dev]
5+
#
6+
# This file provides standalone installation for deployments.
7+
# Version constraints are aligned with pyproject.toml
28

3-
# FastAPI and web server
4-
fastapi==0.115.6
5-
uvicorn[standard]==0.34.0
6-
python-multipart==0.0.20
9+
# FastAPI and web server (CVE-fixed versions)
10+
fastapi>=0.109.1,<1.0.0
11+
uvicorn[standard]>=0.20.0,<1.0.0
12+
starlette>=0.40.0,<1.0.0
13+
python-multipart>=0.0.9,<1.0.0
714

815
# Security and authentication
9-
PyJWT[crypto]>=2.8.0 # Replaces python-jose - uses cryptography backend
10-
passlib[bcrypt]==1.7.4
11-
python-dotenv==1.0.0
16+
PyJWT[crypto]>=2.8.0,<3.0.0
17+
passlib[bcrypt]>=1.7.4,<2.0.0
18+
python-dotenv>=1.0.0,<2.0.0
1219

13-
# Data validation
14-
pydantic==2.5.3
15-
pydantic-settings==2.1.0
16-
email-validator==2.1.0
20+
# Data validation (match core deps)
21+
pydantic>=2.0.0,<3.0.0
22+
pydantic-settings>=2.0.0,<3.0.0
23+
email-validator>=2.0.0,<3.0.0
1724

1825
# Async support
19-
aiofiles==23.2.1
20-
21-
# Database (for future use)
22-
# sqlalchemy==2.0.25
23-
# alembic==1.13.1
24-
25-
# Testing
26-
pytest==7.4.4
27-
pytest-asyncio==0.23.3
28-
httpx==0.26.0
26+
aiofiles>=23.0.0,<24.0.0

0 commit comments

Comments
 (0)