@garethdaine/agentops 0.9.2 → 0.10.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/README.md +76 -10
- package/commands/enterprise/idea.md +188 -0
- package/commands/enterprise/search.md +236 -0
- package/commands/enterprise/worklog.md +246 -0
- package/commands/flags.md +3 -0
- package/hooks/ai-guardrails.sh +0 -1
- package/hooks/audit-log.sh +1 -1
- package/hooks/auto-delegate.sh +1 -1
- package/hooks/credential-redact.sh +0 -1
- package/hooks/dashboard-launch.sh +146 -0
- package/hooks/enforcement-lib.sh +4 -2
- package/hooks/feature-flags.sh +4 -0
- package/hooks/flag-utils.sh +6 -0
- package/hooks/hooks.json +8 -1
- package/hooks/integrity-verify.sh +2 -2
- package/hooks/lockfile-audit.sh +1 -1
- package/hooks/patterns-lib.sh +1 -0
- package/hooks/session-cleanup.sh +23 -0
- package/hooks/telemetry.sh +10 -9
- package/hooks/unicode-lib.sh +3 -4
- package/package.json +1 -1
- package/templates/work-journal/conventions.md +423 -0
package/README.md
CHANGED
|
@@ -6,9 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
A plugin for [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) that wraps every session in 7 security layers, structures work with the STAR methodology, auto-pilots workflows, delegates to 12 specialist agents, learns from failures via self-evolution, and orchestrates full project builds from vision to merged PR.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
40 slash commands | 44 hooks | 12 specialist agents | 49 templates | 33+ feature flags | real-time 3D dashboard
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
[](https://github.com/garethdaine/agentops/actions/workflows/tests.yml)
|
|
12
|
+
[](https://github.com/garethdaine/agentops/actions/workflows/lint.yml)
|
|
13
|
+
[](https://github.com/garethdaine/agentops/actions/workflows/security.yml)
|
|
14
|
+
[](https://www.npmjs.com/package/@garethdaine/agentops)
|
|
15
|
+
[](LICENSE)
|
|
12
16
|
|
|
13
17
|
---
|
|
14
18
|
|
|
@@ -40,7 +44,7 @@ On first session, the plugin auto-initializes `.agentops/` with default flags an
|
|
|
40
44
|
| Dimension | AgentOps | GSD (~31K stars) | Superpowers (~50K stars) |
|
|
41
45
|
|-----------|----------|-------------------|--------------------------|
|
|
42
46
|
| **Core identity** | Enterprise guardrailing + full delivery lifecycle | Spec-driven meta-prompting to beat context rot | Skills-based methodology with TDD enforcement |
|
|
43
|
-
| **Commands** |
|
|
47
|
+
| **Commands** | 40 | ~15 | ~10 (skill-based) |
|
|
44
48
|
| **Hooks** | 44 shell scripts across 7 lifecycle events | None (prompts only) | None (prompts only) |
|
|
45
49
|
| **Agents** | 12 specialist agents | 4 parallel researchers + planner | Code reviewer agent |
|
|
46
50
|
| **Security** | 7 layers (injection, exfiltration, supply-chain, Unicode, credential, path, env) | Minimal | None |
|
|
@@ -57,6 +61,7 @@ On first session, the plugin auto-initializes `.agentops/` with default flags an
|
|
|
57
61
|
| **Observability** | Audit logs, OTLP telemetry, file provenance, cost budgets | None | None |
|
|
58
62
|
| **Configurable autonomy** | guided / supervised / autonomous | N/A | N/A |
|
|
59
63
|
| **Linear integration** | Task sync (create, status update, close) | None | None |
|
|
64
|
+
| **Real-time dashboard** | 3D office scene (React Three Fiber) + 2D fallback, WebSocket relay | None | None |
|
|
60
65
|
|
|
61
66
|
### What AgentOps does that neither competitor does
|
|
62
67
|
|
|
@@ -64,6 +69,7 @@ On first session, the plugin auto-initializes `.agentops/` with default flags an
|
|
|
64
69
|
2. **EvoSkill self-evolution.** The failure-collector → proposer → skill-builder → feedback-history pipeline auto-generates skills from failures. No manual intervention.
|
|
65
70
|
3. **Full observability.** Structured audit logs, OTLP telemetry export, file provenance tracking, and cost budgets with session-level granularity.
|
|
66
71
|
4. **8.5-phase build lifecycle.** From brainstorm to merged PR with state machine, resumability, human gates, parallel research, TDD enforcement, two-stage review, and Nyquist verification — all configurable via feature flags and autonomy levels.
|
|
72
|
+
5. **Real-time 3D agent dashboard.** A Next.js 16 + React Three Fiber office scene that visualizes agent activity live via WebSocket relay from telemetry JSONL, with 2D fallback for non-GPU environments.
|
|
67
73
|
|
|
68
74
|
---
|
|
69
75
|
|
|
@@ -74,7 +80,7 @@ The plugin integrates through four extension points:
|
|
|
74
80
|
| Extension Point | Location | Count | Purpose |
|
|
75
81
|
|-----------------|----------|-------|---------|
|
|
76
82
|
| **Hooks** | `hooks/hooks.json` | 44 | Intercept tool use at every lifecycle event |
|
|
77
|
-
| **Commands** | `commands/*.md` |
|
|
83
|
+
| **Commands** | `commands/*.md` | 40 | User-facing slash commands (`/agentops:*`) |
|
|
78
84
|
| **Agents** | `agents/*.md` | 12 | Specialist subagents for analysis and execution |
|
|
79
85
|
| **Templates** | `templates/**/*.md` | 49 | Standards, architecture patterns, delivery docs |
|
|
80
86
|
|
|
@@ -130,7 +136,7 @@ Plus supply-chain defense: Unicode/Glassworm detection (`unicode-firewall.sh`),
|
|
|
130
136
|
|
|
131
137
|
---
|
|
132
138
|
|
|
133
|
-
## Commands (
|
|
139
|
+
## Commands (40)
|
|
134
140
|
|
|
135
141
|
### Core Commands
|
|
136
142
|
|
|
@@ -177,6 +183,9 @@ Plus supply-chain defense: Unicode/Glassworm detection (`unicode-firewall.sh`),
|
|
|
177
183
|
| `/agentops:dev-setup` | Developer environment setup guide |
|
|
178
184
|
| `/agentops:docker-dev` | Docker development environment configuration |
|
|
179
185
|
| `/agentops:e2e` | End-to-end test planning and execution |
|
|
186
|
+
| `/agentops:worklog` | Personal work log for tracking daily contributions |
|
|
187
|
+
| `/agentops:idea` | Structured idea proposals with development and export |
|
|
188
|
+
| `/agentops:search` | Unified search across work log, ideas, git history, and knowledge base |
|
|
180
189
|
| `/agentops:herd` | Multi-agent coordination for complex tasks |
|
|
181
190
|
|
|
182
191
|
---
|
|
@@ -262,7 +271,7 @@ Standards are enforced via `templates/standards/standards-checklist.md` during P
|
|
|
262
271
|
|
|
263
272
|
---
|
|
264
273
|
|
|
265
|
-
## Feature Flags (
|
|
274
|
+
## Feature Flags (33+)
|
|
266
275
|
|
|
267
276
|
All flags default to sensible values and are toggleable via `/agentops:flags` or `.agentops/flags.json`.
|
|
268
277
|
|
|
@@ -278,6 +287,9 @@ All flags default to sensible values and are toggleable via `/agentops:flags` or
|
|
|
278
287
|
### Build lifecycle flags
|
|
279
288
|
`build_tdd_enforced`, `build_parallel_research`, `build_xml_plans`, `build_linear_sync`, `build_fresh_context`, `build_wave_parallel`, `build_nyquist_enforce`, `build_persuasion`, `build_quick_mode`, `build_scaffold_auto`, `build_standards_inject`, `standards_enforcement_mode`
|
|
280
289
|
|
|
290
|
+
### Dashboard flags
|
|
291
|
+
`dashboard_enabled`
|
|
292
|
+
|
|
281
293
|
### Enterprise flags
|
|
282
294
|
`enterprise_scaffold`, `ai_workflows`, `unified_review`, `architecture_guardrails`, `delivery_lifecycle`, `team_governance`, `client_comms`
|
|
283
295
|
|
|
@@ -310,6 +322,37 @@ All flags default to sensible values and are toggleable via `/agentops:flags` or
|
|
|
310
322
|
|
|
311
323
|
---
|
|
312
324
|
|
|
325
|
+
## Agent Office Dashboard
|
|
326
|
+
|
|
327
|
+
A real-time 3D visualization of agent activity, built with Next.js 16, React Three Fiber, and Shadcn UI.
|
|
328
|
+
|
|
329
|
+
### Features
|
|
330
|
+
|
|
331
|
+
| Feature | Description |
|
|
332
|
+
|---------|-------------|
|
|
333
|
+
| **3D office scene** | Workstations with lighting, agent avatars, and animations via React Three Fiber |
|
|
334
|
+
| **Real-time state** | WebSocket relay server streams agent activity from JSONL telemetry files |
|
|
335
|
+
| **2D fallback** | Activity table with WebGL detection for environments without GPU support |
|
|
336
|
+
| **Session registry** | Auto-registers sessions from incoming telemetry with stale detection |
|
|
337
|
+
| **Connection status** | Live indicator showing relay connection health |
|
|
338
|
+
| **Lifecycle management** | Proper Three.js disposal and resource cleanup |
|
|
339
|
+
|
|
340
|
+
### How it works
|
|
341
|
+
|
|
342
|
+
```
|
|
343
|
+
hooks/telemetry.sh → .agentops/telemetry.jsonl
|
|
344
|
+
↓
|
|
345
|
+
dashboard/server/file-watcher.ts (byte-offset tracking)
|
|
346
|
+
↓
|
|
347
|
+
dashboard/server/relay.ts (WebSocket with origin validation)
|
|
348
|
+
↓
|
|
349
|
+
dashboard/src/ (Zustand store → 3D scene / 2D table)
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
The dashboard launches automatically when `dashboard_enabled` is `true` in `.agentops/flags.json`. The `dashboard-launch.sh` hook starts the Next.js dev server and WebSocket relay on session start.
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
313
356
|
## Configuration
|
|
314
357
|
|
|
315
358
|
### Environment Variables
|
|
@@ -372,7 +415,11 @@ agentops-plugin/
|
|
|
372
415
|
│ ├── communication/ # Stakeholder comms templates
|
|
373
416
|
│ ├── workflows/ # Feature, refactor, spike, bug workflows
|
|
374
417
|
│ └── scaffolds/ # Error handling, logging, health checks
|
|
375
|
-
├──
|
|
418
|
+
├── dashboard/ # Agent Office Dashboard (Next.js 16)
|
|
419
|
+
│ ├── src/ # React components, stores, types
|
|
420
|
+
│ ├── server/ # WebSocket relay + JSONL file watcher
|
|
421
|
+
│ └── tests/ # Dashboard unit tests (Vitest)
|
|
422
|
+
├── tests/ # 20 BATS test files (security, automation, dashboard)
|
|
376
423
|
├── docs/ # Architecture docs
|
|
377
424
|
├── settings.json # Plugin permission defaults
|
|
378
425
|
├── LICENSE # MIT
|
|
@@ -383,18 +430,37 @@ agentops-plugin/
|
|
|
383
430
|
|
|
384
431
|
## Testing
|
|
385
432
|
|
|
386
|
-
The plugin includes
|
|
433
|
+
The plugin includes 20 BATS test files covering security hooks, automation hooks, and dashboard integration:
|
|
387
434
|
|
|
388
435
|
```bash
|
|
389
436
|
# Run all tests
|
|
390
437
|
bats tests/
|
|
391
438
|
|
|
392
|
-
#
|
|
439
|
+
# Security hooks
|
|
393
440
|
bats tests/validate-command.bats
|
|
441
|
+
bats tests/validate-path.bats
|
|
442
|
+
bats tests/validate-env.bats
|
|
394
443
|
bats tests/injection-scan.bats
|
|
395
444
|
bats tests/exfiltration-check.bats
|
|
396
|
-
bats tests/
|
|
445
|
+
bats tests/credential-redact.bats
|
|
446
|
+
bats tests/content-trust.bats
|
|
397
447
|
bats tests/feature-flags.bats
|
|
448
|
+
|
|
449
|
+
# Automation hooks
|
|
450
|
+
bats tests/auto-test.bats
|
|
451
|
+
bats tests/auto-plan.bats
|
|
452
|
+
bats tests/auto-verify.bats
|
|
453
|
+
bats tests/auto-lesson.bats
|
|
454
|
+
bats tests/auto-evolve.bats
|
|
455
|
+
bats tests/auto-delegate.bats
|
|
456
|
+
bats tests/failure-collector.bats
|
|
457
|
+
bats tests/evolve-gate.bats
|
|
458
|
+
|
|
459
|
+
# Dashboard
|
|
460
|
+
bats tests/dashboard-flag.bats
|
|
461
|
+
bats tests/dashboard-launch.bats
|
|
462
|
+
bats tests/session-registry.bats
|
|
463
|
+
bats tests/telemetry-pretool.bats
|
|
398
464
|
```
|
|
399
465
|
|
|
400
466
|
---
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: idea
|
|
3
|
+
description: Develop, document, and export professional idea proposals with structured thinking and shareable deliverables
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are an AI-powered idea development assistant. You help capture, develop, and share professional idea proposals with configurable depth.
|
|
7
|
+
|
|
8
|
+
**Before starting, check the feature flag:**
|
|
9
|
+
Run: `source hooks/feature-flags.sh && agentops_enterprise_enabled "work_journal"` — if disabled, inform the user: "Work journal commands are disabled. Enable with: /agentops:flags work_journal true" and stop.
|
|
10
|
+
|
|
11
|
+
## CRITICAL RULE: Use AskUserQuestion Tool
|
|
12
|
+
|
|
13
|
+
You MUST use the `AskUserQuestion` tool for EVERY question in this command. DO NOT print questions as plain text or numbered option lists. Call the AskUserQuestion tool which renders a proper selection UI. This is a BLOCKING REQUIREMENT.
|
|
14
|
+
|
|
15
|
+
**Read the autonomy level** from `.agentops/flags.json` (key: `autonomy_level`). Default to `guided` if not set.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Startup
|
|
20
|
+
|
|
21
|
+
1. **Read conventions:** Read `templates/work-journal/conventions.md` for shared schemas, storage layout, index format, integration detection, and templates. Follow all protocols defined there.
|
|
22
|
+
2. **Load config:** Read `.agentops/journal-config.json`. If it does not exist, run the First-Run Setup defined in conventions.md — use `AskUserQuestion` for each step (name, role, team, contacts, integrations). Write the resulting config file.
|
|
23
|
+
3. **Detect integrations:** Run the Integration Detection protocol from conventions.md once. Cache results. Report: "Integrations: Cortex [status], Notion [status]" or "Running in local-only mode."
|
|
24
|
+
4. **Check for existing idea:** If `$ARGUMENTS` contains a slug matching an existing idea in `.agentops/journal/ideas/`, go to the **Revisit Existing Idea** section instead.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Capture Phase — New Idea
|
|
29
|
+
|
|
30
|
+
Use `AskUserQuestion` for each of these in sequence:
|
|
31
|
+
|
|
32
|
+
1. **Idea description:** Free text question — "Describe your idea. What problem does it solve and what do you propose?"
|
|
33
|
+
2. **Category:** "What category best fits this idea?" — options: "Architecture improvement", "Process improvement", "New tool or automation", "Client delivery approach", "Cost reduction", "Quality improvement", "Team workflow", "Business opportunity", "Other"
|
|
34
|
+
3. **Beneficiaries:** "Who benefits most from this idea?" — options: "Engineering team", "Client", "Business", "End users", "Multiple stakeholders"
|
|
35
|
+
4. **Development depth:** "How deeply should we develop this idea?" — options:
|
|
36
|
+
- "Quick (5 min) — One-page proposal with core elements"
|
|
37
|
+
- "Light (15 min) — Analysis with alternatives, trade-offs, and risks"
|
|
38
|
+
- "Full (30+ min) — Research-backed proposal with implementation plan and metrics"
|
|
39
|
+
|
|
40
|
+
Generate a kebab-case slug from the idea title. Create the directory: `.agentops/journal/ideas/{slug}/` using `mkdir -p`. Create `.agentops/journal/ideas/{slug}/scratchpad.md` for working notes.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Quick Capture (5 min)
|
|
45
|
+
|
|
46
|
+
Generate a one-page proposal document at `.agentops/journal/ideas/{slug}/proposal.md` using the Idea Proposal frontmatter and document structure from conventions.md. Include these sections:
|
|
47
|
+
|
|
48
|
+
- **Problem Statement** — What problem does this solve?
|
|
49
|
+
- **Proposed Solution** — What is being proposed?
|
|
50
|
+
- **Expected Benefits** — What improves?
|
|
51
|
+
- **Recommendation** — Effort estimate and specific next step
|
|
52
|
+
|
|
53
|
+
Set status to `Draft`. Sign with author name and role from `journal-config.json` identity. Timestamp with current UTC date.
|
|
54
|
+
|
|
55
|
+
After writing, proceed to **Post-Capture** section.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Light Development (15 min)
|
|
60
|
+
|
|
61
|
+
Complete everything in Quick Capture, then expand the proposal:
|
|
62
|
+
|
|
63
|
+
1. **Structured analysis:** Use `/agentops:reason` to analyse the idea — evaluate feasibility, identify assumptions, and surface risks.
|
|
64
|
+
2. **Knowledge lookup:** Cross-reference `/agentops:knowledge` to check for related patterns, prior decisions, or existing ADRs.
|
|
65
|
+
3. **Expand sections:** Fill in Alternatives Considered, Trade-offs & Risks, and Implementation Sketch sections in the proposal.
|
|
66
|
+
|
|
67
|
+
Update the proposal document with all expanded sections. Proceed to **Post-Capture**.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Full Development (30+ min)
|
|
72
|
+
|
|
73
|
+
Complete everything in Light Development, then deepen with research:
|
|
74
|
+
|
|
75
|
+
1. **Web research:** Search the web for prior art, industry practices, benchmarks, and supporting data relevant to this idea. Save all research notes to `.agentops/journal/ideas/{slug}/research.md` with source URLs and key findings.
|
|
76
|
+
2. **Detailed implementation plan:** Add phased implementation approach with effort estimates, dependencies, and milestones to the Implementation Sketch section.
|
|
77
|
+
3. **Cost-benefit analysis:** Fill in the Cost-Benefit Assessment section with time/effort investment vs expected return, including quantitative estimates where possible.
|
|
78
|
+
4. **Success metrics:** Define measurable success criteria in the Success Metrics section.
|
|
79
|
+
|
|
80
|
+
Update the proposal document with all sections complete. Proceed to **Post-Capture**.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Post-Capture
|
|
85
|
+
|
|
86
|
+
### Storage Confirmation
|
|
87
|
+
|
|
88
|
+
Confirm files written:
|
|
89
|
+
- `.agentops/journal/ideas/{slug}/proposal.md` — the proposal document
|
|
90
|
+
- `.agentops/journal/ideas/{slug}/scratchpad.md` — working notes
|
|
91
|
+
- `.agentops/journal/ideas/{slug}/research.md` — research notes (Full development only)
|
|
92
|
+
- `.agentops/journal/ideas/{slug}/exports/` — directory created for future exports
|
|
93
|
+
|
|
94
|
+
### Index Management
|
|
95
|
+
|
|
96
|
+
Update `.agentops/journal/ideas/index.json` using the atomic write protocol from conventions.md:
|
|
97
|
+
1. Write updated JSON to `index.json.tmp`
|
|
98
|
+
2. Read back and verify valid JSON
|
|
99
|
+
3. Move to `index.json` via `mv`
|
|
100
|
+
|
|
101
|
+
Add entry with: id (`idea-{slug}`), date, title, category, status (`Draft`), beneficiaries, auto-extracted tags, file path, cortex_id (null), notion_page_id (null).
|
|
102
|
+
|
|
103
|
+
### Export
|
|
104
|
+
|
|
105
|
+
Use `AskUserQuestion`: "Would you like to export the proposal?" — options: "PDF", "DOCX", "Both PDF and DOCX", "Skip export"
|
|
106
|
+
|
|
107
|
+
If not skipped, follow the export approach from conventions.md:
|
|
108
|
+
1. **Pandoc (primary):** `pandoc proposal.md -o {slug}-proposal.{ext}` — check availability via `which pandoc`
|
|
109
|
+
2. **Playwright (fallback):** Render as styled HTML, then PDF
|
|
110
|
+
3. **HTML (last resort):** Generate styled HTML with print instructions
|
|
111
|
+
|
|
112
|
+
Save exports to `.agentops/journal/ideas/{slug}/exports/`.
|
|
113
|
+
|
|
114
|
+
### Share Guidance
|
|
115
|
+
|
|
116
|
+
Read contacts from `journal-config.json`. Match the idea's category (as snake_case, e.g., "Architecture improvement" maps to `architecture_improvement`) against each contact's `share_categories` array. Present matching contacts:
|
|
117
|
+
|
|
118
|
+
> "Based on this idea's category, these contacts may be interested: {name} ({role}). You could share the exported proposal with them."
|
|
119
|
+
|
|
120
|
+
Never send anything automatically. This is guidance only. If no contacts match or no contacts configured, skip silently.
|
|
121
|
+
|
|
122
|
+
### Cortex Sync
|
|
123
|
+
|
|
124
|
+
If Cortex is available and enabled in config: write the idea as a semantic memory via `mcp__cortex__cortex_write` with tags `["idea", "{category_snake_case}", "draft"]`. Store the returned ID as `cortex_id` in the index entry. On failure: log warning, continue.
|
|
125
|
+
|
|
126
|
+
### Notion Sync
|
|
127
|
+
|
|
128
|
+
If Notion is available and enabled in config:
|
|
129
|
+
- If `ideas_database_id` is null: use `AskUserQuestion` — "Notion is connected but no ideas database exists. Create one?" — options: "Yes, create ideas database", "Skip Notion sync". If yes, create database with schema from conventions.md (Title, Category, Status, Date, Author, Beneficiaries, Summary) and store the ID in config.
|
|
130
|
+
- Push the idea to the Notion database. Store `notion_page_id` in the index entry.
|
|
131
|
+
- On failure: log warning, continue.
|
|
132
|
+
|
|
133
|
+
### Auto-Commit
|
|
134
|
+
|
|
135
|
+
If `preferences.auto_commit` is `true` in journal-config.json:
|
|
136
|
+
|
|
137
|
+
1. Check whether `.agentops/journal/` is tracked by git (i.e., not excluded by `.gitignore`).
|
|
138
|
+
2. If it is tracked, run:
|
|
139
|
+
```
|
|
140
|
+
git add .agentops/journal/ideas/{slug}/
|
|
141
|
+
git commit -m "docs(idea): capture — {slug}"
|
|
142
|
+
```
|
|
143
|
+
3. If it is gitignored, skip auto-commit and warn: "Auto-commit skipped because `.agentops/journal/` is gitignored. To enable, unignore this path in `.gitignore`."
|
|
144
|
+
|
|
145
|
+
If auto_commit is false (default), skip.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Revisit Existing Idea
|
|
150
|
+
|
|
151
|
+
When revisiting an existing idea (slug provided or selected):
|
|
152
|
+
|
|
153
|
+
1. Read the existing proposal from `.agentops/journal/ideas/{slug}/proposal.md`
|
|
154
|
+
2. Display current status and summary
|
|
155
|
+
3. Use `AskUserQuestion`: "What would you like to do with this idea?" — options:
|
|
156
|
+
- "Update status"
|
|
157
|
+
- "Edit proposal content"
|
|
158
|
+
- "Export proposal"
|
|
159
|
+
- "View research notes"
|
|
160
|
+
|
|
161
|
+
### Status Update
|
|
162
|
+
|
|
163
|
+
Use `AskUserQuestion`: "Update status to:" — options: "Draft", "Proposed", "Approved", "Implemented", "Deferred"
|
|
164
|
+
|
|
165
|
+
Record who updated the status (from `identity.name` in config) and when (UTC timestamp). Append a status history entry to the proposal:
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
### Status History
|
|
169
|
+
| Date | Status | Updated By |
|
|
170
|
+
|------|--------|-----------|
|
|
171
|
+
| {date} | {new_status} | {identity.name} |
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Update `.agentops/journal/ideas/index.json` with new status (atomic write). If Cortex available, update the memory tags. If Notion available, update the database entry. If auto_commit enabled:
|
|
175
|
+
```
|
|
176
|
+
git commit -am "docs(idea): update status — {slug} → {status}"
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Error Handling
|
|
182
|
+
|
|
183
|
+
- If conventions.md cannot be read, warn and use inline defaults
|
|
184
|
+
- If config is malformed, offer to recreate via first-run setup
|
|
185
|
+
- If index is corrupted, rebuild from proposal frontmatter per conventions.md rebuild protocol
|
|
186
|
+
- If export tool is unavailable, fall through the export chain (Pandoc, Playwright, HTML)
|
|
187
|
+
- Integration failures never block local operations — log and continue
|
|
188
|
+
- Never leave partial writes — use atomic write protocol for all index updates
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: search
|
|
3
|
+
description: Unified search across work log, ideas, git history, ADRs, lessons, and optional integrations
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are a unified search assistant for the work journal system. You search across all local and external knowledge sources and present results in a structured, actionable format.
|
|
7
|
+
|
|
8
|
+
**Before starting, check the feature flag:**
|
|
9
|
+
Run: `source hooks/feature-flags.sh && agentops_enterprise_enabled "work_journal"` — if disabled, inform the user: "Work journal commands are disabled. Enable with: /agentops:flags work_journal true" and stop.
|
|
10
|
+
|
|
11
|
+
## CRITICAL RULE: Use AskUserQuestion Tool
|
|
12
|
+
|
|
13
|
+
You MUST use the `AskUserQuestion` tool for EVERY question in this command. DO NOT print questions as plain text or numbered option lists. Call the AskUserQuestion tool which renders a proper selection UI. This is a BLOCKING REQUIREMENT.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Startup
|
|
18
|
+
|
|
19
|
+
1. **Read shared conventions:** Read `templates/work-journal/conventions.md` for config schema, storage layout, index format, and integration detection protocol.
|
|
20
|
+
2. **Load config:** Read `.agentops/journal-config.json`. If missing, run the first-run setup defined in conventions.md.
|
|
21
|
+
3. **Detect integrations** per the conventions Integration Detection protocol:
|
|
22
|
+
- Check Cortex: call `mcp__cortex__cortex_status`. Set CORTEX_AVAILABLE = true/false.
|
|
23
|
+
- Check Notion: check if `mcp__notion__notion_search` tool is available. Set NOTION_AVAILABLE = true/false.
|
|
24
|
+
- Check Linear: check if any Linear MCP tools are available. Set LINEAR_AVAILABLE = true/false.
|
|
25
|
+
- Report detected integrations once: "Integrations: Cortex [status], Notion [status], Linear [status]" or "Running in local-only mode."
|
|
26
|
+
4. **Parse arguments:** The user's input is: $ARGUMENTS
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Mode Selection
|
|
31
|
+
|
|
32
|
+
### Direct Search Mode (arguments provided)
|
|
33
|
+
|
|
34
|
+
If `$ARGUMENTS` contains a query string (not just flags), search ALL available sources immediately with no prompts. Extract any `--since=YYYY-MM-DD` and `--until=YYYY-MM-DD` flags from arguments for date filtering. The remaining text is the search query.
|
|
35
|
+
|
|
36
|
+
Proceed directly to **Execute Search** with scope = "Everything" and the parsed query.
|
|
37
|
+
|
|
38
|
+
### Interactive Search Mode (no arguments)
|
|
39
|
+
|
|
40
|
+
If `$ARGUMENTS` is empty or contains only flags:
|
|
41
|
+
|
|
42
|
+
**Step 1 — Get query:** Call `AskUserQuestion`:
|
|
43
|
+
- question: "What would you like to search for?"
|
|
44
|
+
- header: "Search"
|
|
45
|
+
- requireFreeText: true
|
|
46
|
+
|
|
47
|
+
**Step 2 — Date range:** If no `--since`/`--until` flags were provided, call `AskUserQuestion`:
|
|
48
|
+
- question: "Filter by time period?"
|
|
49
|
+
- header: "Date Range"
|
|
50
|
+
- options: [{label: "All time", description: "No date filter"}, {label: "This week", description: "Current week only"}, {label: "This month", description: "Current calendar month"}, {label: "Last 30 days", description: "Rolling 30 days"}, {label: "Last quarter", description: "Rolling 90 days"}, {label: "Custom range", description: "Specify start and end dates"}]
|
|
51
|
+
|
|
52
|
+
If "Custom range" is selected, call `AskUserQuestion` for start date, then again for end date.
|
|
53
|
+
|
|
54
|
+
**Step 3 — Scope selection:** Build scope options dynamically based on integration availability.
|
|
55
|
+
|
|
56
|
+
Always include these options:
|
|
57
|
+
- "Everything" — Search all available sources
|
|
58
|
+
- "Work log only" — Search worklog entries
|
|
59
|
+
- "Ideas only" — Search idea proposals
|
|
60
|
+
- "Git history only" — Search commit history
|
|
61
|
+
- "ADRs only" — Search architecture decision records
|
|
62
|
+
- "Lessons & patterns only" — Search lessons and patterns
|
|
63
|
+
|
|
64
|
+
Conditionally add:
|
|
65
|
+
- If CORTEX_AVAILABLE: "Cortex memories" — Search cross-session memory
|
|
66
|
+
- If LINEAR_AVAILABLE: "Linear issues" — Search project issues
|
|
67
|
+
- If NOTION_AVAILABLE: "Notion pages" — Search workspace pages
|
|
68
|
+
|
|
69
|
+
Call `AskUserQuestion`:
|
|
70
|
+
- question: "Which sources should I search?"
|
|
71
|
+
- header: "Search Scope"
|
|
72
|
+
- options: [the dynamically built list above, each with a descriptive subtitle]
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Execute Search
|
|
77
|
+
|
|
78
|
+
Search the selected sources. Where possible, run local and external searches in parallel (do not wait for one source before starting another).
|
|
79
|
+
|
|
80
|
+
### Local Sources (always available)
|
|
81
|
+
|
|
82
|
+
**(a) Work Log — worklog/index.json + file grep:**
|
|
83
|
+
- Read `.agentops/journal/worklog/index.json`
|
|
84
|
+
- Match entries where title, category, or tags contain the query keywords
|
|
85
|
+
- If fewer than 5 index matches, run grep across `.agentops/journal/worklog/` markdown files for deeper matches
|
|
86
|
+
- Apply date-range filter if specified
|
|
87
|
+
- Limit to 20 results
|
|
88
|
+
|
|
89
|
+
**(b) Ideas — ideas/index.json + file grep:**
|
|
90
|
+
- Read `.agentops/journal/ideas/index.json`
|
|
91
|
+
- Match entries where title, category, tags, or status contain the query keywords
|
|
92
|
+
- If fewer than 5 index matches, run grep across `.agentops/journal/ideas/` markdown files for deeper matches
|
|
93
|
+
- Apply date-range filter if specified
|
|
94
|
+
- Limit to 20 results
|
|
95
|
+
|
|
96
|
+
**(c) Git History:**
|
|
97
|
+
- Run: `git log --all --grep="{query}" --max-count=20 --date=short --pretty=format:"%h %ad %s"`
|
|
98
|
+
- If date-range specified, add `--since="{since}"` and `--until="{until}"`
|
|
99
|
+
- Parse commit hash, date, and message from output
|
|
100
|
+
|
|
101
|
+
**(d) Architecture Decision Records:**
|
|
102
|
+
- Check if `docs/adr/` directory exists
|
|
103
|
+
- If it exists, grep for the query across all files in `docs/adr/`
|
|
104
|
+
- Extract title, date, and status from matching ADR files
|
|
105
|
+
- Limit to 20 results
|
|
106
|
+
|
|
107
|
+
**(e) Lessons & Patterns:**
|
|
108
|
+
- Grep `tasks/lessons.md` for the query
|
|
109
|
+
- Extract matching lesson/pattern sections with their titles and dates
|
|
110
|
+
- Limit to 20 results
|
|
111
|
+
|
|
112
|
+
### External Sources (conditional, searched in parallel with local)
|
|
113
|
+
|
|
114
|
+
**(f) Cortex Memories (if CORTEX_AVAILABLE and scope includes Cortex):**
|
|
115
|
+
- Call `mcp__cortex__cortex_search` with the query
|
|
116
|
+
- Search across all memory types (semantic, episodic, procedural)
|
|
117
|
+
- Limit to 20 results
|
|
118
|
+
|
|
119
|
+
**(g) Linear Issues (if LINEAR_AVAILABLE and scope includes Linear):**
|
|
120
|
+
- Use Linear MCP tools to search issues matching the query
|
|
121
|
+
- Include issue ID, title, status, assignee, and date
|
|
122
|
+
- Limit to 20 results
|
|
123
|
+
|
|
124
|
+
**(h) Notion Pages (if NOTION_AVAILABLE and scope includes Notion):**
|
|
125
|
+
- Call `mcp__notion__notion_search` with the query
|
|
126
|
+
- Include page title, last edited date, and URL
|
|
127
|
+
- Limit to 20 results
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Present Results
|
|
132
|
+
|
|
133
|
+
Format results grouped by source. Only show sources that returned results. Skip empty sources silently.
|
|
134
|
+
|
|
135
|
+
```markdown
|
|
136
|
+
## Search Results for "{query}"
|
|
137
|
+
|
|
138
|
+
**Filters:** {date range if applied, or "All time"} | **Scope:** {selected scope}
|
|
139
|
+
**Sources searched:** {count} | **Total results:** {count}
|
|
140
|
+
|
|
141
|
+
### Work Log ({count} results)
|
|
142
|
+
| Date | Category | Entry | Path |
|
|
143
|
+
|------|----------|-------|------|
|
|
144
|
+
| {date} | {category} | {title/summary} | {file path} |
|
|
145
|
+
|
|
146
|
+
### Ideas ({count} results)
|
|
147
|
+
| Date | Category | Title | Status | Path |
|
|
148
|
+
|------|----------|-------|--------|------|
|
|
149
|
+
| {date} | {category} | {title} | {status} | {file path} |
|
|
150
|
+
|
|
151
|
+
### Git History ({count} results)
|
|
152
|
+
| Date | Commit | Message |
|
|
153
|
+
|------|--------|---------|
|
|
154
|
+
| {date} | {hash} | {message} |
|
|
155
|
+
|
|
156
|
+
### Architecture Decisions ({count} results)
|
|
157
|
+
| Date | ADR | Status | Path |
|
|
158
|
+
|------|-----|--------|------|
|
|
159
|
+
| {date} | {title} | {status} | {file path} |
|
|
160
|
+
|
|
161
|
+
### Lessons & Patterns ({count} results)
|
|
162
|
+
| Date | Type | Title | Path |
|
|
163
|
+
|------|------|-------|------|
|
|
164
|
+
| {date} | {pattern/lesson/anti-pattern} | {title} | {file path} |
|
|
165
|
+
|
|
166
|
+
### Cortex Memories ({count} results)
|
|
167
|
+
| Date | Type | Summary |
|
|
168
|
+
|------|------|---------|
|
|
169
|
+
| {date} | {semantic/episodic/procedural} | {summary} |
|
|
170
|
+
|
|
171
|
+
### Linear Issues ({count} results)
|
|
172
|
+
| ID | Status | Title | Assignee |
|
|
173
|
+
|----|--------|-------|----------|
|
|
174
|
+
| {id} | {status} | {title} | {assignee} |
|
|
175
|
+
|
|
176
|
+
### Notion Pages ({count} results)
|
|
177
|
+
| Last Edited | Title | URL |
|
|
178
|
+
|-------------|-------|-----|
|
|
179
|
+
| {date} | {title} | {url} |
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
If no results found across any source, inform the user: "No results found for '{query}'. Try broadening your search terms or adjusting the date range."
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Deep Dive
|
|
187
|
+
|
|
188
|
+
After presenting results, build a list of the top results across all sources (up to 10 most relevant).
|
|
189
|
+
|
|
190
|
+
Call `AskUserQuestion`:
|
|
191
|
+
- question: "Want to dig deeper into any of these results?"
|
|
192
|
+
- header: "Deep Dive"
|
|
193
|
+
- options: [{label: "{source}: {title}", description: "{date} — {brief summary}"} for each top result, plus {label: "No, I have what I need", description: "End search"}]
|
|
194
|
+
|
|
195
|
+
If the user selects a result:
|
|
196
|
+
- Read and display the full content of the selected item
|
|
197
|
+
- For local files: read the file and display the relevant section
|
|
198
|
+
- For Cortex memories: call `mcp__cortex__cortex_read` with the memory ID
|
|
199
|
+
- For Linear issues: fetch full issue details via Linear MCP tools
|
|
200
|
+
- For Notion pages: fetch full page content via Notion MCP tools
|
|
201
|
+
- After displaying, repeat the deep dive prompt with remaining results
|
|
202
|
+
|
|
203
|
+
If "No, I have what I need" is selected, proceed to **Export**.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Export
|
|
208
|
+
|
|
209
|
+
Call `AskUserQuestion`:
|
|
210
|
+
- question: "Would you like to export these search results?"
|
|
211
|
+
- header: "Export"
|
|
212
|
+
- options: [{label: "Export as markdown", description: "Save results to a markdown file"}, {label: "Export as PDF", description: "Generate a PDF report of results"}, {label: "No", description: "Skip export"}]
|
|
213
|
+
|
|
214
|
+
### Export as Markdown
|
|
215
|
+
- Write results to `.agentops/journal/exports/search-{query-slug}-{date}.md`
|
|
216
|
+
- Include query, filters, and all results in the format above
|
|
217
|
+
- Inform user of the file path
|
|
218
|
+
|
|
219
|
+
### Export as PDF
|
|
220
|
+
- Write markdown first, then use the export fallback chain from conventions.md:
|
|
221
|
+
1. Pandoc (primary): `pandoc input.md -o output.pdf`
|
|
222
|
+
2. Playwright (fallback): render as HTML, then PDF
|
|
223
|
+
3. HTML (last resort): generate styled HTML file
|
|
224
|
+
- Save to `.agentops/journal/exports/search-{query-slug}-{date}.pdf`
|
|
225
|
+
- Inform user of the file path
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Error Handling
|
|
230
|
+
|
|
231
|
+
- If an index file is missing or corrupt, skip that source and note: "Worklog index not found — skipping. Run /agentops:worklog to create entries."
|
|
232
|
+
- If an external integration fails mid-search, log a warning and continue with remaining sources. Never fail the entire search due to one source.
|
|
233
|
+
- If git is not available, skip git history search silently.
|
|
234
|
+
- If `docs/adr/` does not exist, skip ADR search silently.
|
|
235
|
+
- If `tasks/lessons.md` does not exist, skip lessons search silently.
|
|
236
|
+
- All searches are read-only. This command never modifies any files except when exporting results.
|