@tplog/hasapi 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +54 -0
  3. package/bin/hasapi.mjs +292 -0
  4. package/hasapi-skills/README.md +56 -0
  5. package/hasapi-skills/_shared/common.md +240 -0
  6. package/hasapi-skills/_shared/custom-risks-guide.md +48 -0
  7. package/hasapi-skills/_shared/decay-risks.md +294 -0
  8. package/hasapi-skills/_shared/remedy-guide.md +37 -0
  9. package/hasapi-skills/_shared/source-coverage.md +248 -0
  10. package/hasapi-skills/_shared/test-decay-risks.md +246 -0
  11. package/hasapi-skills/hasapi-audit/SKILL.md +42 -0
  12. package/hasapi-skills/hasapi-audit/architecture-guide.md +195 -0
  13. package/hasapi-skills/hasapi-audit/onboarding-guide.md +89 -0
  14. package/hasapi-skills/hasapi-debt/SKILL.md +35 -0
  15. package/hasapi-skills/hasapi-debt/debt-guide.md +125 -0
  16. package/hasapi-skills/hasapi-diagnosing-bugs/SKILL.md +134 -0
  17. package/hasapi-skills/hasapi-diagnosing-bugs/scripts/hitl-loop.template.sh +41 -0
  18. package/hasapi-skills/hasapi-grilling/SKILL.md +10 -0
  19. package/hasapi-skills/hasapi-handoff/SKILL.md +16 -0
  20. package/hasapi-skills/hasapi-health/SKILL.md +37 -0
  21. package/hasapi-skills/hasapi-health/health-guide.md +89 -0
  22. package/hasapi-skills/hasapi-implement/SKILL.md +15 -0
  23. package/hasapi-skills/hasapi-resolving-merge-conflicts/SKILL.md +14 -0
  24. package/hasapi-skills/hasapi-review/SKILL.md +37 -0
  25. package/hasapi-skills/hasapi-review/pr-review-guide.md +163 -0
  26. package/hasapi-skills/hasapi-setup/SKILL.md +121 -0
  27. package/hasapi-skills/hasapi-setup/domain.md +51 -0
  28. package/hasapi-skills/hasapi-setup/issue-tracker-github.md +22 -0
  29. package/hasapi-skills/hasapi-setup/issue-tracker-gitlab.md +23 -0
  30. package/hasapi-skills/hasapi-setup/issue-tracker-local.md +19 -0
  31. package/hasapi-skills/hasapi-setup/triage-labels.md +15 -0
  32. package/hasapi-skills/hasapi-sweep/SKILL.md +38 -0
  33. package/hasapi-skills/hasapi-sweep/sweep-guide.md +264 -0
  34. package/hasapi-skills/hasapi-tdd/SKILL.md +108 -0
  35. package/hasapi-skills/hasapi-tdd/mocking.md +59 -0
  36. package/hasapi-skills/hasapi-tdd/refactoring.md +10 -0
  37. package/hasapi-skills/hasapi-tdd/tests.md +61 -0
  38. package/hasapi-skills/hasapi-test/SKILL.md +36 -0
  39. package/hasapi-skills/hasapi-test/test-guide.md +147 -0
  40. package/hasapi-skills/hasapi-to-issues/SKILL.md +84 -0
  41. package/hasapi-skills/hasapi-to-prd/SKILL.md +75 -0
  42. package/package.json +39 -0
