@sugar-crash-studios/vibe-forge 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/clear-attention.md +63 -0
- package/.claude/commands/compact-context.md +52 -0
- package/.claude/commands/configure-vcs.md +102 -0
- package/.claude/commands/forge.md +171 -0
- package/.claude/commands/need-help.md +77 -0
- package/.claude/commands/update-status.md +64 -0
- package/.claude/commands/worker-loop.md +106 -0
- package/.claude/hooks/worker-loop.js +198 -0
- package/.claude/scripts/setup-worker-loop.sh +45 -0
- package/.claude/settings.local.json +46 -0
- package/LICENSE +21 -0
- package/README.md +238 -0
- package/agents/aegis/personality.md +294 -0
- package/agents/anvil/personality.md +276 -0
- package/agents/architect/personality.md +258 -0
- package/agents/crucible/personality.md +360 -0
- package/agents/ember/personality.md +291 -0
- package/agents/forge-master/capabilities.md +144 -0
- package/agents/forge-master/context-template.md +128 -0
- package/agents/forge-master/personality.md +138 -0
- package/agents/furnace/personality.md +340 -0
- package/agents/herald/personality.md +247 -0
- package/agents/loki/personality.md +108 -0
- package/agents/oracle/personality.md +283 -0
- package/agents/pixel/personality.md +113 -0
- package/agents/planning-hub/personality.md +320 -0
- package/agents/scribe/personality.md +251 -0
- package/agents/temper/personality.md +218 -0
- package/bin/cli.js +375 -0
- package/bin/dashboard/api/agents.js +333 -0
- package/bin/dashboard/api/dispatch.js +483 -0
- package/bin/dashboard/api/tasks.js +416 -0
- package/bin/dashboard/frontend/index.html +13 -0
- package/bin/dashboard/frontend/package.json +16 -0
- package/bin/dashboard/frontend/src/App.svelte +222 -0
- package/bin/dashboard/frontend/src/app.css +1777 -0
- package/bin/dashboard/frontend/src/lib/components/AgentCard.svelte +60 -0
- package/bin/dashboard/frontend/src/lib/components/AgentsPanel.svelte +57 -0
- package/bin/dashboard/frontend/src/lib/components/DispatchModal.svelte +180 -0
- package/bin/dashboard/frontend/src/lib/components/Footer.svelte +33 -0
- package/bin/dashboard/frontend/src/lib/components/Header.svelte +84 -0
- package/bin/dashboard/frontend/src/lib/components/IssueCard.svelte +33 -0
- package/bin/dashboard/frontend/src/lib/components/IssuesPanel.svelte +73 -0
- package/bin/dashboard/frontend/src/lib/components/KeyboardShortcutsModal.svelte +108 -0
- package/bin/dashboard/frontend/src/lib/components/MobileTabs.svelte +52 -0
- package/bin/dashboard/frontend/src/lib/components/NotificationCard.svelte +60 -0
- package/bin/dashboard/frontend/src/lib/components/NotificationsPanel.svelte +44 -0
- package/bin/dashboard/frontend/src/lib/components/TaskCard.svelte +63 -0
- package/bin/dashboard/frontend/src/lib/components/TasksPanel.svelte +82 -0
- package/bin/dashboard/frontend/src/lib/components/Toast.svelte +45 -0
- package/bin/dashboard/frontend/src/lib/stores/agents.js +34 -0
- package/bin/dashboard/frontend/src/lib/stores/issues.js +54 -0
- package/bin/dashboard/frontend/src/lib/stores/notifications.js +48 -0
- package/bin/dashboard/frontend/src/lib/stores/tasks.js +63 -0
- package/bin/dashboard/frontend/src/lib/stores/theme.js +33 -0
- package/bin/dashboard/frontend/src/lib/stores/toast.js +35 -0
- package/bin/dashboard/frontend/src/lib/stores/ui.js +25 -0
- package/bin/dashboard/frontend/src/lib/stores/voice.js +275 -0
- package/bin/dashboard/frontend/src/lib/stores/websocket.js +295 -0
- package/bin/dashboard/frontend/src/lib/utils/api.js +101 -0
- package/bin/dashboard/frontend/src/lib/utils/formatters.js +54 -0
- package/bin/dashboard/frontend/src/main.js +9 -0
- package/bin/dashboard/frontend/svelte.config.js +5 -0
- package/bin/dashboard/frontend/vite.config.js +20 -0
- package/bin/dashboard/public/assets/index-DnfVj9Ce.css +1 -0
- package/bin/dashboard/public/assets/index-Ze5h0kXQ.js +2 -0
- package/bin/dashboard/public/index.html +14 -0
- package/bin/dashboard/server.js +566 -0
- package/bin/forge-daemon.sh +463 -0
- package/bin/forge-setup.sh +645 -0
- package/bin/forge-spawn.sh +164 -0
- package/bin/forge.cmd +83 -0
- package/bin/forge.sh +533 -0
- package/bin/lib/agents.sh +177 -0
- package/bin/lib/colors.sh +44 -0
- package/bin/lib/config.sh +347 -0
- package/bin/lib/constants.sh +241 -0
- package/bin/lib/daemon/display.sh +128 -0
- package/bin/lib/daemon/notifications.sh +263 -0
- package/bin/lib/daemon/routing.sh +77 -0
- package/bin/lib/daemon/state.sh +115 -0
- package/bin/lib/daemon/sync.sh +95 -0
- package/bin/lib/database.sh +310 -0
- package/bin/lib/heimdall-setup.js +113 -0
- package/bin/lib/heimdall.js +265 -0
- package/bin/lib/json.sh +264 -0
- package/bin/lib/terminal.js +451 -0
- package/bin/lib/util.sh +126 -0
- package/bin/lib/vcs.js +349 -0
- package/config/agent-manifest.yaml +203 -0
- package/config/agents.json +168 -0
- package/config/task-template.md +159 -0
- package/config/task-types.yaml +106 -0
- package/context/agent-status/aegis.json +7 -0
- package/context/agent-status/anvil.json +7 -0
- package/context/agent-status/architect.json +7 -0
- package/context/agent-status/crucible.json +7 -0
- package/context/agent-status/ember.json +7 -0
- package/context/agent-status/furnace.json +7 -0
- package/context/agent-status/loki.json +7 -0
- package/context/agent-status/oracle.json +7 -0
- package/context/agent-status/pixel.json +7 -0
- package/context/agent-status/planning-hub.json +7 -0
- package/context/agent-status/scribe.json +7 -0
- package/context/agent-status/temper.json +7 -0
- package/context/feature-brainstorm.md +426 -0
- package/context/forge-state.yaml +19 -0
- package/context/modern-conventions.md +129 -0
- package/context/project-context-template.md +122 -0
- package/context/project-context.md +122 -0
- package/docs/TODO.md +150 -0
- package/docs/agents.md +409 -0
- package/docs/architecture/decisions/ADR-001-daemon-modularization.md +122 -0
- package/docs/architecture/vibe-lab-integration.md +684 -0
- package/docs/architecture.md +194 -0
- package/docs/bmad-gap-analysis-2026-03-31.md +444 -0
- package/docs/cleanup-workflow.md +329 -0
- package/docs/commands.md +451 -0
- package/docs/dashboard-mockup.html +989 -0
- package/docs/getting-started.md +261 -0
- package/docs/integration/forge-ownership-policy.md +112 -0
- package/docs/npm-publishing.md +132 -0
- package/docs/roadmap-2026.md +519 -0
- package/docs/security.md +144 -0
- package/docs/wireframes/dashboard-mvp.md +1164 -0
- package/docs/workflows/README.md +32 -0
- package/docs/workflows/azure-devops.md +108 -0
- package/docs/workflows/bitbucket.md +104 -0
- package/docs/workflows/git-only.md +130 -0
- package/docs/workflows/gitea.md +168 -0
- package/docs/workflows/github.md +103 -0
- package/docs/workflows/gitlab.md +105 -0
- package/docs/workflows.md +454 -0
- package/package.json +73 -0
- package/tasks/completed/ARCH-001-duplicate-agent-config.md +121 -0
- package/tasks/completed/ARCH-002-mixed-bash-node-implementation.md +88 -0
- package/tasks/completed/ARCH-003-worker-loop-hook-duplication.md +77 -0
- package/tasks/completed/ARCH-009-test-organization.md +78 -0
- package/tasks/completed/ARCH-011-jq-vs-nodejs-json.md +94 -0
- package/tasks/completed/ARCH-012-tmp-files-in-root.md +71 -0
- package/tasks/completed/ARCH-013-exit-code-constants.md +65 -0
- package/tasks/completed/ARCH-014-sed-incompatibility.md +96 -0
- package/tasks/completed/ARCH-015-docs-todo-tracking.md +83 -0
- package/tasks/completed/BUG-dash-001-tasks-filter-error.md +31 -0
- package/tasks/completed/BUG-dash-002-agents-unknown.md +41 -0
- package/tasks/completed/CLEAN-001.md +38 -0
- package/tasks/completed/CLEAN-002.md +43 -0
- package/tasks/completed/CLEAN-003.md +47 -0
- package/tasks/completed/CLEAN-004.md +56 -0
- package/tasks/completed/CLEAN-005.md +75 -0
- package/tasks/completed/CLEAN-006.md +47 -0
- package/tasks/completed/CLEAN-007.md +34 -0
- package/tasks/completed/CLEAN-008.md +49 -0
- package/tasks/completed/CLEAN-012.md +58 -0
- package/tasks/completed/CLEAN-013.md +45 -0
- package/tasks/completed/FEATURE-001a-dashboard-wireframes.md +162 -0
- package/tasks/completed/IMPL-007a-daemon-notifications-module.md +82 -0
- package/tasks/completed/IMPL-007b-daemon-sync-module.md +71 -0
- package/tasks/completed/IMPL-007c-daemon-state-module.md +80 -0
- package/tasks/completed/IMPL-007d-daemon-routing-module.md +77 -0
- package/tasks/completed/IMPL-007e-daemon-display-module.md +77 -0
- package/tasks/completed/IMPL-007f-daemon-integration.md +124 -0
- package/tasks/completed/PLAT-1-heimdall.md +420 -0
- package/tasks/completed/SEC-001-sql-injection-fix.md +58 -0
- package/tasks/completed/SEC-002-notification-injection-fix.md +45 -0
- package/tasks/completed/SEC-003-eval-injection-fix.md +54 -0
- package/tasks/completed/SEC-004-pid-race-condition-fix.md +49 -0
- package/tasks/completed/SEC-005-worker-loop-path-fix.md +51 -0
- package/tasks/completed/SEC-006-eval-agent-names.md +55 -0
- package/tasks/completed/SEC-007-spawn-escaping.md +67 -0
- package/tasks/completed/TASK-DASH-001-server-infrastructure.md +185 -0
- package/tasks/completed/TASK-anvil-001-dashboard-frontend.md +133 -0
- package/tasks/completed/review-bmad-aegis.md +89 -0
- package/tasks/completed/review-bmad-anvil.md +80 -0
- package/tasks/completed/review-bmad-crucible.md +81 -0
- package/tasks/completed/review-bmad-ember.md +90 -0
- package/tasks/completed/review-bmad-furnace.md +79 -0
- package/tasks/completed/review-bmad-pixel.md +82 -0
- package/tasks/completed/review-bmad-scribe.md +92 -0
- package/tasks/completed/review-bmad-sentinel.md +83 -0
- package/tasks/pending/ARCH-004-git-bash-detection-duplication.md +72 -0
- package/tasks/pending/ARCH-005-missing-src-directory.md +95 -0
- package/tasks/pending/ARCH-006-task-template-location.md +64 -0
- package/tasks/pending/ARCH-008-forge-master-vs-hub.md +81 -0
- package/tasks/pending/ARCH-010-missing-index-files.md +84 -0
- package/tasks/pending/CLEAN-009.md +31 -0
- package/tasks/pending/CLEAN-010.md +30 -0
- package/tasks/pending/CLEAN-011.md +30 -0
- package/tasks/pending/CLEAN-014.md +32 -0
- package/tasks/pending/DESIGN-dash-001-layout-review.md +45 -0
- package/tasks/pending/FEATURE-001-dashboard-mvp.md +268 -0
- package/tasks/review/ARCH-007-daemon-monolith.md +162 -0
- package/tasks/review/bmad-review-aegis.md +349 -0
- package/tasks/review/bmad-review-anvil.md +259 -0
- package/tasks/review/bmad-review-crucible.md +277 -0
- package/tasks/review/bmad-review-ember.md +307 -0
- package/tasks/review/bmad-review-furnace.md +285 -0
- package/tasks/review/bmad-review-pixel.md +329 -0
- package/tasks/review/bmad-review-scribe.md +361 -0
- package/tasks/review/bmad-review-sentinel.md +242 -0
- package/tasks/review/task-001.md +78 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# ADR-001: Modularize forge-daemon.sh
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
Accepted
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
`bin/forge-daemon.sh` has grown to 852 lines, containing multiple unrelated responsibilities:
|
|
10
|
+
|
|
11
|
+
1. **Utility functions** (lines 56-114) - Log rotation, file trimming, safe file moves
|
|
12
|
+
2. **Notification system** (lines 116-288) - Message sanitization, platform-specific toasts, task notifications
|
|
13
|
+
3. **Agent status sync** (lines 290-370) - JSON-to-SQLite synchronization, status building
|
|
14
|
+
4. **State management** (lines 372-496) - State file updates, task routing, daemon state
|
|
15
|
+
5. **Display functions** (lines 658-775) - Status output formatting, worker display
|
|
16
|
+
6. **Commands & main** (lines 560-851) - CLI interface
|
|
17
|
+
|
|
18
|
+
This monolithic structure causes:
|
|
19
|
+
- **Maintenance burden** - Changes to notifications require understanding the entire file
|
|
20
|
+
- **Testing difficulty** - Functions can't be tested in isolation
|
|
21
|
+
- **Cognitive load** - New contributors must grok 850+ lines to make changes
|
|
22
|
+
- **Violation of SRP** - File handles 6+ distinct responsibilities
|
|
23
|
+
|
|
24
|
+
## Decision
|
|
25
|
+
|
|
26
|
+
Split `forge-daemon.sh` into focused modules under `bin/lib/daemon/`:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
bin/lib/daemon/
|
|
30
|
+
notifications.sh - Notification logic
|
|
31
|
+
sync.sh - Agent status synchronization
|
|
32
|
+
state.sh - State file management
|
|
33
|
+
routing.sh - Task routing logic
|
|
34
|
+
display.sh - Status display functions
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The main `forge-daemon.sh` becomes a thin orchestrator (~150 lines):
|
|
38
|
+
- Configuration loading
|
|
39
|
+
- Library sourcing
|
|
40
|
+
- `daemon_loop()` function
|
|
41
|
+
- Command handlers that delegate to modules
|
|
42
|
+
- Main entry point
|
|
43
|
+
|
|
44
|
+
### Module Responsibilities
|
|
45
|
+
|
|
46
|
+
| Module | Functions | Lines (approx) |
|
|
47
|
+
|--------|-----------|----------------|
|
|
48
|
+
| notifications.sh | `sanitize_notification_message`, `notify`, `send_system_notification`, `check_new_pending_tasks`, `check_attention_needed` | ~170 |
|
|
49
|
+
| sync.sh | `sync_agent_status_to_db`, `build_worker_status` | ~80 |
|
|
50
|
+
| state.sh | `update_state`, `build_attention_details`, `determine_daemon_state`, `get_poll_interval` | ~120 |
|
|
51
|
+
| routing.sh | `route_completed_to_review`, `route_approved_to_merged`, `safe_move_task` | ~50 |
|
|
52
|
+
| display.sh | `display_daemon_status`, `display_task_counts`, `display_attention_needed`, `get_status_icon`, `display_worker_status`, `display_recent_notifications` | ~120 |
|
|
53
|
+
|
|
54
|
+
### Interface Contract
|
|
55
|
+
|
|
56
|
+
Each module:
|
|
57
|
+
1. Sources only the libraries it needs (colors.sh, constants.sh, etc.)
|
|
58
|
+
2. Defines functions without executing code on source
|
|
59
|
+
3. Uses FORGE_ROOT and other globals set by parent
|
|
60
|
+
4. Documents its dependencies at the top
|
|
61
|
+
|
|
62
|
+
Example module header:
|
|
63
|
+
```bash
|
|
64
|
+
#!/usr/bin/env bash
|
|
65
|
+
# Daemon notifications module
|
|
66
|
+
# Dependencies: colors.sh, constants.sh
|
|
67
|
+
# Globals: FORGE_ROOT, NOTIFY_FILE, NOTIFIED_FILE, LOG_FILE
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Consequences
|
|
71
|
+
|
|
72
|
+
### Positive
|
|
73
|
+
|
|
74
|
+
- **Testability** - Individual modules can be sourced and tested in isolation
|
|
75
|
+
- **Maintainability** - Changes to notifications don't risk breaking routing
|
|
76
|
+
- **Readability** - Each file is <200 lines with single purpose
|
|
77
|
+
- **Onboarding** - New contributors can understand one module at a time
|
|
78
|
+
- **Reusability** - Notification functions could be reused elsewhere
|
|
79
|
+
|
|
80
|
+
### Negative
|
|
81
|
+
|
|
82
|
+
- **Source overhead** - Multiple `source` commands (minimal impact)
|
|
83
|
+
- **Migration risk** - Refactoring could introduce bugs
|
|
84
|
+
- **Documentation** - Need to document module interfaces
|
|
85
|
+
|
|
86
|
+
### Neutral
|
|
87
|
+
|
|
88
|
+
- **Directory structure** - Adds `bin/lib/daemon/` subdirectory
|
|
89
|
+
- **Variable scope** - Globals still shared (could refine later)
|
|
90
|
+
|
|
91
|
+
## Implementation Plan
|
|
92
|
+
|
|
93
|
+
1. Create `bin/lib/daemon/` directory
|
|
94
|
+
2. Extract `notifications.sh` (highest complexity, most independent)
|
|
95
|
+
3. Extract `sync.sh` (clear boundaries)
|
|
96
|
+
4. Extract `state.sh` (depends on sync)
|
|
97
|
+
5. Extract `routing.sh` (simple, low risk)
|
|
98
|
+
6. Extract `display.sh` (output only, no state changes)
|
|
99
|
+
7. Update `forge-daemon.sh` to source modules
|
|
100
|
+
8. Verify all tests pass
|
|
101
|
+
9. Update documentation
|
|
102
|
+
|
|
103
|
+
## Alternatives Considered
|
|
104
|
+
|
|
105
|
+
### Alternative A: Leave as monolith
|
|
106
|
+
- Pro: No migration risk
|
|
107
|
+
- Con: Continued maintenance burden, harder testing
|
|
108
|
+
|
|
109
|
+
### Alternative B: Full Node.js rewrite
|
|
110
|
+
- Pro: Single language, better testing tools
|
|
111
|
+
- Con: High effort, loses Bash transparency, not aligned with current hybrid strategy
|
|
112
|
+
|
|
113
|
+
### Alternative C: Just add more comments
|
|
114
|
+
- Pro: Low effort
|
|
115
|
+
- Con: Doesn't address structural issues
|
|
116
|
+
|
|
117
|
+
**Selected: Module extraction** - Balances improvement vs. risk, maintains Bash strategy.
|
|
118
|
+
|
|
119
|
+
## References
|
|
120
|
+
|
|
121
|
+
- Task: ARCH-007
|
|
122
|
+
- Related: ARCH-005 (src/ directory), ARCH-010 (index files)
|