Installation

Install as Agent Plugin Recommended
copilot plugin marketplace add samueltauil/skills-hub
copilot plugin install scout-issue@skills-hub

Works with GitHub Copilot CLI and VS Code (enable chat.plugins.enabled). Plugin scout-issue v1.0.0 follows the Agent Plugins spec.

Install with the gh extension
gh skills-hub install scout-issue

Don't have the extension? Run gh extension install samueltauil/skills-hub first.

Download and extract to your repository:

.github/skills/scout-issue/

Extract the ZIP to .github/skills/ in your repo. The folder name must match scout-issue for Copilot to auto-discover it.

Skill Files (17)

LICENSE 11.0 KB
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to the Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by the Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding any notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. Please also get an
      in-depth understanding of the license from
      http://www.apache.org/foundation/license-faq.html

   Copyright 2026 Shaurya Gangrade

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
SKILL.md 10.1 KB
---
name: scout-issue
description: "Use when a developer wants to find the best GitHub issues to contribute to in a repository. Invoke with /scout-issue or ask to find good first issues, beginner-friendly issues, or open source work. Asks about experience level, technical skills, time, and contribution type, then searches GitHub issues, scores them, and presents ranked recommendations with match analysis."
---

# Issue Scout - /scout-issue Command

Run this four-phase pipeline when the user invokes `/scout-issue` or asks for
help finding issues to contribute to. This skill is read-only by default:
inspect issues and code, but never modify issues unless the user explicitly
asks.

## Bundled Resources

- `references/interview.md` — intake questions, prioritization, and the internal specification format
- `references/scoring-rubric.md` — scoring dimensions, adaptive weights, and confidence levels
- `references/workflow.md` — end-to-end workflow, decision points, and edge cases
- `references/tool-patterns.md` — GitHub CLI, REST, and git command patterns
- `references/investigation-templates.md` — deep-investigation and implementation-plan output templates
- `references/recovery.md` — cancellation, missing tools, rate limits, and fallbacks
- `references/quick-reference.md` — condensed command and output reference
- `examples/` — worked scenarios, including `copilot-run.md`, a run against real issues
- `scripts/validate-skill.sh` — local consistency check for this skill

Read the relevant reference when a phase needs more detail than this file provides.

## Command Detection