@@ -0,0 +1,163 @@
1
+ # PR Review Guide — Mode 1
2
+
3
+ **Purpose:** Analyze a code diff or specific files for decay risks that are directly visible
4
+ in the changed code. Every finding must follow the Iron Law: Symptom → Source → Consequence → Remedy.
5
+
6
+ ---
7
+
8
+ ## Before You Start
9
+
10
+ **Auto-generated files:** If the diff contains generated files (protobuf stubs, OpenAPI clients,
11
+ ORM migrations, lock files, minified bundles), skip those files entirely. Generated code reflects
12
+ tool choices, not developer decisions. Note in the report which files were skipped and why.
13
+
14
+ **Scope calibration:** Adjust analysis depth based on PR size before starting.
15
+
16
+ | PR Size | Approach |
17
+ |---------|----------|
18
+ | < 50 lines | Focus on Steps 1–3 only; run Step 6a only if imports changed; run Step 6b if any class, method, or variable was renamed or introduced |
19
+ | 50–300 lines | Full process, all steps |
20
+ | > 300 lines | Full process; note in the Scope line that review is sampled — cover the highest-risk areas rather than every file |
21
+
22
+ For PRs > 500 lines: flag in the Summary that a PR this size is itself a Change Propagation signal. A change that cannot be reviewed in one pass suggests tangled responsibilities.
23
+
24
+ ---
25
+
26
+ ## Analysis Process
27
+
28
+ Work through these seven steps in order. Do not skip steps.
29
+
30
+ ### Step 1: Understand the scope
31
+
32
+ Read the diff or files and answer:
33
+ - What is the stated purpose of this change?
34
+ - Which files were modified?
35
+ - Flag immediately if the PR changes more than 10 unrelated files — that itself is a
36
+ 🟡 Warning: Change Propagation (a PR that touches many unrelated things is a sign
37
+ that responsibilities are tangled).
38
+
39
+ ### Step 2: Scan for Change Propagation
40
+
41
+ *Scan this first — it is the most visible risk in a diff.*
42
+
43
+ Look for:
44
+ - Does this change touch files in modules that have no conceptual connection to the stated purpose?
45
+ - Does any modified class change for more than one business reason in this diff?
46
+ - Does any method use more data from another class than from its own?
47
+
48
+ If the diff shows no cross-module changes beyond what the feature requires → skip, no finding.
49
+
50
+ ### Step 3: Scan for Cognitive Overload
51
+
52
+ Look for:
53
+ - Are any new or modified functions longer than 20 lines?
54
+ - Is there nesting deeper than 3 levels in new or modified code?
55
+ - Are there more than 4 parameters in any new function signature?
56
+ - Are there magic numbers or unexplained constants in new code?
57
+ - Do new variable or function names require reading the implementation to understand?
58
+ - Are there train-wreck chains (3+ method calls chained)?
59
+
60
+ ### Step 4: Scan for Knowledge Duplication
61
+
62
+ Look for:
63
+ - Does this change introduce logic that already exists elsewhere in the codebase?
64
+ - Does this change introduce a new name for a concept that already has a name?
65
+ - Does this change add a class to a hierarchy that has a parallel in another module?
66
+
67
+ ### Step 5: Scan for Accidental Complexity
68
+
69
+ Look for:
70
+ - Does this change add an abstraction with only one concrete use?
71
+ - Does this change add a class that only wraps another class or delegates everything?
72
+ - Does this change add configuration options or extension points that serve no current requirement?
73
+
74
+ ### Step 6a: Scan for Dependency Disorder
75
+
76
+ - Do any new imports create a dependency from a high-level module to a low-level one?
77
+ (e.g., domain service now imports a database driver or HTTP client)
78
+ - Do any new imports introduce a cycle between modules?
79
+ - Does any new interface force callers to depend on methods they do not use?
80
+
81
+ If no new imports and no structural changes → skip, no finding.
82
+
83
+ ### Step 6b: Scan for Domain Model Distortion
84
+
85
+ - Do new class or variable names match the language the business uses for the same concept?
86
+ - Does any new class hold only data with no behavior (pure data bag), where behavior was expected?
87
+ - Does any new method put logic that belongs to the domain in a service or utility layer?
88
+
89
+ ---
90
+
91
+ ## Severity Calibration
92
+
93
+ Apply the Iron Law format from `../_shared/common.md`. Each risk in `../_shared/decay-risks.md` has its own Severity
94
+ Guide with numeric thresholds — use those as the primary reference. When a finding sits
95
+ on the boundary between two tiers, use this as a tiebreaker:
96
+ - 🔴 Critical — actively breaking velocity or creating production risk *today*
97
+ - 🟡 Warning — will if left unaddressed through the next few features
98
+ - 🟢 Suggestion — worth fixing when nearby, not urgent
99
+
100
+ When multiple findings exist, list Critical items first. If there are more than 5 findings,
101
+ add a one-line "Recommended fix order" at the end of the Findings section.
102
+
103
+ ---
104
+
105
+ ## Step 7: Quick Test Check
106
+
107
+ *Run this last. Three signals only — this is not a full Mode 4 review.*
108
+
109
+ If the diff contains only generated files, configuration, or documentation with no
110
+ production logic changes → skip Step 7 entirely.
111
+
112
+ **Signal 1: Do tests exist for the changed behavior?**
113
+
114
+ - Does the diff modify production code?
115
+ - Are corresponding test file changes included in the diff?
116
+ - If new public behavior was added with no new tests:
117
+ → 🟡 Warning: Coverage Illusion — new behavior is untested
118
+ → Source: Feathers — Working Effectively with Legacy Code, Ch. 1
119
+ - If the change is a pure refactor and existing tests cover the behavior → no finding.
120
+
121
+ **Signal 2: Quick Mock Abuse sniff**
122
+
123
+ Only check if the diff includes test file changes.
124
+
125
+ - Is mock setup code in new/modified tests obviously longer than the test logic?
126
+ - Are the primary assertions `expect(mock).toHaveBeenCalledWith(...)` with no behavior verification?
127
+ - Does the diff add any methods to production classes that are only called from test files?
128
+
129
+ If any of these are true:
130
+ → 🟡 Warning: Mock Abuse — test complexity exceeds behavior complexity
131
+ → Source: Osherove — The Art of Unit Testing, mock usage guidelines
132
+
133
+ **Signal 3: Quick Test Obscurity sniff**
134
+
135
+ Only check if the diff includes test file changes.
136
+
137
+ - Do new test names express scenario and expected outcome?
138
+ (Pattern: `methodName_scenario_expectedResult` or equivalent)
139
+ - Are there new tests with multiple assertions and no message strings on any of them?
140
+
141
+ If test names are vague or assertions lack messages:
142
+ → 🟢 Suggestion: Test Obscurity — test intent is unclear from the test name or assertions
143
+ → Source: Meszaros — xUnit Test Patterns, Assertion Roulette (p.224)
144
+
145
+ **Output rule:**
146
+
147
+ If all three signals are clean → write no Test findings. Proceed directly to the report.
148
+
149
+ If findings exist → add them to the Findings section using the standard Iron Law format.
150
+ Label the risk as the test decay risk name (e.g., "Coverage Illusion", "Mock Abuse",
151
+ "Test Obscurity").
152
+
153
+ > **Note:** Step 7 is a fast check, not a full test audit. When systemic test problems
154
+ > are found, note in the Summary: "Consider running `/brooks-lint:brooks-test` for a
155
+ > complete test quality diagnosis."
156
+
157
+ ---
158
+
159
+ ## Output
160
+
161
+ Use the standard Report Template from `../_shared/common.md`.
162
+ Mode: PR Review
163
+ Scope: list the files reviewed (excluding skipped generated files).
@@ -0,0 +1,121 @@
1
+ ---
2
+ name: hasapi-setup
3
+ description: Configure this repo for the engineering skills — set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Setup Matt Pocock's Skills
8
+
9
+ Scaffold the per-repo configuration that the engineering skills assume:
10
+
11
+ - **Issue tracker** — where issues live (GitHub by default; local markdown is also supported out of the box)
12
+ - **Triage labels** — the strings used for the five canonical triage roles
13
+ - **Domain docs** — where `CONTEXT.md` and ADRs live, and the consumer rules for reading them
14
+
15
+ This is a prompt-driven skill, not a deterministic script. Explore, present what you found, confirm with the user, then write.
16
+
17
+ ## Process
18
+
19
+ ### 1. Explore
20
+
21
+ Look at the current repo to understand its starting state. Read whatever exists; don't assume:
22
+
23
+ - `git remote -v` and `.git/config` — is this a GitHub repo? Which one?
24
+ - `AGENTS.md` and `CLAUDE.md` at the repo root — does either exist? Is there already an `## Agent skills` section in either?
25
+ - `CONTEXT.md` and `CONTEXT-MAP.md` at the repo root
26
+ - `docs/adr/` and any `src/*/docs/adr/` directories
27
+ - `docs/agents/` — does this skill's prior output already exist?
28
+ - `.scratch/` — sign that a local-markdown issue tracker convention is already in use
29
+
30
+ ### 2. Present findings and ask
31
+
32
+ Summarise what's present and what's missing. Then walk the user through the three decisions **one at a time** — present a section, get the user's answer, then move to the next. Don't dump all three at once.
33
+
34
+ Assume the user does not know what these terms mean. Each section starts with a short explainer (what it is, why these skills need it, what changes if they pick differently). Then show the choices and the default.
35
+
36
+ **Section A — Issue tracker.**
37
+
38
+ > Explainer: The "issue tracker" is where issues live for this repo. Skills like `to-issues`, `triage`, `to-prd`, and `qa` read from and write to it — they need to know whether to call `gh issue create`, write a markdown file under `.scratch/`, or follow some other workflow you describe. Pick the place you actually track work for this repo.
39
+
40
+ Default posture: these skills were designed for GitHub. If a `git remote` points at GitHub, propose that. If a `git remote` points at GitLab (`gitlab.com` or a self-hosted host), propose GitLab. Otherwise (or if the user prefers), offer:
41
+
42
+ - **GitHub** — issues live in the repo's GitHub Issues (uses the `gh` CLI)
43
+ - **GitLab** — issues live in the repo's GitLab Issues (uses the [`glab`](https://gitlab.com/gitlab-org/cli) CLI)
44
+ - **Local markdown** — issues live as files under `.scratch/<feature>/` in this repo (good for solo projects or repos without a remote)
45
+ - **Other** (Jira, Linear, etc.) — ask the user to describe the workflow in one paragraph; the skill will record it as freeform prose
46
+
47
+ **Section B — Triage label vocabulary.**
48
+
49
+ > Explainer: When the `triage` skill processes an incoming issue, it moves it through a state machine — needs evaluation, waiting on reporter, ready for an AFK agent to pick up, ready for a human, or won't fix. To do that, it needs to apply labels (or the equivalent in your issue tracker) that match strings *you've actually configured*. If your repo already uses different label names (e.g. `bug:triage` instead of `needs-triage`), map them here so the skill applies the right ones instead of creating duplicates.
50
+
51
+ The five canonical roles:
52
+
53
+ - `needs-triage` — maintainer needs to evaluate
54
+ - `needs-info` — waiting on reporter
55
+ - `ready-for-agent` — fully specified, AFK-ready (an agent can pick it up with no human context)
56
+ - `ready-for-human` — needs human implementation
57
+ - `wontfix` — will not be actioned
58
+
59
+ Default: each role's string equals its name. Ask the user if they want to override any. If their issue tracker has no existing labels, the defaults are fine.
60
+
61
+ **Section C — Domain docs.**
62
+
63
+ > Explainer: Some skills (`improve-codebase-architecture`, `diagnosing-bugs`, `tdd`) read a `CONTEXT.md` file to learn the project's domain language, and `docs/adr/` for past architectural decisions. They need to know whether the repo has one global context or multiple (e.g. a monorepo with separate frontend/backend contexts) so they look in the right place.
64
+
65
+ Confirm the layout:
66
+
67
+ - **Single-context** — one `CONTEXT.md` + `docs/adr/` at the repo root. Most repos are this.
68
+ - **Multi-context** — `CONTEXT-MAP.md` at the root pointing to per-context `CONTEXT.md` files (typically a monorepo).
69
+
70
+ ### 3. Confirm and edit
71
+
72
+ Show the user a draft of:
73
+
74
+ - The `## Agent skills` block to add to whichever of `CLAUDE.md` / `AGENTS.md` is being edited (see step 4 for selection rules)
75
+ - The contents of `docs/agents/issue-tracker.md`, `docs/agents/triage-labels.md`, `docs/agents/domain.md`
76
+
77
+ Let them edit before writing.
78
+
79
+ ### 4. Write
80
+
81
+ **Pick the file to edit:**
82
+
83
+ - If `CLAUDE.md` exists, edit it.
84
+ - Else if `AGENTS.md` exists, edit it.
85
+ - If neither exists, ask the user which one to create — don't pick for them.
86
+
87
+ Never create `AGENTS.md` when `CLAUDE.md` already exists (or vice versa) — always edit the one that's already there.
88
+
89
+ If an `## Agent skills` block already exists in the chosen file, update its contents in-place rather than appending a duplicate. Don't overwrite user edits to the surrounding sections.
90
+
91
+ The block:
92
+
93
+ ```markdown
94
+ ## Agent skills
95
+
96
+ ### Issue tracker
97
+
98
+ [one-line summary of where issues are tracked]. See `docs/agents/issue-tracker.md`.
99
+
100
+ ### Triage labels
101
+
102
+ [one-line summary of the label vocabulary]. See `docs/agents/triage-labels.md`.
103
+
104
+ ### Domain docs
105
+
106
+ [one-line summary of layout — "single-context" or "multi-context"]. See `docs/agents/domain.md`.
107
+ ```
108
+
109
+ Then write the three docs files using the seed templates in this skill folder as a starting point:
110
+
111
+ - [issue-tracker-github.md](./issue-tracker-github.md) — GitHub issue tracker
112
+ - [issue-tracker-gitlab.md](./issue-tracker-gitlab.md) — GitLab issue tracker
113
+ - [issue-tracker-local.md](./issue-tracker-local.md) — local-markdown issue tracker
114
+ - [triage-labels.md](./triage-labels.md) — label mapping
115
+ - [domain.md](./domain.md) — domain doc consumer rules + layout
116
+
117
+ For "other" issue trackers, write `docs/agents/issue-tracker.md` from scratch using the user's description.
118
+
119
+ ### 5. Done
120
+
121
+ Tell the user the setup is complete and which engineering skills will now read from these files. Mention they can edit `docs/agents/*.md` directly later — re-running this skill is only necessary if they want to switch issue trackers or restart from scratch.
@@ -0,0 +1,51 @@
1
+ # Domain Docs
2
+
3
+ How the engineering skills should consume this repo's domain documentation when exploring the codebase.
4
+
5
+ ## Before exploring, read these
6
+
7
+ - **`CONTEXT.md`** at the repo root, or
8
+ - **`CONTEXT-MAP.md`** at the repo root if it exists — it points at one `CONTEXT.md` per context. Read each one relevant to the topic.
9
+ - **`docs/adr/`** — read ADRs that touch the area you're about to work in. In multi-context repos, also check `src/<context>/docs/adr/` for context-scoped decisions.
10
+
11
+ If any of these files don't exist, **proceed silently**. Don't flag their absence; don't suggest creating them upfront. The `/domain-modeling` skill (reached via `/grill-with-docs` and `/improve-codebase-architecture`) creates them lazily when terms or decisions actually get resolved.
12
+
13
+ ## File structure
14
+
15
+ Single-context repo (most repos):
16
+
17
+ ```
18
+ /
19
+ ├── CONTEXT.md
20
+ ├── docs/adr/
21
+ │ ├── 0001-event-sourced-orders.md
22
+ │ └── 0002-postgres-for-write-model.md
23
+ └── src/
24
+ ```
25
+
26
+ Multi-context repo (presence of `CONTEXT-MAP.md` at the root):
27
+
28
+ ```
29
+ /
30
+ ├── CONTEXT-MAP.md
31
+ ├── docs/adr/ ← system-wide decisions
32
+ └── src/
33
+ ├── ordering/
34
+ │ ├── CONTEXT.md
35
+ │ └── docs/adr/ ← context-specific decisions
36
+ └── billing/
37
+ ├── CONTEXT.md
38
+ └── docs/adr/
39
+ ```
40
+
41
+ ## Use the glossary's vocabulary
42
+
43
+ When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in `CONTEXT.md`. Don't drift to synonyms the glossary explicitly avoids.
44
+
45
+ If the concept you need isn't in the glossary yet, that's a signal — either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for `/domain-modeling`).
46
+
47
+ ## Flag ADR conflicts
48
+
49
+ If your output contradicts an existing ADR, surface it explicitly rather than silently overriding:
50
+
51
+ > _Contradicts ADR-0007 (event-sourced orders) — but worth reopening because…_
@@ -0,0 +1,22 @@
1
+ # Issue tracker: GitHub
2
+
3
+ Issues and PRDs for this repo live as GitHub issues. Use the `gh` CLI for all operations.
4
+
5
+ ## Conventions
6
+
7
+ - **Create an issue**: `gh issue create --title "..." --body "..."`. Use a heredoc for multi-line bodies.
8
+ - **Read an issue**: `gh issue view <number> --comments`, filtering comments by `jq` and also fetching labels.
9
+ - **List issues**: `gh issue list --state open --json number,title,body,labels,comments --jq '[.[] | {number, title, body, labels: [.labels[].name], comments: [.comments[].body]}]'` with appropriate `--label` and `--state` filters.
10
+ - **Comment on an issue**: `gh issue comment <number> --body "..."`
11
+ - **Apply / remove labels**: `gh issue edit <number> --add-label "..."` / `--remove-label "..."`
12
+ - **Close**: `gh issue close <number> --comment "..."`
13
+
14
+ Infer the repo from `git remote -v` — `gh` does this automatically when run inside a clone.
15
+
16
+ ## When a skill says "publish to the issue tracker"
17
+
18
+ Create a GitHub issue.
19
+
20
+ ## When a skill says "fetch the relevant ticket"
21
+
22
+ Run `gh issue view <number> --comments`.
@@ -0,0 +1,23 @@
1
+ # Issue tracker: GitLab
2
+
3
+ Issues and PRDs for this repo live as GitLab issues. Use the [`glab`](https://gitlab.com/gitlab-org/cli) CLI for all operations.
4
+
5
+ ## Conventions
6
+
7
+ - **Create an issue**: `glab issue create --title "..." --description "..."`. Use a heredoc for multi-line descriptions. Pass `--description -` to open an editor.
8
+ - **Read an issue**: `glab issue view <number> --comments`. Use `-F json` for machine-readable output.
9
+ - **List issues**: `glab issue list -F json` with appropriate `--label` filters.
10
+ - **Comment on an issue**: `glab issue note <number> --message "..."`. GitLab calls comments "notes".
11
+ - **Apply / remove labels**: `glab issue update <number> --label "..."` / `--unlabel "..."`. Multiple labels can be comma-separated or by repeating the flag.
12
+ - **Close**: `glab issue close <number>`. `glab issue close` does not accept a closing comment, so post the explanation first with `glab issue note <number> --message "..."`, then close.
13
+ - **Merge requests**: GitLab calls PRs "merge requests". Use `glab mr create`, `glab mr view`, `glab mr note`, etc. — the same shape as `gh pr ...` with `mr` in place of `pr` and `note`/`--message` in place of `comment`/`--body`.
14
+
15
+ Infer the repo from `git remote -v` — `glab` does this automatically when run inside a clone.
16
+
17
+ ## When a skill says "publish to the issue tracker"
18
+
19
+ Create a GitLab issue.
20
+
21
+ ## When a skill says "fetch the relevant ticket"
22
+
23
+ Run `glab issue view <number> --comments`.
@@ -0,0 +1,19 @@
1
+ # Issue tracker: Local Markdown
2
+
3
+ Issues and PRDs for this repo live as markdown files in `.scratch/`.
4
+
5
+ ## Conventions
6
+
7
+ - One feature per directory: `.scratch/<feature-slug>/`
8
+ - The PRD is `.scratch/<feature-slug>/PRD.md`
9
+ - Implementation issues are `.scratch/<feature-slug>/issues/<NN>-<slug>.md`, numbered from `01`
10
+ - Triage state is recorded as a `Status:` line near the top of each issue file (see `triage-labels.md` for the role strings)
11
+ - Comments and conversation history append to the bottom of the file under a `## Comments` heading
12
+
13
+ ## When a skill says "publish to the issue tracker"
14
+
15
+ Create a new file under `.scratch/<feature-slug>/` (creating the directory if needed).
16
+
17
+ ## When a skill says "fetch the relevant ticket"
18
+
19
+ Read the file at the referenced path. The user will normally pass the path or the issue number directly.
@@ -0,0 +1,15 @@
1
+ # Triage Labels
2
+
3
+ The skills speak in terms of five canonical triage roles. This file maps those roles to the actual label strings used in this repo's issue tracker.
4
+
5
+ | Label in mattpocock/skills | Label in our tracker | Meaning |
6
+ | -------------------------- | -------------------- | ---------------------------------------- |
7
+ | `needs-triage` | `needs-triage` | Maintainer needs to evaluate this issue |
8
+ | `needs-info` | `needs-info` | Waiting on reporter for more information |
9
+ | `ready-for-agent` | `ready-for-agent` | Fully specified, ready for an AFK agent |
10
+ | `ready-for-human` | `ready-for-human` | Requires human implementation |
11
+ | `wontfix` | `wontfix` | Will not be actioned |
12
+
13
+ When a skill mentions a role (e.g. "apply the AFK-ready triage label"), use the corresponding label string from this table.
14
+
15
+ Edit the right-hand column to match whatever vocabulary you actually use.
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: hasapi-sweep
3
+ description: >
4
+ Full-sweep mode: runs a unified analysis across all quality dimensions — code decay,
5
+ architecture, tech debt, and test quality — then applies fixes directly to the
6
+ codebase. Safe changes are auto-applied; risky changes are confirmed before
7
+ execution. Drawing on twelve classic engineering books.
8
+ Triggers when: user wants to "fix everything", "sweep the codebase", "auto-fix all
9
+ issues", "run all checks and fix them", "clean up the whole project", or asks for
10
+ a single command that both diagnoses and remediates quality problems.
11
+ Do NOT trigger for: read-only audits or health reports where the user only wants
12
+ findings without code changes; single-dimension reviews (use the focused skill
13
+ instead: brooks-review / brooks-audit / brooks-debt / brooks-test); server health
14
+ checks, HTTP /health endpoints, Kubernetes probes, or application uptime.
15
+ ---
16
+
17
+ # Brooks-Lint — Full Sweep & Auto-Fix
18
+
19
+ ## Setup
20
+
21
+ 1. Read `../_shared/common.md` for the Iron Law, Project Config, Report Template, and Health Score rules
22
+ 2. Read `../_shared/source-coverage.md` for book-level coverage, exceptions, and tradeoffs
23
+ 3. Read `../_shared/decay-risks.md` for production risk symptom definitions
24
+ 4. Read `../_shared/test-decay-risks.md` for test risk symptom definitions
25
+ 5. Read `sweep-guide.md` in this directory for the unified scan and fix process
26
+
27
+ ## Process
28
+
29
+ **If the user has not specified a project or directory:** apply Auto Scope Detection
30
+ from `../_shared/common.md` to determine the review scope before proceeding.
31
+
32
+ 1. Show pre-flight consent notice and wait for the user's one-time approval (Step 0 of the guide)
33
+ 2. Enumerate scope and initialize the `unresolvable` / `non_critical_rounds` / `fix_log` state (Step 1 of the guide)
34
+ 3. Run the four dimensions in sequence — review, test, debt, audit — each scanning, classifying, applying Safe + Extended-Safe fixes, and verifying via the project test command (Steps 2–5 of the guide)
35
+ 4. Iterate: re-scan modified files + same-module + static consumers; converge on a clean round, retire 3-retry failures to the `unresolvable` set, cap non-critical rounds at 3 (Step 6 of the guide)
36
+ 5. Aggregate residual and unresolvable items and output the Full Sweep Report (Steps 7–8 of the guide)
37
+
38
+ **Mode line in report:** `Full Sweep`