Skip to content
Back to skills

Github Issue

BSecurity

Creates well-documented GitHub issues (or rewrites the body of an existing one) from problems discussed in conversation. Investigates the codebase to map affected layers, files, and data flow, then writes up findings with an objective and measurable key results as the acceptance criteria — without prescribing fixes. Use when a conversation has identified a problem that needs a GitHub issue, when the user wants to document a bug or problem for an implementer, or when dispatching work. Triggers...

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added October 5, 2026
ai-agentsgobashterraformtestinggitapifrontendbackend

Works with

  • api

Security analysis

B75/100
  • criticalSends environment variables or credentials to an external URL

Pro shows the line behind each finding and how to fix it

Scanned November 30, 2026

npx -y skills add stempeck/agentfactory --skill github-issue --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Github Issue?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Github Issue
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/stempeck-github-issue/badge)](https://www.skillsdirectory.com/skills/stempeck-github-issue)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: github-issue
description: Creates well-documented GitHub issues (or rewrites the body of an existing one) from problems discussed in conversation. Investigates the codebase to map affected layers, files, and data flow, then writes up findings with an objective and measurable key results as the acceptance criteria — without prescribing fixes. Use when a conversation has identified a problem that needs a GitHub issue, when the user wants to document a bug or problem for an implementer, or when dispatching work. Triggers on "create a GitHub issue", "write up an issue for this", "file a bug", or "document this problem".
---

# GitHub Issue Investigation & Write-Up

Produces a write-up that gives an implementer everything they need to find and understand a problem — without telling them how to fix it.

## Your Role: Cartographer, Not Surgeon

You are not fixing this problem. You are drawing the map for someone who will.

The implementer who picks this up is skilled — they will read the codebase, trace the
data flow, form their own theory, and write the fix. What they need from you is the
terrain: which files are involved, what the data flow looks like, what's surprising
about the system, and what "done" looks like. What they don't need — and what actively
hurts them — is you pre-chewing the solution. When you prescribe specific changes, you
close off their discovery, narrow their scope, and cause them to miss things you missed.

**Cartographer of the fix — not of the problem's altitude.** The "not a surgeon" rule
governs the FIX: don't prescribe how to solve it. It does NOT license accepting the
reported problem's *altitude* uncritically. The report — and any pre-stated acceptance
criteria — is a hypothesis about where the defect lives, not scripture to be mapped. Your
job includes testing whether the reported problem IS the defect or merely a leaf of a
larger one, and stating the defect at the altitude that serves the Objective. A precise,
well-anchored map of the wrong territory is the worst thing this skill can produce —
worse than a rough map of the right territory, because its precision manufactures
confidence that the wrong problem is the real one. Phase 3 forces this check; do not skip it.

**Confirmation volume is not correctness.** Anchor counts, prior approvals, downstream
cross-reviews, and "looks right" verdicts measure internal consistency with the frame you
were handed — not whether that frame is right. When everyone downstream inherits your
framing, their agreement is one frame counted many times, not many independent
confirmations. Judge the issue against the Objective, never against how well-supported the
reported symptom is.

**Write every sentence as if you're briefing a colleague who will go deeper than you
did.** Your job is to save them the first hour of orientation, not to do their job for
them.

**Be honest about what you find.** If a feature was half-implemented, say "this was
never wired up." If there are no tests covering the flow, say "there are no tests
for this." If the frontend and backend API contracts don't match, say "these were
built without verifying the contract." Don't soften findings into neutral descriptions
of state — name what's broken, what's missing, and what was never done. The CEO and
the implementer both need the unvarnished picture to make good decisions.

In practice:
- **DO**: List every file and layer that touches the affected data flow
- **DO**: Note contextual gotchas an implementer might miss (env differences, data
  format mismatches, orphan fields, display vs stored values)
- **DO**: Write an Objective and key results that define "done" without defining "how"
- **DON'T**: Say "add this line to this file" or "change X to Y"
- **DON'T**: Name a specific function, flag, command substitution, or approach as
  "the correct" / "the equivalent" / "the substitute" — naming the mechanism is
  prescription even when it's offered as an example
- **DON'T**: State scope constraints ("no changes to X", "read-only on Y",
  "cleanup only") unless the USER said them — editorial scope decisions
  masquerading as user requirements bias every downstream reader
