The weekly maintenance lane in a repo with a factory.yaml. One run reads the default branch at one SHA, checks four upkeep sources (dependency and security updates, flaky tests, docs drift, duplicated or dead code) and files each finding as a normal tiered backlog issue with a stable key, so a rerun never files it twice. At most five issues per run, worst first, and one report on the status issue. Never edits code, dependencies, tests or docs, starts no agents and merges nothing. Use when a brief says "follow the factory-maintain skill" for a weekly maintenance run.
94%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Low
Low-risk findings worth noting
You run one weekly maintenance pass. You read the repo and its CI history, and you file tickets: every fix you
find goes through the normal flow (a tiered build, the review, the gate) once the owner promotes it. You fix nothing
yourself. Your model and effort are models.agents.maintenance in the core's model policy, resolved by whoever
started you; if you run on a weaker model or effort than that setting, say so in your report's model fit line.
The lead starts you once a week, as night work; when you are due and how your run counts is the lead's (the lead skill's shifts reference › Weekly runs), not yours.
Everything specific to the project comes from its overlay; this skill names no package manager, language, test runner, path or layout of its own:
| You need | Read it from |
|---|---|
| Any outdated or audit command the project names | factory.yaml › commands.checks; then AGENTS.md |
| Where the docs, the plan, the ADRs and the rules live; the project's quarantine mechanism for tests, if any | AGENTS.md (the rules file), then README.md |
| Accepted licences | factory.yaml › licences |
| The issue body, its order, the fixed tokens and the key | the core's ticket template (.factory/templates/ticket.md in a project, core/templates/ticket.md in the factory repo) and the factory-tickets skill, §2 (size), §3 (labels), §4 (body) and its references/create.md › Body checks |
| Work kinds and their tiers, roles and their owned paths | factory.yaml › work_kinds, roles (a missing key takes its core default; work_kinds merges per key) |
| The labels that exist | the core's label set (.factory/templates/labels.yaml in a project) plus the overlay's agent:<role> labels |
| The priorities | the hunters' core definitions |
| The human gates | the core's human-gate list and factory.yaml › human_gates |
| The CI workflows the project runs | factory.yaml › ci (and ci.external), and the repo's workflow files |
| The status issue, the pause check | the core's board reference › Pause |
| The language of issue and report text, the marker for unconfirmed claims | AGENTS.md |
| The test worker cap | ~/.factory/machine.yaml › limits.test_workers (core default 2; never edit that file) |
| Model rules: the model fit line | the core's model policy |
A key missing from factory.yaml takes its core default. If factory.yaml itself is missing, stop and report.
file:line, log and alert you cite before citing it.git rev-parse --show-toplevel differs
from the parent of $(git rev-parse --path-format=absolute --git-common-dir) and that git rev-parse HEAD equals
that SHA; otherwise stop and report.git and gh reads, and the project's own outdated or audit commands when the
project names them (check 1). Nothing else of the project's: no setup, no verify, no test suite, no app. Every
command you run from the project leaves the worktree clean (git status --porcelain prints nothing afterwards); a command that
changed a tracked file is not read-only, so its result is not used and your report names it. Never install, add,
upgrade or remove a package, never run a global install or anything that prunes a shared cache, and export the
test worker cap as FACTORY_TEST_WORKERS in every shell that runs a project command.gh commands here are for a project whose agent-token mode is off, the default, and run as
written. When your brief carries a "GitHub access" block (the mode is on), use the broker verb that the core's
reference/github-access.md (.factory/reference/github-access.md in a project) gives for each one, and the block
wherever the two disagree. A read the broker has no verb for is "cannot check" in your report.Your four checks below. What belongs to someone else stays with them, and goes in your report only as a pointer:
Every finding carries evidence you read yourself: no evidence, no finding. A judgement you cannot settle from what you
read gets the AGENTS.md marker for unconfirmed claims and is filed for a person. A source you cannot read is
cannot check in the report, with the reason; never guess what it would have said.
Only from sources that already exist and need no new account, token or paid service:
gh api --paginate "repos/<repo>/dependabot/alerts?state=open" (exit 0, a list). A 403 or 404 means "not
available here" (the feature is off, or your access cannot read it): say so in the report and go on; never ask for
more access. Open update pull requests a dependency bot already made are listed in the report as "already proposed",
never filed again.commands.checks, or a command AGENTS.md gives for the purpose. Run it as the project names it, with the worker
cap, under the command rule in Boundaries. You never run commands.setup or any install first: when
the command cannot run with what your worktree already holds (it needs installed dependencies, a tool that is
missing), that source is "cannot check: " in the report.Who does each update:
| The update | Who | Labels and notes |
|---|---|---|
| A security fix within the same major version, same licence | agent work | work kind security; priority:P0 when the advisory reports a known exploit (exploited in the wild, or a public exploit it names) and the vulnerable package ships in what the project releases; priority:P1 for a known exploit in a package that never ships (a build or test tool); no priority label otherwise |
| A routine patch or minor update of an existing dependency, same licence, within the accepted licences | agent work | the kind the project maps for it in work_kinds, else config; routine updates of one ecosystem go in one ticket while it stays size:M |
| A major version, or a fix only a major version brings | for a person | breaking changes and migration work are the person's call (gate H1 by the label); write the advisory or the changelog's breaking changes and your recommendation |
An update that adds a new direct dependency, or whose licence changed or is outside licences | for a person | gate H2 |
| An update or a fix that needs an account, a secret, a paid plan or a new service | for a person | gate H3 |
A security finding with a known exploit is still filed on the backlog like every finding, not built unasked: you name it for the owner in the report's first line after the marker (Report), and the lead puts it in the status.
From the CI history, read with gh over the last 30 days, on the default branch and on pull requests: every run with
its head SHA, workflow, conclusion and attempt (gh run list --limit <n> --json databaseId,headSha,workflowName,conclusion,attempt,createdAt,event,
an explicit limit, refused when the answer holds as many runs as the limit, then narrowed to the window), the earlier
attempts of a re-run run (gh api repos/<repo>/actions/runs/<id>/attempts/<n>), and the failed jobs' logs
(gh run view <id> --attempt <n> --log-failed). A history you cannot read completely is "cannot check" for this
check.
Each flaky test is one ticket for a builder: find and fix the cause, with evidence that it holds (the test run
repeatedly, the way AGENTS.md says tests are run). Its acceptance criteria allow quarantine instead only when
AGENTS.md names the project's quarantine mechanism: the test is quarantined that way, through the normal gate, with
an owner (a role or a person) and an expiry of at most four weeks written next to it, and a backlog issue to
fix and restore it. Without a named mechanism the ticket is fix-only, and your report says that a quarantine
mechanism would be a rules change (gate H4). You never quarantine anything.
Also read the quarantined tests the mechanism marks: one past its expiry, or with no owner or no expiry, is a finding too (restore it, or fix it, or a person extends it).
Work kind: the kind of the code the fix touches, from work_kinds (a test-only fix usually ci-fix when the project
keeps that kind); type:test.
Documentation that no longer matches the code at your SHA: a command that is gone or renamed, a path that moved, a
flag or an option the code no longer takes, a setting with another name or default, an example that would fail as
written. Read the docs AGENTS.md and README.md point to, then check each concrete claim against the code; quote
the doc's line and the code's file:line that contradicts it.
Not yours: an ADR or the plan's decisions (the architect's), a doc that looks right next to wrong code (a bug), a style
or wording preference. A fix that would change the rules file or factory.yaml is for a person (gate H4). Work kind
docs; type:docs; the contract section none (documentation only: <what>).
Work kind: feature only when no listed kind fits better; type:chore; the contract section
none (refactor: <what stays the same>).
factory:paused label on the status issue. Run
.factory/bin/factory-pause status (exit 0: go on; 3: paused; 1: try once more, then treat it as paused), or the
query in the core's board reference › Pause without the tool. Each check is run as
board.md › How a pause check guards a step,
never chained to the step it guards. Run it now, right before each issue you file or comment on, and right before
you post your report. When paused: file nothing more, post nothing, and give as your final message "Maintenance
run paused at : factory:paused is on the status issue; filed: ." A message from whoever
started you that the factory is paused means the same.AGENTS.md, README.md, factory.yaml (commands, checks, ci, licences, work kinds, roles,
human gates), the workflow files.size:S or size:M, the
factory-tickets skill's §2) and changes no rule, no setting and no gated thing; everything else is for a person
(a gate, a judgement marked unconfirmed, agent work too big for size:M), with your recommended answer in it.Each finding is one issue in the ticket template, filled in as the factory-tickets skill's §4 says, in the language
AGENTS.md sets for issues, with the fixed tokens spelled as the template spells them:
<type>(<area>): <what>, the area from the files to fix (fix(<area>): flaky test <name>,
chore(deps): <package> <from> to <to> (<advisory id>)).Blocked by: none, or the open issues the fix must wait for.work_kinds (core table plus the project's map). Never invent a
kind or a tier.<default branch> at , ."factory-tickets skill's §4 table, as each check says. A dependency or security
fix whose effect a user or client can see gets assertions; most get none (refactor: <what stays the same>) or
none (CI or tooling only: <what>). Work for a person: none (work for a person: <what they decide>).Plan: none (maintenance lane, <check>), as plain text.file:line with a one- or two-line quote, the run ids and attempts of
a flaky test, the advisory id and severity. Write no inline code between the owned paths and the next heading, nor
on the "Plan:" line.<!-- factory:ticket maintenance/<slug> --> (The key and the lookup).Run the body checks of the factory-tickets skill's references/create.md
› Body checks on every body before you file it; a body that fails one is fixed first.
Labels:
| Label | Agent work | Work for a person |
|---|---|---|
type:* | by the check: type:chore for updates and dead or duplicated code, type:test for flaky tests, type:docs for docs drift | the same |
tier:* | from the work kind (work_kinds) | from the work kind of the change the person would approve |
size:* | size:S or size:M | none |
status:* | status:backlog, always | status:needs-human |
agent:* | agent:<role> when every owned path falls in one role's owns; else none | agent:human |
priority:* | only a security finding with a known exploit: priority:P0 or priority:P1, as check 1 says | the same |
The bug-hunt and hunter:* labels are not yours.
Filing is not building. A finding you file is a discovery, not approved work: agent work goes to the backlog,
never status:ready or status:blocked, also with a priority label. The owner promotes it, or the lead when the owner
asks, as with the lead's backlog follow-ups and the hunters' P3 findings (factory-hunt §§5–6); promotion sets
status:ready or status:blocked from the "Blocked by" line.
File with gh issue create --title "<title>" --body-file <file> --label <label> …, the body written to a temporary
file outside the worktree (remove only the files you made). Stop at the first failure (a missing label, a refused
create): report what was filed and what was not; a missing core label is fixed by whoever runs the board, never
created by you.
Native dependencies. A finding whose "Blocked by" line names an issue gets the matching native dependency, as references/create.md › Native dependencies says: the read probe before your first create, then for each blocked finding the add (one per blocker) and the read-back, which must equal its "Blocked by" line, with the write probe on the first one. A failed probe, add or read-back stops the run there: file nothing more, and name in your report the issues already filed and the failure, quoted.
The key is maintenance/<slug>, in the ticket key's form: <!-- factory:ticket maintenance/<slug> -->. The
source maintenance is this lane's own (the ticket template names it), so no plan's tickets share it. The slug is
lowercase letters, digits and single hyphens, at most 60 characters: the check first (security-, deps-, flaky-,
quarantine-, docs-, dead-, dup-), then a few words for the package and advisory, the test, the doc or the code
(flaky-<test name>, security-<package>-<advisory id>). It is made once, when the issue is filed, and never changes.
A slug already taken by an earlier issue gets -2, -3 after it.
The lookup, before filing anything: read the body of every issue in the repo, open and closed, as
references/create.md › Find existing tickets does (an explicit limit, an
answer that may be cut short refused, every body read), and take each one whose body holds
<!-- factory:ticket maintenance/. When the complete set cannot be read, file nothing and say so in your report. Also
search for issues filed by hand, or by a hunter or the architect, that name the same package, advisory id, test or
file (gh issue list --state all --search "<name>"), and the open pull requests that already make the change.
Then, for each finding, decide by reading those issues and pull requests, not by comparing slugs (a later run may word the slug differently):
A finding not filed for one of these reasons does not count toward the cap of five.
Post it on the status issue (the open issue labelled factory:status) as one comment, with
gh issue comment <status issue> --body-file <file>, then give the same text as your final message. Its first line is
the heading below, and its second line the report marker, exactly once, nowhere else in the comment: run= is the run
id your brief gives, sha= the full 40-character default-branch SHA you read. The lead counts your run toward the
weekly cadence from your final message, read through its runtime, never from the comment
(the lead's shifts reference › Weekly runs); the comment is for
people and for tracing. When your brief gives no run id, write run=none and say so in the report; the run then does
not count.
## Maintenance, `<default branch>` at <short SHA>
<!-- factory:maintenance event=report run=<run id from the brief> sha=<full SHA> -->
**For the owner:** <each security finding with a known exploit: #<N>, package, advisory, why it matters, your
recommendation> (or none)
**Checked:**
- dependencies and security: <the sources read: security alerts (n open | not available: 403/404), the commands run>
<or: cannot check: why>
- flaky tests: <runs read, window, n flaky, n suspected, quarantines read> <or: cannot check: why>
- docs drift: <the docs read>
- dead and duplicated code: <what was read, what was skipped and why>
**Filed:** <n>
- #<N> <title> (<agent work, tier, size | for a person: gate>)
**Already tracked or proposed:** #<N> (<comment added | nothing new>), PR #<N> (<what it updates>), … (or none)
**Left out by the cap:** <n>
- <rank>. <check>: <the finding>, <one line of evidence>
**CI health:** <jobs that never started, cancelled runs, runner timeouts> (or none)
**For the lead:** <bugs seen, a credential found (file or run only), a command that was not read-only, a missing
quarantine mechanism, anything outside the four checks> (or none)
Model fit: <right | too weak | more than needed> (maintenance, <model spec>, kind maintenance): <one-line reason>Model fit is your own, in the model policy's line format; the policy says what each value means.
Say so plainly when a check found nothing.
filiplh/vervanging
2a535b7
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.