Skip to content

Commit 4d4ba26

Browse files
wjlgatechclaude
andcommitted
feat(meeting+social): Meeting Intelligence Stack + LinkedIn/X automation
Phase 1: Post-meeting debrief → structured output + Gmail draft + TASKS.md Phase 2: Pre-meeting brief → calendar + Gmail/Drive/web → 1-page cheat sheet Phase 3: Real-time sidebar → 30s refresh, Screenpipe + Whisper, internal-only consent_guard.py: enforces two-party consent laws in code, blocks external meetings Social automation: LinkedIn (Playwright) + X/Twitter (tweepy v4) + post scheduler 7 new MCP tools (21 total), 45 new tests, ~$2.35/month total cost Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a47982b commit 4d4ba26

104 files changed

Lines changed: 18010 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug
4+
labels: bug
5+
---
6+
7+
## What happened?
8+
<!-- Clear description of the bug -->
9+
10+
## Expected behavior
11+
<!-- What should have happened instead -->
12+
13+
## Steps to reproduce
14+
1.
15+
2.
16+
3.
17+
18+
## Environment
19+
- OS:
20+
- Python version:
21+
- WorkflowX version:
22+
- Screenpipe version (if relevant):
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature Request
3+
about: Propose a new feature or improvement
4+
labels: enhancement
5+
---
6+
7+
## What problem does this solve?
8+
<!-- Describe the friction or gap this addresses -->
9+
10+
## Proposed solution
11+
<!-- How should it work? Be specific about the mechanism. -->
12+
13+
## Alternatives considered
14+
<!-- What else did you consider? Why is this better? -->
15+
16+
## Implementation notes
17+
<!-- Any technical details, affected files, or dependencies -->

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.10", "3.11", "3.12"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -e ".[all,dev]"
28+
29+
- name: Lint
30+
run: ruff check src/ tests/
31+
32+
- name: Type check
33+
run: mypy src/workflowx/ --ignore-missing-imports
34+
35+
- name: Test
36+
run: pytest tests/unit/ -v --cov=workflowx --cov-report=xml
37+
38+
- name: Upload coverage
39+
if: matrix.python-version == '3.12'
40+
uses: codecov/codecov-action@v4
41+
with:
42+
file: coverage.xml
43+
fail_ci_if_error: false
44+
45+
format-check:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v4
49+
- uses: actions/setup-python@v5
50+
with:
51+
python-version: "3.12"
52+
- run: pip install ruff
53+
- run: ruff format --check src/ tests/

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*.egg-info/
5+
dist/
6+
build/
7+
*.egg
8+
.eggs/
9+
10+
# Virtual environments
11+
.venv/
12+
venv/
13+
env/
14+
15+
# IDE
16+
.vscode/
17+
.idea/
18+
*.swp
19+
*.swo
20+
21+
# Testing
22+
.pytest_cache/
23+
.mypy_cache/
24+
.ruff_cache/
25+
htmlcov/
26+
.coverage
27+
coverage.xml
28+
29+
# OS
30+
.DS_Store
31+
Thumbs.db
32+
33+
# Environment
34+
.env
35+
.env.local
36+
37+
# Data (user's Screenpipe data should never be committed)
38+
*.sqlite
39+
*.db
40+
data/

