Skip to content

refactor: normalize skill entry point file name to uppercase SKILL.md - #715

Merged
haiphucnguyen merged 2 commits into
mainfrom
feature/improvements
Sep 11, 2026
Merged

haiphucnguyen merged 2 commits into
mainfrom
feature/improvements

Conversation

@haiphucnguyen

Copy link
Copy Markdown
Collaborator
  • Update materialization tests to expect the entry point to be named SKILL.md
  • Adjust UI components (AgentMessageList, MessageComponents, AgentsSettingsSection) to use the normalized path
  • Add new i18n keys for skill call labeling across all locales
  • Improve ClaudeAgent status messages with concise model hints
  • Refactor ExternalAgentTemplate to copy top‑level entry point as SKILL.md, preserving case‑insensitive matching and ensuring uniqueness

- Update materialization tests to expect the entry point to be named SKILL.md
- Adjust UI components (AgentMessageList, MessageComponents, AgentsSettingsSection) to use the normalized path
- Add new i18n keys for skill call labeling across all locales
- Improve ClaudeAgent status messages with concise model hints
- Refactor ExternalAgentTemplate to copy top‑level entry point as SKILL.md, preserving case‑insensitive matching and ensuring uniqueness
Copilot AI lite review requested due to automatic review settings September 11, 2026 15:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical and moderate findings affect skill persistence, materialization determinism, and tool-call labeling.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Normalizes skill entry-point files to SKILL.md while updating Claude status messaging, skill-call UI, localization, and tests.

Changes:

  • Standardize skill materialization and editing paths.
  • Add Claude status hints and localized skill-call labels.
  • Update UI layout and materialization tests.
File summaries
File Reviewed changes and findings
shared/src/main/kotlin/io/askimo/core/agent/ExternalAgentTemplate.kt Normalizes copied entry points. Moderate (3 votes): duplicate case variants can be copied nondeterministically.
shared/src/main/kotlin/io/askimo/core/agent/ClaudeAgent.kt Adds model/status reporting. Nit (1 vote): add coverage for new status branches.
desktop-shared/src/main/resources/i18n/messages.properties Adds skill-call translations.
desktop-shared/src/main/resources/i18n/messages_zh_TW.properties Adds skill-call translations.
desktop-shared/src/main/resources/i18n/messages_zh_CN.properties Adds skill-call translations.
desktop-shared/src/main/resources/i18n/messages_vi_VN.properties Adds skill-call translations.
desktop-shared/src/main/resources/i18n/messages_pt_BR.properties Adds skill-call translations.
desktop-shared/src/main/resources/i18n/messages_ko_KR.properties Adds skill-call translations.
desktop-shared/src/main/resources/i18n/messages_ja_JP.properties Adds skill-call translations.
desktop-shared/src/main/resources/i18n/messages_fr.properties Adds skill-call translations.
desktop-shared/src/main/resources/i18n/messages_es.properties Adds skill-call translations.
desktop-shared/src/main/resources/i18n/messages_de.properties Adds skill-call translations.
desktop-shared/src/main/kotlin/io/askimo/ui/settings/AgentsSettingsSection.kt Uses uppercase entry paths. Critical (1 vote): existing lowercase entries can result in duplicate files and nondeterministic edits.
desktop-shared/src/main/kotlin/io/askimo/ui/chat/MessageComponents.kt Displays skill tool calls. Moderate (1 vote each): broad startsWith("skill") matching misclassifies tools, and arguments may not identify the skill.
desktop-shared/src/main/kotlin/io/askimo/ui/agent/AgentMessageList.kt Adjusts streaming layout spacing.
cli/src/test/kotlin/io/askimo/core/skills/ExternalAgentTemplateMaterializeSkillTest.kt Updates and expands materialization tests.
Review details

Suppressed comments (3)

desktop-shared/src/main/kotlin/io/askimo/ui/chat/MessageComponents.kt:1762

  • The heuristic documentation identifies toolName (for example skills-skills-pptx) as the skill identifier, but this label prefers arguments. The Claude pipeline populates that field from the first input value, so it can be an arbitrary invocation argument or empty rather than the skill name; native calls can therefore display the wrong label. Use toolCall.toolName here, or parse a named skill field explicitly.
                        stringResource("tool.call.skill.label", toolCall.arguments ?: toolCall.toolName)