**Trigger:** The user invokes `/scout-issue`, or asks for help finding issues to
contribute to (for example, "find me a beginner-friendly issue I could finish
this weekend").

**Detection:** Parse user input for `/scout-issue` anywhere in the message, or
recognize a request to discover and rank contribution opportunities. If
detected, activate this pipeline instead of normal chat.

**Examples:**
- `/scout-issue`
- `/scout-issue rust`
- `/scout-issue beginner-friendly`
- `Find a beginner-friendly Rust issue I could finish this weekend`

**Note:** If the user types `/scout-issue` again during the process, restart
from Phase 1. If they type `/cancel`, abort the pipeline.

## Pipeline Flow

```
/scout-issue invoked
    ↓
Phase 1: User Interrogation
    ↓
Phase 2: Issue Detection
    ↓
Phase 3: Issue Analysis & Ranking
    ↓
Phase 4: Output Formatting
    ↓
Display to User
```

---

## Phase 1: User Interrogation

**Goal:** Build an internal specification: experience, languages, available
time, contribution type, difficulty, and special requirements.

Ask the six questions in `references/interview.md`, in a single message when the
client supports it. Skip any question the user already answered, and do not
re-ask after a clarification. If the user gives no special requirements, do not
filter on assignment or linked-PR status.

**Output:**
```
Experience: [level]
Languages: [list]
Scope: [time estimate]
Type: [contribution type]
Difficulty: [level]
Special: [requirements]
```

---

## Phase 2: Issue Detection

**Goal:** Find candidate issues with GitHub CLI/REST and git.

### Step 1: Inspect Repository

```bash
repo=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
gh repo view --json name,primaryLanguage,languages
cat CONTRIBUTING.md 2>/dev/null || echo "No CONTRIBUTING.md"
git log --oneline -10
ls -la
```

### Step 2: List Candidate Issues

```bash
# Issue-only total. open_issues_count also counts open pull requests, so it
# overstates the search population.
gh api "search/issues?q=repo:$repo+is:issue+is:open&per_page=1" --jq '.total_count'

# Newest 100 open issues. gh issue list excludes pull requests.
gh issue list --state open --limit 100

# Page beyond 100 with REST. --paginate follows the API's pagination links
# before jq runs, so filtering pull requests cannot cut pagination short. The
# issues endpoint includes pull requests, so drop entries that have a
# pull_request field.
gh api "repos/$repo/issues?state=open&per_page=100" --paginate \
  --jq '.[] | select(.pull_request == null) | .number'

# Filter by label when the user named a language, type, or difficulty hint
gh issue list --state open --label "bug" --limit 50
gh issue list --state open --label "good first issue" --limit 50
```

> **Note:** `gh issue list` and `gh search issues` have no `--page` flag. Use the
> REST issues endpoint with `--paginate` to walk every page, and always filter
> out entries with a non-null `pull_request` field. `gh search issues --repo
> "$repo" --limit N` can raise the search ceiling without pagination; `--repo`
> is required to keep results repository-scoped.

### Step 3: Initial Filtering

Only apply filters that match the user's explicit preferences.

Remove issues that:
- Are assigned, **only** when special requirements include "No active PRs
  (unclaimed work only)".
- Are clearly outside the user's stated skill set.

Keep these for Phase 3 as weighted evidence, not automatic rejection:
- Issues with linked PRs (an **open** linked PR is competing work; closed or
  reverted PRs are evidence only).
- Inactive issues (no activity for 6+ months) unless there is evidence of
  obsolescence or the user set a recency constraint.

**Output:** Candidate issue numbers (typically 20-50).

---

## Phase 3: Issue Analysis & Ranking

> The `good first issue` label is a candidate-hunting hint only. Verify difficulty
> from the issue body, comments, and surrounding code before scoring.

**Goal:** Apply eligibility gates, score candidates, and rank them.

For each candidate:
```bash
gh issue view ISSUE_NUM
gh issue view ISSUE_NUM --comments
gh api "repos/$repo/issues/ISSUE_NUM/timeline" --paginate --jq '[.[] | select(.event == "cross-referenced") | select(.source.issue.pull_request != null) | select(.source.issue.state == "open") | .source.issue.number]'
rg "relevant_function" src/
find . -name "*test*" -type f | head -5
```

**Eligibility gates (all must pass before scoring):**
- The issue is open and still matches the user's hard constraints.
- When the user requested unclaimed work, the issue is unassigned and has no
  open linked PR.
- Evidence comes from the issue body, comments, code, and tests — never from the
  title alone.
- The proposed work is actionable: a location or subsystem can be identified, or
  the missing information is called out as a risk.

**Score each eligible issue 0-100 on:** User Fit, Technical Fit, Scope Fit,
Difficulty Fit, Issue Quality, Activity, Contribution Feasibility, and Evidence
Quality.

Use the default weights (User Fit 20%, Technical Fit 15%, Scope Fit 20%,
Difficulty Fit 15%, Issue Quality 10%, Activity 5%, Contribution Feasibility
10%, Evidence Quality 5%), or the adapted weights in
`references/scoring-rubric.md`. Rank by weighted score and keep the evidence
behind each score.

**Output:** Top 5-10 issues with scores and analysis.

---

## Phase 4: Output Formatting

**Goal:** Present a ranked shortlist that a developer can act on.

**Output contract:** Top 5 maximum. For each issue show the overall match score
out of 100, difficulty level, estimated scope, confidence level, a brief note on
verification gaps, short evidence bullets, and short concerns bullets. End with
a single "best match" recommendation. Use emojis for visual clarity.

Use the template in `references/quick-reference.md` ("Output Format"). Mention
the issue-only candidate pool size and any issues excluded for competing PRs,
assignments, or hard constraints.

**Rules:**
- Show top 5 issues maximum.
- Explain why each issue matches and note concerns.
- Separate evidence from inference; never claim an issue "will definitely be
  accepted" or is "guaranteed to work".
- Never skip eligibility or evidence checks for a quick-scan shortcut.

---

## Investigation Mode

**Trigger:** User says "Investigate #[NUMBER]"

**Action:** Produce the deep-investigation brief in
`references/investigation-templates.md`. Include the problem, why it matches,
relevant code and tests, related PRs/commits, implementation scope, potential
difficulties, maintainer expectations, effort estimate, first steps, and
confidence.

End with: `Want me to create an implementation plan? Say: "Plan this issue".`

---

## Implementation Planning

**Trigger:** User says "Plan this issue" or "How should I approach this?"

**Action:** Produce the implementation plan in
`references/investigation-templates.md`. Separate verified facts from likely
implementation and open questions, and include files to modify, testing
approach, potential challenges, time estimate, and confidence.

End with: `Ready to start? Say: "Start working on this".`

---

## Evidence Rules

- **Evidence:** what was observed — issue text, comment, code, test, timeline, or
  assignment.
- **Inference:** what you conclude — likely actionable, likely accepted.
- Use: likely, appears, suggests, uncertain, insufficient evidence.
- Never: "will definitely be accepted", "guaranteed to work".
- Record the source for every claim; call out gaps instead of filling them.

---

## Error Handling

- **Cancel:** on `/cancel`, stop immediately and return to normal chat.
- **Restart:** on `/scout-issue` again, discard progress and restart Phase 1.
- **Missing tools, auth failures, rate limits:** explain the limitation and use
  the fallbacks in `references/recovery.md`.
- **No issues found:** explain which constraints are binding and offer to relax
  them.

---

## Important Rules

1. Never rank by title match alone.
2. Never trust `good first issue` or `help-wanted` labels without checking the
   issue and surrounding code.
3. Never assume active from open status, or abandoned from age.
4. Always check for open linked PRs before recommending unclaimed work.
5. Always check code and tests when difficulty or feasibility matters.
6. Explain recommendations and rejections.
7. Separate evidence from inference; never invent facts.
8. Fewer, better recommendations beat many weak ones.
9. Read-only by default; never modify issues unless explicitly asked.
10. Handle cancellation and restart at any point.

---

## Portability

Works with any AI CLI that provides shell access, git, and optional GitHub CLI.
If `gh` is unavailable, use the git and web fallbacks in `references/recovery.md`
and state what could not be checked.
examples/
copilot-run.md 4.4 KB
# Copilot Run: Real Issues in `cli/cli`

Captured on 2026-11-06 against `github/cli` (`cli/cli`). This is a condensed
run, not a synthetic scenario. The user was an intermediate Go contributor
looking for a bug fix they could finish in a weekend and explicitly requested
unclaimed work only (no open competing PR).

## Candidate Pool

- Issue-only search count: **1,057 open issues**. The repository
  `open_issues_count` was not used because it also counts open pull requests.
- Read the newest 100 open issues with `gh issue list --state open --limit 100`.
- Added repository-scoped label and text searches for `bug`, `gh-issue`,
  `gh-auth`, and `gh-pr` so older issues were not excluded by recency.
- Those passes left seven candidates: #14621, #14647, #14386, #14844, #14754,
  #14856, and #14550.

## Evidence and Eligibility Screen

| Issue | Evidence from the issue | Open linked PR? | Result |
|---|---|---|---|
| #14647 | Help text promises local files survive `gh skill update`; reproduction and affected version given | Yes — #14689 | **Excluded** for unclaimed work |
| #14844 | Detailed sandbox token-refresh failure; clear steps and impact | Yes — #14845 | **Excluded** for unclaimed work |
| #14621 | Skill description lacks task triggers; concrete gap list | Yes — #14629 | **Excluded** for unclaimed work |
| #14856 | Exact failing command, code path, affected versions, and expected behavior | No — attempts #14860 and #14914 are closed | Eligible |
| #14550 | Clear data-loss repro; points at `pkg/cmd/pr/close/close.go` | No — attempts #14556 and #14763 are closed | Eligible |
| #14754 | Clear scope-mismatch report with token and version details | No — attempt #14857 is closed | Eligible |
| #14386 | Priority-2 behavior regression with nine comments | No — attempt #14448 is closed | Eligible |

None of the seven issues was assigned. Competing PRs were checked from the
issue timeline, not from title matches:

```bash
repo=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
gh api "repos/$repo/issues/14647/timeline" --paginate --jq '[.[] | select(.event == "cross-referenced") | select(.source.issue.pull_request != null) | select(.source.issue.state == "open") | .source.issue.number]'
```

`#14647` was excluded even though it was otherwise a strong documentation fit:
open PR #14689 already claimed the fix. The same rule removed #14844 and #14621.
Closed attempts were treated as evidence (the work was tried before), not as
competing work.

## Ranking

Scores use the default weights from `references/scoring-rubric.md`.

| Rank | Issue | User | Tech | Scope | Diff. | Quality | Activity | Feasibility | Evidence | Overall |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | #14856 | 85 | 90 | 85 | 80 | 90 | 70 | 80 | 85 | **84** |
| 2 | #14754 | 80 | 85 | 85 | 75 | 80 | 55 | 70 | 70 | **78** |
| 3 | #14550 | 80 | 85 | 70 | 65 | 85 | 75 | 65 | 75 | **75** |
| 4 | #14386 | 70 | 80 | 55 | 50 | 75 | 80 | 50 | 70 | **65** |

### Final shortlist

1. **#14856 — 84/100 — best match.** The issue names the failing code path,
   gives reproducible steps, and has a small, testable fix. Concern: two closed
   attempts show the area has tripped people up; check the linked history first.
   Confidence: **High**. Verification gaps: none; open-PR state, assignment, and
   code/test paths were all rechecked.
2. **#14754 — 78/100.** Small auth validation fix with clear expected behavior.
   Concern: lower activity and an earlier closed attempt.
   Confidence: **Medium**. Verification gaps: maintainer appetite for the fix was
   not confirmed.
3. **#14550 — 75/100.** High-quality report with a serious data-loss impact and
   an identified file. Concern: the fix touches branch cleanup and needs
   careful regression tests.
   Confidence: **Medium**. Verification gaps: branch-cleanup regression risk was
   not exercised locally.

## How the Final Ranking Was Checked

- Re-ran the open-linked-PR timeline for each finalist immediately before
  output; #14856, #14754, and #14550 had no open linked PR.
- Re-checked assignees and confirmed all four were unassigned.
- Confirmed via the repository contents API that the cited code paths and their
  test files exist (`develop.go`, `close.go`, `login.go`, `create.go`).
- Used comments and update dates as activity evidence; no issue was discarded
  for age alone.
- Recomputed the weighted total with the default weights and sanity-checked the
  order: #14856 stayed first because its scope, issue quality, and evidence were
  all strongest.
deep-investigation.md 1.8 KB
# Example: Deep Investigation of a Specific Issue

## User Request
```
Investigate #1842.
```

## Output

```
ISSUE #1842 — Investigation Brief

Problem: Multi-line commands get corrupted in terminal history. When recalling such commands, line breaks are lost or duplicated.

Why it matches:
- Bug fix with clear reproduction
- No active PR (previous attempt reverted)
- Maintainer priority for upcoming release
- Good learning opportunity for terminal internals

Relevant code:
- src/terminal/history.rs: Main history management
- src/terminal/parser.rs: Command parsing
- src/terminal/display.rs: Display logic

Relevant tests:
- tests/history_tests.rs: Existing history tests
- tests/integration/terminal_integration.rs: Integration tests

Related PRs:
- PR #1801: Fixed similar issue for single-line (merged)
- PR #1839: Attempted fix reverted (indicates complexity)

Related commits:
- abc123: Refactored history storage
- def456: Fixed memory leak in history

Likely implementation scope:
1. Fix multi-line storage in history.rs
2. Update parser to handle line breaks
3. Add tests for multi-line scenarios
4. Update documentation

Potential difficulties:
- Multi-line command boundaries unclear
- Single-line optimizations may conflict
- Edge cases with escaped characters
- Performance considerations

Maintainer expectations:
- Must not break single-line functionality
- Comprehensive test coverage required
- Consider performance impact
- Documentation updates needed

Estimated effort: 8-12 hours

Recommended first steps:
1. Read PR #1839 to understand previous attempt
2. Create reproduction test case
3. Study history.rs and parser.rs
4. Implement fix with tests

Confidence: Medium

Reasons:
- Clear problem and reproduction
- Previous fix attempt suggests complexity
- Need to understand parser internals
- Edge cases may be tricky
first-contribution.md 1.5 KB
# Example: Finding a First Contribution

*Note: Issue counts and numbers below are illustrative examples.*

## User Request
```
Find me a good first contribution in this repository.
```

## Output

```
ISSUE SCOUT

Found 3 strong candidates from 23 issues matching the initial criteria.

1. #1247 — Fix button hover state not working in Safari
   Match: 91/100
   Difficulty: Easy
   Estimated scope: 1-2 hours
   Confidence: High
   Verification gaps: None identified

   Why:
   ✓ Clear reproduction case provided
   ✓ Localized fix in single file
   ✓ Existing tests to verify
   ✓ Maintainer actively responding
   ✓ Simple CSS issue

   Concern:
   ⚠ Need to test across Safari versions

2. #1301 — Add loading spinner to async components
   Match: 82/100
   Difficulty: Easy-Medium
   Estimated scope: 2-4 hours
   Confidence: Medium
   Verification gaps: Design sign-off not confirmed

   Why:
   ✓ Clear specification
   ✓ Follows existing patterns
   ✓ Good learning opportunity

   Concern:
   ⚠ Touches multiple components
   ⚠ May need design decisions

3. #1189 — Fix typo in error message
   Match: 75/100
   Difficulty: Trivial
   Estimated scope: 15 minutes
   Confidence: High
   Verification gaps: None identified

   Why:
   ✓ Simple, low-risk change
   ✓ Good for confidence building

   Concern:
   ⚠ Very trivial, may not provide learning value

Best match: #1247

It provides a good balance of simplicity, learning value, and realistic scope for a first contribution.
no-good-matches.md 1.6 KB
# Example: No Good Matches Found

*Note: Issue counts and numbers below are illustrative examples.*

## User Request
```
Find me a beginner-friendly Rust issue in the compiler subsystem. No active
PRs (unclaimed work only), and it should have seen activity in the last 6 months.
```

## Output

```
ISSUE SCOUT

Searched 47 open issues. Found 0 strong candidates.

Analysis:
- Rust issues in compiler subsystem: 23
- Beginner-friendly: 3
- After filtering (assigned, active PRs, inactive): 0

Rejected issues and reasons:

Issue #1234 — Rejected
Reasons:
- Assigned to maintainer
- Requires deep compiler knowledge
- Estimated scope: 20+ hours

Issue #1289 — Rejected
Reasons:
- Active PR already exists
- Design discussion still ongoing

Issue #1362 — Rejected
Reasons:
- Requires understanding of LLVM backend
- No reproduction case provided

Recommendation:
Your constraints are quite specific. Consider:

1. **Relaxing scope**: "Beginner-friendly Rust issues" (not limited to compiler)
2. **Expanding timeframe**: "Issues I can complete in a week" (not just beginner-friendly)
3. **Different area**: "Frontend Rust issues" or "documentation issues"

The compiler subsystem requires deep expertise. For a first contribution, consider:
- Issues labeled "good first issue" in other areas
- Documentation improvements
- Test coverage additions
- Simple bug fixes in utilities

Would you like me to search with different constraints?
```

## Key Points
- Explains why no matches were found
- Shows rejection reasoning for top candidates
- Suggests alternative approaches
- Offers to re-search with different constraints
portfolio-contribution.md 1.9 KB
# Example: Finding Portfolio-Worthy Contributions

## User Request
```
Find me an issue that would make a strong open-source contribution for my portfolio.
```

## Output

```
ISSUE SCOUT

Found 3 strong candidates from 412 open issues.

1. #2103 — Implement real-time notifications with WebSockets
   Match: 96/100
   Difficulty: Hard
   Estimated scope: 12-16 hours
   Confidence: Medium
   Verification gaps: Infrastructure approach not confirmed

   Why:
   ✓ Significant feature with visible impact
   ✓ Demonstrates full-stack development
   ✓ Clear specification from maintainer
   ✓ Community interest and support
   ✓ Good documentation potential

   Concern:
   ⚠ Requires WebSocket knowledge
   ⚠ Needs frontend and backend changes
   ⚠ May require infrastructure decisions

2. #2156 — Add data visualization dashboard
   Match: 93/100
   Difficulty: Hard
   Estimated scope: 10-14 hours
   Confidence: Medium
   Verification gaps: Charting library choice unresolved

   Why:
   ✓ Visible user-facing feature
   ✓ Demonstrates data visualization skills
   ✓ Clear mockups provided
   ✓ Good portfolio showcase potential

   Concern:
   ⚠ Needs UI/UX design decisions
   ⚠ May require charting library selection

3. #2189 — Implement caching layer for performance
   Match: 89/100
   Difficulty: Medium-Hard
   Estimated scope: 8-12 hours
   Confidence: Medium
   Verification gaps: Cache invalidation design unverified

   Why:
   ✓ Technical depth in optimization
   ✓ Demonstrates performance engineering
   ✓ Clear performance metrics to improve
   ✓ Good technical writing opportunity

   Concern:
   ⚠ Requires understanding of current architecture
   ⚠ May need cache invalidation strategy

Best match: #2103

This WebSocket implementation would be an impressive portfolio piece. It demonstrates full-stack skills, has clear requirements, and would be a significant feature contribution that the maintainer actually wants.
skill-matching.md 1.8 KB
# Example: Finding Issues Matching Specific Skills

## User Request
```
I know TypeScript and React well but don't know this codebase.
Find me something I can reasonably solve in 4–8 hours.
```

## Output

```
ISSUE SCOUT

Found 3 strong candidates from 278 open issues.

1. #1456 — Fix responsive layout breaking on mobile
   Match: 92/100
   Difficulty: Easy-Medium
   Estimated scope: 2-4 hours
   Confidence: High
   Verification gaps: None identified

   Why:
   ✓ Clear screenshots of the issue
   ✓ CSS/React expertise required
   ✓ Localized to layout component
   ✓ Visual regression tests exist
   ✓ Common mobile responsiveness issue

   Concern:
   ⚠ Need to test across device sizes
   ⚠ May need to understand CSS media queries

2. #1502 — Add keyboard navigation to dropdown component
   Match: 89/100
   Difficulty: Medium
   Estimated scope: 4-6 hours
   Confidence: Medium
   Verification gaps: Current component implementation not reviewed

   Why:
   ✓ Clear accessibility specification
   ✓ Follows React component patterns
   ✓ Good portfolio contribution
   ✓ Well-defined success criteria

   Concern:
   ⚠ Need to understand component's current implementation
   ⚠ May require ARIA attribute knowledge

3. #1478 — Fix form validation error messages
   Match: 84/100
   Difficulty: Medium
   Estimated scope: 3-5 hours
   Confidence: Medium
   Verification gaps: Form state management not inspected

   Why:
   ✓ Multiple user reports (real problem)
   ✓ TypeScript form validation
   ✓ Good learning opportunity

   Concern:
   ⚠ Touches multiple files
   ⚠ Need to understand form state management

Best match: #1456

It's a responsive layout issue that perfectly matches your TypeScript/React skills. The clear screenshots and localized fix make it ideal for someone unfamiliar with the codebase.
weekend-project.md 1.6 KB
# Example: Finding a Weekend-Sized Issue

## User Request
```
Find me a Rust issue I could realistically finish this weekend.
```

## Output

```
ISSUE SCOUT

Found 3 strong candidates from 156 open issues.

1. #892 — Fix memory leak in connection pool
   Match: 94/100
   Difficulty: Medium
   Estimated scope: 4-6 hours
   Confidence: High
   Verification gaps: None identified

   Why:
   ✓ Clear reproduction with profiler output
   ✓ Maintainer confirmed the issue
   ✓ Localized to single module
   ✓ Existing test infrastructure
   ✓ Clear success criteria

   Concern:
   ⚠ May require understanding of async lifetimes
   ⚠ Similar to #845 but different scenario

2. #915 — Improve error messages for invalid configurations
   Match: 88/100
   Difficulty: Easy-Medium
   Estimated scope: 3-5 hours
   Confidence: Medium
   Verification gaps: Error message format decisions unresolved

   Why:
   ✓ Multiple user reports (real problem)
   ✓ Maintainer wants this fixed
   ✓ Follows existing error patterns
   ✓ Good learning opportunity

   Concern:
   ⚠ Touches multiple files
   ⚠ Need to decide on error message format

3. #878 — Add timeout to HTTP client requests
   Match: 85/100
   Difficulty: Medium
   Estimated scope: 5-7 hours
   Confidence: Medium
   Verification gaps: Client architecture not inspected

   Why:
   ✓ Clear specification
   ✓ Follows existing patterns
   ✓ Good feature contribution

   Concern:
   ⚠ Need to understand client architecture
   ⚠ May need API design decisions

Best match: #892

It's a well-defined bug with clear reproduction, localized fix, and existing tests. The 4-6 hour estimate fits perfectly in a weekend.
references/
interview.md 2.5 KB
# Issue Scout Interview

Ask these six questions in order, in a single message when the AI CLI supports
batched prompts. Skip any question the user already answered in their request.

## Question 1: Experience Level

```
What's your experience level with this repository?
- [ ] First-time contributor
- [ ] Some familiarity
- [ ] Experienced with the codebase
```

## Question 2: Technical Skills

```
What languages/frameworks are you comfortable with?
(Select all that apply)
- [ ] JavaScript/TypeScript
- [ ] Python
- [ ] Rust
- [ ] Go
- [ ] Java/Kotlin
- [ ] C/C++
- [ ] Ruby
- [ ] Other: ___
```

## Question 3: Time Availability

```
How much time can you dedicate?
- [ ] Quick fix (< 2 hours)
- [ ] Weekend project (4-8 hours)
- [ ] Week-long (20-40 hours)
- [ ] Longer contribution (40+ hours)
```

## Question 4: Contribution Type

```
What type of contribution are you looking for?
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation
- [ ] Tests
- [ ] Performance improvement
- [ ] Code refactoring
- [ ] Any suitable issue
```

## Question 5: Difficulty Preference

```
What difficulty level do you prefer?
- [ ] Beginner-friendly (good first issue)
- [ ] Intermediate
- [ ] Advanced
- [ ] Any difficulty
```

## Question 6: Special Requirements

```
Any special requirements?
- [ ] No active PRs (unclaimed work only)
- [ ] Must have reproduction case
- [ ] Must have clear acceptance criteria
- [ ] Avoid compiler/core subsystem
- [ ] Other: ___
```

## Internal Specification

Parse the answers into this structure before moving to Phase 2:

```
Experience: [level]
Languages: [list]
Scope: [time estimate]
Type: [contribution type]
Difficulty: [level]
Special: [requirements]
```

Treat "No active PRs (unclaimed work only)" as two hard filters: the issue must
be unassigned and must have no open linked pull request. If that box is not
selected, keep assigned and claimed issues eligible and score them as evidence.

## Prioritization Hints

Use the user's answers to choose weights in `scoring-rubric.md`:

- **First-time contributor** → "first contribution" weights, prioritizing
  Difficulty Fit, Contribution Feasibility, and Issue Quality.
- **Weekend project** → "weekend project" weights, prioritizing Scope Fit,
  Difficulty Fit, and Contribution Feasibility.
- **Portfolio contribution** → "portfolio contribution" weights, prioritizing
  Technical Fit, Issue Quality, and Contribution Feasibility.
- Otherwise use the default weights.

Record any assumption made about an implicit constraint so the final output can
distinguish evidence from inference.
investigation-templates.md 3.3 KB
# Investigation and Planning Templates

Use these templates after the ranked shortlist. Keep the same evidence rules:
mark what was verified, what is inferred, and what still needs investigation.

## Investigation Mode

**Trigger:** User says "Investigate #[NUMBER]".

**Action:** Provide a detailed contribution brief.

**Output format:**
```
🔍 ISSUE #[NUMBER] — DEEP INVESTIGATION

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📋 PROBLEM
[Clear description of the issue]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🎯 WHY IT MATCHES
• [Match point 1]
• [Match point 2]
• [Match point 3]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📁 RELEVANT CODE
• src/path/file1.ts: [What it does]
• src/path/file2.ts: [What it does]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🧪 RELEVANT TESTS
• tests/path/test1.ts: [What it tests]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🔗 RELATED
• PR #[NUMBER]: [Description]
• Commit [HASH]: [Description]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📝 IMPLEMENTATION SCOPE
1. [Step 1]
2. [Step 2]
3. [Step 3]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⚠️ POTENTIAL DIFFICULTIES
• [Difficulty 1]
• [Difficulty 2]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

👨‍💻 MAINTAINER EXPECTATIONS
[If known]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⏱️ ESTIMATED EFFORT: [X-Y] hours

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🚀 RECOMMENDED FIRST STEPS
1. [Step 1]
2. [Step 2]
3. [Step 3]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📊 CONFIDENCE: [HIGH/MEDIUM/LOW]
[Reason for confidence level]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

💡 Want me to create an implementation plan?
   Say: "Plan this issue"
```

## Implementation Planning

**Trigger:** User says "Plan this issue" or "How should I approach this?".

**Action:** Provide a step-by-step implementation plan.

**Output format:**
```
📋 IMPLEMENTATION PLAN

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🔍 PROBLEM ANALYSIS
[What needs to be fixed/implemented]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✅ VERIFIED FACTS
• [Fact from code inspection]
• [Fact from tests]
• [Fact from documentation]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🔮 LIKELY IMPLEMENTATION
• [Probable approach]
• [Expected file locations]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

❓ NEEDS INVESTIGATION
• [Uncertain aspect]
• [Potential edge cases]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📝 STEP-BY-STEP PLAN

Step 1: [First step]
├─ Why: [Rationale]
├─ Files: [Specific files]
└─ Time: [Estimate]

Step 2: [Second step]
├─ Why: [Rationale]
├─ Files: [Specific files]
└─ Time: [Estimate]

Step 3: [Third step]
├─ Why: [Rationale]
├─ Files: [Specific files]
└─ Time: [Estimate]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📁 FILES TO MODIFY
• src/path/file1.ts: [What to change]
• src/path/file2.ts: [What to change]
• tests/path/test.ts: [What tests to add]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🧪 TESTING APPROACH
1. [How to verify the fix]
2. [Edge cases to test]
3. [Regression prevention]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⚠️ POTENTIAL CHALLENGES
• [Challenge 1]: [Mitigation]
• [Challenge 2]: [Mitigation]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⏱️ TIME ESTIMATE
• Implementation: [X] hours
• Testing: [Y] hours
• Total: [X+Y] hours

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📊 CONFIDENCE: [HIGH/MEDIUM/LOW]
[Brief explanation]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Ready to start? Say: "Start working on this"
```
quick-reference.md 4.5 KB
# Issue Scout Quick Reference

## Commands

| Command | Description |
|---------|-------------|
| `/scout-issue` | Start issue discovery |
| `/scout-issue rust` | Start with language filter |
| `/scout-issue beginner` | Start with difficulty filter |
| `Find issues I could contribute to` | Auto-activates the skill (no slash command needed) |
| `Investigate #NNN` | Deep dive into specific issue |
| `Plan this issue` | Get implementation plan |
| `How should I approach this?` | Get approach advice |
| `/cancel` | Abort the current pipeline and return to normal chat mode |
| `/scout-issue` (again) | Restart the pipeline from Phase 1, discarding previous progress |
| `Start working on this` | Begin the planned implementation |

## Pipeline Flow

```
/scout-issue invoked
    ↓
Phase 1: User Interrogation
    ↓
Phase 2: Issue Detection
    ↓
Phase 3: Issue Analysis & Ranking
    ↓
Phase 4: Output Formatting
    ↓
Display to User
```

## User Interrogation Questions

1. **Experience Level**
   - First-time contributor
   - Some familiarity
   - Experienced with the codebase

2. **Technical Skills**
   - JavaScript/TypeScript
   - Python
   - Rust
   - Go
   - Java/Kotlin
   - C/C++
   - Ruby
   - Other

3. **Time Availability**
   - Quick fix (< 2 hours)
   - Weekend project (4-8 hours)
   - Week-long (20-40 hours)
   - Longer contribution (40+ hours)

4. **Contribution Type**
   - Bug fix
   - New feature
   - Documentation
   - Tests
   - Performance improvement
   - Code refactoring
   - Any suitable issue

5. **Difficulty Preference**
   - Beginner-friendly (good first issue) — label is a hunting hint only; verify difficulty from the issue body and code
   - Intermediate
   - Advanced
   - Any difficulty

6. **Special Requirements**
   - No active PRs (unclaimed work only)
   - Must have reproduction case
   - Must have clear acceptance criteria
   - Avoid compiler/core subsystem
   - Other

## Scoring Dimensions

1. **User Fit** - Matches user preferences
2. **Technical Fit** - Matches tech stack
3. **Scope Fit** - Matches time constraints
4. **Difficulty Fit** - Matches skill level
5. **Issue Quality** - Well-defined problem
6. **Activity** - Active maintenance
7. **Contribution Feasibility** - Realistic to complete
8. **Evidence Quality** - Strong supporting evidence

## GitHub CLI Commands

```bash
# Issue-only open count (open_issues_count also includes PRs)
repo=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
gh api "search/issues?q=repo:$repo+is:issue+is:open&per_page=1" --jq '.total_count'

# List open issues (excludes pull requests)
gh issue list --state open

# Filter by label
gh issue list --label "bug" --state open

# View specific issue
gh issue view 1234

# Check for open linked PRs (only open PRs count as competing work)
gh api "repos/$repo/issues/1234/timeline" --paginate --jq '[.[] | select(.event == "cross-referenced") | select(.source.issue.pull_request != null) | select(.source.issue.state == "open") | .source.issue.number]'

# List PRs
gh pr list --state open

# View PR details
gh pr view 5678
```

## Git Commands

```bash
# Recent activity
git log --oneline -20

# Search code
rg "pattern" src/

# Find files
find . -name "*.ts" -type f

# Check blame
git blame src/file.ts
```

## Confidence Levels

- **High**: Strong evidence, clear path, active support
- **Medium**: Good evidence, achievable, some unknowns
- **Low**: Weak evidence, significant unknowns

## Output Format

```
🔍 ISSUE SCOUT RESULTS

Found X strong candidates from Y open issues (issue-only count).

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

1. #NNNN — [TITLE]
   📊 Match: NN/100
   🎯 Difficulty: [LEVEL]
   ⏱️ Estimated scope: [N] hours
   📌 Confidence: [HIGH/MEDIUM/LOW]
   🔎 Verification gaps: [None, or what could not be checked]

   ✅ Why it matches:
   • [Evidence point 1]
   • [Evidence point 2]
   • [Evidence point 3]

   ⚠️ Concerns:
   • [Concern 1]
   • [Concern 2]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🏆 BEST MATCH: #[NUMBER]

[One sentence recommendation]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

💡 Want me to investigate any of these issues in detail?
   Say: "Investigate #[NUMBER]"
```

## Key Rules

1. Evidence ≠ Inference
2. Don't rank by title match alone
3. Check linked PRs
4. Check recent activity
5. Explain recommendations
6. Explain rejections
7. Never invent facts
8. Read-only by default

## Investigation Checklist

- [ ] Full description read
- [ ] Comments reviewed
- [ ] Linked PRs checked
- [ ] Code locations identified
- [ ] Tests located
- [ ] Complexity assessed
- [ ] Evidence documented
recovery.md 2.1 KB
# Recovery and Fallbacks

Use these paths when the pipeline cannot continue normally. Always explain the
limitation instead of pretending a tool or data source exists.

## User Cancels

If the user types `/cancel` or says "cancel" during any phase:

1. Stop the pipeline immediately.
2. Acknowledge the cancellation.
3. Return to normal chat mode.

## User Restarts

If the user types `/scout-issue` again during the process:

1. Restart from Phase 1.
2. Ask the questions again.
3. Discard any previous progress.

## Missing Tools

If GitHub CLI is not available:

```bash
which gh
echo "GitHub CLI not available. Using git log for activity analysis."
git log --oneline -20
```

Use git history and web search as fallbacks, reduce the scope of the search, and
state which checks could not be completed. Do not claim that linked PRs or
maintainer activity were verified when they were not.

## GitHub CLI Not Authenticated

```bash
gh auth status
```

If not authenticated, explain what is limited:

- Local repository inspection still works.
- Issue text may be available through web search.
- Linked PRs and maintainer activity cannot be verified through the API.

If the user can authenticate, ask them to run `gh auth login` and resume.

## Rate Limiting

```bash
gh api rate_limit
```

If the API is rate-limited:

- Use git history for recent activity.
- Reduce the number of issues investigated.
- Prefer one batched REST page over many per-issue calls.
- Tell the user which evidence is missing.

## No Issues Found

If no suitable issues are found:

- Explain which constraints are binding.
- Suggest relaxing one constraint at a time.
- Offer alternative approaches, such as a different contribution type or a
  nearby subsystem.
- Never lower the evidence bar to fill the shortlist.

## Limited Repository Information

When the repository is not available locally:

- Work with the issue text and API data that is available.
- Note confidence limitations.
- Suggest manual verification for code locations and tests.
- Prefer issues whose body already points to specific files or subsystems.
scoring-rubric.md 6.2 KB
# Scoring Rubric

## Dimensions

### 1. User Fit (0-100)
How well does this issue match the user's explicit and implicit preferences?

- **High (80-100)**: Perfect match for stated skills, experience, and preferences
- **Medium (50-79)**: Good match with minor gaps
- **Low (0-49)**: Partial match or significant gaps

**Factors:**
- Technical skills alignment
- Experience level match
- Preferred issue type
- Avoided areas respected

### 2. Technical Fit (0-100)
How well does this issue align with the repository's technical stack and architecture?

- **High (80-100)**: Uses primary technologies, clear code locations
- **Medium (50-79)**: Uses relevant technologies, some code exploration needed
- **Low (0-49)**: Requires unfamiliar technologies or deep architecture knowledge

**Factors:**
- Primary language/framework match
- Code location clarity
- Architecture understanding required
- Technology familiarity

### 3. Scope Fit (0-100)
How well does this issue fit within the user's time and complexity constraints?

- **High (80-100)**: Clearly within stated scope
- **Medium (50-79)**: Slightly outside scope but achievable
- **Low (0-49)**: Significantly outside scope

**Factors:**
- Estimated time vs. requested time
- Complexity vs. requested complexity
- Number of files/components affected
- External dependencies

### 4. Difficulty Fit (0-100)
How well does this issue match the user's skill level?

- **High (80-100)**: Appropriate challenge level
- **Medium (50-79)**: Slightly above/below but manageable
- **Low (0-49)**: Too easy or too difficult

**Factors:**
- Required expertise level
- Learning curve involved
- Previous similar work
- Available documentation/help

### 5. Issue Quality (0-100)
How well-defined and actionable is this issue?

- **High (80-100)**: Clear problem, reproduction, acceptance criteria
- **Medium (50-79)**: Good description, some gaps
- **Low (0-49)**: Vague, unclear requirements

**Factors:**
- Problem description clarity
- Reproduction steps provided
- Acceptance criteria defined
- Examples/expected behavior

### 6. Activity (0-100)
How active is this issue and its surrounding discussion?

- **High (80-100)**: Recent maintainer activity, clear interest
- **Medium (50-79)**: Some activity, reasonable response time
- **Low (0-49)**: Stale, no recent activity

**Factors:**
- Last maintainer comment
- Overall issue activity
- Related PR activity
- Community interest

### 7. Contribution Feasibility (0-100)
How feasible is it for the user to actually complete this contribution?

- **High (80-100)**: Clear path to completion, low risk
- **Medium (50-79)**: Achievable with some research/learning
- **Low (0-49)**: Significant unknowns or blockers

**Factors:**
- Existing tests to verify changes
- Clear implementation path
- Low risk of rejection
- Available guidance

### 8. Evidence Quality (0-100)
How strong is the evidence supporting this recommendation?

- **High (80-100)**: Multiple strong evidence points
- **Medium (50-79)**: Good evidence with some gaps
- **Low (0-49)**: Weak or insufficient evidence

**Factors:**
- Clear reproduction case
- Maintainer confirmation
- No blocking PRs
- Recent activity

## Weighting

### Default Weights
- User Fit: 20%
- Technical Fit: 15%
- Scope Fit: 20%
- Difficulty Fit: 15%
- Issue Quality: 10%
- Activity: 5%
- Contribution Feasibility: 10%
- Evidence Quality: 5%

### Weight Adaptation

The three named scenarios re-weight a subset of dimensions and reduce the
remaining dimensions **proportionally** so the weights still sum to 100%.

How "proportionally" is computed: let S be the sum of the weights assigned to
the promoted dimensions. The remaining weight is `100 - S`, shared by the
unpromoted dimensions in proportion to their default weights:

```
reduced_weight(d) = default_weight(d) × (100 - S) / sum_of_defaults_of_unpromoted
```

The tables below use the result rounded to whole percentage points (the last
dimension absorbs any rounding remainder so every row sums to exactly 100%).

**For "weekend project":**

| Dimension | Default | Weekend |
|---|---|---|
| Scope Fit | 20% | 30% |
| Difficulty Fit | 15% | 25% |
| Contribution Feasibility | 10% | 20% |
| User Fit | 20% | 9% |
| Technical Fit | 15% | 7% |
| Issue Quality | 10% | 5% |
| Activity | 5% | 2% |
| Evidence Quality | 5% | 2% |

(Promoted sum 75%, remaining 25% reduced proportionally; totals 100%.)

**For "portfolio contribution":**

| Dimension | Default | Portfolio |
|---|---|---|
| Technical Fit | 15% | 25% |
| Issue Quality | 10% | 20% |
| Contribution Feasibility | 10% | 20% |
| User Fit | 20% | 11% |
| Scope Fit | 20% | 11% |
| Difficulty Fit | 15% | 8% |
| Activity | 5% | 3% |
| Evidence Quality | 5% | 2% |

(Promoted sum 65%, remaining 35% reduced proportionally; totals 100%.)

**For "first contribution":**

| Dimension | Default | First |
|---|---|---|
| Difficulty Fit | 15% | 30% |
| Contribution Feasibility | 10% | 25% |
| Issue Quality | 10% | 20% |
| User Fit | 20% | 8% |
| Technical Fit | 15% | 6% |
| Scope Fit | 20% | 8% |
| Activity | 5% | 2% |
| Evidence Quality | 5% | 1% |

(Promoted sum 75%, remaining 25% reduced proportionally; totals 100%.)

## Calculation

Final Score = Σ (Dimension Score × Weight)

Where each dimension score is 0-100 and weights sum to 1.0.

### Worked example ("weekend project")

Scores: User Fit 60, Technical Fit 80, Scope Fit 90, Difficulty Fit 70,
Issue Quality 85, Activity 40, Contribution Feasibility 75, Evidence Quality 50.

| Dimension | Score | Weight (weekend) | Contribution |
|---|---|---|---|
| User Fit | 60 | 9% | 5.40 |
| Technical Fit | 80 | 7% | 5.60 |
| Scope Fit | 90 | 30% | 27.00 |
| Difficulty Fit | 70 | 25% | 17.50 |
| Issue Quality | 85 | 5% | 4.25 |
| Activity | 40 | 2% | 0.80 |
| Contribution Feasibility | 75 | 20% | 15.00 |
| Evidence Quality | 50 | 2% | 1.00 |

Final Score = 5.40 + 5.60 + 27.00 + 17.50 + 4.25 + 0.80 + 15.00 + 1.00 = **76.55**

## Confidence Levels

**High Confidence:**
- Score ≥ 80
- Strong evidence across multiple dimensions
- Clear implementation path
- Active maintainer support

**Medium Confidence:**
- Score 60-79
- Good evidence with some gaps
- Achievable but may require research
- Reasonable maintainer interest

**Low Confidence:**
- Score < 60
- Weak or insufficient evidence
- Significant unknowns
- Unclear maintainer intent
tool-patterns.md 4.7 KB
# Tool Usage Patterns

## GitHub CLI Patterns

### List Issues
```bash
# All open issues
gh issue list --state open --limit 100

# Filter by label (hint only — verify difficulty in Phase 3, never trust labels alone)
gh issue list --state open --label "bug" --limit 50
gh issue list --state open --label "good first issue" --limit 50
gh issue list --state open --label "help-wanted" --limit 50

# Filter by language (if repo uses language labels)
gh issue list --state open --label "rust" --limit 50
gh issue list --state open --label "javascript" --limit 50

# Sort by activity. Always pass --repo; gh search issues searches all of
# GitHub when the repository is omitted.
gh search issues --repo OWNER/REPO --state open --sort updated --limit 50

# Search by text
gh issue list --state open --search "memory leak" --limit 50
```

### View Issues
```bash
# Basic view
gh issue view 1234

# With comments
gh issue view 1234 --comments

# JSON format for parsing
gh issue view 1234 --json title,body,labels,assignees

# Check for open linked PRs (only open PRs count as competing work)
repo=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
gh api "repos/$repo/issues/1234/timeline" --paginate --jq '[.[] | select(.event == "cross-referenced") | select(.source.issue.pull_request != null) | select(.source.issue.state == "open") | .source.issue.number]'
```

### List PRs
```bash
# All open PRs
gh pr list --state open --limit 50

# PRs targeting specific branch
gh pr list --state open --base main --limit 50

# PRs by author
gh pr list --state open --author username --limit 50
```

### View PRs
```bash
# Basic view
gh pr view 5678

# View PR files changed
gh pr diff --name-only 5678

# Check if PR is linked to issue (body references like "Fixes #1234")
gh pr view 5678 --json body | grep -iE "(Fixes|Closes|Resolves)[[:space:]]+#"
```

### Search Code
```bash
# Search for function
gh search code "function_name" --repo owner/repo

# Search for file
gh search code "filename:config.ts" --repo owner/repo
```

## Git Patterns

### Recent Activity
```bash
# Last 20 commits
git log --oneline -20

# Commits in last week
git log --oneline --since="1 week ago"

# Commits by specific author
git log --oneline --author="username" -10

# Commits touching specific file
git log --oneline -10 -- path/to/file
```

### Code Search
```bash
# Search for pattern in code
rg "pattern" src/
rg -i "pattern" src/  # case insensitive

# Search in specific file type
rg "pattern" -g "*.ts" src/
rg "pattern" -g "*.rs" src/

# Search with context
rg -C 3 "pattern" src/  # 3 lines before/after
```

### File Operations
```bash
# Find files by name
find . -name "*.ts" -type f
find . -name "*test*" -type f

# Find files by content
grep -r "function_name" src/
grep -l "TODO" src/**/*.ts

# Check file structure
tree -L 2 -I 'node_modules'
ls -la src/
```

### Blame and History
```bash
# Who changed what
git blame path/to/file

# History of specific function
git log -p -S "function_name" -- path/to/file

# Diff between commits
git diff abc123..def456
```

## Combined Patterns

### Investigate Issue
```bash
# Get issue details
gh issue view 1234 --comments

# Find related code
rg "relevant_function" src/

# Check if tests exist
find . -name "*test*" -type f | xargs grep -l "relevant_function"

# Check recent changes to relevant files
git log --oneline -5 -- path/to/file
```

### Check Issue Activity
```bash
# Get issue timeline (open linked PRs referencing this issue)
repo=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
gh api "repos/$repo/issues/1234/timeline" --paginate --jq '[.[] | select(.event == "cross-referenced") | select(.source.issue.pull_request != null) | select(.source.issue.state == "open") | .source.issue.number]'
# Note: `gh issue view --json timelineItems/linkedPRs` is not supported; the CLI
# exposes a fixed set of REST fields, so linked-PR detection uses the timeline API.

# Check maintainer activity
gh issue view 1234 --json comments | jq '.comments[].author.login'
```

### Validate Contribution Feasibility
```bash
# Check if issue is assigned
gh issue view 1234 --json assignees

# Check if PR exists (search titles AND bodies for a reference to this issue)
gh pr list --state open --search "1234 in:title"
gh pr list --state open --search "Fixes #1234"

# Check test coverage
find . -name "*test*" -type f | wc -l

# Check documentation
cat CONTRIBUTING.md 2>/dev/null | head -50
```

## Error Handling

### When gh CLI is not available
```bash
# Fallback to git
git remote -v  # Get repo URL
git log --oneline -20  # Recent activity
```

### When authentication fails
```bash
# Check auth status
gh auth status

# Provide instructions
echo "Please run: gh auth login"
```

### When rate limited
```bash
# Check rate limit
gh api rate_limit

# Use git instead
git log --oneline -20
```
workflow.md 6.2 KB
# Issue Scout Workflow

## High-Level Flow

```
User Request
    ↓
Parse Intent → Internal Specification
    ↓
Inspect Repository → Understand Context
    ↓
Discover Issues → Candidate Pool
    ↓
Filter Obvious Bad Candidates → Reduced Pool
    ↓
Investigate Promising Candidates → Deep Analysis
    ↓
Score & Rank → Final Shortlist
    ↓
Present Results → User Decision
```

## Detailed Steps

### 1. Parse User Intent

**Input:** Natural language request

**Process:**
- Extract explicit constraints (languages, time, type)
- Infer implicit constraints (experience, preferences)
- Identify priorities (what matters most)
- Create internal specification

**Output:** Structured internal specification

**Example:**
```
"Find me a Rust issue I could finish this weekend"

→ Goal: Weekend project
→ Language: Rust
→ Scope: 4-8 hours
→ Preference: Clear requirements, reproducible bugs
→ Priority: Scope fit > Technical fit
```

### 2. Inspect Repository

**Input:** Repository context

**Process:**
- Identify primary language/framework
- Understand project structure
- Review contribution guidelines
- Check issue templates and labels
- Assess recent activity
- Identify testing infrastructure

**Output:** Repository understanding

**Key Questions:**
- What is this project?
- How is it organized?
- What are the contribution norms?
- What testing tools are used?
- How active is maintenance?

### 3. Discover Issues

**Input:** Repository and constraints

**Process:**
- Use GitHub CLI/API to list issues
- Apply broad filters (open; add "not assigned" only when the user requested
  unclaimed work)
- Consider labels and milestones
- Start with high-potential categories

**Output:** Candidate issue pool

**Commands:**
```bash
gh issue list --state open --limit 100
gh issue list --label "bug" --state open
gh issue list --label "help-wanted" --state open
```

### 4. Filter Obvious Bad Candidates

**Input:** Candidate pool

**Process:**
- Remove closed/duplicate issues
- Eliminate assigned issues only when the user wants unclaimed work
- Exclude open competing PRs only when the user wants unclaimed work; record
  them as evidence otherwise
- Filter out explicit constraint violations
- Keep inactive issues unless there is evidence of obsolescence or the user set
  a recency constraint

**Output:** Reduced candidate pool

**Filters:**
- Status: Open, not closed
- Assignment: Unassigned only when requested
- PR links: No open competing PR only when requested; closed PRs are evidence
- Recency: No automatic stale exclusion; inactivity lowers Activity evidence
- Constraints: Match user requirements

### 5. Investigate Promising Candidates

**Input:** Reduced pool

**Process:**
- Read full issue descriptions
- Examine comments and discussion
- Check linked PRs and commits
- Locate relevant code files
- Assess implementation complexity
- Verify evidence quality

**Output:** Deep analysis of each candidate

**Investigation Checklist:**
- [ ] Full description read
- [ ] Comments reviewed
- [ ] Linked PRs checked
- [ ] Code locations identified
- [ ] Tests located
- [ ] Complexity assessed
- [ ] Evidence documented

### 6. Score & Rank

**Input:** Deep analysis

**Process:**
- Apply scoring rubric
- Adapt weights to user priorities
- Calculate final scores
- Rank by score
- Identify best match

**Output:** Ranked shortlist with scores

**Scoring Dimensions:**
- User Fit
- Technical Fit
- Scope Fit
- Difficulty Fit
- Issue Quality
- Activity
- Contribution Feasibility
- Evidence Quality

### 7. Present Results

**Input:** Ranked shortlist

**Process:**
- Format concise output
- Explain why each issue matches
- Highlight concerns
- Provide clear recommendation
- Offer rejection reasoning for top rejected issues

**Output:** User-ready recommendation

**Format:**
- Top 3-5 issues with scores
- Clear "best match" recommendation
- Key evidence for each
- Important concerns noted

## Decision Points

### When to Reduce Candidates (not skip checks)
- **Reduce candidate pool** if user provides full context (still inspect for evidence)
- **Reduce candidates investigated** if pool is small (<20) — apply full checks to all
- **Focus deep investigation** on top 3-5 from quick scan — still verify eligibility for each

### When to Iterate
- **Re-prioritize** if user clarifies constraints
- **Expand search** if initial pool is insufficient
- **Deepen investigation** if user requests specific issue

### When to Stop
- **Sufficient candidates** found (3-5 strong matches) after full eligibility checks
- **Time constraints** reached
- **User satisfaction** indicated

## Edge Cases

### No Good Matches Found
- Explain why constraints are too restrictive
- Suggest relaxing constraints
- Offer alternative approaches

### Too Many Good Matches
- Increase filtering strictness
- Prioritize highest-scoring
- Group by category

### Ambiguous User Request
- Ask clarifying questions
- Make reasonable assumptions
- Document assumptions made

### Limited Repository Information
- Work with available data
- Note confidence limitations
- Suggest manual verification

## Scout-Specific Decisions

Before presenting, run the investigation checklist in `quick-reference.md`.
Evidence and honesty rules live in `SKILL.md`; the decisions below are
specific to scouting.

### Linked-PR Evidence Unavailable for Unclaimed Work
If auth, rate limits, or the timeline API prevent checking linked PRs:
- Do not call the issue unclaimed.
- Mark the competing-work gate **unverified**, lower Confidence, and prefer
  candidates whose status was verified.
- If no verified candidate remains, present the best unverified option with an
  explicit warning and the manual linked-PR check from `quick-reference.md`.

### Issue State Changed Mid-Run
Re-check state immediately before presenting. If an issue closed, became
assigned, or gained an open linked PR:
- Drop it when the change violates a hard constraint.
- Otherwise keep it and record the change as updated evidence.

### Constraints Eliminate Every Candidate
Name the constraint that removes the most candidates and offer one concrete
relaxation. Do not silently drop a hard constraint to produce a match.

### Code or Test Evidence Missing
Keep the candidate but lower Technical Fit and Evidence Quality. State what
could not be verified and point to the manual check, rather than inferring
difficulty from the title.
scripts/
validate-skill.sh 9.4 KB
#!/usr/bin/env bash
# Validates the Issue Scout skill in a meaningful way: required files exist,
# SKILL.md contains the full pipeline, every gh/git command is well-formed,
# flags used in examples are supported, and the quick reference stays in sync
# with the deeper docs.
#
# Run from the skill folder root, e.g. `cd skills/scout-issue && bash scripts/validate-skill.sh`.
set -euo pipefail

errors=0
fail() {
  echo "  FAIL  $*"
  errors=$((errors + 1))
}

# --- Structure: required files and directories ---------------------------
required_files=(SKILL.md LICENSE)
required_dirs=(examples references)

for file in "${required_files[@]}"; do
  [[ -f "$file" ]] || fail "missing file: $file"
done
for dir in "${required_dirs[@]}"; do
  [[ -d "$dir" ]] || fail "missing directory: $dir/"
done

# --- Content: SKILL.md must contain the full pipeline ---------------------
skill=SKILL.md
[[ -f "$skill" ]] || exit 1
for heading in "Phase 1: User Interrogation" "Phase 2: Issue Detection" \
  "Phase 3: Issue Analysis & Ranking" "Phase 4: Output Formatting" \
  "Investigation Mode" "Implementation Planning"; do
  if ! grep -qF "## $heading" "$skill"; then
    fail "SKILL.md is missing heading \"## $heading\""
  fi
done

# --- Command validation: gh/git subcommand paths and flags ---------------
# Valid gh top-level commands and their subcommands.
GH_TOPLEVEL="alias api auth browse cache codespace config environment extension gist gpg-key issue label org pr project release repo ruleset search secret ssh-key status variable workflow"
# Subcommands allowed for the top-level groups that take them (space-separated).
GH_ISSUE_SUBS="list view status create close reopen lock unlock pin unpin"
GH_PR_SUBS="list view diff checkout create close merge reopen lock ready comment review"
GH_REPO_SUBS="view clone create delete fork rename edit"
GH_SEARCH_SUBS="issues prs code"

# Flags supported by the gh commands used in this skill (per subcommand group).
GH_ISSUE_LIST_FLAGS="state,limit,label,assignee,author,search"
GH_ISSUE_VIEW_FLAGS="comments,json,jq"
GH_PR_LIST_FLAGS="state,search,limit,json,jq,base,author"
GH_PR_VIEW_FLAGS="json,jq"
GH_PR_DIFF_FLAGS="name-only,exclude"
GH_SEARCH_FLAGS="state,label,sort,order,limit,search,json,jq,repo"
GH_API_FLAGS="jq,paginate,method,field,raw-field,input,header,cache,silent,preview,hostname,template,verbose,include,slurp"

# git subcommands (from original script)
GIT_SUBS="add am annotate apply archive bisect blame branch bundle cat-file check-attr check-ignore check-mailmap check-ref-format checkout cherry cherry-pick clean clone column commit config count-objects credential describe diff diff-files diff-index diff-tree difftool fetch filter-branch for-each-ref format-patch fsck gc get-tar-commit-id grep help init instaweb log ls-files ls-remote ls-tree mailinfo mailsplit merge merge-base merge-file merge-index merge-one-file mergetool mktag mktree mv name-rev notes pack-objects pack-redundant pack-refs patch-id prune prune-packed pull push quilt-pop range-diff reflog remote repack replace request-pull reset restore revert rev-list rev-parse rm send-email shortlog show show-branch show-index show-ref stash status stripspace submodule subtree symbolic-ref tag unpack-file unpack-objects update-index update-ref update-server-info var verify-commit verify-pack verify-tag whatchanged worktree"

check_flags() {
  local file="$1"
  local label="$2"
  local flags_str="$3"
  local rest="$4"
  local flag flag_name

  for flag in $rest; do
    case "$flag" in
      --*) ;;
      *) continue ;;
    esac
    flag_name="${flag#--}"
    flag_name="${flag_name%%=*}"
    if ! echo ",$flags_str," | grep -q ",${flag_name},"; then
      fail "$file: unknown flag \"$flag\" for $label"
      return 1
    fi
  done
}