- **DON'T**: Widen the issue to a defect the Objective does not depend on, or propose
  changing behavior the user did not ask to change — Phase 3's sort decides what belongs
- **DON'T**: Assume which environments, scripts, or deploy steps are in scope — if
  multiple exist, list them all and let the implementer determine what's needed
- **DON'T**: Minimize the scope ("it's just one line") — that causes blind spots

**Enumeration is context, not a task list.** When listing files or occurrence sites,
say what the implementer needs to understand, not what they need to transform. If
every item in a list must be processed identically to satisfy an acceptance
criterion, you are prescribing a mechanical transform — which is prescription.
A 128-row table of occurrence sites reads to every downstream agent as "128 things
to fix," regardless of what the surrounding prose says.

## Process

Copy this checklist and track progress:

```
Investigation Progress:
- [ ] Phase 1: Understand the problem as reported
- [ ] Phase 2: Investigate the codebase
- [ ] Phase 3: Reconcile findings with symptoms, interrogate the frame (altitude gate), AND map the outcome's reach (a worksheet, not posted)
- [ ] Phase 4: Draft the GitHub issue
- [ ] Phase 5: Validate the draft (checklist items 1-4 "none", 5 covered, 6 passes, 7 prints KR FORM: PASS)
- [ ] Phase 6: Post via gh api
- [ ] Phase 7: Create bead & dispatch (if requested)
```

### Phase 1: Understand the Problem as Reported

1. If a GitHub issue URL is provided, fetch it via `gh api` to get the full body and
   any comments
2. Read the problem description carefully — note the user's exact symptoms, what they
   expected, and what actually happened
3. Record every decision the user has already made about this issue — success criteria
   they approved, anything they ruled in or out, whether they asked for dispatch — as
   verbatim quotes in `${TMPDIR:-/tmp}/github-issue-frame.md`, the frame worksheet. They
   stand. Only Phase 3's sort can re-open one, by its one question

Treat the report as the *entry point*, not the *boundary*, of the problem — Phase 3 tests
whether it is the right altitude.

**Examine all attached artifacts.** Screenshots, pasted logs, email contents, and
configuration screenshots often carry more signal than the codebase itself. These are
first-class evidence, not supplementary detail.

- Download images with authenticated requests: `curl -sL -H "Authorization: token $(gh auth token)" -o file.png "<url>"`
- Use the Read tool to visually examine downloaded images
- Note every concrete detail visible in artifacts (field values, status indicators,
  error codes, configuration states)

### Phase 2: Investigate the Codebase

Use an **Explore agent** (subagent_type=Explore) to map the technical landscape. The
prompt should ask the agent to trace the full data/control flow related to the problem.
Be thorough — request that the agent search across all relevant directories (src, test,
terraform, deploy scripts, config, etc.).

The investigation should produce:
- **Affected layers**: Frontend, backend, infrastructure, tests, docs — every layer
  the problem touches or that an implementer would need to understand
- **Affected files**: Repo-relative paths, each with its role described by name and
  behavior (the function, section, screen, or command involved), never by line number
- **Data flow**: How data moves through the system (form → API → handler → output)
- **The break point**: Where exactly the expected behavior diverges from actual behavior
- **The actual mechanism**: for an incident, what *actually* caused it — which is often
  not the surface the report named. Trace it to the mechanism, not the first plausible match.
- **Contextual gotchas**: Things that aren't broken but are relevant — orphan fields,
  naming mismatches, environment differences (staging vs prod), format differences
  (stored codes vs display labels), etc.
- **Outcome consumers**: every person, agent, command, screen, dashboard, document,
  formula, or hook that reads or acts on the affected data or capability, each with its
  file and the name of what reads it — found by searching for every reader, not only
  where it breaks

