agentleFS
aryehcarmiaryehcarmi/leetcode-interview-coach/skills/optimize/SKILL.md

optimize

Skill0 starsChanged 4 months agoMITView on GitHub

Improve the time, space, constant factors, and interview cleanliness of a LeetCode-style or coding-interview solution while retaining its recognizable algorithmic idea. Use when explicitly invoked on attached, pictured, or pasted code.

45 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use arrange, overdrive and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • nikafastovets-langSkill

    arrange

    Improve layout, spacing, and visual rhythm. Fixes monotonous grids, inconsistent spacing, and weak visual hierarchy to create intentional compositions.

    Also in 6 projects that use this

  • nikafastovets-langSkill

    overdrive

    Push interfaces past conventional limits with technically ambitious implementations. Whether that's a shader, a 60fps virtual table, spring physics on a dialog, or scroll-driven reveals — make users ask "how did they do that?

    Also in 10 projects that use this

  • mtctSkill

    quieter

    Tone down overly bold or visually aggressive designs. Reduces intensity while maintaining design quality and impact.

    Also in 14 projects that use this

  • mtctSkill

    teach-impeccable

    One-time setup that gathers design context for your project and saves it to your AI config file. Run once to establish persistent design guidelines.

    Also in 10 projects that use this

  • zwy123zwySkill

    normalize

    将用户随意输入的提示词规范化为结构清晰、便于大模型执行的标准化提示词。适用于需要整理、统一提示词格式时调用。

    Also in 10 projects that use this

  • mickeylorenziniSkill

    harden

    Audits any substantial deliverable — documents, grant sections, strategies, protocols, skills, configs, roadmaps, plans — against domain-specific quality criteria before delivery. Searches the web for best practices, runs dual-pass thematic and structural audit with severity classification, fixes all issues, and iterates until convergence. Activates when producing deliverables exceeding 4 paragraphs or 20 lines, or when the user says "harden", "audit", "stress test", or "review before delivering", or when re-auditing a modified deliverable for regressions. Does not activate for conversational responses, brainstorming, web search summaries, or rough drafts.

    Also in 14 projects that use this

  • +4 more from mtct
  • +1 more from nikafastovets-lang

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 44 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the visible problem, constraints, code, line numbers, errors, outputs, and relevant thread context.

    line 12
  2. Distinctive:

    Ask one focused question only when missing constraints make the optimization judgment unsafe.

    line 14
  3. Distinctive:

    Prefer data-structure choices within the same approach, repeated-work removal, allocation reduction, tighter loop bounds, and early exits …

    line 20
  4. Distinctive:

    If the solution is already asymptotically optimal, say so and suggest at most three high-value cleanliness or constant-factor improvements.

    line 24
  5. Very specific:

    Do not switch to a fundamentally different algorithm.

    line 25
  6. Very specific:

    Write the marker as a trailing comment in the target language's own comment syntax, and never mix two languages' syntax: // NEW in C, Java, …

    line 36
  7. Distinctive:

    Do not mark code the user has no existing version of.

    line 38
  8. Very specific:

    When a prompt names several, the least-revealing one sets the response contract, whatever order they were typed in.

    line 46
  9. Distinctive:

    Do not edit, run, or submit the user's code without permission.

    line 50

“Common” is measured: kept by at least 6 in 10 of the 44 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Optimize

Improve the user's solution without replacing the idea they are practicing.

Inspect the attempt

  1. Read the visible problem, constraints, code, line numbers, errors, outputs, and relevant thread context.
  2. Infer the language, algorithm family, current complexity, and highest-impact avoidable costs.
  3. Ask one focused question only when missing constraints make the optimization judgment unsafe.

Optimize within the approach

  • Open with Current: T ..., S ... → Suggested: T ..., S ....
  • Rank only material improvements by impact.
  • Prefer data-structure choices within the same approach, repeated-work removal, allocation reduction, tighter loop bounds, and early exits before naming or cosmetic cleanup.
  • Provide minimal marked snippets rather than a wholesale rewrite.
  • Show only one unchanged existing line above and below each contiguous change when available.
  • Mark the changed lines as described below.
  • If the solution is already asymptotically optimal, say so and suggest at most three high-value cleanliness or constant-factor improvements.
  • Do not switch to a fundamentally different algorithm. That degree of replacement belongs to best.
  • Separate auxiliary space from output space when relevant.

Mark the changes

A marker tells the user what to edit in a file they already have, so it belongs only on a patch against existing code.

  • A line the user must add → NEW
  • An existing line the user must change → MOD
  • An unchanged line shown for context → no marker

Write the marker as a trailing comment in the target language's own comment syntax, and never mix two languages' syntax: // NEW in C, Java, JavaScript, Go, or Rust; # NEW in Python, Ruby, or shell; -- MOD in SQL or Lua; <!-- NEW --> in HTML.

Do not mark code the user has no existing version of. When every line is new there is nothing to distinguish, and the markers are pure noise.

Compose

Base skills, ordered by how much of the solution they hand over:

follow-up → check → lcd → stuck → salvage → optimize → best

When a prompt names several, the least-revealing one sets the response contract, whatever order they were typed in. Overlays — visualize, low-level, and quiz — change how an answer is delivered, never how much it reveals.

Integrate an overlay while preserving the user's algorithm family.

Do not edit, run, or submit the user's code without permission. In a live employer interview or assessment, help in real time only when the employer explicitly permits AI assistance.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.