Conversation
Task 6 (proactive advisory): proactive_suggestions()/settings read-path already existed (PR #302) but had no way to actually set a snooze or dismiss - save_settings() was dead code. Add `skill snooze <name> [--days N]` and `skill dismiss <name>` wired to it. Task 9 (repo stack -> auto provisioning): new `skill provision <path>` subcommand. Detects stack via manifest files (Cargo.toml/package.json/ tsconfig.json/pyproject.toml/requirements.txt/go.mod), ranks indexed skills against it via BM25 search, prints a dry-run report (skills, confidence, token cost) with zero DB writes, and on --yes re-tags the matched entries under source "provisioned:<repo>" via the existing scan+rebuild entry-creation path.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds ChangesSkill management
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant SkillCLI
participant skill_proactive
participant SettingsFile
SkillCLI->>skill_proactive: snooze or dismiss skill
skill_proactive->>SettingsFile: load settings
skill_proactive->>SettingsFile: save updated override
sequenceDiagram
participant SkillCLI
participant detect_stack
participant rank_candidates
participant SkillsDB
SkillCLI->>detect_stack: inspect repository manifests
detect_stack-->>SkillCLI: detected stack tags
SkillCLI->>rank_candidates: search index with stack tags
rank_candidates-->>SkillCLI: ranked skill candidates
SkillCLI->>SkillsDB: rebuild with provisioned:path entries
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
src/skill_proactive.rs (1)
172-230: 📐 Maintainability & Code Quality | 🔵 TrivialGood coverage of the override-preservation semantics.
Tests correctly verify
apply_snooze/apply_dismisscreate/update overrides and preserve the sibling field. Note the publicsnooze()/dismiss()entry points (epoch computation,daysclamping,save_settingsround-trip) remain untested — consider adding coverage similar to thewith_temp_homepattern used elsewhere in the codebase.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/skill_proactive.rs` around lines 172 - 230, The existing tests cover the internal override helpers but not the public snooze() and dismiss() entry points. Add tests using the established with_temp_home pattern to verify epoch computation, days clamping, and save_settings round-trip behavior through those public APIs, while retaining the current helper tests.src/cli/skill.rs (1)
778-779: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueAgent detection is hardcoded to
claude-codeonly.
default_sourcessupports conditionally includingcodex/cursor/opencodeconventional directories when those agents are detected, but provisioning always passes&["claude-code".to_string()], so those dirs are never scanned even if present.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/cli/skill.rs` around lines 778 - 779, Update the source initialization in the skill provisioning flow around skill_registry::sources::default_sources to pass the agents detected from the environment instead of a hardcoded ["claude-code"] list. Reuse the existing agent-detection mechanism and preserve default_sources behavior so codex, cursor, and opencode directories are included when detected.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/cli/skill.rs`:
- Around line 735-810: The --yes path in run_provision rebuilds the database
from only freshly scanned sources, dropping existing DB-only and imported
entries. Before calling skill_registry::db::rebuild, load all current database
entries through the existing list-all query/API and merge them with the scanned
entries and newly tagged provisioned entries, deduplicating by the registry’s
entry identity while preserving the new provisioned:{path} records.
- Around line 706-733: Update rank_candidates to retain the lowest score for
each skill name and sort ranked results in ascending score order, matching FTS5
ordering. In the confidence display near the ranking output, replace the current
raw-score normalization with a monotonic bounded conversion that never produces
negative percentages and caps at 100%.
In `@src/skill_proactive.rs`:
- Around line 80-89: Update snooze() to compute the nonnegative duration with
saturating arithmetic so arbitrarily large days cannot overflow during
multiplication or when adding now. Preserve the existing behavior for valid
nonnegative values and continue passing the resulting timestamp to apply_snooze.
---
Nitpick comments:
In `@src/cli/skill.rs`:
- Around line 778-779: Update the source initialization in the skill
provisioning flow around skill_registry::sources::default_sources to pass the
agents detected from the environment instead of a hardcoded ["claude-code"]
list. Reuse the existing agent-detection mechanism and preserve default_sources
behavior so codex, cursor, and opencode directories are included when detected.
In `@src/skill_proactive.rs`:
- Around line 172-230: The existing tests cover the internal override helpers
but not the public snooze() and dismiss() entry points. Add tests using the
established with_temp_home pattern to verify epoch computation, days clamping,
and save_settings round-trip behavior through those public APIs, while retaining
the current helper tests.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 4be30e5a-f092-499f-b62d-a3b5b5f4c895
📒 Files selected for processing (2)
src/cli/skill.rssrc/skill_proactive.rs
- rank_candidates picked the highest bm25 score as "best" and sorted descending; bm25 is negative-is-better (search.rs sorts ASC on the same raw value), so this had it backwards. Flip to min-selection + ascending sort, add confidence_pct() for a bounded 0-100 display value instead of the broken score.min(1.0)*100.0. - run_provision --yes rebuilt the DB from a fresh flat-dir scan only, and rebuild() is full-replace -- silently dropping any other provisioned:*/imported:*/hub:* DB-only rows on every run. Merge existing DB rows (via list_all_name_source_pairs + load, same reconstruction run_export already uses) before rebuilding, mirroring HubAction::Pull's merge-before-rebuild shape. - Use crate::components::detected_skill_agents() instead of a hardcoded ["claude-code"] source list. - snooze() clamped days to >=0 but not the upper bound; saturating_add from a large --days no longer risks i64 overflow. - New adversarial rank_candidates test (two same-tag matches of different strength) -- the previous test had only one candidate per tag, so it couldn't have caught the sign inversion.
Summary
proactive_suggestions()and its settings read-path already landed via PR feat(skill-registry): skill routing/management epic — FTS5, negation, bandit ranking, pack/hub lifecycle #302, butsave_settings()had no caller — snooze/dismiss couldn't actually be set. Addsagentflare skill snooze <name> [--days N]andagentflare skill dismiss <name>.agentflare skill provision <path>subcommand. Detects stack from manifest files, ranks the already-indexed skill corpus against it via BM25 search, prints a dry-run report (recommended skills, confidence, token cost) with zero DB writes, and on--yesinstalls by re-tagging matched entries undersource = "provisioned:<repo>"through the existing scan+rebuild entry-creation path (same pattern asHubAction::Pull).Test plan
cargo test --bin agentflare skill_proactive::— 3/3 new tests passcargo test --bin agentflare cli::skill::— 10/10 pass (7 new)cargo test --workspace— 853 passed, 0 failedcargo clippy --workspace --all-targets --all-features -- -D warnings -A unsafe_code -A clippy::pedantic— cleancargo fmt --check— cleanSummary by CodeRabbit
New Features
agentflare skillsubcommands to snooze skill suggestions (default 7 days) or dismiss them.--yesto apply provisioning (and record newly provisioned skills for future reference).Bug Fixes
Tests