### Phase 3: Reconcile Findings with Symptoms, and Interrogate the Frame

**This phase is critical.** Before writing anything up, do ALL THREE: (a) verify your
codebase findings explain the reported experience, (b) test whether the reported problem
is even the right problem, and (c) map every consumer of the outcome. Skipping (b) is how
a precise map of the wrong territory ships; skipping (c) is how a surface that must
change gets no acceptance criterion.

**(a) Symptom reconciliation.** Enumerate every symptom the user reported and the specific
finding that explains it:

| Reported symptom (quote) | Finding that explains it (file and named code, or "gap") |
|--------------------------|-----------------------------------------------|
| ...                      | ...                                           |

Any row with "gap" means the investigation is incomplete. Do not proceed to write-up.
Common gap sources: factors outside the codebase (DNS, CDN, third-party services,
environment variables, external dashboards) that Explore agents can't see. If a row
has a gap, ask the user — they often have access to information invisible to the
codebase (admin dashboards, service configurations, deployment history). A single
piece of user context can redirect the entire investigation — don't skip this step
to save time.

**If my findings say "X shouldn't happen" but the user says it does — the user is
right and my investigation is incomplete.**

**(b) Interrogate the frame — the altitude gate.** The card is a hypothesis, not
scripture. Test whether the reported problem is the defect or a leaf of a larger one.
Fill this table:

| Reported problem (the "card") | The purpose it serves, quoted from its source | If someone fixed EXACTLY the reported problem and nothing else, would its cause be gone? (yes/no + why) | This issue's Objective: the next step toward column 2 that removes the cause |
|---|---|---|---|

**Column 2 is the purpose, never the incident.** A failed check, a broken command, an
error, or a proof that could not pass is evidence that a purpose is not being met — it
is not the purpose. Trace up to what established the broken capability: run
`git log --diff-filter=A --format='%h %s' -- <a primary affected file>`, open the design
document, issue, or ADR that commit names, and quote its stated purpose. If nothing
established it, quote the user. Column 2 is quoted word for word as the `source:` of the
issue's `## Objective`.

**Column 4 is the issue's Objective: one step, not the end state.** Column 2 often states
a whole program's purpose. An issue whose Objective is that purpose asks an agent to build
all of it at once, because the key results must achieve the whole Objective. Write column 4
as the outcome this issue delivers: the smallest step toward column 2 that removes the cause
in column 3, within what the user asked for. The rest of column 2 is left to later issues.
Perfect is the enemy of good: a purpose is reached by increments, and each issue is one.

Column 3 is load-bearing. If it is "no," the reported problem sits *below* its cause, and
column 4 must remove the cause, not only the symptom.

Then apply the elevation test: could a change to a boundary or abstraction *delete* the
concern's substrate, rather than guard one path to it? If so, name that boundary under
Additional Context as information for the implementer, not a requirement of this issue.
For a systemic or architectural defect, invoke `/architecture-elevation` and carry its
verdict the same way.

**Sort every finding beyond the report by the Objective.** Give a row to every defect, gap,
or mismatch the investigation reported that the symptom table does not use — a deeper
root, an incident's actual mechanism, a defect that only shares a file, screen, or data
with the reported problem. One with no row was not considered:

| Finding beyond the report | Can the Objective (column 4) be achieved while this is left exactly as it is? (yes/no + why) |
|---|---|

- **No** — it is the cause, or it stands between a consumer and the Objective, so it
  belongs to this issue: name it in the problem statement and measure it with a key
  result. Deferring it to a "follow-up" so the issue stays narrow and closes green is the
  failure this skill exists to prevent — documenting a hole is not filling it. Do not
  split, defer, or narrow it yourself. If a decision in the frame worksheet excludes it,
  that decision and the Objective conflict: ask the user once, every such finding in one
  question, stakes named — *"Investigation found X. The agreed scope leaves it out, and
  [what stays broken]. Widen, or keep the scope?"* If they keep the scope, quote the
  answer in the worksheet and state the finding under Additional Context.
