Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Learn?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/facta-dev-learn-ai-coding-playbook)
---
name: "learn"
description: "Appends a one-line lesson to <app>'s project-local .claude/learnings.jsonl and shows how to consult prior entries before repeating similar work."
division: core
---
# `<app>` learn skill
> Reusable workflow for capturing a durable, project-local lesson learned
> while working on `<app>`. An agent invokes this skill; the agent supplies
> the lesson, the skill supplies the append and the consult procedure.
## When to Activate
Activate this skill when a session surfaces a lesson worth remembering for
`<app>`: a recurring pitfall, a pattern that worked, or a preference that
should outlive the session. Typical triggers:
- A bug traced to a root cause that will recur if unrecorded (an IPC handler
that trusted the sender before validating it, a migration added without
bumping `PRAGMA user_version`).
- A workaround that should become the default approach next time.
- A preference stated by a reviewer or the requester that should persist.
Do NOT activate this skill for one-off facts with no recurrence value, or to
record anything resembling a secret, a credential or a connection string — the
log is committed to the project and is not a secret store.
## Core Principles
- **Append-only.** `.claude/learnings.jsonl` is never rewritten or
reordered; each invocation adds exactly one line at the end. Never
parse-and-rewrite the prior lines.
- **Consult before repeating.** Before starting work that resembles a past
pitfall class (an IPC-boundary change, a migration, a new slice), grep
`.claude/learnings.jsonl` for the relevant `kind` first.
- **One lesson, one line.** A JSONL entry is a single fact, not a narrative;
three lessons produce three lines.
- **Local to this project.** The log stays inside the generated `<app>`
repository: it never syncs anywhere, and a fresh clone starts empty until
the first append.
- **Created on first use.** The template ships no
`.claude/learnings.jsonl`; the file appears with the first successful
append.
## Rules
- No fabricated data: only append a lesson actually observed in this session;
never invent a plausible pitfall to pad the log.
- Every claim needs a source: the `refs` array cites a real `file:line`, an
issue number or a URL from this session. An empty `refs` array is
acceptable only for a pure preference statement.
- Never append a password, token, key or connection string value — cite the
file and line where the problem lives instead.
- Append with pure shell, no JSON rewriter:
`printf '%s\n' "{…}" >> .claude/learnings.jsonl`. A tool that reformats
the file would reorder the history.
- Escape the double quotes inside the `note` string, or the line will not
parse as JSON.
- Report the appended line as raw text, not inside a code fence, so it can be
verified against the file.
## Research References
| Claim | Source | Year | Link |
|-------|--------|------|------|
| JSON Lines format (one JSON value per line) | jsonlines.org | 2017 | https://jsonlines.org |
| The recurring pitfalls worth recording: IPC boundaries, migrations, layer law | `PLAYBOOK_DESKTOP_ELECTRON.md` §3, §5 | - | `PLAYBOOK_DESKTOP_ELECTRON.md` |
| The gate that turns a lesson into a test | `PLAYBOOK_TESTS.md` | - | `PLAYBOOK_TESTS.md` |
## Output Format
Raw structured prose, not a code fence:
```
### <app> learn — entry appended
File: .claude/learnings.jsonl
Line: {"ts":"<ISO-8601 UTC>","kind":"pattern|pitfall|preference","note":"<one-line lesson>","refs":["<file:line | issue# | url>"]}
Consult-first reminder: grep '"kind":"<kind>"' .claude/learnings.jsonl before
starting similar work.
```