From margins
Post a discussion to the Margins review platform for the current repo. Creates the workspace automatically if it doesn't exist (1 workspace per repo). Infers which file and anchor point to use from the topic and conversation context. If no relevant file exists, creates openspec/decisions/<slug>.md with context first. Use when the user wants to: - Flag a decision for team discussion ("post this to Margins", "create a margins discussion", "/margins <topic>") - Get async human input on an architecture or design choice - Record a decision point that needs team sign-off - Start a threaded discussion anchored to a specific file/section
How this skill is triggered — by the user, by Claude, or both
Slash command
/margins:marginsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
```bash
margins binary# Resolve margins CLI binary
if command -v margins &>/dev/null; then
MARGINS="margins"
elif [ -f "$(git rev-parse --show-toplevel 2>/dev/null)/margins-cli/bin/margins.js" ]; then
MARGINS="node $(git rev-parse --show-toplevel)/margins-cli/bin/margins.js"
else
MARGINS="npx --yes github:alvistar/margins-cli"
fi
Use $MARGINS for every command below.
REPO_URL=$(git remote get-url origin 2>/dev/null)
If empty, ask the user for the repo URL.
Normalize SSH to HTTPS:
[email protected]:owner/repo.git -> https://github.com/owner/repo[email protected]:owner/repo.git -> https://gitlab.com/owner/repo.git if presentDerive the workspace slug (mirrors the server's parseSlug() logic):
https://github.com/owner/repo -> gh/owner/repohttps://gitlab.com/owner/repo -> gl/owner/repo<host-without-tld>/<owner>/<repo>$MARGINS workspace create "$REPO_URL" 2>&1
If the command fails with an auth error, tell the user:
"Run
/margins-setupto configure authentication, then retry/margins."
From $ARGUMENTS (the topic) and conversation context, choose the best file to anchor the discussion to.
Priority order:
openspec/changes/<active-change>/brief.md, a spec.md, or decisions.mdChoosing the anchor:
--anchor-heading "<heading text>".--anchor-text "<quoted snippet>".Derive a slug from the topic: lowercase, hyphens, max 40 chars.
Create openspec/decisions/<slug>.md:
# <Topic>
> Created by /margins on <date> for async team discussion.
## Context
<1-3 sentence summary of the situation from conversation context>
## The Question
<What decision or input is needed from the team>
## Options Considered
<Bullet list of the options discussed, if any — omit section if none>
Commit the file:
git add openspec/decisions/<slug>.md
git commit -m "docs: add decision doc for team discussion — <slug>"
Use this file as the target. Anchor to the ## The Question heading.
Write a concise body (3-8 sentences) covering:
Keep it focused — this is async context for teammates, not a full spec.
$MARGINS discuss create <slug> \
--path <relative-file-path> \
[--branch <branch>] \
[--anchor-heading "<heading>"] \
[--anchor-text "<text>"] \
--body "<body>"
<slug> is a positional argument (e.g. gh/owner/repo), not a flag--path must be relative to the repo root (e.g., openspec/brief.md)--branch defaults to current git branch — omit unless targeting a specific branch--anchor-heading if the artifact isn't indexed yet (causes 422)The CLI outputs the full deep-link URL. Show it to the user:
Discussion created: <id>
View at: <serverUrl>/w/<slug>/-/<branch>/<path>#discussion-<id>
npx claudepluginhub alvistar/margins-cli --plugin marginsCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.