feat: Circuit Breaker Pattern and UX Improvements (v2.0.0)#4
Merged
feat: Circuit Breaker Pattern and UX Improvements (v2.0.0)#4
Conversation
Added three hook files that were referenced in settings.json but missing from the template: - session-start.js: Intelligent context awareness on session start - context-awareness.js: Alternative context awareness implementation - post-action-suggestions.js: Smart follow-up suggestions after commands This fixes a bug where agentful init would create broken installations with settings.json referencing non-existent hook files. Fixes issues where new installations would fail on session-start hook with MODULE_NOT_FOUND errors.
…h check The health check was only looking for `techStack` (camelCase) but the architecture.json uses `tech_stack` (snake_case). This caused false "malformed architecture.json" warnings on every session start. Updated the check to support both naming conventions.
The drift detector was firing on every file edit, creating confusing "failed with status code 1" messages that weren't actually errors. Changes: - Only warn if analysis is stale (>7 days old) - Silently mark drift for recent changes - Return exit code 0 (success) for non-stale drift - Clearer messaging when action is needed This makes the hook useful without being noisy during normal development.
The drift detector was too noisy, firing on every dependency change. Now it intelligently filters to only trigger on MEANINGFUL changes: TRIGGERS: ✅ Tech stack changes (switched frameworks) ✅ Significant new patterns (20%+ growth AND 50+ new files) ✅ Very stale analysis (>30 days old) DOES NOT TRIGGER: ❌ Minor dependency updates (version bumps) ❌ Small file additions ❌ Recent analysis (<30 days ago) This makes auto-scanning actually useful instead of annoying.
…ation The drift detector now intelligently distinguishes between: - NEW libraries added → triggers re-analysis (creates new skills/agents) - Version bumps → silent (no architectural change) Key improvements: - Parses package.json, requirements.txt, go.mod, etc. - Compares current vs previous dependencies - Only triggers on NEW library additions - Shows which libraries were added in the warning - Stores dependencies for next comparison This ensures agentful generates skills for new capabilities while ignoring minor version updates.
## Circuit Breaker Pattern - Prevent infinite loops by tracking consecutive failures - Automatically trips after 3 failures on same task - Adds blocking decision to decisions.json with recovery options - Continues with other work instead of getting stuck - 1-minute cooldown period before retry ## Simplified Command Structure - Primary Commands: 3 essentials (start, status, decide) - When-Needed Commands: Contextual (validate, product, generate) - Advanced Commands: Power-user features (analyze, init, agents) - Clear "When to Use" guidance for each command ## Progress Indicators - Phase-based progress (Planning → Implementation → Testing → Complete) - Incremental updates every 2 minutes max - Specific file creation notifications - Visual progress bars with checkmarks - Estimated remaining work when appropriate ## Documentation Updates - Updated CLAUDE.md with new command structure - Added circuit breaker troubleshooting - Added progress indicator expectations - Clearer command organization These improvements make agentful more reliable and user-friendly out-of-the-box by preventing infinite loops and providing better visibility into agent progress. Co-authored-by: agentful <agentful@itz4blitz.com>
…nents - Implement integration tests for entry point functions including main, startServer, and signal handlers. - Create unit tests for DatabaseManager, ErrorRepository, PatternRepository, and EmbeddingService with various scenarios. - Introduce TypeScript configuration and Vitest setup for testing. - Update package version to 2.0.0-beta.1. - Enhance documentation for MCP Vector DB usage in agent templates. - Add health check script for MCP server to ensure proper setup and configuration.
Add MCP (Model Context Protocol) integration to enable pattern learning and error fix reuse across all agentful projects. Changes: - Add MCP tools to backend, frontend, tester, and fixer agents - Fix context-awareness.js to check for both 'agents' and 'generatedAgents' fields - Update version.json from 1.4.0 to 2.0.0-beta.1 - Add MCP server documentation with simple setup instructions - MCP enables agents to store/find patterns and learn from past solutions MCP Benefits: - Fixer agent finds known error fixes instantly - Backend/frontend agents reuse successful patterns - Tester agent stores test patterns - Continuous learning from all projects Setup: claude mcp add npx @itz4blitz/agentful-mcp-server
Update build script to copy schema.sql to dist/ directory so it's included in the npm package. This ensures the database schema is available when the MCP server runs from installed package. Build: tsc && cp sql-wasm.wasm dist/infrastructure/ && cp schema.sql dist/
Resolved version conflicts: - Kept 2.0.0-beta.1 (our MCP feature version) over 1.4.1 from main - MCP server integration requires beta version
Fixes CI validation failures where agent files required at least 30% of code blocks to have language specifiers. Changed bare text for MCP documentation sections in backend.md, frontend.md, and tester.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Overview
This PR introduces significant reliability and user experience improvements to agentful, including a circuit breaker pattern to prevent infinite loops, simplified command structure, and real-time progress indicators.
This is a breaking change and will be released as v2.0.0.
🚀 What's New
Circuit Breaker Pattern
decisions.jsonwith recovery optionsImpact: Reduces token waste and prevents stuck agents from burning resources.
Simplified Command Structure
Impact: Reduces choice paralysis and makes agentful more approachable.
Progress Indicators
Impact: Users get real-time visibility into agent work, reducing "is it stuck?" anxiety.
Enhanced Documentation
CLAUDE.mdwith new command structure📋 Breaking Changes
State File Structure
state.jsonnow includescircuit_breakerobject{ "circuit_breaker": { "consecutive_failures": 0, "last_failure_task": null, "last_failure_time": null, "state": "closed" } }Migration Notes
state.jsonfiles will continue to work (circuit breaker defaults to closed state)🔧 Technical Details
Circuit Breaker Logic
Progress Indicator Pattern
✅ Test Plan
📚 Documentation
template/.claude/agents/orchestrator.mdwith circuit breaker patterntemplate/.claude/agents/backend.mdwith progress indicatorstemplate/.claude/agents/frontend.mdwith progress indicatorstemplate/.claude/commands/agentful.mdwith simplified commandstemplate/CLAUDE.mdwith new structure and troubleshooting🎯 Next Steps
This PR is part of the v2.0.0 release. Future PRs will add:
📊 Version Bump
Co-authored-by: agentful agentful@itz4blitz.com