Factory feedback report
Close the loop: turn this project's journal and task history into one report the factory maintainer can act on.
This skill runs unattended, for example from a weekly automation. Never ask the developer anything and never wait for input. The developer answers later, in comments on the issue it opens.
First read storage and resolve $FACTORY_ROOT. Records stay in that catalog, never in product commits. Skip its interactive first-use steps (such as agreeing a backup destination); mention them in the result instead.
How reporting is tracked
Reports are not stored. Each journal entry records whether a feedback issue already covered it, with a line under its Context line (or under its last metadata bullet if it has none):
- **Reported**: YYYY-MM-DD, <feedback issue URL>
This skill's own notes use Context feedback run, so they never mix with developer entries about the feedback skill. A run first appends a pending note naming the exact issue title and the entries it covers. After posting, it marks those entries and the pending note. A pending note without Reported therefore means an earlier run stopped part-way.
Writing the journal. Every change to journal.md happens under the journal lock (mkdir "$FACTORY_ROOT/locks/journal", see storage). Re-read the file after acquiring it, write the whole new version to a temporary file in the same directory, then rename it over journal.md, so a crash can't leave it half-written. If journal.md is missing, create it with the heading # Engineering journal. Release the lock as soon as the write is done. If the lock is taken, stop and report its owner. A lock left by a crashed run also blocks journaling, so name it plainly in the result.
1. Finish an interrupted run
First do the check in step 2; if it stops, stop here too. Then, if the journal has a pending note without Reported, finish that run before anything else. If gh is unavailable (step 5.1), stop and leave the note as it is.
- Look up its exact title, as in step 5.2.
- If the issue exists, mark the entries the note lists and the note itself with its URL, as in step 6, then continue with step 2.
- If it doesn't, rebuild the report from the listed entries (step 4), post it under the same title with step 5.4 only (skip 5.3; the pending note already exists), and mark them (step 6). Then end the run; the next run reports anything newer.
2. Check for unmigrated reports
Versions before 0.5.0 saved reports in $FACTORY_ROOT/reports/. The 0.5.0 release migration marks the journal entries they covered and archives the directory. If reports/ still exists, stop without writing or posting: say that /factory:migrate 0.5.0 must run first, so old entries aren't reported twice. Never read, edit or delete reports/ here.
3. Gather evidence
Read without holding the lock:
- Journal: every entry in
$FACTORY_ROOT/journal.mdwithout a Reported line, especiallyfrictionandidea, including entries from a journal session review. Skipfeedback runnotes. - Period: from the day after the newest Reported date in the journal (or the first journal entry if there is none) to today. If an included entry is older than that, start at that entry's date instead, so the title matches what the issue covers.
- Tasks: files in
$FACTORY_ROOT/tasks/whose log has lines in the period. Count tasks by status, and take blocks from their status lines. Take build rounds, review rounds and failed gates fromdeliveryjournal entries; older task logs may also record rounds. - "Notes for the factory" from builder and reviewer reports, if they were journaled.
- The running factory version from plugin.json, and which agent (Claude Code or Codex) is running this report. If records show tasks run by more than one agent or version in the period, say so rather than attributing everything to the current one.
If there are no unreported entries and no task activity, stop. Open no issue and report that there was nothing to send.
4. Write the report
Every problem, gap, or idea becomes a numbered point the developer can decide on. Where the evidence is ambiguous, add a question instead of guessing (at most 5). Mark your own inferences as inferences.
Write it to a temporary file outside the product checkout and the catalog (for example from mktemp). Delete that file whenever the run ends, including on failure:
# Factory feedback: <project name>, <start> to <end>
**Factory version**: <version> **Agent**: <Claude Code | Codex>
## Summary
<3–5 lines: the main takeaway.>
## By the numbers
- Tasks defined / delivered / blocked: x / y / z
- Average review rounds: n
- Failed gates: n
## What worked
- ...
## Points for decision
### P1. <short title>
- **Kind**: friction | missing | idea
- **Evidence**: <journal entry date and title, or task id>
- **Suggested change**: <optional>
## Questions for the developer
1. <specific question, for example "DEV-004 needed 3 review rounds. Was the reviewer right, or too strict?">
## How to respond
Answer the questions and add context in comments. A maintainer then comments one decision per point, for example `P1: accept`, `P2: reject: <reason>`, `P3: defer`, or `P4: duplicate of #12`. Accepted points become enhancement issues during triage, and the feedback issue then closes.
Use the project name unless it looks confidential (for example a client codename); then use a neutral label such as "a client project", in both the heading and the issue title.
Leave out empty sections, except Points for decision ("None this period").
No one checks the report before it is posted, so keep it to project-agnostic facts about the factory. Leave out secrets, credentials, customer or personal data, code, internal URLs and product file paths. When unsure whether something is safe to share, leave it out.
5. Post it
- Check
gh auth status. Ifghis missing or not signed in, stop without writing to the journal, so the next run reports the same entries, and state why in the result. - The issue title is
Feedback: <project> <start> to <end>. To look up an issue by title, rungh issue list --repo je3yk/software-factory --state all --search "\"<title>\" in:title" --json title,urland compare titles exactly. Don't filter by label; it may be missing. - Acquire the lock and re-read the journal. If a
feedback runnote is pending, a sentfeedback runnote appeared since you gathered evidence, or any gathered entry is now marked Reported, another run got there first: release the lock and stop without writing. Otherwise append the pending note: typenote, Contextfeedback run, text "Feedback report pending: ", followed by the date and title of every journal entry it covers. - Look up the title. If an issue already exists, use its URL. Otherwise run:
If the label is rejected, look up the title again before retrying withoutgh issue create --repo je3yk/software-factory \ --title "<exact title>" \ --label feedback --body-file <temporary report file>--label, since the first call may have succeeded. Say in the result if the label is missing; theFeedback:title still identifies it for triage. If creation fails, stop. The pending note lets the next run finish this one without posting twice.
6. Mark and finish
- Under the lock, add
- **Reported**: <today>, <issue URL>to every entry the pending note lists and to the note itself, and change its text to "Feedback report for sent: ". Change nothing else. - Delete the temporary report file.
End with a short result: the period, the number of entries reported, and the issue URL, or why nothing was posted. An automation's log is often the only place a failure shows up, so state failures plainly.
Original Markdown, including metadata
---
name: feedback
description: Turn this project's unreported journal entries and recent task history into a feedback report, post it as a `feedback` issue on the software-factory repo, and mark the entries as reported. Runs unattended, so it suits a scheduled automation.
disable-model-invocation: true
---
# Factory feedback report
Close the loop: turn this project's journal and task history into one report the factory maintainer can act on.
This skill runs **unattended**, for example from a weekly automation. Never ask the developer anything and never wait for input. The developer answers later, in comments on the issue it opens.
First read [storage](../storage.md) and resolve `$FACTORY_ROOT`. Records stay in that catalog, never in product commits. Skip its interactive first-use steps (such as agreeing a backup destination); mention them in the result instead.
## How reporting is tracked
Reports are not stored. Each journal entry records whether a feedback issue already covered it, with a line under its **Context** line (or under its last metadata bullet if it has none):
```markdown
- **Reported**: YYYY-MM-DD, <feedback issue URL>
```
This skill's own notes use **Context** `feedback run`, so they never mix with developer entries about the feedback skill. A run first appends a *pending* note naming the exact issue title and the entries it covers. After posting, it marks those entries and the pending note. A pending note without **Reported** therefore means an earlier run stopped part-way.
**Writing the journal.** Every change to `journal.md` happens under the journal lock (`mkdir "$FACTORY_ROOT/locks/journal"`, see [storage](../storage.md)). Re-read the file after acquiring it, write the whole new version to a temporary file in the same directory, then rename it over `journal.md`, so a crash can't leave it half-written. If `journal.md` is missing, create it with the heading `# Engineering journal`. Release the lock as soon as the write is done. If the lock is taken, stop and report its owner. A lock left by a crashed run also blocks journaling, so name it plainly in the result.
## 1. Finish an interrupted run
First do the check in step 2; if it stops, stop here too. Then, if the journal has a pending note without **Reported**, finish that run before anything else. If `gh` is unavailable (step 5.1), stop and leave the note as it is.
1. Look up its exact title, as in step 5.2.
2. If the issue exists, mark the entries the note lists and the note itself with its URL, as in step 6, then continue with step 2.
3. If it doesn't, rebuild the report from the listed entries (step 4), post it under the same title with step 5.4 only (skip 5.3; the pending note already exists), and mark them (step 6). Then end the run; the next run reports anything newer.
## 2. Check for unmigrated reports
Versions before 0.5.0 saved reports in `$FACTORY_ROOT/reports/`. The [0.5.0 release migration](../../docs/migrations/0.5.0-release.md) marks the journal entries they covered and archives the directory. If `reports/` still exists, stop without writing or posting: say that `/factory:migrate 0.5.0` must run first, so old entries aren't reported twice. Never read, edit or delete `reports/` here.
## 3. Gather evidence
Read without holding the lock:
- **Journal**: every entry in `$FACTORY_ROOT/journal.md` without a **Reported** line, especially `friction` and `idea`, including entries from a journal session review. Skip `feedback run` notes.
- **Period**: from the day after the newest **Reported** date in the journal (or the first journal entry if there is none) to today. If an included entry is older than that, start at that entry's date instead, so the title matches what the issue covers.
- **Tasks**: files in `$FACTORY_ROOT/tasks/` whose log has lines in the period. Count tasks by status, and take blocks from their status lines. Take build rounds, review rounds and failed gates from `delivery` journal entries; older task logs may also record rounds.
- "Notes for the factory" from builder and reviewer reports, if they were journaled.
- The running factory version from [plugin.json](../../.claude-plugin/plugin.json), and which agent (Claude Code or Codex) is running this report. If records show tasks run by more than one agent or version in the period, say so rather than attributing everything to the current one.
If there are no unreported entries and no task activity, stop. Open no issue and report that there was nothing to send.
## 4. Write the report
Every problem, gap, or idea becomes a numbered **point** the developer can decide on. Where the evidence is ambiguous, add a question instead of guessing (at most 5). Mark your own inferences as inferences.
Write it to a temporary file outside the product checkout and the catalog (for example from `mktemp`). Delete that file whenever the run ends, including on failure:
```markdown
# Factory feedback: <project name>, <start> to <end>
**Factory version**: <version> **Agent**: <Claude Code | Codex>
## Summary
<3–5 lines: the main takeaway.>
## By the numbers
- Tasks defined / delivered / blocked: x / y / z
- Average review rounds: n
- Failed gates: n
## What worked
- ...
## Points for decision
### P1. <short title>
- **Kind**: friction | missing | idea
- **Evidence**: <journal entry date and title, or task id>
- **Suggested change**: <optional>
## Questions for the developer
1. <specific question, for example "DEV-004 needed 3 review rounds. Was the reviewer right, or too strict?">
## How to respond
Answer the questions and add context in comments. A maintainer then comments one decision per point, for example `P1: accept`, `P2: reject: <reason>`, `P3: defer`, or `P4: duplicate of #12`. Accepted points become enhancement issues during triage, and the feedback issue then closes.
```
Use the project name unless it looks confidential (for example a client codename); then use a neutral label such as "a client project", in both the heading and the issue title.
Leave out empty sections, except Points for decision ("None this period").
No one checks the report before it is posted, so keep it to project-agnostic facts about the factory. Leave out secrets, credentials, customer or personal data, code, internal URLs and product file paths. When unsure whether something is safe to share, leave it out.
## 5. Post it
1. Check `gh auth status`. If `gh` is missing or not signed in, stop without writing to the journal, so the next run reports the same entries, and state why in the result.
2. The issue title is `Feedback: <project> <start> to <end>`. To look up an issue by title, run `gh issue list --repo je3yk/software-factory --state all --search "\"<title>\" in:title" --json title,url` and compare titles exactly. Don't filter by label; it may be missing.
3. Acquire the lock and re-read the journal. If a `feedback run` note is pending, a sent `feedback run` note appeared since you gathered evidence, or any gathered entry is now marked **Reported**, another run got there first: release the lock and stop without writing. Otherwise append the pending note: type `note`, **Context** `feedback run`, text "Feedback report pending: <exact title>", followed by the date and title of every journal entry it covers.
4. Look up the title. If an issue already exists, use its URL. Otherwise run:
```sh
gh issue create --repo je3yk/software-factory \
--title "<exact title>" \
--label feedback --body-file <temporary report file>
```
If the label is rejected, look up the title again before retrying without `--label`, since the first call may have succeeded. Say in the result if the label is missing; the `Feedback:` title still identifies it for triage. If creation fails, stop. The pending note lets the next run finish this one without posting twice.
## 6. Mark and finish
1. Under the lock, add `- **Reported**: <today>, <issue URL>` to every entry the pending note lists and to the note itself, and change its text to "Feedback report for <period> sent: <URL>". Change nothing else.
2. Delete the temporary report file.
End with a short result: the period, the number of entries reported, and the issue URL, or why nothing was posted. An automation's log is often the only place a failure shows up, so state failures plainly.