repo-config
Interactively create or fully rewrite `.issues/repo-config.md` by interviewing the user about VCS, issue tracker, and (for GitHub repos) the associated Project V2 board.
- License 许可
- GPL-3.0
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- repo-config
- description
- Interactively create or fully rewrite `.issues/repo-config.md` by interviewing the user about VCS, issue tracker, and (for GitHub repos) the associated Project V2 board.
03 SKILL.md 正文
You are running the /repo-config skill. Your job is to create the
target repo's .issues/repo-config.md from scratch, or to
fully rewrite it when it already exists, by interviewing the user.
Every /issue-* skill reads this file, as does any other skill or
agent that needs the repo's VCS, tracker, branch, or project-board
values, so it must be present and well formed before those flows will
work.
/repo-config does not merge with the existing file or rewrite
parts of it in place. When the file already exists, the user confirms
an overwrite up front in Step 2.5; the final write in Step 5 replaces
the entire file with content built from the user's answers in the
current run. However, the existing file is not discarded before
the interview: its current values are parsed in Step 2 and become the
recommended default for each interview question, so an
accept-everything run reproduces the prior file (plus any fields the
schema has added since). When the file does not exist, the recommended
option for every interview question is the built-in default baked into
this skill. If the user wants the prior file's contents preserved
verbatim, they decline the Step 2.5 overwrite prompt and the file is
left untouched.
Follow the steps below in order. Do not write the file until the user has explicitly approved the proposed content.
Step 1: Pre-flight
Verify you are inside a git working tree by running:
git rev-parse --show-toplevel
If the command fails (non-zero exit, or stderr indicates "not a git repository"), abort with a clear message:
/repo-configmust be run from inside a git repository. The current directory is not a git working tree.
Do not continue past this step on failure.
Treat the path printed by git rev-parse --show-toplevel as the
repo root for the rest of the skill — the skill writes
<repo-root>/.issues/repo-config.md regardless of which
subdirectory of the worktree the user invoked the command from. Do
not string-compare the printed path against the user's current
working directory: git rev-parse --show-toplevel returns a real
path, while the user's cwd may traverse symlinks (for example, on
macOS /tmp resolves to /private/tmp, and project trees frequently
sit under symlinked workspace directories). A naive equality check
would mis-flag a legitimate repo as "not a repo root".
Step 2: Detect existing config
Check whether .issues/repo-config.md already exists in the
target repo (relative to the repo root from Step 1).
/repo-config is a full-rewrite tool: the final write in Step 5
replaces the entire file with content assembled from the user's
answers in this run, and it does not preserve the existing body
verbatim. But the existing file is treated as a source of
recommended defaults for the interview — its current values are
carried over so an accept-everything run reproduces them.
- If it exists: read the file's full contents into memory. Use
the bytes for two purposes:
- Display to the user in Step 2.5 before they decide whether to overwrite.
- Parse for carry-over defaults. Parse the YAML front-matter into
per-field values, and parse whichever tracker-metadata block
the existing file carries (or note a skip marker) for the
downstream per-slot recommendations: the
github-project:block when present, feeding the Step 3b per-slot recommendations, and thejira:block when present, feeding the Step 3c per-slot recommendations. The two are mutually exclusive (selected by theissues:value), so at most one is present; parse the one that is. Each recognized field's parsed value becomes the recommended (first,(Recommended)-suffixed) option for its interview question in Step 3 (and Step 3b or Step 3c). A field present in the file but unrecognized by the current schema is ignored, not surfaced. A field absent or unparseable falls back to the built-in default. Do not validate parsed values against the live project — carry-over is convenience, not authority (see Step 3b).
- If it does not exist: nothing to read; the recommended option for every interview question is the built-in default baked into this skill. Proceed straight to Step 3.
A file whose schema-version is below the current version is
still parsed for carry-over: the version check is a reader concern,
and /repo-config is the writer — it treats any existing file as a
source of defaults regardless of its declared version.
The built-in front-matter defaults (used when the file is absent, or per-field when a field is missing or unparseable) are:
source-control:GitHubissues:GitHubissue-link-prefix:#default-issue-source-branch:maindefault-pr-target-branch:mainissue-branch-naming-prefix:none
schema-version is not in this list — it is a write-time
constant (currently 7) baked into this skill, not an interview
question, and it is never carried over from the existing file. See
skills/lib/repo-config.md for the reader contract that consumes it.
Also, before Step 3, gather the local branch list with
git branch --format='%(refname:short)' so you can offer real
branches as options for the two branch fields.
Step 2.5: Confirm overwrite (existing file only)
This step runs only if the file existed in Step 2. If the file did not exist, skip directly to Step 3.
/repo-config rewrites the entire file from the user's answers in
this run. Before running the interview — which is wasted effort if
the user actually wanted to inspect, not overwrite — confirm intent
with a single overwrite prompt.
- Display the full current contents of
.issues/repo-config.mdto the user — front-matter and body, byte-for-byte as read from disk. Do not paraphrase or summarize; the user is deciding whether to discard the real file. - Ask via
AskUserQuestion: "This will replace.issues/repo-config.mdwith a fresh file built from your answers — continue?" with optionsYesandNo. - On
No: end the skill cleanly. Report that the file was left unchanged at<repo-root>/.issues/repo-config.md. Do not enter the interview. Do not write or edit anything. Skip Steps 3 through 6. - On
Yes: continue into Step 3. Each interview question recommends the value carried over from the existing file (parsed in Step 2) when one is present and parseable, falling back to the built-in default otherwise.
Step 3: Interview
Use the AskUserQuestion tool to interview the user. Ask the six
fields in the order below. Group them into multiple
AskUserQuestion calls as feels natural — the tool allows 1–4
questions per call, and exact grouping is left to your judgment.
For every question:
- The first option must be the recommended value, with its label
suffixed
(Recommended). The recommendation is the value carried over from the existing file (parsed in Step 2) when one is present and parseable for this field; otherwise it is the built-in default for the field as listed below. - Always include an "Other" option so the user can type a custom value.
- Keep option labels short; put any explanation in the question text.
For each field below, "carry-over value" means the value parsed from the existing file in Step 2 for that field, if present and parseable. When a carry-over value exists, recommend it; otherwise recommend the built-in default named in the field's description.
The six fields, in order:
source-control— chooseGitHuborCodeCommit. Recommend the carry-over value; built-in defaultGitHub.issues— chooseGitHuborJira. Recommend the carry-over value; built-in defaultGitHub.issue-link-prefix— the literal string concatenated with the issue number in commit messages and PR bodies. Recommend the carry-over value if present and parseable. Otherwise the recommended value depends on the just-chosen value ofissues(field 2):- If the user picked
GitHubforissues, recommend#(#123is the only sensible GitHub form). - If the user picked
Jiraforissues, do not pre-recommend a value — prompt the user to enter the Jira project key plus a trailing dash via "Other" (e.g.SET-,PROJ-).
- If the user picked
default-issue-source-branch— branch that new issue work branches FROM. Offer the local branches you gathered in Step 2 as options, plus "Other" for any branch name. Recommend the carry-over value if present in the local branch list; else recommendmainif it is present; otherwise present the gathered branches without a recommendation and require the user to pick. (If the carry-over branch is no longer a local branch, still offer it via "Other" — do not validate it against the remote.)default-pr-target-branch— branch that issue PRs target. Same option set as field 4. Recommend the carry-over value if present; else recommend whatever the user just chose fordefault-issue-source-branch(often the same).issue-branch-naming-prefix— branch naming style. Choose one ofnone,initials,name. Recommend the carry-over value; built-in defaultnone.
Do not validate that the chosen branches actually exist on the remote; that is out of scope for this skill.
Step 3b: GitHub Project interview (conditional)
This step runs only when the just-chosen issues value is GitHub.
If issues is Jira, skip this step entirely and run Step 3c
(the Jira interview) instead. If issues is anything other than
GitHub or Jira, skip both Step 3b and Step 3c and proceed to
Step 4. The github-project: block is a GitHub-only concept; the
Jira repo gets the parallel jira: block built in Step 3c.
The purpose of this step is to populate (or intentionally omit) the
github-project: body block defined in skills/lib/issue.md. The
block carries project node IDs, status option IDs, and issue type
IDs so the /issue-* commands can translate human-readable names
into the GraphQL IDs the GitHub API requires.
Because /repo-config is a full-rewrite tool (see Step 2), this
step re-runs auto-discovery against the live project rather than
copying the prior block wholesale. But where the existing file
already recorded a choice — which slot a field maps to, which option
is the default — that prior choice is offered as the recommended
answer (parsed in Step 2), so an accept-everything run reproduces the
block. The carry-over is not live-validated: if the user renamed
a slot or removed an option in the project since the file was last
written, recommending the now-stale value is fine — the user knows
what they are doing and will pick the right answer.
3b.1 — Decide whether to populate
Use AskUserQuestion to ask the user how to handle the
github-project: block. Offer two options:
- Populate — run auto-discovery (Steps 3b.2 – 3b.5) and build the block, using the existing file's parsed values as per-slot recommendations.
- Skip — do not add a block. Write a skip marker instead with a short reason captured via "Other". Skip the rest of Step 3b except 3b.6 (which writes the marker).
Mark the recommended option per the carry-over from Step 2:
- If the existing file had a
github-project:block, recommend Populate. - If the existing file had a skip marker, recommend Skip, and pre-fill the marker's prior reason as the recommended free-text reason (the user can re-enter it verbatim or change it).
- If the file did not exist (or had neither), recommend Populate.
There is no Keep / Update option in this skill: the block is
always rebuilt from this run's answers (seeded by carry-over
recommendations), not copied verbatim. If the user wants the previous
block back byte-for-byte without re-confirming each slot, they should
answer No at the Step 2.5 overwrite prompt and the file stays
untouched.
3b.2 — Pick the owner and project
Every live lookup in Step 3b goes through issues-discover, which this
plugin puts on PATH. It resolves the repository's host, owner and
name from the checkout itself and sends each query to that host, so a
checkout whose origin is on a GitHub Enterprise host is queried
there. Run it from inside the repo's working tree; on a non-zero exit
it prints gh's error, or the missing scope and the host whose token
lacks it, on stderr.
List the projects of the repository's owner, an organization or a user alike:
issues-discover projects
It prints a JSON array of { number, title, id }. Each project's id
is the ProjectV2 node ID (PVT_...), which is the literal value that
goes into project-id.
Show the user the discovered projects with their numbers and titles, plus options:
- One option per discovered project (label:
<number>: <title>). Otherto type a number of one of the owner's projects by hand.Skipto abandon the github-project block. OnSkip, jump to 3b.6 to record the skip marker.
Common failure modes to handle gracefully:
issues-discover projectsexits non-zero or prints an empty array. Surface the error/empty result and offerOther(manual entry) orSkip.- The user picks
Otherand enters a project number. Resolve it withissues-discover project <number>, which prints that board's{ number, title, id }; read.id(and.titlefor the summary).
If the project node ID does not start with PVT_, treat the response
as invalid and let the user retry or skip.
Record:
project-id— thePVT_...node ID.- The numeric project number and title (for the summary in Step 6; these are not written to the file).
3b.3 — Discover fields (per-slot interview)
This step runs the same generic interview once per conceptually-standard
slot. The slot list is hardcoded: status, priority, size. Making
the slot list user-configurable is out of scope — a repo that wants a
different slot (e.g. effort) has no supported path to add one today.
3b.3.a — Enumerate project fields once
Before asking about any slot, enumerate the project's fields a single time and keep the result in memory for the per-slot loop below.
issues-discover fields <project-number>
It prints a JSON array of the fields a slot can be backed by, each
{ id, name, dataType } with options added on a single-select one.
From it, build two lists for the per-slot loop:
- Number fields: every entry with
dataType == "NUMBER". Captureid(PVTF_...) andname. No options. - Single-select fields: every entry with
dataType == "SINGLE_SELECT". Captureid(PVTSSF_...),name, and the fulloptionslist (each{ id, name }). The option IDs are short hex strings, notPVT_*-prefixed node IDs — that is correct for single-select option IDs in ProjectV2.
Enumerate native Issue Fields (for the issue-field kind)
Separately from the project fields above, enumerate the repo's
native GitHub Issue Fields — the preview feature that attaches
ProjectV2-style fields directly to issues, independent of any project
board. These back the kind: issue-field slot (see "Field kinds
(fields.<slot>.kind)" in skills/lib/issue.md). These belong to the
repository, not the project:
issues-discover issue-fields
It prints a JSON array of the native fields a kind: issue-field
slot can be backed by, each { id, name, options }, with an
IFSS_... field id and each option an { id, name } carrying an
IFSSO_... ID. GitHub ships two such native fields today —
Priority (options Urgent / High / Medium / Low), the
priority-slot backing, and Effort (options High / Medium /
Low), the size-slot backing — so both are offered to the matching
slot in the per-slot loop.
An empty array means there are no issue-field options to offer in
the per-slot loop — skip that option. When the script prints one, it
explains why in a note on stderr; pass that note on to the user. Any other
non-zero exit is also non-fatal: proceed without the issue-field
option and note the error to the user.
3b.3.b — Per-slot interview
Carry-over takes precedence over the discovery chains below. When
the existing file (parsed in Step 2) recorded this slot, recommend the
kind it used (number, single-select, issue-field, label, or
skip) by matching it to the corresponding enumerated option — e.g. a
slot the file recorded as single-select with field id X recommends
the enumerated single-select field whose id is X (fall back to
matching by field name if the id is no longer enumerated; if neither
matches, fall through to the discovery chain). Do not live-validate
the carried-over kind against the project — recommending a stale choice
is acceptable per Step 3b's intro. Only when the file recorded nothing
for this slot (or the file did not exist) do the discovery chains
below choose the recommendation.
Run the same four-step procedure once per slot, in this order:
-
status— strongly recommended. Discovery-recommendation chain for which kind to pick (used when there is no carry-over): a single-select field namedStatus(case-insensitive) if exactly one such field is enumerated. -
priority— optional. Discovery-recommendation chain for which kind to pick (used when there is no carry-over), in this order:- A native Issue Field named
Priority(case-insensitive) from the native-field enumeration above — thekind: issue-fieldbacking. If exactly one such single-select native field exists, recommend it. It is preferred over the project fields below because native fields are not tied to a project board (the issue's stated selling point of this kind). - Otherwise a number field named
PriorityorImportance(case-insensitive —Prioritymatches GitHub's native field name;Importanceis kept so boards that still use the older name resolve). If exactly one such field exists, recommend it. - Otherwise a single-select project field with the same name. If exactly one such field exists, recommend it.
- Otherwise no auto-recommendation — present the full option set and let the user pick.
If multiple fields match at the same tier (e.g. both a
Priorityand anImportancenumber field), present all of them as options and let the user pick; do not silently prefer one. - A native Issue Field named
-
size— optional. Discovery-recommendation chain for which kind to pick (used when there is no carry-over), in this order:- A native Issue Field named
EffortorSize(case-insensitive) from the native-field enumeration above — thekind: issue-fieldbacking.Effortis GitHub's native size-analogue field (dataType: SINGLE_SELECT, optionsHigh/Medium/Low), the size-slot counterpart of the nativePriorityfield. If exactly one such single-select native field exists, recommend it; it is preferred over the project fields below because native fields are not tied to a project board. - Otherwise a single-select project field named
SizeorT-Shirt(case-insensitive). If exactly one such field exists, recommend it. - Otherwise a number field with the same name. If exactly one such field exists, recommend it.
- Otherwise recommend
kind: labelwith namespacesize:(the built-in fallback for repos with no project field for size).
If multiple fields match at the same tier (e.g. both
SizeandT-Shirt), present them as options and let the user pick — no auto-recommendation.Note the slot keeps its name (
size) even when backed by the nativeEffortfield — "size" is the clearer term in this tooling, so only a new backing kind is added, not a rename. Whensizeis backed byEffort, the slot's effective options become the native field's own (High/Medium/Low), captured verbatim in Step 3 below — not the t-shirt set. - A native Issue Field named
For every slot, the procedure is:
Step 1 — Show every option the user could pick
Present, in one AskUserQuestion call, the full set of choices for
this slot:
- One option per enumerated number field from 3b.3.a (label:
<name> (number field)). - One option per enumerated single-select field, with its option
list shown inline so the user can see what they would be choosing
(label:
<name> (single-select: opt1, opt2, opt3, ...)). If the inline list would overflow the question UI, truncate with, ...after the first few — the user is selecting the field, not the option, so a partial list is enough to disambiguate. - One option per enumerated native Issue Field (from the
native-field enumeration in 3b.3.a), with its option list shown
inline (label:
<name> (issue field: opt1, opt2, ...)). This kind corresponds tokind: issue-fieldin the rendered block. Offered only when at least one single-select native field was enumerated; most relevant for thepriorityslot (GitHub's nativePriorityfield), but presented for any slot so a repo can back e.g.sizewith a native field too. - One option for labels:
As labels (with namespace prefix)— independent of project fields. This kind corresponds tokind: labelin the rendered block. - One option for skip:
None / skip— slot stays unconfigured and is rendered askind: skip. Perskills/lib/issue.md's "Field kinds (fields.<slot>.kind)" section, an emittedkind: skipand a slot-absent entry are intentionally equivalent in verb behavior; the wizard always emitskind: skipfor visibility. The slot-absent path only occurs when the user never reached the per-slot interview at all (e.g. they choseSkipat the block level in Step 3b.1).
Mark the recommended choice with (Recommended) in its label — the
carried-over kind if the file recorded one for this slot, else per the
discovery chain above. For status, when there is no carry-over and
no Status-named single-select field exists, fall back to
recommending the first single-select field, then None / skip as a
last resort — status is strongly recommended but not enforced.
Step 2 — Ask the user which to use
Use the option set from Step 1 directly. There is no slot-specific override; the user picks one of the enumerated kinds.
Step 3 — Follow up based on the user's pick
Dispatch on the chosen kind:
In every case below, when the existing file (parsed in Step 2)
recorded this slot with the same kind the user just picked,
recommend that slot's carried-over values for the follow-up prompts
(default, min, max, namespace, option list). Carry-over is not
live-validated. When there is no carry-over for the slot, or the user
picked a different kind than the file recorded, use the per-kind
recommendation noted below.
-
Number field (
kind: number):- Capture the field
id(PVTF_...) from the enumeration. - Ask for
min(an integer). Recommend the carried-overminif present; otherwise no built-in recommendation — the user owns the range. - Ask for
max(an integer, at leastmin). Recommend the carried-overmaxif present; otherwise no built-in recommendation — the user owns the range. - Ask for
default(an integer withinmin/max). Recommend the carried-overdefaultif present; otherwise no built-in recommendation — the user owns the value.
- Capture the field
-
Single-select field (
kind: single-select):- Capture the field
id(PVTSSF_...) and the full option name→id map from the enumeration. - Ask which option should be the default for new issues.
Recommend the carried-over
defaultoption if present in the enumerated option list; otherwise use the slot-aware chain (see "Default-option recommendation (single-select, issue-field, label)" below). - Always include an
Otherchoice to free-type one of the enumerated option names.
- Capture the field
-
Native Issue Field (
kind: issue-field):- Capture the native field's node
id(IFSS_...) underfield-id:, itsnameunderfield-name:,data-type: single-select, and the full option name→id map (optionIFSSO_...IDs) from the native-field enumeration in 3b.3.a. - Ask which option should be the default for new issues.
Recommend the carried-over
defaultoption if present in the enumerated option list; otherwise use the slot-aware chain (see "Default-option recommendation (single-select, issue-field, label)" below). For GitHub's nativePriorityfield the options areUrgent,High,Medium,Low; for the nativeEffortfield — thesize-slot backing — they areHigh,Medium,Low. Always include anOtherchoice to free-type one of the enumerated option names. - This kind is single-select-only for now; the other native data-types (date, number, text, multi-select) are out of scope.
- Capture the native field's node
-
Labels (
kind: label):- Ask for the namespace prefix. Recommend the carried-over
namespaceif present; otherwise<slot>:(e.g.size:for thesizeslot). Free-text viaOtherfor any other value; trailing colon is conventional but not enforced by the wizard. - Ask for the option list as a comma-separated string (e.g.
XS, S, M, L, XL). Recommend the carried-over option list if present; otherwise no built-in recommendation — the user owns the list. Split on commas, trim whitespace from each entry; reject empty entries. - Ask for the default option (must be one of the entered
options, case-insensitive match against the list). Recommend the
carried-over
defaultif present in the entered list; otherwise use the slot-aware chain (see "Default-option recommendation (single-select, issue-field, label)" below). - No field
idis captured — labels are not project fields and the label name is its own identifier.
- Ask for the namespace prefix. Recommend the carried-over
-
Skip (
kind: skip):- Nothing to capture beyond
kind: skip. The slot is explicitly declared as unused. - For the
statusslot specifically,Skipis allowed but discouraged — surface a brief note to the user that/issue-set-statusand the--statusflag will warn-and-skip, then accept the user's choice without re-prompting.
- Nothing to capture beyond
Default-option recommendation (single-select, issue-field, label)
When no carried-over default is available, the wizard recommends a
default by this slot-aware chain. This is only the recommended
prompt value — the user owns the final choice — but the recommendation
should be sensible rather than blindly the first YAML option, because
an option set whose YAML order runs most-work-first (e.g. the native
Effort field's High, Medium, Low) would otherwise default a
size slot to its most-work option.
statusslot:Backlogif present (case-insensitive), otherwise the first option in the list. (Status options have no magnitude; first-in-list is the natural "new issue" state.)sizeslot: the least-work option along the slot's magnitude order (least-work → most-work), not the first YAML option. Establish the magnitude order from the option semantics exactly as the size heuristic does (see "The option set is the slot's own, not a fixed t-shirt set" inskills/issue-create/SKILL.md): for the t-shirt setXS, S, M, L, XLthe YAML order already runs least-work-first, so the least-work option isXS(the first entry); for the nativeEffortfieldHigh, Medium, Lowthe magnitude order is the reverse, so the least-work option isLow(the last entry), notHigh. Recommending the middle option (M/Medium) is an acceptable alternative when a least-work default would skew new issues too small — what must be avoided is defaultingsizeto the most-work option.- Any other slot (e.g.
priority): the first option in the list. Priority option sets are conventionally authored most-important-first (P0,P1, …;Urgent,High, …) and the first entry is the intended high-salience default, so this preserves the existing priority-slot behavior.
Step 4 — Defer rendering to 3b.5
Hold the captured per-slot state in memory. Step 3b.5 assembles all slots into the final YAML block once the loop finishes; do not write or edit the file from inside this loop.
3b.4 — Discover issue types
GitHub Issue Types are an org-level (and now repo-scoped) enum:
issues-discover issue-types
It prints a JSON array of the repository's enabled issue types, each
{ id, name }. Each one contributes <Name>: <id> to the
issue-types: map (preserve the capitalization GitHub returns).
If it prints an empty array (older repos without issue types enabled), ask the user whether to:
Skip issue-types— omit theissue-types:sub-block entirely.Other— manually enterName: IT_...pairs.
A non-zero exit is non-fatal too: note its stderr to the user, then offer the same two choices as for an empty array.
Ask the user which type should be the default. Recommend the
carried-over issue-types.default (parsed in Step 2) if present in
the enumerated list; otherwise, in order: Feature (if present,
case-insensitive), then the first type in the list. Include Other
for free-type.
3b.5 — Assemble the proposed block
From the captured per-slot state in 3b.3.b and the issue-types map in
3b.4, render the YAML block that will be written to the file. Use the
exact indentation and key order shown below (matching the schema in
skills/lib/issue.md). Every populated slot under fields: carries
its kind: discriminator (number, single-select, issue-field,
label, or skip) — there is no implicit default and no
backwards-compat shim for the old type: shape.
The renderer is purely a function of the captured state — it never invents defaults or substitutes built-in fallbacks for kind-specific keys. Every key in the rendered block traces back to a value the user either supplied directly (via "Other") or selected from an enumerated option in 3b.3.b or 3b.4.
Per-kind render shapes
For each populated slot, emit one of the following shapes based on the
slot's captured kind:
-
kind: number— emitkind,id,default,min,max:<slot-name>: kind: number id: <field-id> default: <number> min: <number> max: <number> -
kind: single-select— emitkind,id,default, and the option name→id map:<slot-name>: kind: single-select id: <field-id> default: <option-name> options: <Option Name>: <option-id> ... -
kind: issue-field— emitkind,data-type,field-id,field-name,default, and the option name→id map. The IDs are native-field IDs (IFSS_...for the field,IFSSO_...for each option), not project field/option IDs:<slot-name>: kind: issue-field data-type: single-select field-id: <IFSS_...> field-name: <Field Name> default: <option-name> options: <Option Name>: <IFSSO_...> ... -
kind: label— emitkind,namespace,default, and the flat option list. Noid(labels are not project fields). Thenamespacevalue is double-quoted because trailing-colon strings likesize:would otherwise be interpreted as a YAML mapping key:<slot-name>: kind: label namespace: "<namespace>" default: <option-name> options: [<opt1>, <opt2>, ...] -
kind: skip— emitkind: skipand nothing else:<slot-name>: kind: skip
Full-block shape
The assembled block looks like:
github-project:
project-id: <project-id>
fields:
status:
<per-kind shape from above>
priority:
<per-kind shape from above>
size:
<per-kind shape from above>
issue-types:
default: <Type Name>
<Type Name>: <type-id>
...
Slot order under fields: is fixed: status, then priority,
then size. Because /repo-config is a full-rewrite tool, a run
always emits exactly what that run's auto-discovery produced — the
file is never edited outside a /repo-config run, so it never
carries a slot (e.g. effort) the wizard didn't itself write.
Conditional rendering rules
-
A populated slot with
kind: skipis still emitted underfields:— it is the user's explicit declaration that the slot is unused, which/issue-*verbs treat as equivalent to slot-absent but more visible. Only omit a slot entirely if the user never reached the per-slot interview (e.g. the user aborted out of Step 3b before the loop covered that slot). -
If all slots are emitted as
kind: skipor were never reached, omit thefields:key entirely — the block is still valid without it. -
Omit
issue-typesentirely if issue types were skipped or the repo has none enabled. -
Preserve the case-sensitive option and type names from the GitHub API verbatim — they are the canonical keys the
/issue-*commands match against. -
If any option or type name contains consecutive spaces, or starts with a YAML-special character — any of these:
? : - & * ! [ { , > | % @ ` " '— quote the key with double quotes to keep the YAML well-formed. The common case (single-word or space-separated names like
In Progress) is fine unquoted, matching the example inskills/lib/issue.md. The same quoting rule applies to label options inside thekind: labelflat-list shape: if any option contains a YAML-special character or consecutive spaces, quote that individual entry with double quotes inside the[...]list.
3b.6 — Skip marker (when the user chose to skip)
When the user chose Skip in 3b.1, do not write a github-project:
block. Instead, plan to write a single-line HTML comment of the
exact form:
<!-- github-project: intentionally omitted; <reason>. -->
Place the comment where the block would have gone (see Step 5's compose order). Use the reason captured from the user (free-text trimmed to a single line, period appended if missing). When the existing file (parsed in Step 2) already had a skip marker, its prior reason is the recommended default for this free-text prompt per 3b.1, so an accept-everything run reproduces the marker.
The skip marker documents the deliberate omission so anyone reading the file later knows it was a choice, not an oversight.
Step 3c: Jira interview (conditional)
This step runs only when the just-chosen issues value is Jira.
If issues is GitHub, Step 3b ran instead and this step is skipped.
If issues is anything else, both are skipped.
The purpose of this step is to populate (or intentionally omit) the
jira: body block defined in skills/lib/repo-config.md ("jira:
block") and the /issues-jira:jira-lib skill. The block carries the Jira project
key plus the status / priority / size slot maps and issue-type map
so the /issue-* commands (delivered in #9) can translate
human-readable names into the identifiers acli consumes. It is the
Jira analogue of the Step 3b github-project: interview, run through
acli instead of gh.
All discovery here uses the acli command templates in
the /issues-jira:jira-lib skill — read that file's "Discovery
primitives (for /repo-config)" section for the exact command shapes
and their version caveat. Do not invent acli flags inline;
reference the library.
3c.0 — Preflight: acli and auth
- Detect
acli. Runcommand -v acli. If it is not onPATH, do not install it (host modification — forbidden). Surface a message thatacliis required for the Jira interview and point the user at Atlassian's install docs, then offer to Skip thejira:block (jump to 3c.5 to record a skip marker) so the rest of the file can still be written. - Check auth. Run
acli jira auth status. If unauthenticated or the session is expired, runacli jira auth login --weband wait for the user to complete the browser/SSO flow (a credential-prompting command, allowed per~/.claude/rules/credential-surfaces.md). On an auth failure that--weblogin does not resolve, stop and report — never introspect the user's Atlassian credential state. See the/issues-jira:jira-libskill "Auth expectation and failure surface".
3c.1 — Decide whether to populate
Use AskUserQuestion to ask how to handle the jira: block. Offer:
- Populate — run discovery (3c.2 – 3c.4) and build the block,
using the existing file's parsed
jira:values (if any) as per-slot recommendations. - Skip — write a skip marker instead, with a short reason captured via "Other". Skip the rest of Step 3c except 3c.5.
Recommend Populate when the existing file had a jira: block (or
no metadata block at all); recommend Skip when the existing file
had a jira: skip marker, pre-filling its prior reason. The carry-over
is not live-validated — recommending a stale value is fine.
3c.2 — Pick the project
List the projects visible to the authenticated user:
acli jira project list --json
Show the user the discovered projects (key + name), plus Other to
type a project key by hand and Skip (jump to 3c.5). Record the
chosen project key (e.g. SET) as project-key. Confirm the key
matches the issue-link-prefix chosen in Step 3 (e.g. key SET ↔
prefix SET-); if they disagree, note the mismatch to the user but do
not auto-correct — the front-matter answer stands.
3c.3 — Per-slot interview (status, priority, size)
Run the same generic interview once per conceptually-standard slot, in
this order: status, priority, size. The slot list is hardcoded
(matching Step 3b) — making it user-configurable is out of scope, so
a repo wanting a different slot has no supported path to add one
today.
Carry-over takes precedence over discovery. When the existing file recorded a slot, recommend the kind and values it used. Otherwise use the discovery + per-slot defaults below. Carry-over is not live-validated.
Discover the project's metadata once, up front, via the
the /issues-jira:jira-lib skill "Discovery primitives (for
/repo-config)" templates:
- Issue types — from
acli jira project view --key <KEY> --json, falling back toacli jira workitem create --project <KEY> --generate-json(which enumerates valid types and fields). - Statuses — from a representative work item
(
acli jira workitem search --jql "project = <KEY>" --json, thenacli jira workitem view <KEY-N> --json— the key is positional;workitem viewhas no--keyflag); confirm/extend the status names with the user. - Custom fields — from the
--generate-jsoncreate template, which lists fields keyed bycustomfield_NNNNNwith display names.
For each slot, present (via AskUserQuestion) the kinds the slot can
take, mark the recommended one, and follow up on the pick:
status— recommendkind: status. Capture the statusoptions:as a name→name map from the discovered status names; ask which is the default (recommendBacklogif present, else the first).Skipis allowed but discouraged (warn that/issue-set-statuswill warn-and-skip).priority— offerkind: custom-field(recommend when a custom field namedPriority/Importance/Severityis discovered, capturing itsfield-id:and its allowed-value names as a name→nameoptions:map),kind: label, orkind: skip. Ask for the default option.size— offerkind: custom-field(when aSize/T-Shirtfield is discovered),kind: label(recommend, with namespacesize:and a user-entered option list, matching the GitHub size fallback), orkind: skip. Ask for the default option.
Hold each slot's captured state in memory for 3c.4's render. For
kind: label, ask for the namespace (recommend <slot>:) and a
comma-separated option list exactly as Step 3b.3 does.
3c.4 — Issue types and assemble the block
From the discovered (and user-confirmed) issue types, build the
issue-types: name→name map and ask which is the default
(recommend Task if present, else the first). If the project exposes
no enumerable types, offer to skip the issue-types: sub-block or let
the user enter names via Other.
Assemble the jira: block from the captured per-slot state and the
issue-types map, using the exact shapes in the
skills/lib/repo-config.md "jira: block" schema:
jira:
project-key: <KEY>
fields:
status:
kind: status
default: <name>
options:
<Name>: <Name>
...
priority:
<per-kind shape: custom-field | label | skip>
size:
<per-kind shape: custom-field | label | skip>
issue-types:
default: <Type Name>
<Type Name>: <Type Name>
...
Per-kind render shapes:
kind: status— emitkind,default, and the name→nameoptions:map.kind: custom-field— emitkind,field-id:(customfield_NNNNN),default, and the name→nameoptions:map.kind: label— emitkind,namespace(double-quoted),default, and the flatoptions:list — identical to Step 3b's label shape.kind: skip— emitkind: skipand nothing else.
The same conditional-rendering, YAML-quoting, and slot-order rules
from Step 3b.5 apply: slot order is fixed (status, priority,
size); a slot the user skipped is emitted as kind: skip; quote any
option/type key that contains consecutive spaces or a YAML-special
character. The renderer is purely a function of the captured state —
it never invents identifiers.
3c.5 — Skip marker (when the user chose to skip)
When the user chose Skip in 3c.1 (or acli was unavailable in
3c.0), do not write a jira: block. Instead, plan to write a
single-line HTML comment of the exact form:
<!-- jira: intentionally omitted; <reason>. -->
Place the comment where the block would have gone (Step 5 compose
order). Use the reason captured from the user. When the existing file
already had a jira: skip marker, its prior reason is the recommended
free-text default per 3c.1, so an accept-everything run reproduces the
marker.
Step 4: Show the proposed file and wait for approval
Render the full file that will be written, exactly as it will appear on disk. This applies equally to the new-file case and the overwrite case — there is no diff path, because Step 5 always performs a full-file write rather than an in-place region edit. (The existing file's values may have been carried over as recommended defaults during the interview, but the write itself replaces the file in full.)
Compose the preview in the same order Step 5 will write it:
-
The resolved YAML front-matter (the canonical seven-key block):
--- schema-version: 7 source-control: <value> issues: <value> issue-link-prefix: "<value>" default-issue-source-branch: <value> default-pr-target-branch: <value> issue-branch-naming-prefix: <value> ---Notes:
schema-versionis always the first key and always7in files this skill writes. It is a constant baked into the writer, not an interview question — seeskills/lib/repo-config.mdfor how readers consume it. When the schema bumps, update this skill's constant and the library'sSCHEMA_VERSION. Readers pin a minimum required version and accept any file at that version or newer (bumps are additive by construction), so a reader's pin is bumped only when that reader needs to consume a newly-added field — there is no lockstep requirement.issue-link-prefixis always quoted because values like#are otherwise interpreted as a YAML comment.
-
A blank line.
-
The tracker-metadata block, selected by
issues:- GitHub — if Step 3b produced a
github-project:block (user chosePopulate): the rendered block from 3b.5, followed by a blank line. If Step 3b produced a skip marker (user choseSkip): the single-line HTML comment from 3b.6, followed by a blank line. - Jira — if Step 3c produced a
jira:block (user chosePopulate): the rendered block from 3c.4, followed by a blank line. If Step 3c produced a skip marker (user choseSkip, oracliwas unavailable): the single-line HTML comment from 3c.5, followed by a blank line. - Neither ran (some other
issuesvalue): no extra content here.
- GitHub — if Step 3b produced a
-
The canonical body template (the same
# Repo Config... body used in Step 5).
Then ask explicitly for approval, e.g.:
Write
.issues/repo-config.mdwith the content above? (y to proceed, or tell me what to change)
Wait for explicit approval (y, yes, go, do it, etc.) before
moving to Step 5. If the user asks for changes, loop back to Step
3, Step 3b, or Step 3c as appropriate, then re-render the full file
in this step.
Step 5: Write the file
The repo-config-write script, which this plugin puts on PATH,
writes the file; you never write .issues/repo-config.md yourself.
Write the approved content from Step 4 to a draft file under
.claude/tmp/, then run the script with the Bash tool from inside the
repo's working tree:
repo-config-write <draft-path>
The script applies the validity checks the issue verbs apply when
they read the file — among them that a kind: number slot's min, max and
default are integers with min at most max, and that every slot's
default is a value the slot accepts — and refuses a draft that fails
one, leaving any existing file untouched. Otherwise it replaces
<repo-root>/.issues/repo-config.md whole with the draft's bytes,
creating .issues/ when it is missing. On a non-zero exit, relay its
stderr verbatim, loop back to the interview step that owns the value
it names, and show the corrected file in Step 4 again before retrying.
This applies whether the file existed before or not — /repo-config
is a full-rewrite tool, and the user already saw the full proposed
contents in Step 4 before approving.
Do not use Edit for in-place region rewrites. Do not copy any bytes
verbatim from the previous file. The new file's content is determined
entirely by the user's answers in this run plus the canonical body
template below — even though those answers may have been seeded by
values carried over from the previous file as recommended defaults
(Step 2). The carry-over influences the interview, not the write
mechanism: the write always emits a fresh full file.
Compose the draft in this order:
- The resolved YAML front-matter (the canonical seven-key block
from Step 4 —
schema-version: 7followed by the six user-resolved fields, in that exact order). - A blank line.
- The tracker-metadata block, selected by
issues:- GitHub — if Step 3b produced a resolved
github-project:block: that block exactly as rendered in 3b.5, followed by a blank line. If Step 3b produced a skip marker: the single-line HTML comment from 3b.6, followed by a blank line. - Jira — if Step 3c produced a resolved
jira:block: that block exactly as rendered in 3c.4, followed by a blank line. If Step 3c produced a skip marker: the single-line HTML comment from 3c.5, followed by a blank line. - Neither ran (some other
issuesvalue): no extra content here.
- GitHub — if Step 3b produced a resolved
- The canonical body template (below), starting with
# Repo Config.
The canonical body template (body only — front-matter and any tracker-metadata content are composed in steps 1-3 above):
# Repo Config
Never hand-edit this file — re-run `/repo-config`.
Verification
After the script exits zero, re-read the file with Read and
confirm:
- The front-matter parses as YAML and contains exactly the seven
canonical keys:
schema-version: 7(first) followed by the six fields with the values the user approved in Step 4. - If Step 3b produced a
github-project:block (GitHub) or Step 3c produced ajira:block (Jira), the block appears at column 0 and parses as YAML; it terminates at a column-0 non-blank line (heading or next top-level key) asskills/lib/issue.md/skills/lib/repo-config.mdexpect. - The canonical body template is present below the front-matter (and below the tracker-metadata block, if any).
If verification fails, surface the discrepancy to the user and stop
— do not attempt a corrective second write. The user should re-run
/repo-config after manually resolving the inconsistency.
Step 6: Summarize
After the file is written, report back:
- The absolute path written.
- The final resolved values for all six front-matter fields.
- The tracker-metadata outcome — for the block matching
issues(github-project:on GitHub,jira:on Jira), one of:populated(GitHub: project title/number, count of status options, count of issue types; Jira: project key, count of status options, count of issue types).skipped(no block present; skip marker written with reason).not applicable(issuesis neitherGitHubnorJira, so no tracker-metadata block applies).
- Whether the prior file (if any) was replaced. If the user declined the Step 2.5 overwrite prompt, this step is not reached — the skill exits in Step 2.5 with a "left unchanged" message.
- Next step: the flows that read this file can now run in this repo.
Hard constraints
- Never write the file without explicit approval in Step 4.
- Never overwrite an existing file without the Step 2.5 confirmation. If the user declines, exit cleanly and leave the file untouched.
- Carry values forward as recommended defaults, not as authority. When the file exists, each interview question recommends the value parsed from the prior file (Step 2), falling back to the built-in default when a field is absent or unparseable. The user can always override. Never live-validate a carried-over value against the project (Step 3b), and never copy the prior file's bytes verbatim into the new file — the carry-over feeds the interview, the write is always a fresh full file built from this run's answers.
- Never edit anything outside the target repo. The skill writes
one draft under
.claude/tmp/, and throughrepo-config-writeone file:<repo-root>/.issues/repo-config.md. - Never run destructive git commands. This skill does not commit, push, branch, reset, or otherwise change git state. The user commits the new file themselves.
- Always go through
repo-config-write, neverWriteorEditon.issues/repo-config.md: the script is what refuses a file the issue verbs would reject, and it replaces the file in full. - Do not validate remote branch existence — out of scope.
- Run the tracker-matching interview, never both. Step 3b
(
github-project:) runs only underissues: GitHub; Step 3c (jira:) runs only underissues: Jira. The two blocks are mutually exclusive — never prompt for or emit agithub-project:block on a Jira repo, or ajira:block on a GitHub repo. Under any otherissuesvalue, skip both. - Never invent project IDs, field IDs, option IDs, issue type IDs,
Jira project keys, custom-field ids, status names, or type names.
All identifiers written to the
github-project:block must come from a liveissues-discoverlookup in Step 3b, and all identifiers written to thejira:block must come from a liveacliquery in Step 3c (or, in either case, with explicit user override viaOther, from values the user typed in). Do not copy identifiers from the schema examples in this file,skills/lib/issue.md, or the/issues-jira:jira-libskill — those are illustrative placeholders. - Never install
aclior introspect Jira credential state. Ifacliis missing in Step 3c, report and offer to skip — do not install it (host modification). On anacliauth failure, runacli jira auth login --webonce and wait; never read or manipulate the user's Atlassian token cache. See the/issues-jira:jira-libskill "Auth expectation and failure surface".
04 同仓库更多 Skills
mask-inappropriate-language
Replace inappropriate language (profanity, slurs, strong insults) in provided text or a file with asterisks, character-for-character, preserving everything else.
theorem-agents-interface
The interface between the sdlc reviewer and the theorem agents it spawns — what each double-dash brief parameter means, and what each consequence class means. Preloaded into every theorem agent (sdlc:theorem-generator, the disprover, and the verifier) via its skills frontmatter, and read by name by the sdlc:theorem-based-pr-reviewer agent for what its briefs' parameters mean; not invoked from the user's slash menu.
sdlc-config-user
Interactively create or merge-update the repo user sdlc config, `<repo-root>/.sdlc/user-config.yml` (tier 3 — this user, this repo, never committed), and add it to the repo's tracked `.gitignore`.
sdlc-config-repo
Interactively create or merge-update the shared repo sdlc config, `<repo-root>/.sdlc/repo-config.yml` (tier 2 — tracked, every user of this repo).
sdlc-config-global
Interactively create or merge-update the global user sdlc config, `$XDG_CONFIG_HOME/sdlc/user-config.yml` (tier 1 — this user, every repo on this machine).
pr-read-cli-interface
The contract for sdlc's PR-read CLIs — sdlc-pr-round, sdlc-pr-adjustments, sdlc-fixer-brief and sdlc-records-chain — their arguments, exit codes and output grammar. Preloaded into sdlc:theorem-based-pr-reviewer, sdlc:issue-fixer, sdlc:docs-writer and sdlc:pr-finalizer via their skills frontmatter; not invoked from the user's slash menu.