Log

From jellyrock/jellyrock · View interactive version

Log is an AI agent skill from the GitHub repository jellyrock/jellyrock. Single-entry-point capture for the journals this repo keeps: `decision` (agent-gated: ADR-grade becomes a numbered record in `docs/adr/`, sub-architectural a note in `docs/decisions.md`, trivia is declined; `--revise=<slug>` corrects a note that misdescribes what shipped, which is not a supersede),

How to use this skill

Skill file

/log: single-entry-point capture

This repo

Contract

Goal. Be the single capture entry point for every kind of journal write this repo keeps, so instead of remembering which file each entry lives in and which format it uses, the user types /log {{type}} {{body}} and the skill routes to the right place in the right format. There are two capture modes. Mechanical types (followup and most domain types) apply directly, with no per-invocation gate, because routing is mechanical. A followup is written by the journal script (journal.sh), which does everything with one right answer (the entry's place, its markers, the date line, the checks and the commit), so the model carries only the judgment: which category, the title, the fid, the words. The agent-gated decision type is the deliberate exception: the agent drafts the record, applies a significance gate (is this architectural, hard-to-reverse, or cross-component?), routes it (numbered ADR vs. the tracked project's decision list vs. decline-as-trivia), and shows a diff-and-confirm the human can override in one tap. Here the gate is right because the agent is confirming a classification judgment, not gating a mechanical append. Capture stays frictionless for the human, who classifies nothing; the deliberation moved to the agent. Started by the agent it runs on the session's own model and effort; its pin applies when it is typed. A third built-in type, message, hands a note to another repo: it goes into that repo's mailbox in the projects home, never into this repo's journal (where the other repo never looks) or the other repo's (whose context the sender lacks, so it would duplicate and mis-file). A fourth, request, asks other repos to make a change this repo decided: one record with a part per target, which each target closes or declines. Who decides the work picks between the two: the sender decided it, a request; the receiver decides whether and how, a message.

Inputs. The arguments are {{type}} [optional title or body]. The first whitespace-separated token is the type; the rest is passed to the type-specific flow. The recognized types are this repo's capture types (a Repo facts slot in AGENTS.md), the one list every capture sentence also reads. message and request are recognized beside them wherever this machine has a mailbox; neither is a capture type, since a sub-agent reports a followup and the parent sends it. If there are no arguments, the skill prompts for the type, listing the valid ones. For an unrecognized type, list the valid types and ask; never guess.

Outputs.

Success criteria.

Failure modes to avoid.

When not to use.

Implementation

