share-learning
Skill47 starsChanged 2 months agoMITView on GitHub
Promote a team-relevant learning to the shared team-knowledge repo after deduping against existing notes. Triggers "share this", "add to the knowledge base", or a gotcha, decision, or convention worth team-wide awareness.
- Reads credentials
In this repository39 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/AGENTS.mdAGENTS.md
- adhdSkill
- auditSkill
- autoresearchSkill
- buildSkill
- ccSkill
- checkpointSkill
- codexSkill
- componentSkill
- consolidateSkill
- context-docSkill
- design-tokensSkill
- dr-initSkill
- exploreSkill
- fixSkill
- freezeSkill
- handoffSkill
- harvestSkill
- hookSkill
- lighthouseSkill
- oracleSkill
- orchestrateSkill
- plan-ceo-reviewSkill
- plan-featureSkill
- poke-holesSkill
- projectSkill
- proof-of-workSkill
- qaSkill
- refactorSkill
- retroSkill
- review-batchSkill
- reviewSkill
- shipSkill
- strategistSkill
- testSkill
- tldrSkill
- triageSkill
- zero-tech-debtSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Use when a learning meets the shared-tier bar from AGENTS.md (Knowledge Routing): an architecture decision the team must follow, a library …
- Very specific: line 33
If invoked without arguments, infer the most likely kind and a concise text from the recent conversation, then show the user what you …
- Very specific: line 36
Before starting, run gh auth status and confirm the authenticated account can read darkroomengineering/team-knowledge (or $KNOWLEDGE_REPO) …
- Very specific: line 44
Resolve the repo: Read $KNOWLEDGE_REPO from the environment.
- Distinctive: line 60
Ask whether to skip (already covered), post anyway (genuinely distinct), or
- Distinctive: line 63
Only continue to step 3 once the user has chosen, or when there is clearly no duplicate.
- Distinctive: line 102
If creating a new note:
- Very specific: line 124
If updating an existing note, first GET its current sha:
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
share-learning
Promote a single learning to the team's shared knowledge repo (darkroomengineering/team-knowledge) —
the "public corpus" tier of the knowledge system (see docs/knowledge-system.md). Local,
personal knowledge stays in auto-memory; this skill is only for things another teammate's
agent would benefit from knowing.
When to use
Use when a learning meets the shared-tier bar from AGENTS.md (Knowledge Routing): an
architecture decision the team must follow, a library gotcha that affects everyone, a
convention, an incident postmortem, or a reusable pattern. If it is a personal preference,
local project state, or an external pointer, let auto-memory handle it instead — do NOT
post it.
Inputs
Invoked as /share-learning <kind> "<text>" where <kind> is one of:
decision, convention, gotcha, incident, pattern.
If invoked without arguments, infer the most likely kind and a concise text from the
recent conversation, then show the user what you intend to post and confirm before posting.
Before starting, run gh auth status and confirm the authenticated account can read
darkroomengineering/team-knowledge (or $KNOWLEDGE_REPO) with
gh api repos/${KNOWLEDGE_REPO:-darkroomengineering/team-knowledge} --jq .full_name. Stop with the
failed prerequisite if either check fails. Do not wait until the write step to surface missing
authentication or repository access.
Steps
Resolve the repo. Read
$KNOWLEDGE_REPOfrom the environment; default isdarkroomengineering/team-knowledge:KNOWLEDGE_REPO="${KNOWLEDGE_REPO:-darkroomengineering/team-knowledge}"Dedup against the index (required). Fetch the current index:
gh api repos/$KNOWLEDGE_REPO/contents/INDEX.md --jq .content | base64 -dScan the note names and titles in the index for an entry that already captures this learning (semantic near-duplicate, not just exact match). If you find one:
- Show the user the existing note name and its summary line.
- Ask whether to skip (already covered), post anyway (genuinely distinct), or revise your proposed entry to complement it.
Only continue to step 3 once the user has chosen, or when there is clearly no duplicate.
Post. Derive a
name(kebab-case slug from the essence of the learning). Assemble the note:- Frontmatter:
name= the slug;kindfrom the argument;summary(required, see below);added-byfromgh api user --jq .login(fall back togit config user.nameif that fails);tags,scopeandverifiedoptional (see below);supersedesonly when this note replaces an existing one. summary: one line, at most 160 characters, no·, in double quotes. It becomes the note's line inINDEX.md, which is all an agent sees before deciding to open the note, so state the rule and what to do, not how it was found. Good: "drizzle-kit push on SQLite plansdelete fromfor any new NOT NULL column, even with a default; add the column with ALTER TABLE." Bad: "What happened: on theca, drizzle-kit push against prod...". Never put"or\inside it: in YAML double quotes a backslash starts an escape sequence, so\d+fails to parse and\bsilently turns into a control character. Rephrase instead (write "digits", not\d+).tags: theknowledge-hinthook matches them as whole words against the command or file an agent is working on, and one specific tag is enough to surface the note. Include the literal identifiers that appear there, lowercased (drizzle-kit,getboundingclientrect,x-fb-ck-fbp); skip identifiers used everywhere (useref). A hyphenated tag matches only a hyphen, so tagsendmsg, notscm-rightsforSCM_RIGHTS.scope: repo names (as on GitHub) the note applies to, e.g.[programa]. The hook hides a scoped note in every other repo, so add it only when the rule is wrong or irrelevant elsewhere, never because the learning came from one repo. Check the name withgh repo view darkroomengineering/<name>.verified: for a note about a tool, SDK or service version, the date ("YYYY-MM-DD", quoted) its claims were last confirmed.- Body: open with the rule in one or two sentences, then what happened or why it matters, then how to apply it. An agent that reads only the first paragraph should know what to do. One learning per note, atomic and self-contained.
Assign the note with a quoted heredoc, so the summary's double quotes and any backticks or
$in the body stay literal.If creating a new note:
NOTE=$(cat <<'EOF' --- name: <name> kind: <kind> summary: "<one-line rule, max 160 chars>" tags: [<tag1>, <tag2>] scope: [<repo>] # only when the rule applies to one repo verified: "<YYYY-MM-DD>" # only for version-specific claims added-by: <login> --- <body> EOF ) gh api -X PUT repos/$KNOWLEDGE_REPO/contents/<name>.md \ -f message="knowledge: add <name>" \ -f content="$(printf '%s' "$NOTE" | base64)"If updating an existing note, first GET its current
sha:SHA=$(gh api repos/$KNOWLEDGE_REPO/contents/<name>.md --jq .sha) gh api -X PUT repos/$KNOWLEDGE_REPO/contents/<name>.md \ -f message="knowledge: update <name>" \ -f content="$(printf '%s' "$NOTE" | base64)" \ -f sha="$SHA"- Frontmatter:
- Report. Surface the blob URL to the user:
https://github.com/$KNOWLEDGE_REPO/blob/main/<name>.md
Notes
- This skill posts to a shared, team-visible repo — treat it like publishing. Never post
secrets, credentials, or anything from
.env. When unsure whether something is team-relevant, ask the user rather than over-sharing. - The dedup step is what makes this more than a
ghwrapper: you are exercising judgment about whether the corpus already knows this.
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
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.

