Index of every page on this site: llms.txt
All skills
onmax avatar

/teach-lesson

@aecfada
by Maxonmax/comark-ui43 stars
3
Run it yourself

Writes a short lesson on one concept in simplified English, with a worked example and a question the reader answers. Use when someone asks to learn or understand one concept, wants a tutorial or self-check they can test themselves on, or needs onboarding on one idea.

Use this Skill: https://skilld.dev/gh/onmax/comark-ui/teach-lesson

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesexample.md

≈681 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Keep both writers' changes

After this lesson, you can predict how a server handles two changes to the same record, with or without a version check.

Why it matters

In this example, Ana and Ben open the same help article. Ana corrects a spelling error and saves the article. Ben adds a paragraph to his older copy and saves it. His save removes Ana's correction without a warning. This is a lost update.

The idea

An ETag is a version label, such as "v7", that the server sends with a resource. The If-Match header carries that label back to require the same version before saving a change. If the labels match, the server saves the change. If the labels differ, the server returns 412 Precondition Failed and keeps the resource unchanged.

Worked example

::steps

Both load version 7

Ana and Ben each GET /articles/42, and both get ETag: "v7".

Ana saves first

PUT /articles/42
If-Match: "v7"

The article is still at "v7". The server saves Ana's change and returns 200 OK with ETag: "v8".

Ben saves second

PUT /articles/42
If-Match: "v7"

The article is now at "v8". The labels differ, so the server returns 412 Precondition Failed. Ana's correction stays.

Ben reloads and merges

Ben's editor fetches "v8" and shows Ana's correction. Ben adds his paragraph to that version. He saves again with If-Match: "v8". ::

Check yourself

::question{#etag-no-if-match} This API accepts requests without If-Match. Ben's editor sends his PUT without that header. The article is at "v8". What happens?

  • The server saves Ben's version and removes Ana's correction

    Without If-Match, the server has no version condition to check. The server saves Ben's version. This removes Ana's correction.

  • The server refuses the save with a 412 status code

    A 412 response requires a condition that failed. Ben sent no condition, so the server has no labels to compare.

  • The server merges Ben's paragraph into version 8

    The server does not combine the two versions. After a 412 response, the client must get the current version and combine the changes.

#explain The client must send its original version label for If-Match to protect the change. An API can require that header. If the header is absent, that API can return 428 Precondition Required. ::

::recall{#etag-412} What does a server answer when If-Match names an old version?

#answer 412 Precondition Failed, and it leaves the resource unchanged. ::

Read next

RFC 9110, section 13.1.1 defines If-Match.

The next lesson explains weak ETags and why W/"v7" never matches If-Match.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning20d3 checks · Risk MEDIUM
  • Gen Agent Trust Hub20d

    This skill instructs the agent to download and execute unversioned Node.js packages from a non-standard source using the `dlx` command. It also involves running shell commands on content generated from external data, which presents a surface for indirect prompt injection.

  • Socket20d

    No alerts

  • Snyk20d

    Risk: LOW · No issues

Signed by skilld at aecfada. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 3 weeks ago

README badge

README badge for onmax/comark-ui/teach-lesson