CLAUDE.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# WorkflowX — AI Developer Context
2+
3+
## What This Is
4+
WorkflowX is a workflow intelligence system. It reads events from screen capture tools
5+
(Screenpipe, ActivityWatch), clusters them into workflow sessions, uses LLMs to infer
6+
what the user was trying to do, diagnoses friction, generates replacement workflows
7+
(connected to Agenticom for execution), and measures whether replacements actually work.
8+
A background daemon runs the full pipeline automatically on a smart schedule.
9+
10+
## Repository Structure
11+
```
12+
src/workflowx/
13+
├── models.py # Core Pydantic domain models (the contract)
14+
├── config.py # Config from env vars / .env
15+
├── storage.py # Local JSON storage (file-per-day, patterns, outcomes)
16+
├── export.py # JSON/CSV export for external analysis
17+
├── measurement.py # Before/after ROI tracking
18+
├── dashboard.py # HTML ROI dashboard (static snapshot + live server mode)
19+
├── server.py # Live dashboard HTTP server (GET / and GET /api/data)
20+
├── daemon.py # Background scheduler — all pipeline stages, smart cadences
21+
├── notifications.py # macOS native notifications via osascript
22+
├── mcp_server.py # MCP server for Claude/Cursor integration
23+
├── capture/ # Adapters for data sources
24+
│ ├── screenpipe.py # Reads Screenpipe's SQLite DB
25+
│ └── activitywatch.py # Reads ActivityWatch REST API
26+
├── inference/ # The intelligence layer
27+
│ ├── clusterer.py # Groups raw events into workflow sessions
28+
│ ├── intent.py # LLM-based intent inference + classification questions
29+
│ ├── reporter.py # Daily/weekly report generation
30+
│ └── patterns.py # Cross-day pattern detection + friction trends
31+
├── replacement/ # Workflow replacement engine
32+
│ └── engine.py # LLM-powered proposals + Agenticom YAML
33+
├── api/ # FastAPI endpoints (Phase 4)
34+
└── cli/ # Click CLI — 16 commands
35+
└── main.py
36+
```
37+
38+
## CLI Commands (16 total)
39+
```bash
40+
workflowx status # Connection status, storage stats
41+
workflowx capture # Read events from Screenpipe/ActivityWatch
42+
workflowx analyze # LLM intent inference on sessions
43+
workflowx validate # Answer classification questions
44+
workflowx report # Daily/weekly workflow report
45+
workflowx propose # Generate replacement proposals
46+
47+
# Phase 2
48+
workflowx patterns # Detect recurring high-friction workflows
49+
workflowx trends # Weekly friction trajectory
50+
workflowx export # JSON/CSV export
51+
workflowx mcp # Start MCP server for Claude/Cursor
52+
53+
# Phase 3
54+
workflowx adopt # Mark a replacement as adopted, start ROI tracking
55+
workflowx measure # Measure actual ROI of adopted replacements
56+
workflowx dashboard # Generate static HTML ROI dashboard
57+
workflowx serve # Live dashboard server at localhost:7788 (Update button)
58+
workflowx demo # Full pipeline on synthetic data (no Screenpipe needed)
59+
60+
# Daemon
61+
workflowx daemon start # Install launchd agent + start (auto-restarts on login)
62+
workflowx daemon stop # Stop daemon + remove launchd plist
63+
workflowx daemon status # Job history table + upcoming schedule
64+
workflowx daemon run # Internal: raw event loop (called by launchd)
65+
```
66+
67+
## Daemon Schedule
68+
```
69+
health: every 5 min — Screenpipe liveness; notifies if frames drop
70+
capture: 12:55·17:55·22:55 — rolls up last 4h of Screenpipe events (every day)
71+
analyze: 13:00·18:00·23:00 — LLM inference; event-triggers propose on HIGH/CRITICAL
72+
measure: 07:00 daily — adaptive ROI (weekly ≤30 days, monthly after)
73+
brief: 08:30 weekdays — morning notification: friction summary + pending actions
74+
```
75+
76+
State: `~/.workflowx/daemon_state.json`
77+
PID: `~/.workflowx/daemon.pid`
78+
Log: `~/.workflowx/daemon.log`
79+
80+
## Common Dev Commands
81+
```bash
82+
make install-dev # Install with all deps + dev tools
83+
make test # Run all tests with coverage
84+
make test-fast # Run unit tests only, stop on first failure
85+
make lint # Ruff + mypy
86+
make format # Auto-format
87+
make check # lint + test (run before PR)
88+
```
89+
90+
## Architecture Principles
91+
1. **Don't build capture** — use Screenpipe/ActivityWatch. Our value is intelligence.
92+
2. **Local-first** — all data stays on device. No cloud requirement.
93+
3. **Models are the contract** — everything flows through Pydantic models in models.py
94+
4. **LLM calls are isolated** — only intent.py and engine.py call LLMs
95+
5. **Daemon logic is pure** — scheduling/trigger functions (next_fire_time, should_measure,
96+
should_propose) have zero I/O and are 100% unit-testable without asyncio or mocking
97+
6. **Measure everything** — without before/after ROI, we're just another advice tool
98+
99+
## Testing
100+
- 134 tests in `tests/unit/` — fast, no external deps, no LLM calls
101+
- `tests/integration/` — may require Screenpipe DB or LLM API key
102+
- Always run `make test-fast` before committing
103+
- Test files: test_models, test_clusterer, test_config, test_storage, test_storage_v2,
104+
test_reporter, test_patterns, test_measurement, test_export, test_dashboard, test_daemon
105+
106+
## Key Design Decisions
107+
- **Screenpipe as primary capture**: MIT licensed, 12.6k stars, cross-platform
108+
- **Session gap = 5 min**: Configurable. >5 min between events = new session
109+
- **Friction = context switches / minute**: Simple heuristic, validated by user feedback
110+
- **Classification questions**: When inference confidence < 0.7, ask ONE question
111+
- **Agenticom integration**: Replacement engine generates workflow YAML
112+
- **Pattern detection**: Greedy clustering by intent similarity (SequenceMatcher ≥ 0.55)
113+
- **ROI measurement**: Compare pre-adoption vs post-adoption weekly minutes for same intent
114+
- **MCP server**: 5 tools (sessions, friction, patterns, trends, roi) via FastMCP
115+
- **Daemon scheduling**: next_fire_time() scans 8 days forward; weekdays_only=True for
116+
brief, False for capture/analyze (late-night work happens on weekends too)
117+
- **Adaptive measure cadence**: weeks_tracked < expected; weekly ≤30d, monthly >30d
118+
- **Propose dedup**: per session ID, pruned after 30 days
119+
120+
## PR Workflow
121+
1. Branch from `main`
122+
2. `make check` must pass
123+
3. Add tests for new logic
124+
4. Atomic commits: one concern per commit

