Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## [Unreleased][unreleased]

## [1.0.5][] - 2026-08-06

- Added skills: data-structures, metautil-data-structures
- Updated js-data-structures skill
- Fixed scripts code style

## [1.0.4][] - 2026-03-19

- Added GoF creational patterns
Expand Down Expand Up @@ -31,7 +37,8 @@
- Autodetect IDE dirs and link skills without a menu prompt
- Prune stale symlinks on re-run after package update

[unreleased]: https://github.com/metarhia/metaskills/compare/v1.0.4...HEAD
[unreleased]: https://github.com/metarhia/metaskills/compare/v1.0.5...HEAD
[1.0.5]: https://github.com/metarhia/metaskills/compare/v1.0.4...v1.0.5
[1.0.4]: https://github.com/metarhia/metaskills/compare/v1.0.3...v1.0.4
[1.0.3]: https://github.com/metarhia/metaskills/compare/v1.0.2...v1.0.3
[1.0.2]: https://github.com/metarhia/metaskills/compare/v1.0.1...v1.0.2
Expand Down
33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,31 @@ the skills without copying files.

**Supported IDEs:**

| IDE | Command | Target dir |
| ---------- | ------------------------- | ------------------ |
| Autodetect | `npx metaskills` | Autodetect or menu |
| Cursor | `npx metaskills cursor` | `.cursor/skills` |
| Claude | `npx metaskills claude` | `.claude/skills` |
| Windsurf | `npx metaskills windsurf` | `.windsurf/skills` |
| VS Code | `npx metaskills vscode` | `.github/skills` |
| All | `npx metaskills all` | All of the above |
| IDE | Command | Target dir |
| ----------- | ---------------------------- | ------------------ |
| Autodetect | `npx metaskills` | Autodetect or menu |
| Cursor | `npx metaskills cursor` | `.cursor/skills` |
| Claude | `npx metaskills claude` | `.claude/skills` |
| Windsurf | `npx metaskills windsurf` | `.windsurf/skills` |
| VS Code | `npx metaskills vscode` | `.github/skills` |
| Gemini | `npx metaskills gemini` | `.gemini/skills` |
| Antigravity | `npx metaskills antigravity` | `.agents/skills` |
| All | `npx metaskills all` | All of the above |

Run once after install or after updating the package. Stale symlinks are
removed and missing ones are added automatically.

## Skills

Skills live under `skills/<name>/SKILL.md`. They cover:
Skills live under `skills/<name>/SKILL.md`:

- **Code style**: JavaScript/TypeScript (eslint-config-metarhia), formatting, naming
- **Patterns**: GoF, GRASP, data access, error handling, security, concurrency, async
- **Architecture**: OOP, functional, procedural, SOLID, highload, distributed systems
- **Platform**: Node.js, databases, networking, V8 optimizations, web UI, metarhia stack
- `js-conventions` — Metarhia JavaScript/TypeScript style and naming
- `js-data-structures` — JavaScript collections and structural patterns
- `data-structures` — general data-structure guidance for agents
- `metautil-data-structures` — metautil structures (list, queue, deque, trie, …)
- `js-gof` — GoF creational and related patterns in JavaScript
- `error-handling` — error handling conventions
- `npm-publish` — prepare an npm package for release

See the [skills](skills/) directory for the full list.

Expand All @@ -51,7 +56,7 @@ Clone the repo and link skills for local testing:

```bash
git clone https://github.com/metarhia/metaskills.git
cd Skills
cd metaskills
npm install
npx metaskills # autodetect, or npx metaskills cursor, etc.
```
Expand Down
74 changes: 44 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "metaskills",
"version": "1.0.4",
"version": "1.0.5",
"author": "Timur Shemsedinov <timur.shemsedinov@gmail.com>",
"description": "Metarhia Skills",
"license": "MIT",
Expand Down
16 changes: 13 additions & 3 deletions skills/data-structures/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ description: Implements custom JavaScript data structures: queues, deques, stack
Choose a structure for the property you need to control — not only for speed.

**Big-O (typical; n = size, k = key/word length):**

- Singly-linked push/pop at head: O(1); search / index: O(n)
- Doubly-linked append/prepend / splice at known node: O(1); index: O(n) (nearer-end walk helps)
- Cons `prepend` / `uncons`: O(1); `reverse` / `map` / random access: O(n); tails share structure
Expand All @@ -23,20 +24,24 @@ Choose a structure for the property you need to control — not only for speed.
- Prefer the structure whose hot operation is O(1) or O(log n); measure before optimizing rare paths

**Readability and semantics:**

- Name by role: `pending` (Queue), `frontier` (Deque), `undo` (Stack) — not `buffer1`
- Type states intent: ring/unrolled = throughput; cons = persistent; heap = priority; trie = prefix
- Small public API (`enqueue`/`dequeue`) — do not expose nodes or buffers

**Stability and contracts:**

- Return copies or iterators; document live vs snapshot and iteration order
- Cap growth (capacity, pool size, LRU max); unbounded queues/caches are operability bugs
- Immutable Cons/Struct: updates are new values (`prepend`, `fork`); mutable lists document aliasing

**Testability:**

- Assert on contents (`[...q]`, `toArray()`, size), not private fields; keep `Symbol.iterator`
- Deterministic fixtures; inject clocks/timeouts for Pool waiters

**Encapsulation and cost:**

- Hide representation so callers survive swaps (array → ring → unrolled)
- Amortized grow and node pools trade memory for latency; clear slots on dequeue for GC
- Power-of-2 ring capacity; index with `& (len - 1)` instead of `%`
Expand Down Expand Up @@ -74,12 +79,14 @@ class LinkedList {
```

Doubly-linked list ideas:

- `#head` / `#tail` / `#size`; nodes `{ value, prev, next }` (fixed key order)
- Resolve index from nearer end; splice ranges by relinking, not rebuild
- Ops worth adding: `append`/`prepend`/`insert`/`delete`, `rotate`, `move`, `slice`/`take`/`drop`, `reverse`, `groupBy` → `Map` of lists
- `Symbol.iterator`; `toArray` only at boundaries

Immutable cons list ideas:

- Cell `{ value, next, size }` + singleton empty; `prepend` returns a new cell (share the old list)
- Build from arrays backwards; merge by prepending earlier lists onto the last
- Prefer for persistent pipelines; use mutable doubly-linked for mid-list edits
Expand Down Expand Up @@ -308,8 +315,10 @@ class MinHeap {
let smallest = i;
const l = this.#left(i),
r = this.#right(i);
if (l < this.#data.length && this.#data[l] < this.#data[smallest]) smallest = l;
if (r < this.#data.length && this.#data[r] < this.#data[smallest]) smallest = r;
if (l < this.#data.length && this.#data[l] < this.#data[smallest])
smallest = l;
if (r < this.#data.length && this.#data[r] < this.#data[smallest])
smallest = r;
if (smallest === i) break;
this.#swap(i, smallest);
i = smallest;
Expand Down Expand Up @@ -458,7 +467,8 @@ class Struct {
const Entity = {
[name]: class {
constructor(data = {}) {
for (const k of fields) this[k] = Object.hasOwn(data, k) ? data[k] : defaults[k];
for (const k of fields)
this[k] = Object.hasOwn(data, k) ? data[k] : defaults[k];
Object.freeze(this);
}
fork(updates = {}) {
Expand Down
Loading
Loading