- **Yes** — it is not this issue's. It gets no key result and no question to the user:
  widening the issue to cover it is scope creep, and so is proposing to change behavior
  the user did not ask to change. Mention it under Additional Context only when the
  implementer needs it to deliver this issue; otherwise tell the user about it when you
  report the posted issue.

**FRAME GATE — quote your answers; a yes/no is not passing:**
- [ ] Column 2 quotes the purpose's source (a design document, issue, ADR, or the user)
  — not the incident that triggered this issue.
- [ ] Column 3 is answered for every reported symptom, with the "fix exactly this →
  cause gone?" reasoning shown.
- [ ] If any column-3 answer is "no," quote the words of column 4 that name the cause it
  removes.
- [ ] Column 4 is one step toward column 2, not column 2 restated: quote what of column 2
  it leaves to later issues.
- [ ] The elevation test is answered in writing: the boundary whose change would delete
  the concern, or why there is none.
- [ ] Every finding beyond the report has a row in the sort, with its reasoning shown, and
  every conflict with a recorded decision has the user's answer quoted.

Add the symptom table, the frame table, the sort and the gate answers to the frame
worksheet. Phase 5 reads them there. Keep them out of the Reach file below: its check
counts every table row in that file as a consumer.

**(c) Map the outcome's reach.** Every outcome consumer from Phase 2 gets one row:

| Consumer | Surface (file, screen, or command) | What they need from the outcome | Key result, or "not needed: <reason>" |
|---|---|---|---|