check_command() {
  local file="$1"
  local line="$2"
  local cmd sub rest

  case "$line" in
    gh\ *)
      read -r cmd sub rest <<<"$line"
      # Validate top-level subcommand
      if [[ " $GH_TOPLEVEL " != *" $sub "* ]]; then
        fail "$file: unknown gh subcommand \"$sub\""
        return
      fi
      # gh api and auth take no meaningful second subcommand.
      if [[ "$sub" == "api" ]]; then
        check_flags "$file" "gh api" "$GH_API_FLAGS" "$rest" || true
        return
      fi
      if [[ "$sub" == "auth" ]]; then
        return
      fi
      # Top-level groups that require a second subcommand
      local subs=""
      case "$sub" in
        issue) subs="$GH_ISSUE_SUBS" ;;
        pr) subs="$GH_PR_SUBS" ;;
        repo) subs="$GH_REPO_SUBS" ;;
        search) subs="$GH_SEARCH_SUBS" ;;
        *) subs="" ;;
      esac
      if [[ -n "$subs" ]]; then
        local second
        read -r second _ <<<"$rest"
        if [[ -z "$second" ]]; then
          fail "$file: gh $sub is missing a subcommand"
          return
        fi
        if [[ " $subs " != *" $second "* ]]; then
          fail "$file: unknown gh $sub subcommand \"$second\""
          return
        fi
        # Validate flags for this path
        local flags_str=""
        case "$sub/$second" in
          issue/list) flags_str="$GH_ISSUE_LIST_FLAGS" ;;
          issue/view) flags_str="$GH_ISSUE_VIEW_FLAGS" ;;
          pr/list) flags_str="$GH_PR_LIST_FLAGS" ;;
          pr/view) flags_str="$GH_PR_VIEW_FLAGS" ;;
          pr/diff) flags_str="$GH_PR_DIFF_FLAGS" ;;
          search/issues|search/prs) flags_str="$GH_SEARCH_FLAGS" ;;
        esac
        if [[ -n "$flags_str" ]]; then
          check_flags "$file" "gh $sub $second" "$flags_str" "$rest" || true
        fi
      fi
      ;;
    git\ *)
      read -r cmd sub rest <<<"$line"
      if [[ " $GIT_SUBS " != *" $sub "* ]]; then
        fail "$file: unknown git subcommand \"$sub\""
      fi
      ;;
    *)
      # Not a gh/git command, skip
      ;;
  esac
}

