Skip to content
Skills Library
Programming · Building & coding

sort-components

/sort-components

Keep apps/ui/components organized by feature (agent/, space/, chat/, dialogs/, layout/, ui/). Use to place a new component in the right spot, or when the root of components/ starts overflowing with flat files again and needs re-sorting.

Repository
rerun ↗
Licence
AGPL-3.0
Last repository change
13.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 13.11.2026, without references to retired models or APIs.

Licence

AGPL-3.0, copyleft: przeróbki udostępniane innym muszą mieć tę samą licencję.

What it does and when to use it

Keep apps/ui/components organized by feature (agent/, space/, chat/, dialogs/, layout/, ui/). Use to place a new component in the right spot, or when the root of components/ starts overflowing with flat files again and needs re-sorting.

Original author description

Keep apps/ui/components organized by feature (agent/, space/, chat/, dialogs/, layout/, ui/). Use to place a new component in the right spot, or when the root of components/ starts overflowing with flat files again and needs re-sorting.

How it works

  1. Canonical structure
  2. Placement rule (new component)
  3. Import conventions
  4. Re-sorting when the root overflows
  5. Verification
Original SKILL.md headings · 58 lines, 476 words
SKILL.md preview
---
name: sort-components
description: Keep apps/ui/components organized by feature (agent/, space/, chat/, dialogs/, layout/, ui/). Use to place a new component in the right spot, or when the root of components/ starts overflowing with flat files again and needs re-sorting.
---

# sort-components: organize UI components by feature

The components in `apps/ui/components/` must **always** be placed in a subfolder by **functional domain**, never left flat at the root. That root had ended up with 56 flat files; it was reorganized. This skill is for **maintaining** that organization: placing a new component correctly, or re-sorting when it overflows again.

## Canonical structure

```
apps/ui/components/
  agent/        Agent panel + all its tabs (chat, files, skills, tools, mcp,
                scheduled, settings, memories, data) + agent-related forms/templates
  space/        Space panel + space files
  chat/         Sessions (tabs, history) + message blocks (ToolCall, Reasoning,
                Approval, attachments, mentions)
  dialogs/      Create / delete / onboarding modals
  layout/       Page shell: HomeContent, IsoBoard, Toolbar, Logo
  ui/           Low-level primitives (button, input, dialog, card…) + generic placeholders
  ai-elements/  Conversation components (prompt-input, message, conversation, reasoning…)
  services/     Service install / config / list
  auth/         Auth page decor
```

## Placement rule (new component)

1. **Is it a generic primitive** (reusable, no business logic: button, input, placeholder)? → `ui/`.
2. **Is it pure conversation** (message rendering, prompt input)? → `ai-elements/`.
3. Otherwise, sort by **feature**: it concerns an agent → `agent/`; a space → `space/`; chat sessions/blocks → `chat/`; a modal → `dialogs/`; the global shell → `layout/`.
4. When in doubt between feature and type, **the feature wins** (group by domain, not by technical nature).

> NEVER create a `.tsx` file directly at the root of `components/`.

## Import conventions

- Cross-file imports with the **absolute alias**: `@/components/<folder>/<File>` (the repo has `@/*` → `./*` in [tsconfig.json](apps/ui/tsconfig.json)). No fragile relative `./Foo` / `../Foo`.
- The `ui/` and `ai-elements/` primitives are imported with the absolute alias too (`@/components/ui/button`).

## Re-sorting when the root overflows

When files show up flat in `components/` again:

1. **Map**: `ls apps/ui/components/*.tsx` → list the flat files.
2. **Assign** each file to its feature folder according to the rule above.
3. **Move with `git mv`** (preserves history) into the right subfolder.
4. **Rewrite the imports** to each moved file with the absolute alias `@/components/<folder>/<File>`. Remember:
   - the **relative imports** `./Foo` / `../Foo` between neighbors,
   - the **relative imports into existing subfolders** (`./ui/...`, `./services/...`) that break as soon as the file changes level,
   - the **external references** from `apps/ui/app/`.
   - Spot all of it: `grep -rnE "@/components/|from ['\"]\.{1,2}/" apps/ui --include="*.tsx" --include="*.ts"`.
5. Delete the empty subfolders.

For a massive re-sort, a small Python script (basename→folder mapping, `git mv`, then an import-rewriting regex that sorts the bases **from longest to shortest** so `AgentPanel` is not replaced inside `AgentPanelChat`) is safer than doing it by hand.

## Verification

- `cd apps/ui && npx tsc --noEmit` → **exit 0** proves that every import resolves (this is the decisive check).
- `npm run lint` → no new module resolution error (`import/no-unresolved`). Ignore the pre-existing code-quality errors (`no-explicit-any`, hooks).
- `git status --short` → the files show up as **renames** (`R`), not delete+add: history is preserved.

Versions

The database has no other skills named sort-components.

Database snapshot: 13.11.2026 · package version 9283490f7f7c (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90split-components
    Keep component files small and split — one main component per file, extract heavy sub-components, pull out logic and types. Use whenever a .tsx file is swelling (several big components in one file, file over ~250 lines) or before creating a new one, to avoid ending up with monster 800+ line files.
  • 91components
    React component architecture for creating composable, accessible components with data attributes. Use when creating/updating composable components, not for higher-level feature/page components.
  • 100content-sdk-pages-router-component-scaffold
    Creates a new Sitecore component in a Content SDK Pages Router app: file layout, props interface, src/components/ placement, generated component map. Use when adding or scaffolding a component. Not App Router.
  • 100content-sdk-app-router-component-scaffold
    Creates a new Sitecore component in a Content SDK App Router app: file layout, props interface, src/components/ placement, Server vs Client choice. Use when asked to add, create or scaffold a component Sitecore layout renders.
  • 100server-components
    This skill should be used when the user asks about "Server Components", "Client Components", "'use client' directive", "when to use server vs client", "RSC patterns", "component composition", "data fetching in components", or needs guidance on React Server Components architecture in Next.js.
  • 100core-components
    Core component library and design system patterns. Use when building UI, using design tokens, or working with the component library.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.