Fill the last column when the key results are written in Phase 4. A consumer with no key
result and no reason was not considered: either it needs this issue's outcome, and a key
result measures what it needs, or it does not, and the row says why (for example "not
needed: a later step toward the purpose", or a decision the user made, quoted). Every key
result must appear in at least one row — a key result no consumer needs is not needed.

Save the table to `${TMPDIR:-/tmp}/github-issue-reach.md`. It is a drafting worksheet,
not part of the issue: Phase 5's check reads it, and Phase 6 does not post it. Every
surface in it already appears in the issue under Affected Layers & Files.

### Phase 4: Draft the GitHub Issue

Draft the body locally and save it to `${TMPDIR:-/tmp}/github-issue-draft.md`. Do not
post yet — Phase 5 checks that file and Phase 6 posts it.

**If a GitHub issue already exists:** the draft replaces its body in Phase 6. Carry every
still-accurate fact from the current body into the draft — GitHub keeps the replaced body
in the issue's edit history, and nothing reads it there. Never post the write-up as a
comment: the body is what every reader of the issue reads.
**If no GitHub issue exists:** The draft will become the body of a new issue in Phase 6.

Structure:

```markdown
## Objective

[One sentence: the outcome this issue delivers, and for whom (Phase 3 column 4) — no mechanism, file, or command] — source: "[the purpose it serves, Phase 3 column 2, verbatim]" ([issue number, URL, or file path it comes from, without backticks])

## Problem

[1-2 sentences stating the defect and its cause (Phase 3 column 3), not merely the
reported symptom. Where the break occurs and — for an incident — its actual mechanism.]

### Affected Layers & Files

**[Layer Name]**
- `path/to/file` — What this file does in context of the problem

[Repeat for each layer: Frontend, Backend, Infrastructure, Tests, Docs, etc.]

### Additional Context

- [Gotcha 1: something non-obvious the implementer should know]
- [Gotcha 2: environment differences, data format issues, etc.]
- [Gotcha 3: related but not broken things worth being aware of]
- [Any frame or elevation finding — information for the implementer, not a requirement]

### Acceptance Criteria

- **KR-1** — Count of [what must stop happening]: 0. Measured against: [what the consumer reads after the change, or a source the change cannot alter]. Scope: [the whole population, e.g. 100% of X].
- **KR-2** — Percentage of [population] that [state that must hold]: 100%. Measured against: [...]. Scope: [...].
```

**Writing guidelines:**
- Keep it factual and terse — no filler, no opinions on difficulty
- Every file mentioned should be a real path confirmed by the investigation
- **Write what stays true while the code moves.** The issue states what must be done at
  any point in time, not a snapshot of today's code. Use no line numbers, line ranges, or
  `file:line` anchors anywhere in the issue. Refer to a file by its path, and to code by
  the name of its function, section, screen, or command. Leave out other details that
  change with routine edits (current counts, test positions, today's values) unless the
  problem is about them.
- Each acceptance criterion is a key result on one line: a metric with a target number,
  what it is measured against, and a scope.
- **Name the metric as a count or a percentage.** Write "Count of [what is counted]: N"
  or "Percentage of [population] that [state that must hold]: 100%". Use a count with
  target 0 only for something that must stop happening ("Count of stocks shown as
  excluded because their implied return is below 9%: 0").
- **State it positively.** Name the thing counted, or the state that must hold. Never
  count a negation: "Stocks … that are not excluded: 0" becomes "Percentage of stocks …
  that are shown as excluded for that reason: 100%"; "… differs from before: 0" becomes
  "Percentage of … that is the same as before the change: 100%".
- **One requirement per key result.** When a key result joins two conditions ("its value,
  or its other reasons, differ"), split it into two key results.
- **Measure against what the consumer reads, or a source the change cannot alter.**
  Measure against the screen, the API response, or the document the consumer reads after
  the change, or against a source the change cannot alter: filed data, or a baseline
  recorded before the change. Never measure against a recomputation by the code being
  changed. It only confirms the new code, not what readers see: stored rows written
  before the change can still show the old result.
- A key result never names the current system's internal files, functions, or states. It
  names a surface (a screen, a command, a document) only when a row of the Reach
  worksheet shows someone reads the outcome there.
- A key result never offers a way to be done without the outcome. Removing the surface a
  consumer reads is such a way, so a key result about a surface holds only while the
  consumer still reads the outcome there.
- Behavior that must be preserved is a key result too ("Percentage of X that is the
  same as before the change: 100%").

### Phase 5: Validate the Draft Before Posting

**Do not run `gh api` until this checklist is complete with quoted evidence from the
draft.** Answer each question by quoting the relevant passage from the draft, or
writing "none" only after reading every section of the body.

1. **Scope constraints** — Does the body constrain the scope of the fix (e.g., "no
   changes to X", "read-only on Y", "cleanup only", "no new features")? Quote every
   such constraint. For each: is it a decision in the frame worksheet, or did I add it? If I added
   it, remove it — editorial scope decisions masquerading as user requirements bias
   every downstream reader.

2. **Prescribed mechanisms** — Does the body name a specific function, flag, file
   path, command substitution, variable, or implementation approach as "the correct"
   / "the right" / "the equivalent" / "the substitute" / the suggested replacement?
   Quote each. Remove every one — naming the mechanism is prescription, including
   when offered as an example.

3. **Mechanical transforms** — Does any list or table in the body imply the
   implementer must transform each enumerated item identically to satisfy an
   acceptance criterion (e.g., "N sites to rewrite", "zero matches after cleanup",
   a line-number table of occurrences)? Quote each. Rewrite as behavioral AC or
   keep the enumeration as context only (without a corresponding AC that forces
   transforming every row).

4. **Regex-compliance AC** — Does any AC item pass if `grep` returns specific match
   counts (zero matches, N matches, exact string present/absent)? Quote each.
   Rewrite as observable behavioral outcome. AC tests what the system does, not
   what the file contents look like.

5. **Symptom coverage** — Does every user-reported symptom from the frame worksheet's
   symptom table appear in the body, tied to the finding that explains it? If a symptom is not
   covered, add it or re-open Phase 2.

6. **Frame coverage** — Does the problem statement name the cause behind the reported
   symptom (Phase 3 column 3), not merely the symptom? Quote the sentence. If the issue
   addresses only the reported symptom while the investigation found a deeper root or the
   incident's real mechanism, that is a FAIL — widen the issue to remove that cause, or
   quote the user's answer to the sort's question. This is the check that catches shipping
   "an agent can't pass one flag" for "an agent took down the whole factory."
   Then check the sort against the draft. For every "no" row, quote the problem-statement
   sentence that names it and its key result. For every "yes" row, confirm no key result
   measures it and every key result can be met while it is left as it is; if one cannot,
   the row is a "no".

7. **Objective and key results** — Run this against the saved draft. It must print
   `KR FORM: PASS`; paste that line as the evidence for this item.

   ```bash
   D="${TMPDIR:-/tmp}/github-issue-draft.md"; R="${TMPDIR:-/tmp}/github-issue-reach.md"; fail=0
   grep -q '^### Reach' "$D" && { echo "FAIL: the Reach table belongs in $R, not in the issue"; fail=1; }
   if grep -nE '\.[A-Za-z0-9]+:[0-9]+|`:[0-9]+|(^|[^[:alnum:]])[Ll]ines? [0-9]+|(^|[^[:alnum:]])L[0-9]+(-L?[0-9]+)?([^[:alnum:]]|$)' "$D"; then echo "FAIL: the lines above cite line numbers; name the file and the function, section, screen, or command instead"; fail=1; fi
   src=$(sed -n '/^## Objective/,/^#/p' "$D" | sed '1d' | grep -v '^#')
   obj=$(printf '%s\n' "$src" | sed -E 's/"[^"]*"//g')
   ac=$(sed -n '/^### Acceptance Criteria/,/^#/p' "$D" | sed '1d' | grep -v '^#')
   [ -n "$(printf '%s' "$obj" | tr -d '[:space:]')" ] || { echo "FAIL: no Objective"; fail=1; }
   printf '%s\n' "$src" | grep -qE 'source: *"[^"]{8,}" *\(.+\)' || { echo 'FAIL: the Objective does not quote its source as: source: "..." (where)'; fail=1; }
   if printf '%s\n%s\n' "$obj" "$ac" | grep -n '`'; then echo "FAIL: the lines above name an artifact"; fail=1; fi
   if printf '%s\n%s\n' "$obj" "$ac" | grep -inE 'degrad|best[- ]effort|where possible|if possible|if available|when available|unavailable|or document|documents? (explicitly )?why|honest(ly)? (classified )?state|fallback'; then echo "FAIL: the lines above allow done without the outcome"; fail=1; fi
   n=0
   while IFS= read -r line; do
     case "$line" in
       "- **KR-"*)
         n=$((n + 1)); body=$(printf '%s' "$line" | sed -E 's/^- [*][*]KR-[0-9]+[*][*]//')
         metric=$(printf '%s' "$body" | sed -E 's/Measured against:.*//')
         truth=$(printf '%s' "$body" | sed -nE 's/.*Measured against:(.*)Scope:.*/\1/p')
         printf '%s' "$body" | grep -q '[0-9]' || { echo "FAIL: no target number: $line"; fail=1; }
         for f in 'Measured against:' 'Scope:'; do
           printf '%s' "$body" | grep -qF "$f" || { echo "FAIL: missing '$f': $line"; fail=1; }
         done
         printf '%s' "$metric" | grep -qE '^[[:space:]]*(—|–|-)[[:space:]]*(Count|Percentage) of ' || { echo "FAIL: name the metric as 'Count of ...: N' or 'Percentage of ... : 100%': $line"; fail=1; }
         printf '%s' "$metric" | grep -qiE '(^|[^[:alnum:]])(not|never|without|no longer|fails?|differs?|neither|nor)([^[:alnum:]]|$)' && { echo "FAIL: state the metric positively, with no negation: $line"; fail=1; }
         printf '%s' "$truth" | grep -qiE 'recomput' && { echo "FAIL: measure against what the consumer reads or a source the change cannot alter, not a recomputation: $line"; fail=1; } ;;
       "- "* | "* "*) echo "FAIL: not a key result: $line"; fail=1 ;;
     esac
   done < <(printf '%s\n' "$ac")
   [ "$n" -ge 1 ] || { echo "FAIL: no key results"; fail=1; }
   reach=$([ -f "$R" ] && grep '^|' "$R" | grep -vE '^\|[-: |]+\|$' | sed '1d')
   krs=$(printf '%s\n' "$ac" | grep -oE '^- [*][*]KR-[0-9]+' | grep -oE 'KR-[0-9]+')
   [ -n "$reach" ] || { echo "FAIL: no rows in the Reach worksheet $R"; fail=1; }
   while IFS= read -r row; do
     [ -n "$row" ] || continue
     last=$(printf '%s' "$row" | sed -E 's/\|[[:space:]]*$//; s/.*\|//')
     case "$last" in
       *"not needed:"*) ;;
       *KR-[0-9]*) for k in $(printf '%s' "$last" | grep -oE 'KR-[0-9]+'); do printf '%s\n' "$krs" | grep -qx "$k" || { echo "FAIL: Reach cites $k, which is not a key result: $row"; fail=1; }; done ;;
       *) echo "FAIL: consumer with no key result and no reason: $row"; fail=1 ;;
     esac
   done < <(printf '%s\n' "$reach")
   for k in $krs; do printf '%s\n' "$reach" | grep -qE "$k([^0-9]|\$)" || { echo "FAIL: $k serves no consumer in the Reach worksheet"; fail=1; }; done
   if [ "$fail" = 0 ]; then echo "KR FORM: PASS"; else echo "KR FORM: FAIL"; exit 1; fi
   ```

   The script checks form only. The key results must be the measurables the Objective
   cannot be achieved without, and that together achieve it. Answer both in writing:
   - **Necessity**, for each key result, quoted: can the Objective be achieved while this
     key result is not met? The answer must be "no", with the reason. A "yes" means the
     key result is not needed — remove it, or rewrite it until the Objective depends on it.
   - **Sufficiency**, for the whole set: if every key result is met, is the Objective
     achieved for every consumer in the Reach worksheet? The answer must be "yes", with the
     reason. A "no" means a measurable is missing — name what the Objective still lacks and
     add the key result that measures it.
   - **One requirement**, for each key result, quoted: does it hold more than one condition?
     The answer must be "no". A "yes" means it is split into one key result per condition.
   - **Ground truth**, for each key result: name who reads its "Measured against" source,
     and why the change cannot alter that source. A source the changed code produces
     afresh is not ground truth; rewrite it to what the consumer reads after the change.

Any "yes" on 1-4 requires removing the offending content; a FAIL on 6 requires widening
the frame (or the user's quoted answer to the sort's question); a FAIL on 7, a "yes" to any necessity or
one-requirement question, a "no" to sufficiency, or a ground truth the change can alter
requires rewriting the key results. Re-read the revised draft and re-run the checklist
until 1-4 return "none", 5 is covered, 6 passes, and 7 prints `KR FORM: PASS` with every
necessity and one-requirement answer "no", the sufficiency answer "yes", and every ground
truth one the change cannot alter.

### Phase 6: Post

Post the saved draft, so the body posted is the body Phase 5 checked:

- **Existing issue** (replace its body; add `-f title="..."` when the title no longer
  states the problem): `gh api repos/{owner}/{repo}/issues/{number} -X PATCH -F body=@"${TMPDIR:-/tmp}/github-issue-draft.md"`
- **New issue**: `gh api repos/{owner}/{repo}/issues -X POST -f title="..." -F body=@"${TMPDIR:-/tmp}/github-issue-draft.md"`

### Phase 7: Create Bead & Dispatch (if requested)

If the user wants to dispatch the work:

1. Create a bead with `af bead create`:
   - `--type bug` for defects, `--type feature` for new behavior
   - `--title "..."` summarizing the problem
   - Description should reference the GitHub issue URL for full context
2. Dispatch with `af sling`:
   - `af sling --agent <specialist> "task description"` for specialist agents
     (e.g., `design-v5`, `ultra-implement`, `rootcause-all`)
   - `af sling --formula <name>` to instantiate a formula

## Anti-Patterns to Avoid

Prescription-shaped failures (smuggling mechanisms, constraints, transforms, or
regex-compliance AC into the body) are caught by the Phase 5 validation checklist.
Frame-shaped failures (mapping the wrong altitude, deferring the real root) are caught
by Phase 3's frame gate and Phase 5 item 6. Objective-shaped failures (the triggering
incident standing in for the Objective, key results that name the system or allow
failure) are caught by Phase 3 column 2 and Phase 5 item 7. Reach-shaped failures (a
consumer of the outcome with no key result) are caught by Phase 3 (c) and Phase 5 item 7.
The anti-patterns below name the ones that happen before the draft exists.

| Anti-Pattern | Why It's Bad | Instead |
|-------------|-------------|---------|
| Deriving key results from the Objective's wording alone | A surface that reads the outcome but is not named in the Objective gets no key result, and sufficiency cannot see it | Map every outcome consumer in Phase 3 (c); each cites a key result or a reason |
| Using the incident that triggered the issue as its Objective | "Fix exactly this → served?" answers yes by construction, so the frame gate passes on an incident-sized problem and every downstream stage traces to it | Trace up to what established the broken capability and quote its purpose (Phase 3 column 2) |
| Mapping the reported problem faithfully without testing its altitude | Ships a precise, well-anchored fix for the wrong (too-narrow) problem; the real defect survives | Run Phase 3's frame gate: if fixing exactly the report would leave its cause, the Objective removes the cause |
| Writing the whole purpose as the issue's Objective | The key results must achieve all of it, so an agent builds all of it at once | Phase 3 column 4: the next step toward the purpose, within what the user asked for |
| A key result that removing a surface would satisfy | "Every surface shows the right figure" is met by deleting surfaces; the consumer loses what it read | Write it so it holds only while the consumer still reads the outcome there |
| Deferring a deeper root the investigation found to a "follow-up" | Closes a narrow issue green while the real defect is documented-but-unfixed — documenting a hole is not filling it | It belongs to this issue (Phase 3's sort); only the user's quoted answer to the sort's question leaves it out |
| Asking the user to widen-or-defer a finding the Objective does not depend on, or a scope they already set | Each question re-opens a settled decision and proposes scope creep | Phase 3's sort: a "yes" row gets no key result and no question, and Phase 1's recorded decisions stand |
| A key result measured against a recomputation by the code being changed | It confirms only the new code; stored results from before the change, which readers still see, go unchecked | Measure against what the consumer reads after the change, or a source the change cannot alter |
| A key result that counts a negation ("… that are not excluded: 0", "… differs: 0") | Readers have to decode a double negative to learn what must hold | "Count of [what must stop happening]: 0" or "Percentage of [population] that [state that must hold]: 100%" |
| Two requirements in one key result | One can fail while the other passes, and the result reads as half met | One condition per key result |
| Posting the Reach table in the issue | It repeats Affected Layers & Files and adds bookkeeping no implementer needs | Keep it in the Reach worksheet; the check reads it there |
| A line-numbered code map | Line numbers move with every edit, so the issue goes stale and ties the implementer to today's code | Name the file, and the function, section, screen, or command in it |
| Treating anchor counts / prior approvals as proof the frame is right | Confirmation that all inherits one frame is that frame counted N times, not N independent checks | Judge correctness against the Objective, not against internal consistency |
| "This is a one-line fix" | Minimizes scope, misses environments/tests | List all affected layers |
| Naming specific deploy scripts | Assumes deploy path, misses staging/prod parity | Note that multiple environments exist |
| Skipping test files | Implementer might skip test updates | Always list test files in affected layers |
| Skipping artifact examination | Screenshots and pastes often contain the diagnosis | Examine every attached image, log, and config screenshot before exploring the codebase |

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.