projecta-rrr 1.11.0 → 1.11.2
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/agents/rrr-explore.md +62 -0
- package/bin/install.js +20 -0
- package/commands/rrr/add-phase.md +15 -1
- package/commands/rrr/check-browser-uat.md +63 -28
- package/commands/rrr/help.md +191 -11
- package/commands/rrr/new-milestone.md +29 -12
- package/commands/rrr/plan-phase.md +92 -8
- package/commands/rrr/progress.md +102 -10
- package/commands/rrr/update.md +49 -0
- package/commands/rrr/verify-work.md +50 -8
- package/docs/RELEASE-CHECKLIST.md +239 -0
- package/package.json +1 -1
- package/rrr/lib/install-roots.js +21 -12
- package/rrr/lib/semantic-metrics.js +216 -0
- package/rrr/lib/semantic-metrics.md +151 -0
- package/rrr/references/browser-testing.md +229 -0
- package/rrr/workflows/execute-plan.md +136 -27
- package/rrr/workflows/resume-project.md +66 -0
- package/scripts/browser-uat.sh +45 -9
- package/scripts/doctor-rrr.js +181 -1
- package/scripts/release-rrr.sh +61 -3
- package/scripts/test-install-smoke.js +190 -0
package/agents/rrr-explore.md
CHANGED
|
@@ -247,6 +247,15 @@ Am I finding files by naming pattern?
|
|
|
247
247
|
YES --> Use Glob (file pattern)
|
|
248
248
|
NO --> Re-evaluate what you're looking for
|
|
249
249
|
```
|
|
250
|
+
|
|
251
|
+
### Efficiency Reminder
|
|
252
|
+
|
|
253
|
+
After each semantic search, mentally note:
|
|
254
|
+
- Characters returned (divide by 4 = tokens)
|
|
255
|
+
- Multiply by 5.5 = what grep would have cost
|
|
256
|
+
- Track cumulative savings for final report
|
|
257
|
+
|
|
258
|
+
This takes <1 second and enables the Token Efficiency report that demonstrates semantic search value.
|
|
250
259
|
</tool_strategy>
|
|
251
260
|
|
|
252
261
|
<query_patterns>
|
|
@@ -437,6 +446,14 @@ When exploration is complete, return organized findings:
|
|
|
437
446
|
### Relationships
|
|
438
447
|
[If call graph was explored, key relationships]
|
|
439
448
|
|
|
449
|
+
### Token Efficiency
|
|
450
|
+
| Metric | Value |
|
|
451
|
+
|--------|-------|
|
|
452
|
+
| Semantic queries | N |
|
|
453
|
+
| Tokens used | N |
|
|
454
|
+
| Est. grep tokens | N |
|
|
455
|
+
| Tokens saved | N (X% reduction) |
|
|
456
|
+
|
|
440
457
|
### Confidence
|
|
441
458
|
[HIGH/MEDIUM/LOW based on search result quality]
|
|
442
459
|
```
|
|
@@ -621,6 +638,42 @@ Total: ~1200 tokens, 5 minutes
|
|
|
621
638
|
```
|
|
622
639
|
</token_efficiency>
|
|
623
640
|
|
|
641
|
+
<metrics_tracking>
|
|
642
|
+
## Displaying Token Savings
|
|
643
|
+
|
|
644
|
+
After completing an exploration, report token efficiency in results.
|
|
645
|
+
|
|
646
|
+
### What to Track
|
|
647
|
+
|
|
648
|
+
For each search operation, estimate tokens:
|
|
649
|
+
- **Semantic search result:** Characters returned / 4
|
|
650
|
+
- **Estimated grep equivalent:** Semantic tokens * 5.5 (benchmark multiplier)
|
|
651
|
+
|
|
652
|
+
### Example Tracking
|
|
653
|
+
|
|
654
|
+
```
|
|
655
|
+
Query: "how is authentication implemented"
|
|
656
|
+
GrepAI returned: 3,200 characters = 800 tokens
|
|
657
|
+
Estimated grep: 800 * 5.5 = 4,400 tokens
|
|
658
|
+
Savings: 3,600 tokens (82% reduction)
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
### When to Display
|
|
662
|
+
|
|
663
|
+
- Always include Token Efficiency section in exploration results
|
|
664
|
+
- Show cumulative savings if multiple queries were needed
|
|
665
|
+
- Round percentages to nearest whole number
|
|
666
|
+
|
|
667
|
+
### Benchmark Reference
|
|
668
|
+
|
|
669
|
+
Based on TOKEN-BENCHMARK.md analysis:
|
|
670
|
+
- Conceptual queries: 78-84% reduction typical
|
|
671
|
+
- Call graph traces: 91% reduction typical
|
|
672
|
+
- Overall average: 85-91% reduction
|
|
673
|
+
|
|
674
|
+
If your results differ significantly from benchmarks, note why in findings (e.g., very targeted query, complex codebase).
|
|
675
|
+
</metrics_tracking>
|
|
676
|
+
|
|
624
677
|
<integration>
|
|
625
678
|
## How Other Agents Use rrr-explore
|
|
626
679
|
|
|
@@ -656,6 +709,14 @@ When spawned for exploration, return structured findings:
|
|
|
656
709
|
### Code References
|
|
657
710
|
[Specific code snippets with line numbers]
|
|
658
711
|
|
|
712
|
+
### Token Efficiency
|
|
713
|
+
| Metric | Value |
|
|
714
|
+
|--------|-------|
|
|
715
|
+
| Semantic queries | N |
|
|
716
|
+
| Tokens used | N |
|
|
717
|
+
| Est. grep tokens | N |
|
|
718
|
+
| Tokens saved | N (X% reduction) |
|
|
719
|
+
|
|
659
720
|
### Confidence: [HIGH/MEDIUM/LOW]
|
|
660
721
|
[Why this confidence level]
|
|
661
722
|
|
|
@@ -705,6 +766,7 @@ Explore:
|
|
|
705
766
|
- [ ] Minimal files read (only what's needed)
|
|
706
767
|
- [ ] Findings returned in structured format
|
|
707
768
|
- [ ] High relevance in search results
|
|
769
|
+
- [ ] Token efficiency reported in exploration results
|
|
708
770
|
|
|
709
771
|
### Quality Metrics
|
|
710
772
|
|
package/bin/install.js
CHANGED
|
@@ -710,6 +710,26 @@ function install(isGlobal) {
|
|
|
710
710
|
copyWithPathReplacement(rrrSrc, rrrDest, pathPrefix);
|
|
711
711
|
console.log(` ${green}✓${reset} Installed commands/rrr`);
|
|
712
712
|
|
|
713
|
+
// Verify critical command files exist
|
|
714
|
+
const criticalCommands = ['help.md', 'progress.md', 'update.md', 'new-project.md'];
|
|
715
|
+
const missingCommands = [];
|
|
716
|
+
for (const cmd of criticalCommands) {
|
|
717
|
+
const cmdPath = path.join(rrrDest, cmd);
|
|
718
|
+
if (!fs.existsSync(cmdPath)) {
|
|
719
|
+
missingCommands.push(cmd);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
if (missingCommands.length > 0) {
|
|
724
|
+
console.log(` ${orange}ERROR:${reset} Critical commands missing after install:`);
|
|
725
|
+
for (const cmd of missingCommands) {
|
|
726
|
+
console.log(` - ${cmd}`);
|
|
727
|
+
}
|
|
728
|
+
console.log(`\n Installation may be corrupted. Try: rm -rf ${claudeDir} && npx projecta-rrr --global`);
|
|
729
|
+
process.exit(1);
|
|
730
|
+
}
|
|
731
|
+
console.log(` ${green}✓${reset} Verified ${criticalCommands.length} critical commands exist`);
|
|
732
|
+
|
|
713
733
|
// Copy rrr skill with path replacement
|
|
714
734
|
const skillSrc = path.join(src, 'rrr');
|
|
715
735
|
const skillDest = path.join(claudeDir, 'rrr');
|
|
@@ -16,6 +16,16 @@ This command appends sequential phases to the current milestone's phase list, au
|
|
|
16
16
|
Purpose: Add planned work discovered during execution that belongs at the end of current milestone.
|
|
17
17
|
|
|
18
18
|
**v1.11 Breaking Change:** Requires active milestone and no orphan phases before creating new phases.
|
|
19
|
+
|
|
20
|
+
**When to use this command:**
|
|
21
|
+
- Adding planned work at the END of current milestone
|
|
22
|
+
- Work that should run AFTER all existing phases
|
|
23
|
+
- New features discovered during planning
|
|
24
|
+
|
|
25
|
+
**When to use /rrr:insert-phase instead:**
|
|
26
|
+
- Urgent work that needs to run BEFORE remaining phases
|
|
27
|
+
- Work that logically fits between existing phases
|
|
28
|
+
- Bug fixes that should precede planned features
|
|
19
29
|
</objective>
|
|
20
30
|
|
|
21
31
|
<execution_context>
|
|
@@ -304,6 +314,9 @@ Phase {N} added to current milestone:
|
|
|
304
314
|
Roadmap updated: {roadmap-path}
|
|
305
315
|
Project state updated: .planning/STATE.md
|
|
306
316
|
|
|
317
|
+
**Tip:** Need this phase to run sooner?
|
|
318
|
+
Use `/rrr:insert-phase` to insert between existing phases (creates decimal numbers like 5.1).
|
|
319
|
+
|
|
307
320
|
---
|
|
308
321
|
|
|
309
322
|
## ▶ Next Up
|
|
@@ -317,7 +330,8 @@ Project state updated: .planning/STATE.md
|
|
|
317
330
|
---
|
|
318
331
|
|
|
319
332
|
**Also available:**
|
|
320
|
-
- `/rrr:add-phase <description>` — add another phase
|
|
333
|
+
- `/rrr:add-phase <description>` — add another phase at end
|
|
334
|
+
- `/rrr:insert-phase <after> <description>` — insert between phases (e.g., after Phase 5)
|
|
321
335
|
- Review roadmap
|
|
322
336
|
|
|
323
337
|
---
|
|
@@ -65,24 +65,25 @@ fi
|
|
|
65
65
|
|
|
66
66
|
## Report
|
|
67
67
|
|
|
68
|
-
Print summary report:
|
|
68
|
+
Print summary report with REASONING:
|
|
69
69
|
|
|
70
70
|
```
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
71
|
+
Browser UAT Setup Check
|
|
72
|
+
=======================
|
|
74
73
|
|
|
75
|
-
| Check
|
|
76
|
-
|
|
77
|
-
| ANTHROPIC_API_KEY| {
|
|
78
|
-
| agent-browse
|
|
79
|
-
| Dev server
|
|
80
|
-
| Environment
|
|
74
|
+
| Check | Status | Details |
|
|
75
|
+
|--------------------|--------|---------|
|
|
76
|
+
| ANTHROPIC_API_KEY | {Y|X} | {set to sk-...xxx | not set} |
|
|
77
|
+
| agent-browse | {Y|X} | {installed | not installed} |
|
|
78
|
+
| Dev server | {Y|!} | {running at URL | not reachable} |
|
|
79
|
+
| Environment | {value}| {Interactive | Headless} |
|
|
81
80
|
|
|
82
|
-
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
Tool Selection: {TOOL_NAME}
|
|
84
|
+
Reason: {SPECIFIC_REASON}
|
|
83
85
|
|
|
84
|
-
{
|
|
85
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
86
|
+
{Additional context based on selection}
|
|
86
87
|
```
|
|
87
88
|
|
|
88
89
|
## Tool Selection Logic
|
|
@@ -90,43 +91,77 @@ Print summary report:
|
|
|
90
91
|
```
|
|
91
92
|
if api_key_present AND plugin_installed:
|
|
92
93
|
tool = "agent-browse"
|
|
93
|
-
|
|
94
|
+
reason = "API key found + plugin installed = full automation available"
|
|
95
|
+
|
|
94
96
|
elif api_key_present AND environment == "interactive":
|
|
95
97
|
tool = "claude --chrome"
|
|
96
|
-
|
|
98
|
+
reason = "API key found but plugin missing. Falling back to interactive Chrome."
|
|
99
|
+
suggestion = "Install plugin for autonomous testing: /plugin marketplace add browserbase/agent-browse"
|
|
100
|
+
|
|
97
101
|
elif environment == "interactive":
|
|
98
102
|
tool = "claude --chrome (manual)"
|
|
99
|
-
|
|
103
|
+
reason = "No API key. You'll need to test manually in Chrome."
|
|
104
|
+
suggestion = "Set ANTHROPIC_API_KEY for automated browser testing"
|
|
105
|
+
|
|
100
106
|
else:
|
|
101
107
|
tool = "Skipped"
|
|
102
|
-
|
|
108
|
+
reason = "Headless mode without API key = no browser testing available"
|
|
109
|
+
suggestion = "Set ANTHROPIC_API_KEY=... to enable browser UAT in Pushpa/CI"
|
|
103
110
|
```
|
|
104
111
|
|
|
105
112
|
## Next Steps (conditional)
|
|
106
113
|
|
|
107
|
-
If
|
|
114
|
+
**If tool = "agent-browse":**
|
|
108
115
|
```
|
|
109
|
-
|
|
110
|
-
|
|
116
|
+
Ready for Browser UAT
|
|
117
|
+
---------------------
|
|
118
|
+
Your setup supports fully automated browser testing.
|
|
119
|
+
No further action needed.
|
|
111
120
|
```
|
|
112
121
|
|
|
113
|
-
If
|
|
122
|
+
**If tool = "claude --chrome" (plugin missing):**
|
|
114
123
|
```
|
|
115
|
-
|
|
124
|
+
Fallback Mode: claude --chrome
|
|
125
|
+
------------------------------
|
|
126
|
+
Browser UAT will work but requires you to be present.
|
|
127
|
+
|
|
128
|
+
To upgrade to autonomous testing:
|
|
116
129
|
/plugin marketplace add browserbase/agent-browse
|
|
117
130
|
/plugin install agent-browse@browserbase
|
|
131
|
+
|
|
132
|
+
Then re-run: /rrr:check-browser-uat
|
|
118
133
|
```
|
|
119
134
|
|
|
120
|
-
If
|
|
135
|
+
**If tool = "claude --chrome" (no API key):**
|
|
121
136
|
```
|
|
122
|
-
|
|
123
|
-
|
|
137
|
+
Manual Mode: claude --chrome
|
|
138
|
+
----------------------------
|
|
139
|
+
Browser UAT will prompt you to test manually.
|
|
140
|
+
|
|
141
|
+
To enable AI-powered testing:
|
|
142
|
+
export ANTHROPIC_API_KEY=your-key-here
|
|
143
|
+
|
|
144
|
+
Then re-run: /rrr:check-browser-uat
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**If tool = "Skipped":**
|
|
124
148
|
```
|
|
149
|
+
Browser UAT will be SKIPPED
|
|
150
|
+
---------------------------
|
|
151
|
+
Running in headless mode without ANTHROPIC_API_KEY.
|
|
125
152
|
|
|
126
|
-
|
|
153
|
+
To enable browser UAT in Pushpa/CI:
|
|
154
|
+
1. export ANTHROPIC_API_KEY=your-key-here
|
|
155
|
+
2. Ensure agent-browse plugin is installed
|
|
156
|
+
|
|
157
|
+
Browser UAT is optional - Playwright tests still run.
|
|
158
|
+
See: rrr/references/browser-testing.md
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**If server not running:**
|
|
127
162
|
```
|
|
128
|
-
|
|
129
|
-
|
|
163
|
+
Start dev server before running visual proof:
|
|
164
|
+
npm run dev
|
|
130
165
|
```
|
|
131
166
|
</behavior>
|
|
132
167
|
|
package/commands/rrr/help.md
CHANGED
|
@@ -364,31 +364,46 @@ Usage: `/rrr:pause-work`
|
|
|
364
364
|
### Verification
|
|
365
365
|
|
|
366
366
|
**`/rrr:verify-work [target] [--audit | --uat]`**
|
|
367
|
-
Validate built features through audit or interactive UAT.
|
|
367
|
+
Validate built features through evidence audit or interactive UAT.
|
|
368
368
|
|
|
369
|
-
**Two modes:**
|
|
369
|
+
**Two modes (pick based on your question):**
|
|
370
370
|
|
|
371
|
-
|
|
|
372
|
-
|
|
373
|
-
|
|
|
374
|
-
|
|
|
371
|
+
| Your Question | Mode | Command |
|
|
372
|
+
|---------------|------|---------|
|
|
373
|
+
| "Did Claude finish the work?" | Audit | `/rrr:verify-work --audit` (default) |
|
|
374
|
+
| "Does the app actually work?" | UAT | `/rrr:verify-work --uat` |
|
|
375
|
+
|
|
376
|
+
**Mode details:**
|
|
377
|
+
|
|
378
|
+
| Mode | What it checks | When to use |
|
|
379
|
+
|------|----------------|-------------|
|
|
380
|
+
| `--audit` (default) | PLAN/SUMMARY existence, git commits | Quick evidence check, pre-release validation |
|
|
381
|
+
| `--uat` | Manual testing with UAT.md tracking | Hands-on testing, finding UX bugs |
|
|
375
382
|
|
|
376
383
|
**Target options:**
|
|
377
|
-
- Phase: `05`, `5`, `05-auth`
|
|
378
|
-
- Milestone: `v1.9`
|
|
379
|
-
- Empty
|
|
384
|
+
- Phase: `05`, `5`, `05-auth` - verify that phase
|
|
385
|
+
- Milestone: `v1.9` - verify all phases in milestone
|
|
386
|
+
- Empty - verify current milestone from STATE.md
|
|
380
387
|
|
|
381
388
|
**Examples:**
|
|
382
389
|
```
|
|
383
390
|
/rrr:verify-work # Audit current milestone (default)
|
|
384
|
-
/rrr:verify-work --audit # Audit current milestone
|
|
385
391
|
/rrr:verify-work --audit 05 # Audit phase 05 only
|
|
386
|
-
/rrr:verify-work --audit v1.9 # Audit all phases in v1.9
|
|
387
392
|
/rrr:verify-work --uat 05 # Interactive UAT for phase 05
|
|
388
393
|
```
|
|
389
394
|
|
|
390
395
|
**Audit output:** `.planning/artifacts/VERIFY_WORK_AUDIT.md`
|
|
391
396
|
|
|
397
|
+
**`/rrr:check-browser-uat`**
|
|
398
|
+
Check browser UAT prerequisites and see which tool will be used.
|
|
399
|
+
|
|
400
|
+
- Reports ANTHROPIC_API_KEY status
|
|
401
|
+
- Reports agent-browse plugin status
|
|
402
|
+
- Shows tool selection with reasoning
|
|
403
|
+
- Provides setup instructions if needed
|
|
404
|
+
|
|
405
|
+
Usage: `/rrr:check-browser-uat`
|
|
406
|
+
|
|
392
407
|
### Debugging
|
|
393
408
|
|
|
394
409
|
**`/rrr:debug [issue description]`**
|
|
@@ -776,6 +791,39 @@ Plans are automatically classified by `frontend_impact` (replaces legacy `ui_aff
|
|
|
776
791
|
|
|
777
792
|
Planner adds `verification.frontend_impact: true|false` frontmatter automatically based on file paths and keywords. See `rrr/references/frontend-impact-detection.md` for classification rules.
|
|
778
793
|
|
|
794
|
+
**Gap Closure Workflow**
|
|
795
|
+
|
|
796
|
+
When UAT finds issues, RRR supports iterative fixing:
|
|
797
|
+
|
|
798
|
+
```
|
|
799
|
+
/rrr:verify-work --uat 05 # UAT finds 3 issues
|
|
800
|
+
# Issues logged to 05-UAT.md with root causes
|
|
801
|
+
/rrr:plan-phase 05 --gaps # Creates fix plans from diagnosed gaps
|
|
802
|
+
/rrr:execute-phase 05 # Executes fix plans
|
|
803
|
+
/rrr:verify-work --uat 05 # Re-test (resumes from last position)
|
|
804
|
+
```
|
|
805
|
+
|
|
806
|
+
**How it works:**
|
|
807
|
+
1. UAT mode tracks test progress in `{phase}-UAT.md`
|
|
808
|
+
2. Issues are diagnosed automatically (root cause analysis)
|
|
809
|
+
3. `--gaps` flag creates targeted fix plans from diagnosed issues
|
|
810
|
+
4. Re-running UAT resumes from where you left off
|
|
811
|
+
|
|
812
|
+
**Progress tracking:**
|
|
813
|
+
- UAT.md shows: `Progress: 3/8 tests, 2 issues found`
|
|
814
|
+
- Gap closure plans reference the specific gaps they address
|
|
815
|
+
- Each iteration should close more gaps until all pass
|
|
816
|
+
|
|
817
|
+
**When to stop iterating:**
|
|
818
|
+
- All UAT tests pass
|
|
819
|
+
- Remaining issues are deferred (documented in STATE.md)
|
|
820
|
+
- User decides remaining issues are acceptable
|
|
821
|
+
|
|
822
|
+
**Avoid infinite loops:**
|
|
823
|
+
- If same gap reappears after fix, investigate root cause
|
|
824
|
+
- Consider marking as tech debt rather than blocking
|
|
825
|
+
- Use `/rrr:debug` for persistent issues
|
|
826
|
+
|
|
779
827
|
**Visual Proof: Two-Step Verification**
|
|
780
828
|
|
|
781
829
|
Frontend-impacting plans require **both** verification steps to be green:
|
|
@@ -790,6 +838,8 @@ Frontend-impacting plans require **both** verification steps to be green:
|
|
|
790
838
|
|
|
791
839
|
**Browser UAT Tool Selection Matrix:**
|
|
792
840
|
|
|
841
|
+
See `rrr/references/browser-testing.md` for complete documentation. Quick reference:
|
|
842
|
+
|
|
793
843
|
| Environment | API Key? | Plugin? | Tool Used | Notes |
|
|
794
844
|
|-------------|----------|---------|-----------|-------|
|
|
795
845
|
| Interactive | Yes | Yes | agent-browse | Preferred - autonomous browser automation |
|
|
@@ -848,6 +898,17 @@ agent-browse enables autonomous browser automation without manual intervention.
|
|
|
848
898
|
| "Connection refused on port 3000" | Dev server not started | Run `npm run dev` in another terminal |
|
|
849
899
|
| "Plugin initialization failed" | MCP connection error | Restart Claude Code, reinstall plugin |
|
|
850
900
|
|
|
901
|
+
**For comprehensive browser testing documentation:**
|
|
902
|
+
```
|
|
903
|
+
@rrr/references/browser-testing.md
|
|
904
|
+
```
|
|
905
|
+
|
|
906
|
+
This covers:
|
|
907
|
+
- All three testing tools (Playwright, agent-browse, claude --chrome)
|
|
908
|
+
- Decision tree for which tool runs when
|
|
909
|
+
- Environment matrix (local, Pushpa, CI)
|
|
910
|
+
- Setup instructions and troubleshooting
|
|
911
|
+
|
|
851
912
|
**Checking your setup:**
|
|
852
913
|
```
|
|
853
914
|
/rrr:check-browser-uat
|
|
@@ -1016,6 +1077,125 @@ skills:
|
|
|
1016
1077
|
└── (vendor with scripts/vendor-droid-tings-skills.sh)
|
|
1017
1078
|
```
|
|
1018
1079
|
|
|
1080
|
+
## Semantic Search (GrepAI)
|
|
1081
|
+
|
|
1082
|
+
RRR integrates with [GrepAI](https://github.com/yoanbernabeu/grepai) for semantic code search. Instead of grep patterns, ask natural language questions like "how is authentication implemented" and get relevant code chunks.
|
|
1083
|
+
|
|
1084
|
+
### Why Semantic Search?
|
|
1085
|
+
|
|
1086
|
+
| Approach | Query | Results |
|
|
1087
|
+
|----------|-------|---------|
|
|
1088
|
+
| Traditional grep | `grep -r "auth"` | 200+ lines, mostly noise |
|
|
1089
|
+
| Semantic search | "how is user authentication implemented" | 5-10 relevant code chunks |
|
|
1090
|
+
|
|
1091
|
+
**Benefits:**
|
|
1092
|
+
- **90%+ token reduction** — focused results, not grep noise
|
|
1093
|
+
- **Concept discovery** — finds related code even without exact string matches
|
|
1094
|
+
- **Call graph analysis** — trace callers/callees through codebase
|
|
1095
|
+
|
|
1096
|
+
### When to Use Each Tool
|
|
1097
|
+
|
|
1098
|
+
| Query Type | Use | Example |
|
|
1099
|
+
|------------|-----|---------|
|
|
1100
|
+
| **Concept/behavior** | Semantic | "how is authentication implemented" |
|
|
1101
|
+
| **Exact identifier** | Grep | `findUserById`, `validateToken` |
|
|
1102
|
+
| **Pattern matching** | Grep | `TODO:`, `console.log` |
|
|
1103
|
+
| **Understanding flow** | Semantic | "what happens when a user logs in" |
|
|
1104
|
+
| **Finding definition** | Grep | `function processPayment` |
|
|
1105
|
+
| **Finding usage** | Call graph | `grepai_trace_callers processPayment` |
|
|
1106
|
+
|
|
1107
|
+
**Semantic search is NOT good for:**
|
|
1108
|
+
- Exact variable/function names (use grep)
|
|
1109
|
+
- String literals or patterns (use grep)
|
|
1110
|
+
- Single-word searches like "thing" (too vague, use grep with context)
|
|
1111
|
+
|
|
1112
|
+
**Semantic search IS good for:**
|
|
1113
|
+
- Natural language questions about behavior
|
|
1114
|
+
- Finding code when you don't know the exact names
|
|
1115
|
+
- Understanding how features are implemented
|
|
1116
|
+
- Discovering related code across the codebase
|
|
1117
|
+
|
|
1118
|
+
### Setup
|
|
1119
|
+
|
|
1120
|
+
**Prerequisites:**
|
|
1121
|
+
1. [Ollama](https://ollama.com/) installed and running
|
|
1122
|
+
2. Pull embedding model: `ollama pull nomic-embed-text`
|
|
1123
|
+
|
|
1124
|
+
**Install GrepAI:**
|
|
1125
|
+
```bash
|
|
1126
|
+
# Download to ~/.local/bin (no sudo required)
|
|
1127
|
+
curl -L https://github.com/yoanbernabeu/grepai/releases/latest/download/grepai-darwin-arm64 -o ~/.local/bin/grepai
|
|
1128
|
+
chmod +x ~/.local/bin/grepai
|
|
1129
|
+
|
|
1130
|
+
# Initialize in your project
|
|
1131
|
+
cd your-project
|
|
1132
|
+
~/.local/bin/grepai init
|
|
1133
|
+
```
|
|
1134
|
+
|
|
1135
|
+
**Configure MCP (Claude Code):**
|
|
1136
|
+
Add to `.mcp.json` in your project:
|
|
1137
|
+
```json
|
|
1138
|
+
{
|
|
1139
|
+
"mcpServers": {
|
|
1140
|
+
"grepai": {
|
|
1141
|
+
"command": "~/.local/bin/grepai",
|
|
1142
|
+
"args": ["mcp-serve"]
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
```
|
|
1147
|
+
|
|
1148
|
+
Restart Claude Code to load the MCP server.
|
|
1149
|
+
|
|
1150
|
+
### Starting the Indexer
|
|
1151
|
+
|
|
1152
|
+
GrepAI needs to index your codebase first:
|
|
1153
|
+
|
|
1154
|
+
```bash
|
|
1155
|
+
# Start watcher (builds index and watches for changes)
|
|
1156
|
+
~/.local/bin/grepai watch
|
|
1157
|
+
|
|
1158
|
+
# Or one-time index (without watching)
|
|
1159
|
+
~/.local/bin/grepai index
|
|
1160
|
+
```
|
|
1161
|
+
|
|
1162
|
+
**Note:** `/rrr:resume-work` automatically checks index status and offers to start the watcher if needed.
|
|
1163
|
+
|
|
1164
|
+
### Using Semantic Search
|
|
1165
|
+
|
|
1166
|
+
**In Claude Code (via MCP tools):**
|
|
1167
|
+
- `grepai_search` — Natural language code search
|
|
1168
|
+
- `grepai_trace_callers` — Find what calls a function
|
|
1169
|
+
- `grepai_trace_callees` — Find what a function calls
|
|
1170
|
+
- `grepai_trace_graph` — Build complete call graph
|
|
1171
|
+
- `grepai_index_status` — Check index health
|
|
1172
|
+
|
|
1173
|
+
**CLI usage:**
|
|
1174
|
+
```bash
|
|
1175
|
+
~/.local/bin/grepai search "retry mechanism with exponential backoff"
|
|
1176
|
+
~/.local/bin/grepai trace-callers validateUser
|
|
1177
|
+
~/.local/bin/grepai index status
|
|
1178
|
+
```
|
|
1179
|
+
|
|
1180
|
+
### RRR Integration
|
|
1181
|
+
|
|
1182
|
+
The `rrr-explore` agent uses semantic search as its primary strategy:
|
|
1183
|
+
1. Semantic search first (concepts and behaviors)
|
|
1184
|
+
2. Call graph tools for dependency mapping
|
|
1185
|
+
3. Grep only for exact identifier lookup
|
|
1186
|
+
|
|
1187
|
+
See `@agents/rrr-explore.md` for full exploration patterns.
|
|
1188
|
+
|
|
1189
|
+
### Troubleshooting
|
|
1190
|
+
|
|
1191
|
+
| Issue | Solution |
|
|
1192
|
+
|-------|----------|
|
|
1193
|
+
| "No index found" | Run `~/.local/bin/grepai watch` to build index |
|
|
1194
|
+
| "Ollama not running" | Start Ollama: `ollama serve` |
|
|
1195
|
+
| "Model not found" | Pull model: `ollama pull nomic-embed-text` |
|
|
1196
|
+
| Empty search results | Check index status: `~/.local/bin/grepai index status` |
|
|
1197
|
+
| MCP tools not available | Restart Claude Code after adding .mcp.json |
|
|
1198
|
+
|
|
1019
1199
|
## External Skills (skills.sh Ecosystem)
|
|
1020
1200
|
|
|
1021
1201
|
RRR automatically installs and manages external skills from the skills.sh ecosystem using the `add-skill` CLI.
|
|
@@ -45,7 +45,12 @@ Milestone name: $ARGUMENTS (optional - will prompt if not provided)
|
|
|
45
45
|
|
|
46
46
|
1.5. **Version consistency check (MANDATORY):**
|
|
47
47
|
|
|
48
|
-
Before writing any milestone files, verify version consistency
|
|
48
|
+
Before writing any milestone files, verify version consistency.
|
|
49
|
+
|
|
50
|
+
**Important context:**
|
|
51
|
+
- `package.json` is the CANONICAL source of truth for the current version
|
|
52
|
+
- `/rrr:check-version` compares against npm registry (different concern — checks if release is published)
|
|
53
|
+
- Documentation version drift is normal after updates — auto-fix is almost always the right choice
|
|
49
54
|
|
|
50
55
|
```bash
|
|
51
56
|
# Read canonical version from package.json
|
|
@@ -67,38 +72,50 @@ Milestone name: $ARGUMENTS (optional - will prompt if not provided)
|
|
|
67
72
|
- If CHANGELOG major.minor != canonical major.minor → MISMATCH
|
|
68
73
|
- If planning docs reference different milestone version → MISMATCH
|
|
69
74
|
|
|
70
|
-
**If mismatch detected
|
|
75
|
+
**If mismatch detected:**
|
|
71
76
|
|
|
72
77
|
```
|
|
73
78
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
74
|
-
|
|
79
|
+
VERSION SYNC NEEDED
|
|
75
80
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
76
81
|
|
|
77
82
|
Canonical (package.json): {CANONICAL_VERSION}
|
|
78
83
|
CHANGELOG.md: {CHANGELOG_VERSION}
|
|
79
84
|
Planning docs: {ROADMAP_VERSION}
|
|
80
85
|
|
|
81
|
-
|
|
86
|
+
This is normal after updates. Auto-fix will sync docs to package.json.
|
|
82
87
|
```
|
|
83
88
|
|
|
84
89
|
Use AskUserQuestion:
|
|
85
90
|
- header: "Version"
|
|
86
|
-
- question: "
|
|
91
|
+
- question: "Documentation versions need sync. How would you like to proceed?"
|
|
87
92
|
- options:
|
|
88
|
-
- "
|
|
89
|
-
- "
|
|
93
|
+
- "Auto-fix now (Recommended)" — Update docs to match package.json
|
|
94
|
+
- "Run /rrr:check-version" — Check npm registry status (different concern — won't fix doc drift)
|
|
95
|
+
- "Continue anyway" — Proceed with mismatched versions (documentation debt)
|
|
90
96
|
- "Abort" — Cancel milestone creation
|
|
91
97
|
|
|
98
|
+
**If "Auto-fix now (Recommended)":**
|
|
99
|
+
- Update CHANGELOG.md with [Unreleased] header if needed
|
|
100
|
+
- Update planning docs milestone references to match canonical
|
|
101
|
+
- Continue to step 2
|
|
102
|
+
|
|
92
103
|
**If "Run /rrr:check-version":**
|
|
93
104
|
```
|
|
94
|
-
|
|
105
|
+
Note: /rrr:check-version compares package.json against the npm registry.
|
|
106
|
+
This is useful for checking publish status, but won't fix documentation drift.
|
|
107
|
+
You may still need to run "Auto-fix now" after.
|
|
108
|
+
|
|
109
|
+
Run `/rrr:check-version` to check registry status, then return to `/rrr:new-milestone`
|
|
95
110
|
```
|
|
96
111
|
Exit command.
|
|
97
112
|
|
|
98
|
-
**If "
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
-
|
|
113
|
+
**If "Continue anyway":**
|
|
114
|
+
```
|
|
115
|
+
Continuing with version mismatch. This creates documentation debt.
|
|
116
|
+
Consider running `/rrr:new-milestone` again later with "Auto-fix now" to sync versions.
|
|
117
|
+
```
|
|
118
|
+
Continue to step 2.
|
|
102
119
|
|
|
103
120
|
**If "Abort":** Exit command.
|
|
104
121
|
|