# Replace Rules UI with Skills creation UI \(\#56924\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/e2c38b535829d351345fbac695bada34be61ee4f)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: e2c38b535829d351345fbac695bada34be61ee4f

Requested commit: e2c38b535829d351345fbac695bada34be61ee4f

Commit: e2c38b535829d351345fbac695bada34be61ee4f

Tree: 9fee5578a35398591e596afd2943b5dec359c46f

Author: MartinYe1234

Committer: GitHub

## Message

```
Replace Rules UI with Skills creation UI (#56924)

Replaces the legacy Rules creation UI with a focused "New Skill"
creation window when the `SkillsFeatureFlag` is on.

The new `skills_library` crate provides a single-skill form with:
- Name, Description, and Body fields (placeholders double as labels)
- Live validation matching the SKILL.md spec (name: 1–64 lowercase +
digits + hyphens, no leading/trailing hyphen; description: non-empty,
≤1024 chars)
- A scope dropdown listing every local worktree in the originating
workspace plus "Global"
- An Optional Parameters card with the `disable-model-invocation`
checkbox
- Save writes `<scope>/.agents/skills/<name>/SKILL.md` via
`serde_yaml_ng` (YAML-safe escaping), refuses to overwrite existing
skills, shows a success toast in the originating workspace, then closes
the window

The "Rules" entry in the agent panel triple-dot menu is renamed to
"Skills" when the flag is on. The existing `cmd-alt-l` keyboard shortcut
still works: `AgentPanel::deploy_rules_library` reroutes to
`deploy_skills_library` when the flag is on, so any persisted keymaps
and the menu's automatic shortcut lookup keep functioning without
changes to the default keymap files.

The old `rules_library` crate is intentionally left in place for this PR
— once the flag rolls out and the few remaining `OpenRulesLibrary {
prompt_to_select }` call sites (in thread_view link handlers and
@-mention crease) are migrated to an "open existing skill" flow, a
follow-up can delete the crate entirely.

15 unit tests cover the validation rules, frontmatter formatting
(including YAML-special-character round-tripping), and disk write
behavior (creates directory, refuses overwrite).

Closes AI-247

Release Notes:

- Added a new Skills creation UI that replaces the old Rules library
when the Skills feature flag is enabled.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
```

## Parents

- [661f185f9ffc6ebb4462d08f62522983196723a4](https://git.cafe/gitcafe/zed/commit/661f185f9ffc6ebb4462d08f62522983196723a4?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/e2c38b535829d351345fbac695bada34be61ee4f?format=markdown)
