/aoshimash-skills:collect-agent-rulesfrom aoshimash-skills
Promote hand-written conventions out of the author's own GitHub repositories and into the shared rule corpus in aoshimash/skills — confirm which repositories to scan, read each one's AGENTS.md over the GitHub API without cloning, ignore everything inside a managed rules block, propose the conventions that recur across repositories, decide on them one at a time, and open a pull request adding the approved ones to the corpus. Runs inside a checkout of aoshimash/skills; proposes, never promotes automatically. Use when the user says "collect agent rules", "promote rules into the shared corpus", "find rules worth sharing in my repos", "scan my repositories for conventions to centralize", "harvest conventions from my other projects", "ルールを収集して", "他のリポジトリのルールを共通ルールに取り込んで", "自分のリポジトリから共通化できる規約を集めて", "エージェントルールを収集", "共通ルールに昇格させて", or otherwise wants hand-written conventions in owned repositories gathered into the shared rule set.
Ships in aoshimash-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Promote hand-written conventions out of the author's own repositories and into
the shared rule corpus. This skill runs inside a checkout of aoshimash/skills,
reads the AGENTS.md of the repositories the user confirms, proposes the
conventions that look worth sharing, and — for the candidates the user approves
— appends them to the corpus and opens a pull request.
This is the reverse direction of sync-agent-rules: that skill distributes the
corpus into a repository; this one collects from repositories into the corpus.
Rewriting a source repository to drop its now-shared copy is out of scope —
a later sync-agent-rules run puts the promoted rule into that repository's
managed block, and tidying the hand-written original is left to the author.
plugins/aoshimash-skills/rules/agent-rules.md in a checkout of
aoshimash/skills, and running anywhere else stops the run (Phase 0).sync-agent-rules appear in every repository that received
them; treating them as candidates would rediscover the entire corpus on every
scan. Only text outside the delimiters counts (Phase 5).git clone, and never create a working copy of
a scanned repository.git fetch, which updates remote-tracking refs, but that touches nothing the
run could damage and nothing the wrap-up has to undo. Phases 0–7 otherwise
read, decide, and ask. A run that finds nothing, is cancelled at the
repository confirmation, or has every candidate rejected leaves the checkout
exactly as it was found — no stray file, no stray branch, no stray commit.AGENTS.md. The corpus's own "Format" section is authoritative.This skill targets any agent implementing the Agent Skills spec. Instructions below use capability terms; map them to your environment as follows.
| Capability | With native support (example) | Fallback |
|---|---|---|
| User choice — present numbered options, wait for an explicit selection | Structured question tool (e.g. Claude Code's AskUserQuestion) | Numbered options as plain text; wait for the user's reply |
User choice is used in exactly two places: Phase 3's confirmation of the repository set, and Phase 7's per-candidate decision. Both are gates in the strict sense — an unanswered question stops the run rather than defaulting to "yes".
The corpus file's "Contract" and "Format" sections are the authoritative specification of everything below; this table is a reading aid, not a second source. If the two ever disagree, the corpus wins.
| Thing | Value |
|---|---|
| Corpus path | plugins/aoshimash-skills/rules/agent-rules.md, relative to the root of a checkout of aoshimash/skills |
| Rule format | One ## rule: <id> section per rule, containing a **Title:** line, a **Detect:** line of backticked glob patterns, and a **Rule:** line followed by the verbatim rule body |
| Managed-block delimiters | <!-- BEGIN aoshimash-agent-rules --> … <!-- END aoshimash-agent-rules -->, each alone on its own line |
| Per-rule marker inside a block | <!-- rule: <id> -->, on the line after the rule's ### heading |
Fenced regions are skipped by every parse in this skill — when enumerating
## rule: sections, when counting delimiter lines, and when segmenting a
scanned file into sections. Two inputs make this mandatory rather than
defensive: the corpus's own "Format" section shows the rule template inside a
fence whose first line is literally ## rule: <id>, so every run exercises
this path; and a scanned AGENTS.md that documents this mechanism will contain
fenced delimiter examples that must not be mistaken for a real block.
Verify all of the following before touching anything, and stop if any does not hold.
Evaluation order. Step 1 comes first; if it fails nothing else can be
evaluated, so report it alone. Steps 2 and 5 are then both local: evaluate
both and report every failure together, so a user with two problems
learns about two rather than discovering them one re-run at a time. Steps 3 and
4 need the network and run only once the local checks pass, in that order,
stopping at the first failure — which is what keeps a logged-out gh from being
reported as a wrong repository. Step 6 runs last, only when everything passed.
Inside a git repository, at its root. git rev-parse --show-toplevel
succeeds; run everything from that directory.
An origin remote exists and points at GitHub (git remote get-url origin). Without it Phase 1's fetch and Phase 8's push have nowhere to go,
and a local-only repository has nowhere to open a pull request. Parse the URL
into <owner>/<repo> and keep it: every later gh call names its
repository explicitly, and this is where that name comes from.
gh is authenticated (gh auth status) and the network is reachable.
This runs before the identity check below, which is an API call: a logged-out
or offline gh must be reported as exactly that, never as "this is not a
checkout of aoshimash/skills".
This checkout is aoshimash/skills. Two parts, in this order:
gh repo view <origin owner/repo> --json nameWithOwner,parent reports
aoshimash/skills as the repository itself or as its parent (a fork is
acceptable; references/corpus-edit.md covers
the extra handling a fork needs). Naming the repository is mandatory
here — gh repo view takes it as a positional argument, and the value
is the one recorded in step 2. Left off, gh resolves the repository from
the whole remote set and prefers a remote named upstream over
origin, so the standard fork layout (origin = the fork, upstream =
aoshimash/skills) reports aoshimash/skills with a null parent — the run
would conclude it is not on a fork and skip every fork safeguard,
including the staleness check that stops a duplicate rule id from being
appended. If the command itself fails — network error, permission
error, rate limit — report that failure and stop; do not convert a
failed call into a wrong-repository verdict.When either part shows this is genuinely the wrong repository, stop and
explain: this skill edits the corpus as a real file, the corpus lives in
aoshimash/skills, and a running skill's own copy is a version-pinned cache
that is replaced on update — so there is nothing here to edit. Tell the user
to re-run from a checkout of aoshimash/skills. Do not clone one.
The corpus file is unmodified and nothing is staged.
git status --porcelain must not list the corpus file and must show no
staged entries, so the commit contains only the promotion. Refuse rather than
stashing, committing, or discarding the user's work.
Record the starting position so the wrap-up can restore it:
git symbolic-ref --quiet --short HEAD for a branch, or — when that fails
because HEAD is detached — git rev-parse HEAD for the commit. Restoring by
SHA is correct for a detached HEAD; do not assume a branch name exists.
Fetch, determine the default branch, and decide which ref this run reads the corpus from and will later commit onto — without checking anything out (Principle 6). An open promotion pull request means its branch is reused; a promotion branch left on the remote with no open pull request stops the run, because every subsequent push would be rejected and no re-run could clear it. A fork needs its default branch verified current first. See references/corpus-edit.md.
Read the corpus from the base ref resolved in Phase 1 — git show <base-ref>:<corpus path>, not the working tree, so what candidates are deduped
against is exactly what Phase 8 appends to. Parse it into (id, title, detect patterns, body), skipping fenced regions and the corpus's own non-rule
sections. Record the file's line ending and whether it ends with a newline.
See references/corpus-edit.md.
List the authenticated user's own, non-fork, non-archived repositories (metadata only — no file is read yet) and ask the user to choose (see Environment Adaptation) which to scan: all, a named subset, or cancel. Even when the user named repositories in the request, show the resolved set and confirm it. On cancel, go straight to the wrap-up. See references/scanning.md.
AGENTS.mdFor each confirmed repository, read AGENTS.md over the GitHub API. Then, only
for those whose AGENTS.md was read successfully, make a best-effort second
call for the repository's file list — that is what lets Phase 6 check a drafted
Detect pattern against real paths, and it never blocks the run. Never clone,
and keep anything written to disk outside the working tree. A repository with no
AGENTS.md is recorded and skipped; an authentication, rate-limit, or network
failure stops the scan and reports, because recurrence counted over a
partial set understates the signal. See
references/scanning.md.
In each fetched file, validate the managed-block delimiters (fence-aware,
whole-line counting; accept only zero of each, or exactly one of each with
BEGIN before END). A malformed block — unterminated or duplicated — means
that repository is skipped and reported, never guessed at. Remove the block
from BEGIN to END inclusive; everything that remains is the hand-written
text. Segment it into sections by heading, skipping fenced regions. See
references/scanning.md.
From the hand-written sections, derive candidate rules. The primary signal is recurrence: the same convention stated in 2+ scanned repositories. Drop anything already covered by a corpus rule from Phase 2, and anything tied to one project's domain, architecture, or build commands. Conventions seen in exactly one repository are listed for visibility but not proposed — unless the user asks for one of them specifically, which puts it to the same per-candidate decision as any other. If nothing meets the threshold, report that and go to the wrap-up — no branch, no pull request. See references/candidates.md.
Present the findings report, then take each candidate in rank order and ask the user to choose (see Environment Adaptation): Add / Add with edits / Skip (default) / Abort. Never bulk-approve, and never add a candidate without an explicit Add. Each approved candidate is drafted into the corpus format — id, title, detect patterns, body — before moving to the next. See references/candidates.md.
Reached only with at least one approved candidate. Check out the branch decided
in Phase 1, confirm the corpus file on disk still matches what Phase 2 read,
append the approved rules by the byte-level recipe, stage only the corpus file,
commit, push, and open the pull request against aoshimash/skills. If anything
fails between writing the file and a successful commit, restore the corpus
file before the wrap-up — nothing else undoes a modified tracked file. See
references/corpus-edit.md.
Reached by every exit path — success, a cancelled confirmation, an empty result, a refusal, and every stop-and-report above.
git branch -d chore/collect-agent-rules). Never delete a branch that
existed before this run.sync-agent-rules run distributes
the promoted rule.CLAUDE.md. The corpus targets AGENTS.md; a second source
file would multiply the malformed-input surface for little gain.## rule: sections.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub aoshimash/skills --plugin aoshimash-skills11 skills in this plugin
/analyze-sessionsAnalyze the running agent's session history — Codex or Claude Code, or a history export the user provides — to detect recurring patterns in skill executions and propose improvements to skill definitions and, where that agent's configuration surface is confirmed, to its settings or hooks. Use when the user says "analyze sessions", "improve skills", "analyze skill logs", "セッションを分析", "スキルを改善", "ログを分析", "設定を提案", or wants to review skill usage patterns and environment configuration.
/create-issueCreate well-structured issues on GitHub or Backlog with codebase analysis — from a single quick issue to a fully designed issue hierarchy (parent + sub-issues with dependencies). Everything unknown is gathered in one batched question round; design work is carried by a single consolidated plan file refined through inline annotation; nothing is published without an explicit approval. Use when the user wants to create an issue, file a bug report, request a feature, create a technical task, or design a feature and break it down into implementable issues. Triggers on phrases like "create an issue", "file a bug", "open an issue", "issueを作って", "issue作成", "バグ報告", "機能要望", "課題を作成", "design sprint", "スプリント設計", "機能を設計して issue に分解", "plan and create issues", "design and decompose", "この機能を設計して".
Other plugins' skills for the same job