AltimateAI / AltimateAI/altimate-code
Dynamic skill discovery fails silently, hardcoded prompt is only fallback
- Vorherrschende Sprache
- TypeScript
- Sterne
- 811
- Forks
- 134
- Ø Merge
- 3 T. 2 Std.
- Gemergte PRs (30 T.)
- 50
Beschreibung
## Problem
Skills defined in `.opencode/skills/` that are **not hardcoded in the agent mode system prompt** (e.g., `builder.txt`) are effectively invisible to the agent — even when the skill file exists on disk and is properly formatted.
## Root Cause
The builder-mode system prompt (`packages/opencode/src/altimate/prompts/builder.txt`) contains a **static, hardcoded list** of available skills under `## Available Skills`. The dynamic skill discovery system (`Skill.fmt()` in `system.ts`) is designed to supplement this by scanning `.opencode/skills/`, `~/.claude/skills/`, `.agents/skills/`, and configured paths at runtime. However, when the dynamic scanner returns 0 results (e.g., working directory mismatch, no project-level `.opencode/` directory), the **only skills the agent knows about are the hardcoded ones**.
This means any newly added skill (like `data-viz`) that exists in `.opencode/skills/data-viz/SKILL.md` but was never added to `builder.txt` will be silently ignored — the agent won't suggest it, won't invoke it, and won't know it exists.
## Observed Behavior
- User asked for a Snowflake credit consumption report with data visualization
- The `data-viz` skill exists at `.opencode/skills/data-viz/SKILL.md` with a proper frontmatter and description that explicitly matches visualization-related requests
- The agent produced a text-only report instead of loading the `data-viz` skill
- The `mcp_skill` tool description confirmed: *"No skills are currently available"* — the dynamic scanner found nothing
- The hardcoded list in `builder.txt` has 14 skills but `data-viz` is not among them
## Expected Behavior
All skills in `.opencode/skills/` should be discoverable by the agent regardless of whether they are manually listed in the agent mode prompt. The dynamic discovery should be the **primary** mechanism, not a supplement to a static list.
## Suggested Fix Options
1. **Remove the hardcoded skill list** from `builder.txt` entirely — rely solely on dynamic discovery via `Skill.fmt()` and `SystemPrompt.skills()`
2. **Auto-generate the skill list** in the prompt from the same scanner that `Skill.available()` uses, so any new `SKILL.md` file is automatically included
3. **As a stopgap**, add `/data-viz` to the hardcoded list in `builder.txt`
## Files Involved
- `packages/opencode/src/altimate/prompts/builder.txt` (lines 72-87) — hardcoded skill list
- `packages/opencode/src/skill/skill.ts` — dynamic skill scanner
- `packages/opencode/src/session/system.ts` — runtime skill injection into system prompt
- `packages/opencode/src/tool/skill.ts` — skill tool definition (shows "No skills available" when scanner returns 0)
- `.opencode/skills/data-viz/SKILL.md` — the missing skill
---
### Metadata
| Field | Value |
|-------|-------|
| CLI Version | v0.4.0 |
| Platform | darwin |
| Architecture | arm64 |
| OS Release | 24.6.0 |
| Category | bug |
| Working Directory | saurabh-altimate-home |
| Session ID | ses_306e28fe3ffem202w6U4qcQawg |
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.