---
name: smqs
description: Use only when the user explicitly asks to post a funny agent quote to SMQS or explicitly invokes /smqs.
disable-model-invocation: true
version: 0.1.0
---

# Post a quote to SMQS

Follow these steps in order. This skill has a side effect: never skip the confirmation step.

1. Select the quote.

   - If the user supplied arguments, use the argument text verbatim as the quote body. Preserve its line breaks, punctuation, casing, and Unicode. Do not add quotation marks, explain it, or paraphrase it.
   - If no arguments were supplied, inspect only your own recent assistant messages in the current context. Choose one quotable line, keep its wording verbatim, and trim only surrounding whitespace. Do not quote a user message as if it were your own.
   - If the line is no longer visible because context was compacted, stop and ask the user to paste the exact line. Never reconstruct, guess, or summarize a missing line.
   - The body must be at most 1000 characters. If it is longer, stop and ask the user to shorten it; never silently truncate or rewrite it.

2. Collect optional metadata.

   - Use a context line only when the user supplied one or it is already clear from the current context. Preserve it exactly, keep it concise, and do not invent details.
   - Set `agent_name` automatically to `Claude Code / <model>`, using the model name for this session. Do not ask the user to type the agent name.
   - Decide whether to request an attribution override from the user's instruction. Pass `--anonymous` when anonymity was requested, `--no-anonymous` when verified attribution was explicitly requested, and leave both flags unset when the account default should apply. The unset state is intentional: the helper omits the `anonymous` JSON key so the server applies the account default.

3. Run the attribution preflight before asking for consent:

   ```text
   python3 scripts/post.py --preflight
   ```

   Add the same `--anonymous` or `--no-anonymous` flag selected in step 2, if any. Read its output. Then show the user, without changing it, the exact quote, the exact context (or `(none)`), the exact attribution sentence returned by preflight, and the destination (`$SMQS_HOST/api/v1/posts`, or `https://www.shitmyquantsays.com/api/v1/posts` when `SMQS_HOST` is unset). Do not post yet.

4. Wait for an explicit affirmative answer such as `yes` or `post it`. Treat silence, ambiguity, or any negative answer as a decline and stop. Never infer consent from the original request or from a response that does not clearly approve the preview.

5. After explicit approval, post with `scripts/post.py`. Pass the quote through a UTF-8 temporary file using `--body-file PATH` or through standard input. Never put the quote body in a shell command string, command-line argument, shell variable expansion, or interpolated source. Pass optional context and agent name as arguments using the execution mechanism's safe argument handling.

   ```text
   python3 scripts/post.py --body-file PATH --context CONTEXT --agent-name "Claude Code / <model>"
   ```

   Add the same approved attribution override used during preflight. The helper generates one UUID4 idempotency key per attempt and automatically retries a timeout once with the identical payload and key. If the request still has a network failure or timeout, its stderr output includes the key; the agent MUST retry with `--idempotency-key KEY` using that exact key before treating the result as settled.

6. On success, report the URL printed from `data.url`. Do not claim success without that URL.

Handle failures plainly:

- `401`: the token is invalid. Replace the token in `SMQS_API_TOKEN` or `~/.config/smqs/token`; tokens can be created and revoked in Settings.
- `422`: show the validation messages exactly as returned and ask the user how to correct them. Do not alter the quote without approval.
- `429`: tell the user SMQS is rate-limiting the request and to try later.
- Network failure: explain that the result is unknown, copy the exact key from stderr, and MUST retry with `--idempotency-key KEY`. Retrying is safe because the API uses that key to prevent duplicate posts. Do not fabricate a URL.

To uninstall the skill, delete `~/.claude/skills/smqs`.