# --- Commands: every gh/git command must be well-formed -------------------
check_commands() {
  local file="$1"
  [[ -f "$file" ]] || return 0
  local line
  # Join backslash-continued lines so flags on continuation lines are checked.
  while IFS= read -r line; do
    case "$line" in
      gh | git)
        fail "$file: bare \"$line\" command (truncated?)"
        ;;
      gh\ * | git\ *)
        check_command "$file" "$line"
        ;;
    esac
  done < <(awk '
    /\\$/ {
      sub(/\\$/, " ")
      printf "%s", $0
      next
    }
    { print }
  ' "$file")
}

for f in "$skill" references/*.md examples/*.md; do
  check_commands "$f"
done

# --- Negative fixtures: verify each invalid command is caught -------------
# Each fixture is checked independently. Expected failures are counted and then
# removed from the real error count; an accepted fixture is a real failure.
negative_fixtures=(
  "gh issue definitely-not-a-subcommand"
  "gh pr view --files"
  "gh issue list --sort updated"
  "git definitely-not-a-subcommand"
  "gh api --invalid-flag"
)
fixture_errors=0
for fixture in "${negative_fixtures[@]}"; do
  before=$errors
  check_command "negative fixture" "$fixture" >/dev/null
  if (( errors > before )); then
    fixture_errors=$((fixture_errors + errors - before))
    errors=$before
  else
    fail "validator accepted negative fixture: $fixture"
  fi
done

# --- Negative fixture: flags on a backslash-continued line are validated ---
# check_commands must join continuations; otherwise a bad flag on the second
# line of a command (like the paginated REST example in SKILL.md) slips past.
continuation_fixture=$(mktemp)
printf 'gh api "repos/o/r/issues" --paginate \\\n  --invalid-flag\n' >"$continuation_fixture"
before=$errors
check_commands "$continuation_fixture" >/dev/null
if (( errors > before )); then
  fixture_errors=$((fixture_errors + errors - before))
  errors=$before
else
  fail "validator accepted an invalid flag on a backslash-continued command"
fi
rm -f "$continuation_fixture"

# --- Sync: the quick reference must not invent commands -------------------
# Every gh/git subcommand pair in the quick reference must also be used in
# SKILL.md or the deeper references, so the cheat sheet cannot drift into
# documenting commands the corpus does not support.
check_reference_sync() {
  local quick_ref="$1"
  local known_list pair
  known_list=$({ grep -hoE "^(gh|git) [a-z-]+" "$skill" references/tool-patterns.md references/workflow.md || true; } | sort -u)
  while IFS= read -r pair; do
    if ! grep -qF "$pair" <<<"$known_list"; then
      fail "$quick_ref uses \"$pair\", which is not used in SKILL.md, tool-patterns.md, or workflow.md"
    fi
  done < <(grep -hoE "^(gh|git) [a-z-]+" "$quick_ref")
}

check_reference_sync references/quick-reference.md

# --- Regression: a reference-sync failure must exit nonzero ---------------
# Run the validator against a temporary copy whose quick reference contains a
# valid command pair that the corpus does not document. The nested run skips
# this regression to avoid recursion.
if [[ -z "${SCOUT_VALIDATOR_SELF_TEST:-}" ]]; then
  regression_dir=$(mktemp -d)
  cp -R . "$regression_dir/skill"
  printf '\ngh gist list\n' >> "$regression_dir/skill/references/quick-reference.md"
  if ( cd "$regression_dir/skill" && SCOUT_VALIDATOR_SELF_TEST=1 bash scripts/validate-skill.sh >/dev/null 2>&1 ); then
    fail "reference-sync regression: validator exited 0 for a quick reference with an undocumented command"
  fi
  rm -rf "$regression_dir"
fi

if (( errors > 0 )); then
  echo ""
  echo "Skill validation failed: $errors error(s)."
  exit 1
fi

echo ""
echo "Skill validation passed: structure, pipeline headings, commands, flags, reference sync, and $fixture_errors negative fixture(s) rejected."

License (Apache-2.0)

View full license text
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to the Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by the Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding any notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. Please also get an
      in-depth understanding of the license from
      http://www.apache.org/foundation/license-faq.html

   Copyright 2026 Shaurya Gangrade

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.