desktop-shared/src/main/kotlin/io/askimo/ui/chat/MessageComponents.kt:1679

  • startsWith("skill") classifies every tool whose name merely begins with that text (for example skill_search or skill-manager) as a native skill. That causes this UI to rename unrelated tools and suppress their argument details, so their actual name and inputs are lost. Match only the exact Claude-native names/prefix documented above.
private fun String.isSkillToolCall(): Boolean = startsWith("skill", ignoreCase = true)

shared/src/main/kotlin/io/askimo/core/agent/ClaudeAgent.kt:157

  • The new status behavior is not exercised by the existing Claude tests: ClaudeStreamJsonEventParserTest verifies field extraction, but no test invokes ClaudeAgent.parseStdoutLine with developer mode active/inactive. Add focused coverage for the non-dev model hint, the full dev-mode diagnostic, and an init event without a model so regressions in these user-visible branches are caught.
                    val model = event.fields["model"] as? String

                    if (AppConfig.developer.enabled && AppConfig.developer.active) {
                        // Dev mode: surface everything useful for debugging how the CLI is
                        // actually running — model, permission mode, tool/MCP counts, cwd.
                        val toolCount = (event.fields["tools"] as? String)
                            ?.let { ClaudeStreamJsonEventParser.parseArray(it).size }
                        val mcpCount = (event.fields["mcp_servers"] as? String)
                            ?.let { ClaudeStreamJsonEventParser.parseArray(it).size }
                        val permissionMode = event.fields["permissionMode"] as? String
                        val cwd = event.fields["cwd"] as? String

                        onStatus(
                            buildString {
                                append("init")
                                model?.let { append(" | model=$it") }
                                permissionMode?.let { append(" | permission=$it") }
                                toolCount?.let { append(" | tools=$it") }
                                mcpCount?.let { append(" | mcp=$it") }
                                cwd?.let { append(" | cwd=$it") }
                            },
                        )
                    } else if (!model.isNullOrBlank()) {
                        // Non-dev: just a brief, low-noise hint of which model answered.
                        onStatus("model: $model")
  • Files reviewed: 16/16 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Three unresolved moderate findings remain in MessageComponents.kt and AgentsSettingsSection.kt.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (2)

desktop-shared/src/main/kotlin/io/askimo/ui/chat/MessageComponents.kt:1679

  • toolCallRow is also used for regular/MCP tool calls, whose names are arbitrary, so startsWith("skill") will misclassify tools such as skill_lookup (and hide their arguments) as Claude Skill calls. Restrict this predicate to the native forms documented here (for example exact Skill/skill or skill-/skills- prefixes) so unrelated tools keep the normal rendering.
private fun String.isSkillToolCall(): Boolean = startsWith("skill", ignoreCase = true)

desktop-shared/src/main/kotlin/io/askimo/ui/settings/AgentsSettingsSection.kt:663

  • This recomputes the exact entry-file path when absolutePath changes, but the editor's rawSkillMdBody and body state are still remembered only by skill.relativePath below. Selecting the same virtual skill after its lowercase/uppercase entry variant changes can therefore display and save the previous file's contents rather than the newly resolved file; include the resolved path in the editor state keys (or key the whole editor by it).
    val skillMdRelativePath = remember(skill.relativePath, skill.absolutePath) {
        deriveSkillMdRelativePath(skill, AskimoHome.skillsDir())
    }
  • Files reviewed: 19/19 changed files
  • Comments generated: 1
  • Review effort level: Lite

Text(
text = toolCall.toolName,
text = if (isSkillCall) {
stringResource("tool.call.skill.label", toolCall.arguments ?: toolCall.toolName)
@haiphucnguyen
haiphucnguyen merged commit 9bf1b21 into main Sep 11, 2026
10 of 11 checks passed
@haiphucnguyen
haiphucnguyen deleted the feature/improvements branch September 11, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants