Skip to content

fix(skill-sync): relax adopt name check#1875

Merged
zerob13 merged 5 commits into
devfrom
codex/fix-skill-adopt-name-check
Jul 5, 2026
Merged

fix(skill-sync): relax adopt name check#1875
zerob13 merged 5 commits into
devfrom
codex/fix-skill-adopt-name-check

Conversation

@zerob13

@zerob13 zerob13 commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • allow adopting agent skills whose SKILL.md name differs from the agent entry name
  • keep the agent entry name as the default DeepChat target name so link ownership still matches
  • add regression coverage for the mismatch case

Tests

  • pnpm vitest run test/main/presenter/skillSyncPresenter/index.test.ts
  • pnpm run format
  • pnpm run i18n
  • pnpm run lint

Summary by CodeRabbit

  • New Features

    • Added clearer guidance for organizing SDD work by feature, issue, architecture, and small-bug scope.
    • Introduced a new cleanup workflow for removing completed SDD documentation when explicitly requested.
  • Bug Fixes

    • Skill adoption previews now handle naming differences more gracefully and use the agent-facing name consistently.
    • Added coverage for adoption cases where the source name is not a valid target name.
  • Documentation

    • Updated multiple guidance docs to reflect the new workflow, linking, and retention rules.

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9bf954cd-f923-44c0-ba35-4bbccc82cbd9

📥 Commits

Reviewing files that changed from the base of the PR and between 3a933cc and 766c3e8.

📒 Files selected for processing (58)
  • .agents/skills/add-provider/SKILL.md
  • .agents/skills/deepchat-sdd-cleanup/agents/openai.yaml
  • docs/architecture/agent-fff-node-api-search/spec.md
  • docs/architecture/agent-plan-task-refactor/spec.md
  • docs/architecture/cua-managed-helper-validation/spec.md
  • docs/architecture/dead-code-cleanup-2026-06/spec.md
  • docs/architecture/provider-db-github-source/spec.md
  • docs/features/assistant-permission-review-mode/plan.md
  • docs/features/assistant-permission-review-mode/tasks.md
  • docs/features/message-delete-confirmation/plan.md
  • docs/features/message-delete-confirmation/tasks.md
  • docs/features/skill-sync-directory-ux/plan.md
  • docs/features/skill-sync-directory-ux/tasks.md
  • docs/features/tool-call-review-status-indicator/plan.md
  • docs/features/tool-call-review-status-indicator/spec.md
  • docs/features/tool-call-review-status-indicator/tasks.md
  • docs/issues/assistant-loading-placeholder-delay/spec.md
  • docs/issues/context-overflow-auto-handoff/plan.md
  • docs/issues/context-overflow-auto-handoff/tasks.md
  • docs/issues/file-attachment-token-bloat/spec.md
  • docs/issues/harness-reliability-1841-1849/plan.md
  • docs/issues/harness-reliability-1841-1849/spec.md
  • docs/issues/harness-reliability-1841-1849/tasks.md
  • docs/issues/hooks-settings-clone-error/plan.md
  • docs/issues/hooks-settings-clone-error/tasks.md
  • docs/issues/mcp-enabled-server-sort/plan.md
  • docs/issues/mcp-enabled-server-sort/tasks.md
  • docs/issues/mcp-oauth-callback-refresh/plan.md
  • docs/issues/mcp-oauth-callback-refresh/tasks.md
  • docs/issues/mcp-plugin-startup-nonblocking/plan.md
  • docs/issues/mcp-plugin-startup-nonblocking/tasks.md
  • docs/issues/mcp-save-toast-i18n/plan.md
  • docs/issues/mcp-save-toast-i18n/tasks.md
  • docs/issues/mcp-tools-missing-from-session/plan.md
  • docs/issues/mcp-tools-missing-from-session/tasks.md
  • docs/issues/memory-recall-hot-path-keyword-recall/plan.md
  • docs/issues/memory-recall-hot-path-keyword-recall/tasks.md
  • docs/issues/model-list-fetch-404/plan.md
  • docs/issues/model-list-fetch-404/tasks.md
  • docs/issues/parcel-watcher-issue-1764/spec.md
  • docs/issues/pr-1862-review-fixes/plan.md
  • docs/issues/pr-1862-review-fixes/tasks.md
  • docs/issues/pr-1870-review-fixes/plan.md
  • docs/issues/pr-1870-review-fixes/tasks.md
  • docs/issues/sdd-cleanup-default-prompt/spec.md
  • docs/issues/session-restore-scroll-intent/plan.md
  • docs/issues/session-restore-scroll-intent/tasks.md
  • docs/issues/session-start-lag/spec.md
  • docs/issues/settings-save-clone-errors/plan.md
  • docs/issues/settings-save-clone-errors/tasks.md
  • docs/issues/sheet-close-no-drag/plan.md
  • docs/issues/sheet-close-no-drag/tasks.md
  • docs/issues/sidebar-history-pagination-stuck/spec.md
  • docs/issues/skill-scope-and-refresh/plan.md
  • docs/issues/skill-scope-and-refresh/tasks.md
  • docs/issues/vueuse-typecheck-dedupe/plan.md
  • docs/issues/vueuse-typecheck-dedupe/tasks.md
  • docs/issues/yobrowser-cdp-graceful-degradation/spec.md
💤 Files with no reviewable changes (53)
  • docs/issues/hooks-settings-clone-error/tasks.md
  • docs/issues/sheet-close-no-drag/plan.md
  • docs/issues/mcp-save-toast-i18n/tasks.md
  • docs/issues/session-restore-scroll-intent/tasks.md
  • docs/issues/model-list-fetch-404/plan.md
  • docs/architecture/cua-managed-helper-validation/spec.md
  • docs/issues/parcel-watcher-issue-1764/spec.md
  • docs/issues/session-restore-scroll-intent/plan.md
  • docs/issues/session-start-lag/spec.md
  • docs/issues/mcp-enabled-server-sort/plan.md
  • docs/issues/vueuse-typecheck-dedupe/tasks.md
  • docs/issues/pr-1862-review-fixes/plan.md
  • docs/issues/assistant-loading-placeholder-delay/spec.md
  • docs/issues/mcp-save-toast-i18n/plan.md
  • docs/issues/vueuse-typecheck-dedupe/plan.md
  • docs/issues/settings-save-clone-errors/tasks.md
  • docs/issues/memory-recall-hot-path-keyword-recall/tasks.md
  • docs/issues/mcp-oauth-callback-refresh/tasks.md
  • docs/issues/memory-recall-hot-path-keyword-recall/plan.md
  • docs/features/skill-sync-directory-ux/plan.md
  • docs/issues/sheet-close-no-drag/tasks.md
  • docs/features/assistant-permission-review-mode/plan.md
  • docs/issues/pr-1870-review-fixes/plan.md
  • docs/issues/pr-1870-review-fixes/tasks.md
  • docs/issues/mcp-enabled-server-sort/tasks.md
  • docs/architecture/provider-db-github-source/spec.md
  • docs/issues/context-overflow-auto-handoff/tasks.md
  • docs/issues/file-attachment-token-bloat/spec.md
  • docs/architecture/dead-code-cleanup-2026-06/spec.md
  • docs/issues/mcp-plugin-startup-nonblocking/tasks.md
  • docs/features/assistant-permission-review-mode/tasks.md
  • docs/features/message-delete-confirmation/tasks.md
  • docs/issues/mcp-tools-missing-from-session/tasks.md
  • docs/issues/model-list-fetch-404/tasks.md
  • docs/issues/mcp-tools-missing-from-session/plan.md
  • docs/issues/skill-scope-and-refresh/tasks.md
  • docs/issues/settings-save-clone-errors/plan.md
  • docs/issues/sidebar-history-pagination-stuck/spec.md
  • docs/features/tool-call-review-status-indicator/tasks.md
  • docs/issues/harness-reliability-1841-1849/tasks.md
  • docs/issues/skill-scope-and-refresh/plan.md
  • docs/issues/mcp-oauth-callback-refresh/plan.md
  • docs/issues/harness-reliability-1841-1849/plan.md
  • docs/features/tool-call-review-status-indicator/plan.md
  • docs/issues/pr-1862-review-fixes/tasks.md
  • docs/architecture/agent-fff-node-api-search/spec.md
  • docs/features/message-delete-confirmation/plan.md
  • docs/features/skill-sync-directory-ux/tasks.md
  • docs/issues/yobrowser-cdp-graceful-degradation/spec.md
  • docs/issues/mcp-plugin-startup-nonblocking/plan.md
  • docs/issues/harness-reliability-1841-1849/spec.md
  • docs/issues/context-overflow-auto-handoff/plan.md
  • docs/issues/hooks-settings-clone-error/plan.md
✅ Files skipped from review due to trivial changes (5)
  • docs/issues/sdd-cleanup-default-prompt/spec.md
  • .agents/skills/add-provider/SKILL.md
  • .agents/skills/deepchat-sdd-cleanup/agents/openai.yaml
  • docs/features/tool-call-review-status-indicator/spec.md
  • docs/architecture/agent-plan-task-refactor/spec.md

📝 Walkthrough

Walkthrough

This PR removes the frontmatter name-mismatch validation during agent skill adoption preview, deriving conflict detection and target naming from the agent-facing skill entry name instead. It also revises SDD workflow documentation and skill definitions to separate feature, issue, architecture, and cleanup flows, and prunes numerous completed plan/task documents.

Changes

Skill Name Mismatch Adoption

Layer / File(s) Summary
Spec and preview logic
docs/issues/skill-adopt-name-mismatch/spec.md, src/main/presenter/skillSyncPresenter/index.ts
New spec defines mismatch handling; previewAdoptAgentSkill no longer validates parsed SKILL.md name against adoption.skill.name, deriving conflict/target naming and warnings from adoption.skill.name; readAdoptableSkill drops the assertValidDeepChatSkillName check.
Preview test coverage
test/main/presenter/skillSyncPresenter/index.test.ts
New unit test verifies adoption preview keeps the agent directory entry name when SKILL.md frontmatter name differs, with no conflict/warnings.

SDD Workflow Simplification

Layer / File(s) Summary
Repository guidance updates
AGENTS.md, docs/spec-driven-dev.md, docs/README.md
Required artifact sets, GitHub issue-linking rules, and cleanup policy are revised to differentiate feature/architecture (full spec+plan+tasks) vs small-bug (single spec.md) work.
SDD skill definitions
.agents/skills/deepchat-sdd/SKILL.md, .agents/skills/deepchat-sdd/agents/openai.yaml, .agents/skills/add-provider/SKILL.md
The SDD skill description, interface metadata, and workflow steps are rewritten to classify work before implementation; add-provider workflow now conditionally reads plan/tasks files.
Cleanup skill and interface
.agents/skills/deepchat-sdd-cleanup/SKILL.md, .agents/skills/deepchat-sdd-cleanup/agents/openai.yaml
New dedicated skill and interface metadata define an explicit, request-only SDD cleanup workflow with never-delete safety rules.
Architecture and issue doc cleanup
docs/architecture/agent-plan-task-refactor/spec.md, docs/features/tool-call-review-status-indicator/spec.md, docs/issues/sdd-cleanup-default-prompt/spec.md, docs/issues/mcp-plugin-startup-nonblocking/plan.md, docs/issues/settings-save-clone-errors/plan.md, docs/issues/vueuse-typecheck-dedupe/tasks.md, plus numerous other docs/issues/*/{plan,tasks,spec}.md and docs/architecture/*/spec.md removals
Architecture spec wording tightened, a feature status flipped to implemented, a new issue spec added for the cleanup-prompt fix, and many completed plan/task/spec documents removed.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • ThinkInAIXYZ/deepchat#1818: Both PRs modify the agent-skill adoption flow in SkillSyncPresenter, touching readAdoptableSkill/previewAdoptAgentSkill name validation and target naming logic.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the main change: relaxing the skill adoption name check.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-skill-adopt-name-check

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
test/main/presenter/skillSyncPresenter/index.test.ts (1)

1050-1092: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Good regression test, but consider adding a negative-path case.

This covers the happy path (mismatched but still slug-valid SKILL.md name, no conflict). Given the concern raised in index.ts about readAdoptableSkill still enforcing assertValidDeepChatSkillName on the unused parsed name, a companion test where the frontmatter name is not a valid slug (e.g., contains spaces) would help confirm whether adoption should succeed in that case too.

🤖 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 `@test/main/presenter/skillSyncPresenter/index.test.ts` around lines 1050 -
1092, Add a negative-path test for previewAdoptAgentSkill in
skillSyncPresenter/index.test.ts to cover a SKILL.md frontmatter name that is
not a valid slug (for example, contains spaces). Reuse the existing adoption
preview setup around previewAdoptAgentSkill, toolScanner.scanTool, and
fs.promises.readFile, but change the parsed name to an invalid one and assert
the adoption preview still succeeds or fails as intended. This will verify the
behavior of readAdoptableSkill and its assertValidDeepChatSkillName handling for
the unused parsed name.
🤖 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/main/presenter/skillSyncPresenter/index.ts`:
- Line 822: The adoption loading path still blocks nonconforming source names,
causing `readAdoptableSkill()` to fail before rename handling. Update
`readAdoptableSkill()` in `src/main/presenter/skillSyncPresenter/index.ts` so it
only validates `description` and no longer rejects based on the parsed `name`;
treat `adoption.skill.name` as the source of truth and move any target-name
validation to the rename step in the adoption flow.

---

Nitpick comments:
In `@test/main/presenter/skillSyncPresenter/index.test.ts`:
- Around line 1050-1092: Add a negative-path test for previewAdoptAgentSkill in
skillSyncPresenter/index.test.ts to cover a SKILL.md frontmatter name that is
not a valid slug (for example, contains spaces). Reuse the existing adoption
preview setup around previewAdoptAgentSkill, toolScanner.scanTool, and
fs.promises.readFile, but change the parsed name to an invalid one and assert
the adoption preview still succeeds or fails as intended. This will verify the
behavior of readAdoptableSkill and its assertValidDeepChatSkillName handling for
the unused parsed name.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: d4f49887-7b00-4064-a033-c0652f9d0125

📥 Commits

Reviewing files that changed from the base of the PR and between 0b615c7 and 561d3ac.

📒 Files selected for processing (3)
  • docs/issues/skill-adopt-name-mismatch/spec.md
  • src/main/presenter/skillSyncPresenter/index.ts
  • test/main/presenter/skillSyncPresenter/index.test.ts

Comment thread src/main/presenter/skillSyncPresenter/index.ts
@zerob13

zerob13 commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator Author

Handled review feedback:

  • readAdoptableSkill() no longer validates the unused source frontmatter name.
  • Adoption still validates the actual DeepChat target name derived from the scanned agent entry or explicit target name.
  • Regression test now covers an invalid source frontmatter name with spaces.

Validation:

  • pnpm vitest run test/main/presenter/skillSyncPresenter/index.test.ts
  • pnpm run format
  • pnpm run i18n
  • pnpm run lint

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 @.agents/skills/deepchat-sdd-cleanup/agents/openai.yaml:
- Line 4: The default_prompt for the deepchat-sdd-cleanup skill is too generic
and sounds like a routine post-implementation action; tighten it so the
manual-only gate is explicit. Update the wording in the openai.yaml entry for
default_prompt under the deepchat-sdd-cleanup skill to clearly state it should
only be used when the developer explicitly asks to clean, prune, or organize SDD
docs, keeping the intent aligned with the cleanup skill’s purpose.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8b380a9c-313a-4ab9-8bc3-9335a35edf14

📥 Commits

Reviewing files that changed from the base of the PR and between 561d3ac and 3a933cc.

📒 Files selected for processing (13)
  • .agents/skills/deepchat-sdd-cleanup/SKILL.md
  • .agents/skills/deepchat-sdd-cleanup/agents/openai.yaml
  • .agents/skills/deepchat-sdd/SKILL.md
  • .agents/skills/deepchat-sdd/agents/openai.yaml
  • AGENTS.md
  • docs/README.md
  • docs/architecture/sdd-workflow-simplification/plan.md
  • docs/architecture/sdd-workflow-simplification/spec.md
  • docs/architecture/sdd-workflow-simplification/tasks.md
  • docs/issues/skill-adopt-name-mismatch/spec.md
  • docs/spec-driven-dev.md
  • src/main/presenter/skillSyncPresenter/index.ts
  • test/main/presenter/skillSyncPresenter/index.test.ts
💤 Files with no reviewable changes (1)
  • src/main/presenter/skillSyncPresenter/index.ts
✅ Files skipped from review due to trivial changes (7)
  • docs/architecture/sdd-workflow-simplification/tasks.md
  • .agents/skills/deepchat-sdd/agents/openai.yaml
  • docs/architecture/sdd-workflow-simplification/plan.md
  • .agents/skills/deepchat-sdd-cleanup/SKILL.md
  • docs/README.md
  • docs/issues/skill-adopt-name-mismatch/spec.md
  • docs/spec-driven-dev.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/main/presenter/skillSyncPresenter/index.test.ts

Comment thread .agents/skills/deepchat-sdd-cleanup/agents/openai.yaml Outdated
@zerob13

zerob13 commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator Author

Handled the latest review feedback:

  • tightened deepchat-sdd-cleanup default_prompt so the explicit developer-request gate is clear.
  • added a small SDD issue spec for the prompt fix.

Validation:

  • pnpm run format
  • pnpm run i18n
  • pnpm run lint

@zerob13 zerob13 merged commit 24c90c9 into dev Jul 5, 2026
3 checks passed
@zhangmo8 zhangmo8 deleted the codex/fix-skill-adopt-name-check branch July 7, 2026 05:47
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.

1 participant