diff --git a/course/labs/_shared/__pycache__/mock_llm.cpython-313.pyc b/course/labs/_shared/__pycache__/mock_llm.cpython-313.pyc index ca0418b..ee24d24 100644 Binary files a/course/labs/_shared/__pycache__/mock_llm.cpython-313.pyc and b/course/labs/_shared/__pycache__/mock_llm.cpython-313.pyc differ diff --git a/course/labs/_shared/mock_llm.py b/course/labs/_shared/mock_llm.py index 89c566c..2f3c3ff 100644 --- a/course/labs/_shared/mock_llm.py +++ b/course/labs/_shared/mock_llm.py @@ -127,22 +127,44 @@ def _generate_tool_input(tool_name: str, prompt: str) -> dict: def _generate_text_response(prompt: str) -> str: - """Generate realistic mock text response.""" + """Generate realistic mock text response from tool results or user input.""" if not prompt or len(prompt) < 5: return "I understand your request. How can I help you further?" prompt_lower = prompt.lower() + # File content responses + if "contents of" in prompt_lower: + return "Based on the file contents, I can see the document contains sample data. The key information includes test records and example data points. What specific aspect would you like me to analyze?" + + # Search result responses + if "search" in prompt_lower and ("result" in prompt_lower or "found" in prompt_lower): + return "Here are the search results I found. The most relevant result covers the topic you asked about with specific examples and implementation details." + + # Write confirmation responses + if "successfully wrote" in prompt_lower or "wrote" in prompt_lower: + return "The file has been written successfully. I've confirmed the content was saved correctly." + + # Hello/greetings if "hello" in prompt_lower or "hi " in prompt_lower: return "Hello! I'm your AI coding agent. How can I help you today?" + + # Explanation patterns elif "explain" in prompt_lower or "what is" in prompt_lower: return "Based on my analysis: this is a well-known pattern in software engineering. The key insight is that it separates concerns and allows for independent evolution of components." + + # Error/fix patterns elif "error" in prompt_lower or "bug" in prompt_lower or "fix" in prompt_lower: return "I found the issue. The problem is a missing null check on line 42. Adding `if value is not None:` before the operation resolves it." + + # Test results elif "test" in prompt_lower or "pytest" in prompt_lower: return "All tests pass. 34 passed, 0 failed, 0 skipped. Completed in 3.62 seconds." + + # Summary requests elif "summarize" in prompt_lower or "summary" in prompt_lower: return "Summary: The document covers three main topics. First, architectural patterns for agent systems. Second, security considerations for production deployments. Third, evaluation methodologies." + else: return "I've completed the analysis. Here are the key findings:\n\n1. The approach is viable\n2. Recommended next steps are documented\n3. No blockers identified\n\nWould you like me to proceed with implementation?" diff --git a/products/multi-agent-orch/examples/agent-team-config.md b/products/multi-agent-orch/examples/agent-team-config.md new file mode 100644 index 0000000..46854f1 --- /dev/null +++ b/products/multi-agent-orch/examples/agent-team-config.md @@ -0,0 +1,91 @@ +# Multi-Agent Team — Example Configuration + +This example sets up a 3-team agent system for a web application project. + +## Team Structure + +``` +Orchestrator +├── Frontend Team Lead +│ ├── UI Developer (React components) +│ └── Styling Specialist (CSS/Tailwind) +├── Backend Team Lead +│ ├── API Developer (endpoints, routes) +│ └── Database Specialist (queries, migrations) +└── Review Team Lead + ├── Code Reviewer (quality, patterns) + └── Security Reviewer (vulnerabilities) +``` + +## Configuration + +```yaml +# .pi/multi-team/teams.yaml +teams: + orchestrator: + model: claude-opus-4 + role: "Orchestrator — delegates, never executes" + max_turns: 25 + + frontend-lead: + model: claude-sonnet-4 + role: "Frontend Team Lead — plans UI work, delegates to devs" + max_turns: 30 + agents: + - frontend-dev + - styling-dev + + backend-lead: + model: claude-sonnet-4 + role: "Backend Team Lead — plans API work, delegates to devs" + max_turns: 30 + agents: + - api-dev + - db-dev + + review-lead: + model: claude-sonnet-4 + role: "Review Team Lead — coordinates quality checks" + max_turns: 20 + agents: + - code-reviewer + - security-reviewer +``` + +## Domain Locking + +```yaml +# Frontend domain +frontend-lead: + domain: + - path: src/frontend/ + read: true + upsert: true + delete: false + - path: src/shared/ + read: true + upsert: false + delete: false + +# Backend domain +backend-lead: + domain: + - path: src/api/ + read: true + upsert: true + delete: false + - path: src/db/ + read: true + upsert: true + delete: false +``` + +## Running + +```bash +# Start the team +cd your-project && just multi-team + +# Delegate a task +"Design and implement a user profile feature" +``` diff --git a/products/security-foundation/examples/L3-blacklist-hook.md b/products/security-foundation/examples/L3-blacklist-hook.md new file mode 100644 index 0000000..8aaceda --- /dev/null +++ b/products/security-foundation/examples/L3-blacklist-hook.md @@ -0,0 +1,60 @@ +# L3 Blacklist Hook — Example Setup + +This example shows how to configure a Level 3 blacklist hook for Claude Code on a web application project. + +## Installation + +```bash +# Install the security-foundation kit +bash install.sh security + +# Or manually copy the hook +cp skills/kits/security-foundation/skills/damage-control/hooks/pre-tool.l3-blacklist.js .claude/hooks/ +``` + +## Configuration: Web App Project + +```yaml +# .claude/hooks/l3-blacklist.yaml +blocked_commands: + # Destructive operations + - pattern: "rm -rf" + severity: critical + - pattern: "rm -r" + severity: critical + - pattern: "git clean -fdx" + severity: high + - pattern: "git reset --hard" + severity: high + - pattern: "drop table" + severity: critical + - pattern: "drop database" + severity: critical + - pattern: "truncate" + severity: high + + # Network operations (warn only) + - pattern: "curl -X POST" + severity: warn + - pattern: "nc " + severity: warn +``` + +## Expected Behavior + +| Command | Blocked? | Response | +|---------|----------|----------| +| `rm -rf node_modules` | YES | `BLOCKED: rm -rf is not allowed` | +| `git status` | Allowed | Normal output | +| `npm install express` | Allowed | Normal output | +| `DROP TABLE users` | YES | `BLOCKED: DROP TABLE is not allowed` | +| `git commit -m "fix"` | Allowed | Normal output | + +## Testing It Works + +```bash +# Should be blocked +echo "test" > /tmp/test-rm.txt && rm -rf /tmp/test-rm.txt + +# Output: BLOCKED: rm -rf is not allowed +``` diff --git a/site/.vitepress/dist/.nojekyll b/site/.vitepress/dist/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/site/.vitepress/dist/404.html b/site/.vitepress/dist/404.html index 70ef594..38b38d0 100644 --- a/site/.vitepress/dist/404.html +++ b/site/.vitepress/dist/404.html @@ -6,14 +6,14 @@