Every followup read and write goes through bash .claude/skills/log/journal.sh (run from anywhere in the repo; journal.sh with no arguments prints its commands). It finds the journal itself (docs/cursor.md unless this repo's .claude/skills/log/journal.conf names another), so no step here names the file. A type other than followup and decision is this repo's own: its steps are in this skill's ## This repo.

Step 1: Parse the type

The first whitespace-separated token of the arguments is the type; the rest is the body. The valid types are this repo's capture types; followup also answers to f and todo, decision to d, and a type of this repo's own to the aliases its ## This repo gives. message and request are valid beside them and go to Steps 6 and 7.

If journal.sh add or replace refuses for uncommitted journal edits, show them and ask in chat which of the two ways its refusal names to take: the edits are the user's, so the choice is theirs. For a decision, check the file about to change yourself (git diff --quiet HEAD -- {{file}}) before any write, since Step 5's path-restricted commit would take its uncommitted edits along, and ask the same way.

Step 2: `followup`

  1. Entry test, for an item an agent proposed (a sub-agent's capture, an item in a skill's report, one you noticed yourself). Skip it when the user asked for this followup in their own words. Give the item exactly one outcome:

Report each outcome with its one-line why (in the caller's report, or in Step 5's confirmation), so a wrong drop or fix is seen and can be overridden: the user's override files it.

  1. Look for a duplicate first. journal.sh list shows every open entry. Search the journal for the file, symbol or error text the new item is about (grep -n '{{file-or-symbol}}' "$(bash .claude/skills/log/journal.sh path)"). If an open entry already covers it, journal.sh show {{fid}}, then add what is new to that entry with journal.sh replace {{fid}} --body-file {{file}} instead of adding a second one.
  2. Pick the category from list: the area whose code the fix changes, not the work that surfaced it. Never file under a category named for a slice, a project or a session. A new category only for a durable area that none fits; ask in chat only when two fit equally.
  3. Write the entry:
  1. Add it. Write the body to a temporary file with a quoted heredoc (cat >"$tmp" <<'EOF') so nothing in it is escaped, then run bash .claude/skills/log/journal.sh add --category "{{category}}" --fid {{fid}} --title "{{title}}" --body-file "$tmp" (plus --prompt, --pinned, --waits-on and --due when set). It stamps the entry's captured date and bumps the journal's date line.
  2. Read it back with journal.sh show {{fid}}: the Markdown must read as meant (a stray backslash from an escaped backtick is the usual fault).

Then Step 4.

Step 3: `decision` (agent-gated)

The human supplies content; the agent does the rest:

  1. Draft from the body + session context: what was decided, why, over what alternative, what it affects or supersedes. A count or measurement in the draft is run again now, with the command that defines it (the checker's own rule, not a grep for part of the text), never carried over from earlier in the session: the record outlives the session that could correct it. A fork where the user declined one option is recorded as that decline, never as a choice of the other.
  2. Significance gate. Architectural, hard-to-reverse, or cross-component? Negative filter: if every decision is architectural, none is.
  3. Route on the verdict:
  1. Diff-and-confirm. Before showing the draft, check it for what Step 4's checks reject and you can see (a /{{skill}} this repo does not have, a link to a missing file), so the text the human confirms is the text committed; a fix Step 4 still needs after the reply is shown again before the commit. Show the proposed routing and the drafted text. If the decision changes a choice the human approved earlier, put that change on its own line above the draft, as its own question: a line inside the record is not consent. The human confirms or redirects in one reply; nothing is written before that.
  2. Apply only what was confirmed, then Step 4.

Step 4: Check before committing

Step 5: Commit

journal.sh commit makes the path-restricted commit (-m before --), stages a file the write created, and prints committed as {{sha}} on {{branch}}. When this repo commits journal writes together with the change that prompted them, it commits nothing and says so; pass that on. A path in a projects home (a repo of its own) is pushed there by projects-write.sh, and a gitignored path is left out; the output says which. In a public repo where the journal is an agent file, it commits with agent-body.sh's title and no body, and says so. A decision's subject follows this repo's commit style: skim git log --oneline -10 for it.

If it refuses for journal edits it did not write, nothing was committed: show them and leave the write uncommitted; they are the user's, so never commit them another way. If a hook refuses the commit, nothing was committed: fix what it names and commit again; never --no-verify. Skip the commit only when the user said "don't commit" / "leave it for me".

Step 6: `message`

Every mailbox read and write goes through bash .claude/skills/start-project/mailbox.sh (with no arguments it prints its usage). It writes the message into the receiving repo's mailbox in the projects home and pushes it, so Steps 4 and 5 do not apply.

First, who decides the work (Step 7 runs this test too). A request when this repo decided the change: every item names its exact change, and a check the receiver runs first has a pass-or-fail answer (a failed check declines that part, with the reason). A message when the receiver decides whether or how: one item left to their judgment makes the whole note a message. When the test points to the other kind, say so in one line and ask in chat before switching, since the user named the kind.

  1. The receiver: {{owner}}/{{name}} as that repo's origin reads, lowercase. The script refuses a repo the machine does not have registered, so a typo makes no stray mailbox. If the user named it loosely ("the website repo"), ask in chat which owner/name they mean.
  2. A followup to move (the user names one of this journal's fids, or the item is already filed here): bash .claude/skills/start-project/mailbox.sh send {{owner/name}} --from {{fid}}. Its title and body become the message, and the script closes the followup here and commits that close only after the message is pushed.
  3. A new message: an id shaped like a fid; a title readable on its own; a body written for a session in the other repo that has none of this one's context: what to do, why, and where, with every commit named as {{owner/name}}@{{sha}}. Write the body with a quoted heredoc (cat >"$tmp" <<'EOF'), then bash .claude/skills/start-project/mailbox.sh send {{owner/name}} --id {{id}} --title "{{title}}" --body-file "$tmp". Its proof is this repo's HEAD, which must be pushed; name another pushed commit with --commit {{sha}} when the message is about that one.
  4. About one of the receiver's projects? Add --project {{folder}} (its YYYY-MM-slug folder) only when you know the folder: that repo's /resume-project then shows the message. Never guess one.
  5. Pinned? Only when the user says the receiver should take it first: add --pinned. It then ranks with the receiver's pinned followups. A followup moved with --from keeps its pin.
  6. Report the outcome, passing on what the script printed. Exit 0: sent (and, with --from, closed here). Exit 3: refused, nothing written: a private-term hit for a public receiver means reword those lines and send again; an unpushed proof means push first. Exit 4: nothing was sent because the projects home's remote did not take it, and a moved followup is still open: run the same command again later. "No mailbox on this machine": say so, and file the note here as a followup instead, saying in its body which repo it is for.

Step 7: `request`

Run Step 6's who-decides test first. The send goes through the same mailbox.sh, so Steps 4 and 5 do not apply.

  1. The targets: each owner/name as Step 6 item 1 finds it. Never this repo: a change it decided for itself is made here, or filed as a followup.
  2. The body: the shared change first, written for a session in each target with none of this one's context: what to change, why and where, every commit as {{owner/name}}@{{sha}}, and any pass-or-fail check to run before the change. Then one part per target under its own ## {{owner/name}} heading, holding what differs there; a part may open with a project: line naming that target's project folder, only when you know the folder. A ## line inside a code fence is shared text, not a target.
  3. Send: write the body with a quoted heredoc, then bash .claude/skills/start-project/mailbox.sh request --id {{id}} --title "{{title}}" --body-file "$tmp", adding --commit {{sha}} and --pinned as Step 6 does. The id is shaped like a fid and unique in the whole projects home. Public targets get their own file under the same id, its text scanned for private terms.
  4. Report the outcome as Step 6 item 6 does. Exit 3 also covers a heading no registry holds, a target named twice, and a private target named by a repo that is not private (mail that one instead). Each target closes or declines its part with /done request {{id}} there; once none is open, this repo settles the request with /done request {{id}} here.

Sub-agent invocation

To invoke from a sub-agent, the parent passes: Read .claude/skills/log/SKILL.md and follow the steps with the arguments {{type and body}}; run journal.sh list to pick a category, then return the drafted entry and the exact journal.sh add command — never run add, replace or commit. End your report with a "Captures for /log" section: one "- <type>: <title> — <body>" bullet per journal-worthy item this work surfaced, where <type> is one of [this repo's capture types](../../../AGENTS.md#capture-types); omit the section if there are none, and never write to journals yourself. A parent writing that prompt for an Explore sub-agent (which loads no instruction files) spells the types out from the slot in place of the link. A sub-agent this section starts never applies a journal write: the journal is what /catchup reads first every session, so an unconfirmed entry misleads every session after it. The one grant is elsewhere: a /sonnet sub-agent its parent supervises carries out the journal writes its saved plan names, as the plan's own steps, and the parent reviews them before any push. For decision the bar is higher still: a sub-agent surfaces the proposed routing + drafted record and waits; it never files an ADR, since a numbered ADR is a durable, supersede-only record.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.