CONTRIBUTING.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributing to WorkflowX
2+
3+
We welcome contributions. Here's how to get started fast.
4+
5+
## Setup (2 minutes)
6+
7+
```bash
8+
git clone https://github.com/wjlgatech/workflowx.git
9+
cd workflowx
10+
python -m venv .venv && source .venv/bin/activate
11+
make install-dev
12+
make test
13+
```
14+
15+
If tests pass, you're ready.
16+
17+
## What to Work On
18+
19+
Check [Issues](https://github.com/wjlgatech/workflowx/issues) for tasks tagged:
20+
- `good-first-issue` — small, well-scoped, great for first contribution
21+
- `help-wanted` — we need your help here
22+
- `capture-adapter` — new data source adapters (ActivityWatch, WakaTime, etc.)
23+
- `inference` — improving intent inference accuracy
24+
- `replacement` — workflow replacement engine work
25+
26+
## How to Contribute
27+
28+
### 1. Pick an issue or propose one
29+
Comment on an issue to claim it, or open a new one describing what you want to build.
30+
31+
### 2. Branch and build
32+
```bash
33+
git checkout -b your-feature
34+
# write code
35+
make check # must pass
36+
```
37+
38+
### 3. Submit a PR
39+
- Keep PRs focused (one concern per PR)
40+
- Add tests for new logic
41+
- Update CLAUDE.md if you change architecture
42+
43+
### 4. Review
44+
We review PRs within 48 hours. Expect direct, constructive feedback.
45+
46+
## Code Style
47+
48+
- Python 3.10+, type hints everywhere
49+
- Pydantic models for data contracts
50+
- structlog for logging
51+
- Ruff for linting + formatting
52+
- Tests in `tests/unit/` (fast) or `tests/integration/` (external deps)
53+
54+
## Architecture Rules
55+
56+
1. **Capture adapters are thin** — they convert external data to `RawEvent`. No business logic.
57+
2. **Models are the contract** — if you need a new data shape, add it to `models.py` first.
58+
3. **LLM calls are isolated** — only `inference/intent.py` talks to LLMs. Everything else is deterministic.
59+
4. **Privacy by default** — no data leaves the device. No cloud calls except explicit LLM inference.
60+
61+
## Adding a New Capture Adapter
62+
63+
Want to add support for ActivityWatch, WakaTime, or another tool?
64+
65+
1. Create `src/workflowx/capture/your_source.py`
66+
2. Implement a class with `read_events(since, until, limit) -> list[RawEvent]`
67+
3. Add tests in `tests/unit/test_your_source.py`
68+
4. Add optional deps to `pyproject.toml` under `[project.optional-dependencies]`
69+
70+
That's it. The inference layer doesn't care where events come from.
71+
72+
## Questions?
73+
74+
Open an issue or reach out to [@wjlgatech](https://github.com/wjlgatech).

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Paul Jialiang Wu
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)