arkaos 4.18.0 → 4.20.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.
- package/README.md +1 -1
- package/VERSION +1 -1
- package/arka/SKILL.md +1 -1
- package/config/agents-provenance.yaml +6 -6
- package/config/skills-provenance.yaml +7 -25
- package/core/agents/provenance.py +8 -9
- package/core/cognition/memory/schemas.py +2 -2
- package/core/skills/provenance.py +3 -3
- package/core/workflow/config_guard.py +1 -2
- package/departments/dev/skills/click-path-audit/SKILL.md +8 -8
- package/departments/dev/skills/exploit-triage/SKILL.md +77 -0
- package/departments/dev/skills/laravel-review/SKILL.md +82 -0
- package/departments/dev/skills/ml-adoption-playbook/SKILL.md +88 -0
- package/departments/dev/skills/mle-workflow/SKILL.md +97 -0
- package/departments/dev/skills/pr-test-analyzer/SKILL.md +1 -3
- package/departments/dev/skills/python-review/SKILL.md +80 -0
- package/departments/dev/skills/safety-review/SKILL.md +75 -0
- package/departments/dev/skills/silent-failure-hunter/SKILL.md +1 -3
- package/departments/dev/skills/type-design-analyzer/SKILL.md +1 -3
- package/departments/dev/skills/typescript-review/SKILL.md +81 -0
- package/departments/dev/skills/vue-review/SKILL.md +80 -0
- package/knowledge/skills-manifest.json +109 -13
- package/package.json +1 -1
- package/pyproject.toml +1 -1
package/README.md
CHANGED
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.
|
|
1
|
+
4.20.0
|
package/arka/SKILL.md
CHANGED
|
@@ -25,7 +25,7 @@ measures citation compliance per turn.
|
|
|
25
25
|
# ArkaOS — Main Orchestrator
|
|
26
26
|
|
|
27
27
|
> **The Operating System for AI Agent Teams**
|
|
28
|
-
> 86 agents. 17 departments.
|
|
28
|
+
> 86 agents. 17 departments. 287 skills. Multi-runtime. Dashboard. Knowledge RAG.
|
|
29
29
|
|
|
30
30
|
## ⛔ Evidence flow — 4 gates (NON-NEGOTIABLE)
|
|
31
31
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
# Mirror of config/skills-provenance.yaml for the agent tree. The parser
|
|
4
4
|
# (core/agents/provenance.py) closes every way of writing a BROKEN
|
|
5
5
|
# provenance block, but it cannot see an agent that never writes one:
|
|
6
|
-
# absence reads as first-party, which is exactly what a forgotten
|
|
7
|
-
# agent port looks like.
|
|
6
|
+
# absence reads as first-party, which is exactly what a forgotten
|
|
7
|
+
# third-party agent port looks like.
|
|
8
8
|
#
|
|
9
9
|
# EVERY agent YAML must be CLASSIFIED — listed in `first_party` below,
|
|
10
10
|
# listed in `derived` below, or declaring a `provenance:` block in its
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
#
|
|
20
20
|
# What the baseline is and is not:
|
|
21
21
|
# ASSERTED: these are ArkaOS originals.
|
|
22
|
-
# PROVEN: none can be
|
|
23
|
-
# 2026-07-14,
|
|
24
|
-
# --diff-filter=A; verified once).
|
|
22
|
+
# PROVEN: none can be externally derived — every one was created
|
|
23
|
+
# before 2026-07-14, when this campaign began studying external
|
|
24
|
+
# repositories (git log --diff-filter=A; verified once).
|
|
25
25
|
# The property the control rests on is that the set is CLOSED:
|
|
26
26
|
# anything new must classify itself.
|
|
27
27
|
#
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
#
|
|
30
30
|
# derived format:
|
|
31
31
|
# departments/<dept>/agents/<slug>.yaml:
|
|
32
|
-
# origin: <lowercase-slug> # e.g.
|
|
32
|
+
# origin: <lowercase-slug> # e.g. vendor-derived, community
|
|
33
33
|
# source: https://...
|
|
34
34
|
# license: MIT
|
|
35
35
|
|
|
@@ -30,10 +30,11 @@
|
|
|
30
30
|
# ASSERTED, not independently verified: that these 275 are ArkaOS
|
|
31
31
|
# originals. Nobody re-derived each one from scratch to prove it.
|
|
32
32
|
#
|
|
33
|
-
# PROVEN, for the lineage that matters: none of them can be
|
|
34
|
-
#
|
|
35
|
-
# 2026-03-14 and 2026-07-13 — all of them before
|
|
36
|
-
#
|
|
33
|
+
# PROVEN, for the lineage that matters: none of them can be derived
|
|
34
|
+
# from an external source. `git log --diff-filter=A` puts every
|
|
35
|
+
# creation between 2026-03-14 and 2026-07-13 — all of them before
|
|
36
|
+
# 2026-07-14, when this campaign began studying external repositories.
|
|
37
|
+
# Zero exceptions.
|
|
37
38
|
#
|
|
38
39
|
# The property the control actually rests on is neither: it is that
|
|
39
40
|
# the set is CLOSED. Anything new must classify itself, whatever the
|
|
@@ -52,32 +53,13 @@
|
|
|
52
53
|
#
|
|
53
54
|
# derived format:
|
|
54
55
|
# departments/<dept>/skills/<slug>:
|
|
55
|
-
# origin: <lowercase-slug> # e.g.
|
|
56
|
+
# origin: <lowercase-slug> # e.g. vendor-derived, community
|
|
56
57
|
# source: https://... # where it came from
|
|
57
58
|
# license: MIT # what we are bound by
|
|
58
59
|
|
|
59
60
|
baseline_date: 2026-07-14
|
|
60
61
|
|
|
61
|
-
derived:
|
|
62
|
-
# ECC review lenses (Track C1) — specialised review skills ArkaOS
|
|
63
|
-
# lacked, ported from the MIT-licensed everything-claude-code repo and
|
|
64
|
-
# rewritten in ArkaOS voice with ArkaOS personas.
|
|
65
|
-
departments/dev/skills/silent-failure-hunter:
|
|
66
|
-
origin: ecc-derived
|
|
67
|
-
source: https://github.com/affaan-m/ecc
|
|
68
|
-
license: MIT
|
|
69
|
-
departments/dev/skills/type-design-analyzer:
|
|
70
|
-
origin: ecc-derived
|
|
71
|
-
source: https://github.com/affaan-m/ecc
|
|
72
|
-
license: MIT
|
|
73
|
-
departments/dev/skills/pr-test-analyzer:
|
|
74
|
-
origin: ecc-derived
|
|
75
|
-
source: https://github.com/affaan-m/ecc
|
|
76
|
-
license: MIT
|
|
77
|
-
departments/dev/skills/click-path-audit:
|
|
78
|
-
origin: ecc-derived
|
|
79
|
-
source: https://github.com/affaan-m/ecc
|
|
80
|
-
license: MIT
|
|
62
|
+
derived: {}
|
|
81
63
|
|
|
82
64
|
first_party:
|
|
83
65
|
- arka
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
"""Agent provenance — supply-chain lineage for every agent YAML.
|
|
2
2
|
|
|
3
|
-
The skill tree got provenance in v4.17.0; agents did not
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
port.
|
|
3
|
+
The skill tree got provenance in v4.17.0; agents did not. If a
|
|
4
|
+
third-party agent is ever ported in, it would land with exactly the
|
|
5
|
+
hole skill provenance closes: no origin, no licence trail,
|
|
6
|
+
indistinguishable from an ArkaOS original. This is the agent-side
|
|
7
|
+
mirror, and it guards that boundary before any such port.
|
|
9
8
|
|
|
10
9
|
An agent YAML may carry a top-level ``provenance`` block:
|
|
11
10
|
|
|
12
|
-
id:
|
|
11
|
+
id: example-agent
|
|
13
12
|
name: ...
|
|
14
13
|
provenance:
|
|
15
|
-
origin:
|
|
16
|
-
source: https://
|
|
14
|
+
origin: vendor-derived
|
|
15
|
+
source: https://example.com/upstream
|
|
17
16
|
license: MIT
|
|
18
17
|
|
|
19
18
|
Absent means first-party. The validation rules are the shared
|
|
@@ -98,7 +98,7 @@ class KnowledgeEntry(BaseModel):
|
|
|
98
98
|
# Instinct confidence lives in a band, never at the poles. 0.3 is a weak
|
|
99
99
|
# hypothesis worth keeping; 0.9 is strong but never certainty (an agent
|
|
100
100
|
# that is "certain" from a handful of observations is the failure the
|
|
101
|
-
# band prevents).
|
|
101
|
+
# band prevents). Follows an established continuous-learning instinct model.
|
|
102
102
|
INSTINCT_CONFIDENCE_MIN = 0.3
|
|
103
103
|
INSTINCT_CONFIDENCE_MAX = 0.9
|
|
104
104
|
INSTINCT_SCOPES = ("project", "global")
|
|
@@ -107,7 +107,7 @@ INSTINCT_SCOPES = ("project", "global")
|
|
|
107
107
|
class ActionableInsight(BaseModel):
|
|
108
108
|
"""Actionable insight — generated by agents for proactive presentation.
|
|
109
109
|
|
|
110
|
-
Carries the
|
|
110
|
+
Carries the instinct fields (confidence, scope,
|
|
111
111
|
evidence_count) so an insight can strengthen on corroboration, weaken
|
|
112
112
|
on contradiction, and be promoted from project to global once the
|
|
113
113
|
same signal is seen across enough projects with high enough mean
|
|
@@ -9,12 +9,12 @@ author who ported it moves on.
|
|
|
9
9
|
Contract (opt-in, absence means first-party):
|
|
10
10
|
|
|
11
11
|
---
|
|
12
|
-
name: dev/
|
|
12
|
+
name: dev/example-skill
|
|
13
13
|
description: ...
|
|
14
14
|
allowed-tools: [Read, Grep, Glob]
|
|
15
15
|
metadata:
|
|
16
|
-
origin:
|
|
17
|
-
source: https://
|
|
16
|
+
origin: vendor-derived
|
|
17
|
+
source: https://example.com/upstream
|
|
18
18
|
license: MIT
|
|
19
19
|
---
|
|
20
20
|
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
An agent that hits a lint or type error has two ways out: fix the code,
|
|
4
4
|
or edit the config so the check stops firing. The second is faster and
|
|
5
5
|
almost always wrong — it silences the signal for the whole team, not
|
|
6
|
-
just this change.
|
|
7
|
-
(`config-protection`), and it is the cheapest high-value control in the
|
|
6
|
+
just this change. This gate is the cheapest high-value control in the
|
|
8
7
|
set: refuse edits to linter/formatter/type-checker configs, and the
|
|
9
8
|
agent is left with the honest path.
|
|
10
9
|
|
|
@@ -13,9 +13,7 @@ description: >
|
|
|
13
13
|
brand/design-review wins.
|
|
14
14
|
allowed-tools: [Read, Grep, Glob]
|
|
15
15
|
metadata:
|
|
16
|
-
origin:
|
|
17
|
-
source: https://github.com/affaan-m/ecc
|
|
18
|
-
license: MIT
|
|
16
|
+
origin: arkaos
|
|
19
17
|
---
|
|
20
18
|
|
|
21
19
|
# Click-Path Audit — `/dev click-path-audit`
|
|
@@ -33,11 +31,13 @@ clicks.
|
|
|
33
31
|
|
|
34
32
|
## The bug this catches
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
An "Apply filters" button called `setFilters(next)` and then, to close the
|
|
35
|
+
panel, `resetPanel()`. Each worked alone — but `resetPanel` cleared the
|
|
36
|
+
draft filter state as part of tidying up, so the store ended with the old
|
|
37
|
+
filters and the list never changed. No type error, no crash, no failing
|
|
38
|
+
unit test; the two setters simply fought and the second won. Walking the
|
|
39
|
+
handler's calls in order puts the cleared write next to the one it
|
|
40
|
+
cancelled, and the bug is visible without ever running the app.
|
|
41
41
|
|
|
42
42
|
## Process
|
|
43
43
|
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dev/exploit-triage
|
|
3
|
+
description: >
|
|
4
|
+
Reviews code for the vulnerabilities that are actually reachable and
|
|
5
|
+
actually exploitable — SSRF, auth bypass, injection, insecure
|
|
6
|
+
deserialisation, IDOR — biased toward a remote, unauthenticated
|
|
7
|
+
attacker, and discards the theoretical. Answers "can someone reach and
|
|
8
|
+
weaponise this?", not "is this textbook-perfect?". TRIGGER: "/dev
|
|
9
|
+
exploit-triage", "is this exploitable", "attack surface", "can this be
|
|
10
|
+
reached", "SSRF/IDOR/auth bypass", "isto é explorável?", "que dano real
|
|
11
|
+
se tira daqui?"; run on a diff touching auth, input handling, requests,
|
|
12
|
+
deserialisation, or file/db access. SKIP: broad OWASP/quality pass ->
|
|
13
|
+
dev/security-audit wins; adversarially breaking a diff (abuse cases,
|
|
14
|
+
threat-modelling a change) -> dev/adversarial-review wins; planning a
|
|
15
|
+
full offensive engagement (signed RoE, ATT&CK campaign) -> dev/red-team
|
|
16
|
+
wins; agent/prompt-injection threats -> dev/ai-security wins.
|
|
17
|
+
allowed-tools: [Read, Grep, Glob]
|
|
18
|
+
metadata:
|
|
19
|
+
origin: arkaos
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# Exploit Triage — `/dev exploit-triage`
|
|
23
|
+
|
|
24
|
+
> **Agent:** Bruno (Security Engineer) | **Framework:** Reachability-first, attacker-economics, CWE Top 25
|
|
25
|
+
|
|
26
|
+
A security review that lists every theoretical weakness buries the one
|
|
27
|
+
that gets you breached. This lens inverts the priority: it starts from a
|
|
28
|
+
remote, unauthenticated attacker and asks, of each finding, whether they
|
|
29
|
+
can reach the code path and whether reaching it actually pays. A missing
|
|
30
|
+
security header on an internal admin page is a note; an SSRF on a
|
|
31
|
+
user-supplied URL that reaches the cloud metadata endpoint is the report.
|
|
32
|
+
Reachability and impact rank everything; the textbook comes second.
|
|
33
|
+
|
|
34
|
+
## What to hunt (reachability-first)
|
|
35
|
+
|
|
36
|
+
| Class | The question that decides severity |
|
|
37
|
+
|-------|-----------------------------------|
|
|
38
|
+
| **SSRF** (CWE-918) | Does a user-controlled URL/host reach a fetch, and can it hit internal services or a metadata endpoint? |
|
|
39
|
+
| **Auth / access bypass** (CWE-287/862, IDOR CWE-639) | Can the check be skipped, or an object accessed by ID without ownership (IDOR)? |
|
|
40
|
+
| **Injection** (CWE-74: SQLi/command/template) | Does untrusted input reach a query, a shell, or a template unparameterised? |
|
|
41
|
+
| **Insecure deserialisation** (CWE-502) | Is attacker-controlled data deserialised into objects (pickle, unsafe YAML, native serialisers)? |
|
|
42
|
+
| **Path traversal / upload** | Can a user steer a file path or upload an executable/served type? |
|
|
43
|
+
| **Secrets & SSRF-adjacent** | A leaked credential or an open redirect that chains into the above. |
|
|
44
|
+
|
|
45
|
+
## Process
|
|
46
|
+
|
|
47
|
+
1. Map the **entry points** in the diff — what an unauthenticated request can reach, then what an authenticated-but-untrusted user can.
|
|
48
|
+
2. For each candidate, trace the taint: does attacker input reach the sink, and is there a real control in the way?
|
|
49
|
+
3. Rank by **reachability × impact**, not by CWE checklist order. Discard the theoretically-imperfect-but-unreachable with a one-line note, so the real findings are not buried.
|
|
50
|
+
4. For each real finding, give the **concrete attack** (the request an attacker sends) and the fix.
|
|
51
|
+
|
|
52
|
+
## Proactive Triggers
|
|
53
|
+
|
|
54
|
+
Surface these WITHOUT being asked:
|
|
55
|
+
|
|
56
|
+
- a user-supplied URL or hostname flowing into an HTTP client → the SSRF, and whether it can reach the metadata endpoint
|
|
57
|
+
- an object fetched by an ID from the request with no ownership check → the IDOR and the horizontal access it grants
|
|
58
|
+
- `pickle.loads` / `yaml.load` / a native deserialiser on request data → the deserialisation-to-RCE path
|
|
59
|
+
|
|
60
|
+
## Output
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
## Exploit Triage
|
|
64
|
+
|
|
65
|
+
**Scope:** {diff / entry points reviewed}
|
|
66
|
+
**Attacker model:** {remote unauth / authenticated untrusted}
|
|
67
|
+
|
|
68
|
+
### Exploitable (reachable + impactful)
|
|
69
|
+
- **{class}** {file}:{line}
|
|
70
|
+
- **Reach:** {how the attacker gets input to the sink}
|
|
71
|
+
- **Attack:** {the concrete request/payload}
|
|
72
|
+
- **Impact:** {what it grants}
|
|
73
|
+
- **Fix:** {the specific control}
|
|
74
|
+
|
|
75
|
+
### Noted, not exploitable (unreachable or low impact)
|
|
76
|
+
- {finding} — {why it does not pay}, one line each
|
|
77
|
+
```
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dev/laravel-review
|
|
3
|
+
description: >
|
|
4
|
+
Laravel/PHP review against ArkaOS conventions — mass assignment, N+1
|
|
5
|
+
queries, Blade XSS, business logic leaking into controllers, missing
|
|
6
|
+
FormRequests, and strict-types gaps — with the fix each one needs.
|
|
7
|
+
TRIGGER: "/dev laravel-review", "review this Laravel", "review the PHP",
|
|
8
|
+
"revê este controller", "revê o Eloquent", "isto está seguro em
|
|
9
|
+
Laravel?", any diff touching *.php, Blade, or Eloquent models. SKIP:
|
|
10
|
+
language-agnostic pre-merge review -> dev/code-review wins; database
|
|
11
|
+
schema/migration design -> dev/db-design wins; a security audit of the
|
|
12
|
+
whole app -> dev/security-audit wins.
|
|
13
|
+
allowed-tools: [Read, Grep, Glob, Bash]
|
|
14
|
+
metadata:
|
|
15
|
+
origin: arkaos
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Laravel Review — `/dev laravel-review`
|
|
19
|
+
|
|
20
|
+
> **Agent:** Gonçalo (Laravel Specialist) | **Framework:** Laravel conventions, OWASP, ArkaOS Services+Repositories standard
|
|
21
|
+
|
|
22
|
+
Laravel makes the wrong thing easy: `create($request->all())` is one line
|
|
23
|
+
and a mass-assignment hole, an Eloquent relation in a Blade loop is one
|
|
24
|
+
property access and an N+1, `{!! $x !!}` is shorter than the escaped form
|
|
25
|
+
and an XSS. This review reads a PHP diff for the specific ways the
|
|
26
|
+
framework's convenience turns into a defect, and holds it to the ArkaOS
|
|
27
|
+
Laravel standard — Services and Repositories, FormRequests everywhere,
|
|
28
|
+
`declare(strict_types=1)`, not just to PSR-12.
|
|
29
|
+
|
|
30
|
+
## Review Priorities
|
|
31
|
+
|
|
32
|
+
### Critical — Security
|
|
33
|
+
- **Mass assignment**: `create($request->all())` or `$guarded = []` → whitelist `$fillable`, or pass `$request->validated()` from a FormRequest.
|
|
34
|
+
- **SQL injection**: `DB::raw()`/`whereRaw()`/string-interpolated queries with user input → parameterised bindings or Eloquent.
|
|
35
|
+
- **Blade XSS**: `{!! $userInput !!}` without HTMLPurifier → `{{ }}`, or purify explicitly.
|
|
36
|
+
- **Command/path**: `exec`/`shell_exec`/`system` or `Storage` paths from user input → validate and sanitise.
|
|
37
|
+
- **Unvalidated uploads**: no MIME/size/extension check on file inputs.
|
|
38
|
+
- **Weak crypto / secrets**: MD5 for passwords, hardcoded keys.
|
|
39
|
+
|
|
40
|
+
### Critical — Error handling
|
|
41
|
+
- **Swallowed exceptions**: `catch (\Throwable $e) {}` with no log and no re-throw.
|
|
42
|
+
- **Missing validation**: a controller action with no FormRequest and no inline rules.
|
|
43
|
+
|
|
44
|
+
### High — ArkaOS Laravel standard
|
|
45
|
+
- **Business logic in controllers** → extract to a Service or Action; the controller orchestrates, it does not decide.
|
|
46
|
+
- **Data access outside a Repository** where the ecosystem uses them.
|
|
47
|
+
- **No FormRequest** on a write endpoint → `$request->validated()`, never `$request->all()`.
|
|
48
|
+
- **Missing `declare(strict_types=1)`** in non-view PHP; untyped public method params/returns.
|
|
49
|
+
- **N+1**: an Eloquent relation accessed in a loop or serialisation with no `with()`/`$with`.
|
|
50
|
+
- **Missing `$fillable`/`$casts`** on models; **missing Feature test** (`RefreshDatabase`) on the changed behaviour.
|
|
51
|
+
|
|
52
|
+
## Process
|
|
53
|
+
|
|
54
|
+
1. `git diff -- '*.php' '*.blade.php'` to scope the change.
|
|
55
|
+
2. Run PHPStan/Pint if configured — read their output, do not just report their absence.
|
|
56
|
+
3. Read each changed controller/model/service against the priorities, heaviest first.
|
|
57
|
+
|
|
58
|
+
## Proactive Triggers
|
|
59
|
+
|
|
60
|
+
Surface these WITHOUT being asked:
|
|
61
|
+
|
|
62
|
+
- `$request->all()` reaching a `create`/`update`/`fill` → the mass-assignment hole; name the fields it exposes
|
|
63
|
+
- a relation accessed inside `@foreach` or an API Resource with no eager load → the N+1 and the `with()` that fixes it
|
|
64
|
+
- a controller method over ~15 lines carrying query + business logic → the Service/Action to extract
|
|
65
|
+
|
|
66
|
+
## Output
|
|
67
|
+
|
|
68
|
+
```markdown
|
|
69
|
+
## Laravel Review
|
|
70
|
+
|
|
71
|
+
**Scope:** {changed PHP / Blade}
|
|
72
|
+
**Verdict:** {APPROVED / CHANGES REQUESTED}
|
|
73
|
+
|
|
74
|
+
### Critical
|
|
75
|
+
- [ ] {file}:{line} — {the hole} → {the fix}
|
|
76
|
+
|
|
77
|
+
### High (ArkaOS standard)
|
|
78
|
+
- [ ] {file}:{line} — {the convention broken} → {the fix}
|
|
79
|
+
|
|
80
|
+
### Positive
|
|
81
|
+
{what follows the standard well}
|
|
82
|
+
```
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dev/ml-adoption-playbook
|
|
3
|
+
description: >
|
|
4
|
+
Decides whether a problem needs ML at all, then adds it to a non-ML
|
|
5
|
+
codebase the cheap way — heuristic baseline first, a defined metric and
|
|
6
|
+
mistake budget, data readiness, and a decoupled seam before any model.
|
|
7
|
+
TRIGGER: "/dev ml-adoption-playbook", "should we use ML for this", "add
|
|
8
|
+
ML to", "is this an ML problem", "machine learning for X", "vale a pena
|
|
9
|
+
ML aqui?", "adicionar ML ao projeto", "modelo ou regras?". SKIP: the
|
|
10
|
+
model is already chosen and the job is to productionise it ->
|
|
11
|
+
dev/mle-workflow wins; a ranking/feed pipeline's plumbing ->
|
|
12
|
+
dev/rag-architect or dev/architecture-design wins.
|
|
13
|
+
allowed-tools: [Read, Grep, Glob]
|
|
14
|
+
metadata:
|
|
15
|
+
origin: arkaos
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# ML Adoption Playbook — `/dev ml-adoption-playbook`
|
|
19
|
+
|
|
20
|
+
> **Agent:** Salvador (AI Engineering Specialist) | **Framework:** Heuristic-first, metric-and-mistake-budget, incremental adoption
|
|
21
|
+
|
|
22
|
+
The most expensive way to add machine learning to a product is to reach
|
|
23
|
+
for a model before asking whether rules would do. A regex, a threshold,
|
|
24
|
+
or a lookup table ships in an afternoon, is trivial to debug, and is
|
|
25
|
+
often within a few points of what a model would give — and if it is not,
|
|
26
|
+
it becomes the baseline the model has to beat. This playbook decides
|
|
27
|
+
whether the problem is really an ML problem, and if it is, adds ML to a
|
|
28
|
+
codebase that has none of the scaffolding, one committed step at a time.
|
|
29
|
+
|
|
30
|
+
## Phase 1 — Framing & feasibility (before any model)
|
|
31
|
+
|
|
32
|
+
- **Heuristic check.** Could a rule, threshold, or lookup solve this
|
|
33
|
+
acceptably? If yes, ship that first — it is the baseline and often the
|
|
34
|
+
answer. A model that cannot beat a well-tuned heuristic is not worth
|
|
35
|
+
its operational cost.
|
|
36
|
+
- **Metric.** Define how success is measured, tied to the product
|
|
37
|
+
decision — before touching data. No metric, no project.
|
|
38
|
+
- **Mistake budget.** State what a wrong prediction costs and how many
|
|
39
|
+
are tolerable. This sets the bar the model must clear and whether a
|
|
40
|
+
human stays in the loop.
|
|
41
|
+
- **Data reality.** Do labelled examples exist, or a path to them? Is the
|
|
42
|
+
outcome observable, and when? A problem with no labels and no path to
|
|
43
|
+
them is not yet an ML problem.
|
|
44
|
+
|
|
45
|
+
## Phase 2 — Data readiness
|
|
46
|
+
|
|
47
|
+
- Locate the data that would feed the model; assess volume, quality, and
|
|
48
|
+
bias before assuming it is usable.
|
|
49
|
+
- Confirm the label is available at the time a prediction is needed, not
|
|
50
|
+
only in hindsight.
|
|
51
|
+
|
|
52
|
+
## Phase 3 — Architectural seam
|
|
53
|
+
|
|
54
|
+
- Add a decoupled boundary where the prediction plugs in — an interface
|
|
55
|
+
the current heuristic satisfies too, so the model can replace the rule
|
|
56
|
+
without rewiring the app.
|
|
57
|
+
- Keep the heuristic as the fallback and the regression baseline.
|
|
58
|
+
|
|
59
|
+
## Phase 4 — Baseline model
|
|
60
|
+
|
|
61
|
+
- Integrate the simplest model that could work behind the seam; compare
|
|
62
|
+
it to the heuristic on the defined metric and mistake budget.
|
|
63
|
+
- Promote only if it clears the bar. If it does not, the heuristic stays
|
|
64
|
+
and the finding is recorded — a negative result is still a result.
|
|
65
|
+
|
|
66
|
+
## Proactive Triggers
|
|
67
|
+
|
|
68
|
+
Surface these WITHOUT being asked:
|
|
69
|
+
|
|
70
|
+
- a request to "use ML" for something a threshold or lookup handles → propose the heuristic baseline first and the bar the model must beat
|
|
71
|
+
- an ML plan with no defined metric or mistake budget → stop; those come before data
|
|
72
|
+
- no labelled data and no path to it → this is not yet an ML problem; name what would make it one
|
|
73
|
+
|
|
74
|
+
## Output
|
|
75
|
+
|
|
76
|
+
```markdown
|
|
77
|
+
## ML Adoption Assessment
|
|
78
|
+
|
|
79
|
+
**Problem:** {what decision needs to be made}
|
|
80
|
+
**Heuristic baseline:** {the rule that ships today, and how close it gets}
|
|
81
|
+
**Verdict:** {ML justified? / heuristic suffices / not yet an ML problem}
|
|
82
|
+
|
|
83
|
+
### If ML is justified
|
|
84
|
+
- **Metric & bar:** {measure + threshold the model must beat the baseline by}
|
|
85
|
+
- **Mistake budget:** {cost of a wrong call + human-in-loop or not}
|
|
86
|
+
- **Data readiness:** {labels? volume? label latency?}
|
|
87
|
+
- **Seam:** {the interface where the model plugs in, heuristic as fallback}
|
|
88
|
+
```
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dev/mle-workflow
|
|
3
|
+
description: >
|
|
4
|
+
Turns model work into a production ML system — data contracts,
|
|
5
|
+
reproducible training, measurable eval gates, a deployable artifact,
|
|
6
|
+
and monitoring with a rollback path — using only the lanes the system
|
|
7
|
+
needs. TRIGGER: "/dev mle-workflow", "productionise this model", "ML
|
|
8
|
+
pipeline", "ranking/recommender/classifier/forecasting system", "model
|
|
9
|
+
refresh", "pôr o modelo em produção", "notebook para pipeline", "eval
|
|
10
|
+
gate do modelo". SKIP: RAG retrieval/context design -> dev/rag-architect
|
|
11
|
+
wins; the app/API around the model with no ML lifecycle concern ->
|
|
12
|
+
dev/architecture-design wins; prompt-injection/model-abuse threats ->
|
|
13
|
+
dev/ai-security wins.
|
|
14
|
+
allowed-tools: [Read, Grep, Glob, Bash]
|
|
15
|
+
metadata:
|
|
16
|
+
origin: arkaos
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# ML Engineering Workflow — `/dev mle-workflow`
|
|
20
|
+
|
|
21
|
+
> **Agent:** Salvador (AI Engineering Specialist) | **Framework:** Data contracts, reproducible training, eval-gated promotion, monitored rollout
|
|
22
|
+
|
|
23
|
+
A model in a notebook is a result; a model in production is a system that
|
|
24
|
+
has to keep being right as the data underneath it moves. The gap between
|
|
25
|
+
the two is not the algorithm — it is the plumbing that makes a prediction
|
|
26
|
+
reproducible, gated on measured quality, deployable as an artifact, and
|
|
27
|
+
observable once real traffic arrives. This workflow builds that plumbing,
|
|
28
|
+
using only the lanes the system in front of you actually needs.
|
|
29
|
+
|
|
30
|
+
## Scope calibration first
|
|
31
|
+
|
|
32
|
+
Not every model has labels, online serving, a feature store, GPUs, or A/B
|
|
33
|
+
tests. Pick the lanes that fit and make the missing ones explicit
|
|
34
|
+
assumptions. A change that a data contract, a baseline, an eval script,
|
|
35
|
+
and a rollback note would make reviewable does not need a feature store.
|
|
36
|
+
|
|
37
|
+
## Lanes
|
|
38
|
+
|
|
39
|
+
### 1. Data contract
|
|
40
|
+
- Define the input schema, types, and allowed ranges; version it. A model is only as trustworthy as the guarantee on what reaches it.
|
|
41
|
+
- Name the label source and its latency (is the outcome known now, or in 30 days?). Undelayed evaluation of a delayed-label problem is a lie.
|
|
42
|
+
- Guard against **leakage**: a feature that encodes the target, or is computed with information unavailable at prediction time.
|
|
43
|
+
|
|
44
|
+
### 2. Reproducible training
|
|
45
|
+
- Pin the data snapshot, code version, dependency lockfile/environment, seed, and hyperparameters — a training run nobody can reproduce is not evidence.
|
|
46
|
+
- Separate train/validation/test by the axis that matches production (time-based split for anything time-ordered, not random).
|
|
47
|
+
- Emit a single versioned artifact (weights + preprocessing + the input schema it expects).
|
|
48
|
+
|
|
49
|
+
### 3. Eval gate (promotion criteria)
|
|
50
|
+
- State the metric and the threshold BEFORE training, tied to the decision the model drives — not accuracy for its own sake.
|
|
51
|
+
- Evaluate on **slices**, not just the aggregate: a model that is 95% overall and 40% on the segment that matters is a failure.
|
|
52
|
+
- Offline gate to promote; where traffic exists, an online check (shadow or canary) before full rollout.
|
|
53
|
+
|
|
54
|
+
### 4. Deployable artifact & serving
|
|
55
|
+
- The serving path must run the **same** preprocessing as training — train/serve skew is the most common silent production failure.
|
|
56
|
+
- Batch vs online: choose by the freshness the decision needs, not by default.
|
|
57
|
+
- Idempotent, versioned, with a health check.
|
|
58
|
+
|
|
59
|
+
### 5. Monitoring & rollback
|
|
60
|
+
- Watch input drift, prediction distribution, and — when labels arrive — realised quality against the offline estimate.
|
|
61
|
+
- A **rollback path** to the previous artifact that can be triggered without a retrain.
|
|
62
|
+
- Preserve every production failure (bad feature, stale label, artifact mismatch, drift) as a regression case.
|
|
63
|
+
|
|
64
|
+
## Process
|
|
65
|
+
|
|
66
|
+
1. Map the change onto the five lanes; mark which apply and which are explicit assumptions.
|
|
67
|
+
2. Find the existing training/feature/serving/eval paths before adding a parallel ML stack (`git grep`, read them).
|
|
68
|
+
3. Build the data contract and the eval gate first — they define what "done" means before any model work.
|
|
69
|
+
|
|
70
|
+
## Proactive Triggers
|
|
71
|
+
|
|
72
|
+
Surface these WITHOUT being asked:
|
|
73
|
+
|
|
74
|
+
- a feature computed from data unavailable at prediction time → the leakage, and the realistic offline score once it is removed
|
|
75
|
+
- a random train/test split on time-ordered data → the optimistic metric it produces and the time-based split that fixes it
|
|
76
|
+
- preprocessing written twice (once in training, once in serving) → the train/serve skew waiting to happen; share the code path
|
|
77
|
+
|
|
78
|
+
## Output
|
|
79
|
+
|
|
80
|
+
```markdown
|
|
81
|
+
## ML Engineering Plan
|
|
82
|
+
|
|
83
|
+
**System:** {what the model decides} · **Lanes in scope:** {of the five}
|
|
84
|
+
**Explicit assumptions:** {labels / serving / traffic / monitoring owner}
|
|
85
|
+
|
|
86
|
+
### Data contract
|
|
87
|
+
{schema, label source + latency, leakage checks}
|
|
88
|
+
|
|
89
|
+
### Training & eval gate
|
|
90
|
+
{reproducibility pins, split axis, metric + threshold + slices}
|
|
91
|
+
|
|
92
|
+
### Serving & monitoring
|
|
93
|
+
{batch/online, skew guard, drift signals, rollback trigger}
|
|
94
|
+
|
|
95
|
+
### Risks
|
|
96
|
+
- {the failure mode} → {the guard}
|
|
97
|
+
```
|
|
@@ -12,9 +12,7 @@ description: >
|
|
|
12
12
|
dev/silent-failure-hunter wins.
|
|
13
13
|
allowed-tools: [Read, Grep, Glob, Bash]
|
|
14
14
|
metadata:
|
|
15
|
-
origin:
|
|
16
|
-
source: https://github.com/affaan-m/ecc
|
|
17
|
-
license: MIT
|
|
15
|
+
origin: arkaos
|
|
18
16
|
---
|
|
19
17
|
|
|
20
18
|
# PR Test Analyzer — `/dev pr-test-analyzer`
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dev/python-review
|
|
3
|
+
description: >
|
|
4
|
+
Python review against ArkaOS conventions — missing type hints, mutable
|
|
5
|
+
default arguments, bare excepts, unvalidated boundaries, injection, and
|
|
6
|
+
Pydantic/FastAPI mistakes — with the fix each needs. TRIGGER: "/dev
|
|
7
|
+
python-review", "review this Python", "review the FastAPI", "revê o
|
|
8
|
+
Python", "revê este endpoint", "isto está pythonico?", any diff touching
|
|
9
|
+
*.py. SKIP: language-agnostic pre-merge review -> dev/code-review wins;
|
|
10
|
+
pytest coverage of the change -> dev/pr-test-analyzer wins; swallowed-error
|
|
11
|
+
hunt across the codebase -> dev/silent-failure-hunter wins.
|
|
12
|
+
allowed-tools: [Read, Grep, Glob, Bash]
|
|
13
|
+
metadata:
|
|
14
|
+
origin: arkaos
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Python Review — `/dev python-review`
|
|
18
|
+
|
|
19
|
+
> **Agent:** Diogo (Python Backend Specialist) | **Framework:** Type hints, Pydantic validation, PEP 8, ArkaOS core conventions
|
|
20
|
+
|
|
21
|
+
Python trusts the author, and that trust is where the bugs live: a
|
|
22
|
+
mutable default argument shared across every call, a bare `except` that
|
|
23
|
+
buries the traceback, a function with no type hints that the checker
|
|
24
|
+
cannot help. This review reads a Python diff against the ArkaOS core
|
|
25
|
+
standard — type hints on every signature, Pydantic at the boundary,
|
|
26
|
+
functions under thirty lines — and for the runtime traps the interpreter
|
|
27
|
+
will happily let ship.
|
|
28
|
+
|
|
29
|
+
## Review Priorities
|
|
30
|
+
|
|
31
|
+
### Critical — Correctness traps
|
|
32
|
+
- **Mutable default argument**: `def f(x=[])` / `={}` → default to `None`, build inside.
|
|
33
|
+
- **Bare `except:` / `except Exception: pass`** → catch the specific type, log, re-raise or handle.
|
|
34
|
+
- **Late-binding closure in a loop** capturing the loop variable → bind explicitly.
|
|
35
|
+
|
|
36
|
+
### Critical — Boundary & security
|
|
37
|
+
- **Unvalidated input** used as a trusted shape → a Pydantic model at the boundary, not a raw dict.
|
|
38
|
+
- **Injection**: f-string/`%`-built SQL or `subprocess`/`os.system` with user input → parameterise / `shlex`, never interpolate.
|
|
39
|
+
- **`eval`/`exec`/`pickle`** on untrusted data; hardcoded secrets.
|
|
40
|
+
|
|
41
|
+
### High — ArkaOS core standard
|
|
42
|
+
- **Missing type hints** on a public signature → hint params and return.
|
|
43
|
+
- **A function over 30 lines** or nesting past 3 → decompose (`.claude/rules/python-core.md`).
|
|
44
|
+
- **Pydantic misuse**: validation logic in a route instead of a `field_validator`; a model that admits an illegal state.
|
|
45
|
+
- **Dataclass over Pydantic** where validation is needed; a broad `dict`/`Any` where a model belongs.
|
|
46
|
+
|
|
47
|
+
### High — Idiom
|
|
48
|
+
- A manual index loop where a comprehension/`enumerate` reads clearer; a `try` used for flow control; string concatenation in a hot loop.
|
|
49
|
+
|
|
50
|
+
## Process
|
|
51
|
+
|
|
52
|
+
1. `git diff -- '*.py'` to scope the change.
|
|
53
|
+
2. Run `ruff`/`mypy`/`pytest` if configured — read the output, do not just note their absence.
|
|
54
|
+
3. Read each changed function against the priorities, correctness traps first.
|
|
55
|
+
|
|
56
|
+
## Proactive Triggers
|
|
57
|
+
|
|
58
|
+
Surface these WITHOUT being asked:
|
|
59
|
+
|
|
60
|
+
- a mutable default argument in the diff → the shared-state bug across calls
|
|
61
|
+
- a `dict` passed through several layers as if typed → the Pydantic model that should guard the boundary
|
|
62
|
+
- a function that grew past 30 lines in the diff → the seam to split it on
|
|
63
|
+
|
|
64
|
+
## Output
|
|
65
|
+
|
|
66
|
+
```markdown
|
|
67
|
+
## Python Review
|
|
68
|
+
|
|
69
|
+
**Scope:** {changed Python}
|
|
70
|
+
**Verdict:** {APPROVED / CHANGES REQUESTED}
|
|
71
|
+
|
|
72
|
+
### Critical
|
|
73
|
+
- [ ] {file}:{line} — {the trap} → {the fix}
|
|
74
|
+
|
|
75
|
+
### High (ArkaOS standard)
|
|
76
|
+
- [ ] {file}:{line} — {the convention broken} → {the fix}
|
|
77
|
+
|
|
78
|
+
### Positive
|
|
79
|
+
{what is idiomatic and well-typed}
|
|
80
|
+
```
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dev/safety-review
|
|
3
|
+
description: >
|
|
4
|
+
Audits a change or an automation for destructive, irreversible
|
|
5
|
+
operations — bulk deletes, DROP/TRUNCATE, force pushes, mass emails,
|
|
6
|
+
raw disk or filesystem writes — and checks each has a guard: a scope
|
|
7
|
+
limit, a dry-run, a confirmation, a backup, a rollback. TRIGGER: "/dev
|
|
8
|
+
safety-review", "is this safe to run", "destructive operation", "will
|
|
9
|
+
this delete/overwrite", "review this migration/script/cron", "isto
|
|
10
|
+
apaga alguma coisa?", "revê este script destrutivo", "posso correr isto
|
|
11
|
+
em produção?"; run before shipping a migration, a bulk job, a cron, or
|
|
12
|
+
an autonomous automation. SKIP: exploitable-vulnerability review ->
|
|
13
|
+
dev/exploit-triage wins; general code review -> dev/code-review wins;
|
|
14
|
+
the deploy/rollout mechanics themselves -> dev/deploy wins.
|
|
15
|
+
allowed-tools: [Read, Grep, Glob]
|
|
16
|
+
metadata:
|
|
17
|
+
origin: arkaos
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Safety Review — `/dev safety-review`
|
|
21
|
+
|
|
22
|
+
> **Agent:** Bruno (Security Engineer) | **Framework:** Blast-radius analysis, reversibility, guard-before-execute
|
|
23
|
+
|
|
24
|
+
The dangerous change is rarely the one that fails — it is the one that
|
|
25
|
+
succeeds at the wrong scope. A migration that runs, a cleanup cron that
|
|
26
|
+
fires, a bulk update that commits: each does exactly what it was told, to
|
|
27
|
+
more rows or files or people than the author pictured. This pass finds
|
|
28
|
+
the destructive and irreversible operations in a change or an automation
|
|
29
|
+
and checks that every one is fenced — scoped, reversible, dry-runnable,
|
|
30
|
+
or gated behind a confirmation — before it can run unattended.
|
|
31
|
+
|
|
32
|
+
## What to flag
|
|
33
|
+
|
|
34
|
+
| Operation | The guard it needs |
|
|
35
|
+
|-----------|--------------------|
|
|
36
|
+
| **Bulk delete / update** (`DELETE`/`UPDATE` without a tight `WHERE`, `deleteMany`, `rm -rf`) | An explicit scope, a row-count check, and a backup or soft-delete |
|
|
37
|
+
| **Schema destruction** (`DROP`, `TRUNCATE`, a down-migration that loses data) | Reversibility or a snapshot; never irreversible without sign-off |
|
|
38
|
+
| **Force / history rewrite** (`git push --force`, `reset --hard`, `filter-branch`) | Branch scoping; never on a shared branch |
|
|
39
|
+
| **Mass outbound** (bulk email/notification/webhook) | A dry-run count, a rate limit, a test-recipient path |
|
|
40
|
+
| **Raw disk / filesystem** (`dd`, recursive writes, `chmod -R`) | Path scoping and a confirmation |
|
|
41
|
+
| **Unbounded loop / job** over production data | A limit, idempotency, and a resumable/rollback path |
|
|
42
|
+
|
|
43
|
+
## Process
|
|
44
|
+
|
|
45
|
+
1. Grep the change/automation for the destructive verbs — `DELETE`, `DROP`, `TRUNCATE`, `deleteMany`, `rm`, `--force`, `reset --hard`, bulk-send calls.
|
|
46
|
+
2. For each, determine the **blast radius**: what is the maximum it can affect if a parameter is wrong or empty (an empty `WHERE` deletes the table; a null filter matches everything)?
|
|
47
|
+
3. Check the guard is present and correct: scope, dry-run, confirmation, backup, rollback. A destructive op with no guard, or a guard that fails open, is a finding.
|
|
48
|
+
4. Rank by reversibility — an irreversible op with no backup is critical; a scoped, reversible one is clean.
|
|
49
|
+
|
|
50
|
+
## Proactive Triggers
|
|
51
|
+
|
|
52
|
+
Surface these WITHOUT being asked:
|
|
53
|
+
|
|
54
|
+
- a `DELETE`/`UPDATE` whose `WHERE` could evaluate to empty or all-rows → the full-table blast radius and the scope/guard it needs
|
|
55
|
+
- a down-migration or `DROP`/`TRUNCATE` with no snapshot → the irreversible data loss
|
|
56
|
+
- an automation that runs unattended (cron, agent, CI job) touching production data with no dry-run or rollback → the guard to add before it ships
|
|
57
|
+
|
|
58
|
+
## Output
|
|
59
|
+
|
|
60
|
+
```markdown
|
|
61
|
+
## Safety Review
|
|
62
|
+
|
|
63
|
+
**Scope:** {change / automation reviewed}
|
|
64
|
+
**Verdict:** {SAFE TO RUN / GUARDS REQUIRED}
|
|
65
|
+
|
|
66
|
+
### Destructive operations
|
|
67
|
+
- **{operation}** {file}:{line}
|
|
68
|
+
- **Blast radius:** {worst case if a parameter is wrong/empty}
|
|
69
|
+
- **Reversible?** {yes + how / no}
|
|
70
|
+
- **Guard present?** {scope/dry-run/confirmation/backup — or missing}
|
|
71
|
+
- **Fix:** {the guard to add before this runs}
|
|
72
|
+
|
|
73
|
+
### Safe
|
|
74
|
+
{operations already correctly fenced}
|
|
75
|
+
```
|
|
@@ -13,9 +13,7 @@ description: >
|
|
|
13
13
|
dev/pr-test-analyzer wins.
|
|
14
14
|
allowed-tools: [Read, Grep, Glob]
|
|
15
15
|
metadata:
|
|
16
|
-
origin:
|
|
17
|
-
source: https://github.com/affaan-m/ecc
|
|
18
|
-
license: MIT
|
|
16
|
+
origin: arkaos
|
|
19
17
|
---
|
|
20
18
|
|
|
21
19
|
# Silent Failure Hunter — `/dev silent-failure-hunter`
|
|
@@ -12,9 +12,7 @@ description: >
|
|
|
12
12
|
schema of a new feature -> dev/db-design or dev/ddd-model wins.
|
|
13
13
|
allowed-tools: [Read, Grep, Glob]
|
|
14
14
|
metadata:
|
|
15
|
-
origin:
|
|
16
|
-
source: https://github.com/affaan-m/ecc
|
|
17
|
-
license: MIT
|
|
15
|
+
origin: arkaos
|
|
18
16
|
---
|
|
19
17
|
|
|
20
18
|
# Type Design Analyzer — `/dev type-design-analyzer`
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dev/typescript-review
|
|
3
|
+
description: >
|
|
4
|
+
TypeScript/Node review for the holes the compiler waves through — `any`
|
|
5
|
+
and unsafe casts, unhandled promise rejections, missing input validation
|
|
6
|
+
at the boundary, and injection in queries or shell calls — with the fix
|
|
7
|
+
each needs. TRIGGER: "/dev typescript-review", "review this TS", "review
|
|
8
|
+
the Node", "revê o TypeScript", "revê este endpoint Node", "isto está
|
|
9
|
+
type-safe?", any diff touching *.ts/*.tsx server or API code. SKIP:
|
|
10
|
+
language-agnostic pre-merge review -> dev/code-review wins; React/Vue
|
|
11
|
+
component rendering bugs -> dev/vue-review or dev/click-path-audit wins;
|
|
12
|
+
type-design depth -> dev/type-design-analyzer wins.
|
|
13
|
+
allowed-tools: [Read, Grep, Glob, Bash]
|
|
14
|
+
metadata:
|
|
15
|
+
origin: arkaos
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# TypeScript Review — `/dev typescript-review`
|
|
19
|
+
|
|
20
|
+
> **Agent:** Vera (Node.js / TypeScript Backend Specialist) | **Framework:** Type safety, async correctness, boundary validation
|
|
21
|
+
|
|
22
|
+
TypeScript's guarantees stop at the edges of the program, and that is
|
|
23
|
+
where the bugs get in: an `any` erases every check downstream, a JSON
|
|
24
|
+
body typed as its interface is a lie until something validates it, a
|
|
25
|
+
floating promise swallows the error the caller needed. This review reads
|
|
26
|
+
a TS diff for the places the type system was told to look away, and for
|
|
27
|
+
the async and boundary mistakes no compiler flags.
|
|
28
|
+
|
|
29
|
+
## Review Priorities
|
|
30
|
+
|
|
31
|
+
### Critical — Type safety holes
|
|
32
|
+
- **`any` / `as` casts** on external data → validate into a real type (Zod, a type guard); an `any` is an unchecked check for everything it touches.
|
|
33
|
+
- **Non-null `!`** on a value that can be null at runtime → handle the null.
|
|
34
|
+
- **`@ts-ignore` / `@ts-expect-error`** hiding a real type error → fix the type, do not silence it.
|
|
35
|
+
|
|
36
|
+
### Critical — Async correctness
|
|
37
|
+
- **Floating promise**: an `async` call with no `await` and no `.catch` → the rejection is lost.
|
|
38
|
+
- **`await` in a loop** where `Promise.all` is correct → serial latency; and the reverse, unbounded `Promise.all` over a large list.
|
|
39
|
+
- **Missing try/catch** around an `await` on I/O, or a catch that swallows.
|
|
40
|
+
|
|
41
|
+
### Critical — Boundary
|
|
42
|
+
- **Unvalidated input**: a request body/query/param used as its TS type with no runtime schema → validate at the boundary.
|
|
43
|
+
- **Injection**: string-built SQL or `exec`/`child_process` with user input → parameterise / sanitise.
|
|
44
|
+
- **Secrets**: hardcoded keys; secrets logged.
|
|
45
|
+
|
|
46
|
+
### High — Standards
|
|
47
|
+
- Public function signatures untyped or returning inferred `any`.
|
|
48
|
+
- `Promise<void>` swallowing a result the caller needs; error thrown as a bare string.
|
|
49
|
+
- Mutating a shared object where an immutable update belongs.
|
|
50
|
+
|
|
51
|
+
## Process
|
|
52
|
+
|
|
53
|
+
1. `git diff -- '*.ts' '*.tsx'` to scope the change.
|
|
54
|
+
2. Run `tsc --noEmit` and the linter if configured — read the output.
|
|
55
|
+
3. Read each changed handler/service for the priorities, type holes first.
|
|
56
|
+
|
|
57
|
+
## Proactive Triggers
|
|
58
|
+
|
|
59
|
+
Surface these WITHOUT being asked:
|
|
60
|
+
|
|
61
|
+
- a request body used as `req.body as SomeType` with no validation → the boundary hole and the schema that closes it
|
|
62
|
+
- an `async` function called with no `await`/`.catch` → the floating rejection
|
|
63
|
+
- an `any` introduced in the diff → what it stops the compiler from checking downstream
|
|
64
|
+
|
|
65
|
+
## Output
|
|
66
|
+
|
|
67
|
+
```markdown
|
|
68
|
+
## TypeScript Review
|
|
69
|
+
|
|
70
|
+
**Scope:** {changed TS}
|
|
71
|
+
**Verdict:** {APPROVED / CHANGES REQUESTED}
|
|
72
|
+
|
|
73
|
+
### Critical
|
|
74
|
+
- [ ] {file}:{line} — {the hole} → {the fix}
|
|
75
|
+
|
|
76
|
+
### High
|
|
77
|
+
- [ ] {file}:{line} — {the issue} → {the fix}
|
|
78
|
+
|
|
79
|
+
### Positive
|
|
80
|
+
{what is genuinely type-safe and correct}
|
|
81
|
+
```
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dev/vue-review
|
|
3
|
+
description: >
|
|
4
|
+
Vue 3 / Nuxt review for the framework's own traps — lost reactivity,
|
|
5
|
+
SSR hydration mismatches, missing keys, uncleaned watchers, and props
|
|
6
|
+
mutated in place — with the fix each needs. Composition API and
|
|
7
|
+
TypeScript assumed. TRIGGER: "/dev vue-review", "review this Vue",
|
|
8
|
+
"review the Nuxt", "revê este componente Vue", "revê o composable",
|
|
9
|
+
"porque é que a reactividade não funciona?", any diff touching
|
|
10
|
+
*.vue/composables. SKIP: language-agnostic review -> dev/code-review
|
|
11
|
+
wins; a handler-ordering/state-cancellation bug -> dev/click-path-audit
|
|
12
|
+
wins; visual/brand review -> brand/design-review wins.
|
|
13
|
+
allowed-tools: [Read, Grep, Glob]
|
|
14
|
+
metadata:
|
|
15
|
+
origin: arkaos
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Vue Review — `/dev vue-review`
|
|
19
|
+
|
|
20
|
+
> **Agent:** Diana (Senior Frontend Developer) | **Framework:** Vue 3 Composition API, Nuxt SSR, reactivity correctness
|
|
21
|
+
|
|
22
|
+
Most Vue bugs are not wrong logic — they are the reactivity system doing
|
|
23
|
+
exactly what you told it, which was not what you meant. Destructure a
|
|
24
|
+
`reactive` object and the binding is gone; read a value during SSR that
|
|
25
|
+
only exists on the client and hydration tears; forget a `:key` and the
|
|
26
|
+
list reuses the wrong DOM. This review reads a Vue/Nuxt diff for those
|
|
27
|
+
framework-specific traps, on the assumption of Composition API and
|
|
28
|
+
TypeScript throughout.
|
|
29
|
+
|
|
30
|
+
## Review Priorities
|
|
31
|
+
|
|
32
|
+
### Critical — Reactivity
|
|
33
|
+
- **Destructured reactivity**: `const { x } = reactive(...)` or a destructured prop → `toRefs`/`toRef`, or access through the object; the destructured copy is inert.
|
|
34
|
+
- **Ref unwrapped wrong**: `.value` missing in script, or added in template; a `ref` stored in a plain object it is read from without unwrapping.
|
|
35
|
+
- **Prop mutated in place** → emit an event or use a local copy; props are one-way.
|
|
36
|
+
|
|
37
|
+
### Critical — SSR / Nuxt hydration
|
|
38
|
+
- **Client-only value read during SSR** (`window`, `localStorage`, `Date.now()` in setup) → guard with `import.meta.client`/`onMounted`; the mismatch tears hydration.
|
|
39
|
+
- **Non-deterministic render** between server and client (random, unstable order).
|
|
40
|
+
- **Data fetched without `useAsyncData`/`useFetch`** where SSR needs it → double fetch or hydration gap.
|
|
41
|
+
|
|
42
|
+
### High — Correctness
|
|
43
|
+
- **Missing `:key`** on a `v-for`, or `:key="index"` on a reorderable list → wrong-DOM reuse.
|
|
44
|
+
- **Watcher/interval/listener not cleaned up** in `onUnmounted` → leak.
|
|
45
|
+
- **`v-if` + `v-for` on the same element**; heavy work in a computed with side effects.
|
|
46
|
+
|
|
47
|
+
### High — Standards
|
|
48
|
+
- Options API in new code where the project is Composition API; `any`-typed props; a composable that is not prefixed `use` or leaks state across instances.
|
|
49
|
+
|
|
50
|
+
## Process
|
|
51
|
+
|
|
52
|
+
1. `git diff -- '*.vue'` plus changed composables to scope the change.
|
|
53
|
+
2. Read each component's `setup`/template against the priorities, reactivity first.
|
|
54
|
+
3. Trace any SSR-sensitive value from setup to template.
|
|
55
|
+
|
|
56
|
+
## Proactive Triggers
|
|
57
|
+
|
|
58
|
+
Surface these WITHOUT being asked:
|
|
59
|
+
|
|
60
|
+
- a destructured `reactive`/props in the diff → the binding that is now dead and the `toRefs` fix
|
|
61
|
+
- a `window`/`localStorage`/`Date` read in `setup` of an SSR page → the hydration mismatch it causes
|
|
62
|
+
- a `v-for` with no `:key` or a keyed index on a list that reorders → the DOM-reuse bug
|
|
63
|
+
|
|
64
|
+
## Output
|
|
65
|
+
|
|
66
|
+
```markdown
|
|
67
|
+
## Vue Review
|
|
68
|
+
|
|
69
|
+
**Scope:** {changed components / composables}
|
|
70
|
+
**Verdict:** {APPROVED / CHANGES REQUESTED}
|
|
71
|
+
|
|
72
|
+
### Critical
|
|
73
|
+
- [ ] {file}:{line} — {the reactivity/SSR trap} → {the fix}
|
|
74
|
+
|
|
75
|
+
### High
|
|
76
|
+
- [ ] {file}:{line} — {the issue} → {the fix}
|
|
77
|
+
|
|
78
|
+
### Positive
|
|
79
|
+
{what handles reactivity and SSR correctly}
|
|
80
|
+
```
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_meta": {
|
|
3
3
|
"generator": "scripts/marketplace_gen.py",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.20.0",
|
|
5
5
|
"marketplace": "arkaos"
|
|
6
6
|
},
|
|
7
7
|
"structural": {
|
|
@@ -580,9 +580,7 @@
|
|
|
580
580
|
],
|
|
581
581
|
"collision": false,
|
|
582
582
|
"provenance": {
|
|
583
|
-
"origin": "
|
|
584
|
-
"source": "https://github.com/affaan-m/ecc",
|
|
585
|
-
"license": "MIT"
|
|
583
|
+
"origin": "arkaos"
|
|
586
584
|
}
|
|
587
585
|
},
|
|
588
586
|
"code-review": {
|
|
@@ -1097,6 +1095,19 @@
|
|
|
1097
1095
|
"origin": "arkaos"
|
|
1098
1096
|
}
|
|
1099
1097
|
},
|
|
1098
|
+
"exploit-triage": {
|
|
1099
|
+
"depts": [
|
|
1100
|
+
"dev"
|
|
1101
|
+
],
|
|
1102
|
+
"curated": false,
|
|
1103
|
+
"plugins": [
|
|
1104
|
+
"arkaos-dev@arkaos"
|
|
1105
|
+
],
|
|
1106
|
+
"collision": false,
|
|
1107
|
+
"provenance": {
|
|
1108
|
+
"origin": "arkaos"
|
|
1109
|
+
}
|
|
1110
|
+
},
|
|
1100
1111
|
"extract-data": {
|
|
1101
1112
|
"depts": [
|
|
1102
1113
|
"strategy"
|
|
@@ -1438,6 +1449,19 @@
|
|
|
1438
1449
|
"origin": "arkaos"
|
|
1439
1450
|
}
|
|
1440
1451
|
},
|
|
1452
|
+
"laravel-review": {
|
|
1453
|
+
"depts": [
|
|
1454
|
+
"dev"
|
|
1455
|
+
],
|
|
1456
|
+
"curated": false,
|
|
1457
|
+
"plugins": [
|
|
1458
|
+
"arkaos-dev@arkaos"
|
|
1459
|
+
],
|
|
1460
|
+
"collision": false,
|
|
1461
|
+
"provenance": {
|
|
1462
|
+
"origin": "arkaos"
|
|
1463
|
+
}
|
|
1464
|
+
},
|
|
1441
1465
|
"launch-execute": {
|
|
1442
1466
|
"depts": [
|
|
1443
1467
|
"saas"
|
|
@@ -1622,6 +1646,32 @@
|
|
|
1622
1646
|
"origin": "arkaos"
|
|
1623
1647
|
}
|
|
1624
1648
|
},
|
|
1649
|
+
"ml-adoption-playbook": {
|
|
1650
|
+
"depts": [
|
|
1651
|
+
"dev"
|
|
1652
|
+
],
|
|
1653
|
+
"curated": false,
|
|
1654
|
+
"plugins": [
|
|
1655
|
+
"arkaos-dev@arkaos"
|
|
1656
|
+
],
|
|
1657
|
+
"collision": false,
|
|
1658
|
+
"provenance": {
|
|
1659
|
+
"origin": "arkaos"
|
|
1660
|
+
}
|
|
1661
|
+
},
|
|
1662
|
+
"mle-workflow": {
|
|
1663
|
+
"depts": [
|
|
1664
|
+
"dev"
|
|
1665
|
+
],
|
|
1666
|
+
"curated": false,
|
|
1667
|
+
"plugins": [
|
|
1668
|
+
"arkaos-dev@arkaos"
|
|
1669
|
+
],
|
|
1670
|
+
"collision": false,
|
|
1671
|
+
"provenance": {
|
|
1672
|
+
"origin": "arkaos"
|
|
1673
|
+
}
|
|
1674
|
+
},
|
|
1625
1675
|
"moat-analysis": {
|
|
1626
1676
|
"depts": [
|
|
1627
1677
|
"strategy"
|
|
@@ -2127,9 +2177,7 @@
|
|
|
2127
2177
|
],
|
|
2128
2178
|
"collision": false,
|
|
2129
2179
|
"provenance": {
|
|
2130
|
-
"origin": "
|
|
2131
|
-
"source": "https://github.com/affaan-m/ecc",
|
|
2132
|
-
"license": "MIT"
|
|
2180
|
+
"origin": "arkaos"
|
|
2133
2181
|
}
|
|
2134
2182
|
},
|
|
2135
2183
|
"premortem": {
|
|
@@ -2238,6 +2286,19 @@
|
|
|
2238
2286
|
"origin": "arkaos"
|
|
2239
2287
|
}
|
|
2240
2288
|
},
|
|
2289
|
+
"python-review": {
|
|
2290
|
+
"depts": [
|
|
2291
|
+
"dev"
|
|
2292
|
+
],
|
|
2293
|
+
"curated": false,
|
|
2294
|
+
"plugins": [
|
|
2295
|
+
"arkaos-dev@arkaos"
|
|
2296
|
+
],
|
|
2297
|
+
"collision": false,
|
|
2298
|
+
"provenance": {
|
|
2299
|
+
"origin": "arkaos"
|
|
2300
|
+
}
|
|
2301
|
+
},
|
|
2241
2302
|
"quality-management": {
|
|
2242
2303
|
"depts": [
|
|
2243
2304
|
"ops"
|
|
@@ -2453,6 +2514,19 @@
|
|
|
2453
2514
|
"origin": "arkaos"
|
|
2454
2515
|
}
|
|
2455
2516
|
},
|
|
2517
|
+
"safety-review": {
|
|
2518
|
+
"depts": [
|
|
2519
|
+
"dev"
|
|
2520
|
+
],
|
|
2521
|
+
"curated": false,
|
|
2522
|
+
"plugins": [
|
|
2523
|
+
"arkaos-dev@arkaos"
|
|
2524
|
+
],
|
|
2525
|
+
"collision": false,
|
|
2526
|
+
"provenance": {
|
|
2527
|
+
"origin": "arkaos"
|
|
2528
|
+
}
|
|
2529
|
+
},
|
|
2456
2530
|
"scaffold": {
|
|
2457
2531
|
"depts": [
|
|
2458
2532
|
"dev"
|
|
@@ -2587,9 +2661,7 @@
|
|
|
2587
2661
|
],
|
|
2588
2662
|
"collision": false,
|
|
2589
2663
|
"provenance": {
|
|
2590
|
-
"origin": "
|
|
2591
|
-
"source": "https://github.com/affaan-m/ecc",
|
|
2592
|
-
"license": "MIT"
|
|
2664
|
+
"origin": "arkaos"
|
|
2593
2665
|
}
|
|
2594
2666
|
},
|
|
2595
2667
|
"skill-audit": {
|
|
@@ -2891,9 +2963,20 @@
|
|
|
2891
2963
|
],
|
|
2892
2964
|
"collision": false,
|
|
2893
2965
|
"provenance": {
|
|
2894
|
-
"origin": "
|
|
2895
|
-
|
|
2896
|
-
|
|
2966
|
+
"origin": "arkaos"
|
|
2967
|
+
}
|
|
2968
|
+
},
|
|
2969
|
+
"typescript-review": {
|
|
2970
|
+
"depts": [
|
|
2971
|
+
"dev"
|
|
2972
|
+
],
|
|
2973
|
+
"curated": false,
|
|
2974
|
+
"plugins": [
|
|
2975
|
+
"arkaos-dev@arkaos"
|
|
2976
|
+
],
|
|
2977
|
+
"collision": false,
|
|
2978
|
+
"provenance": {
|
|
2979
|
+
"origin": "arkaos"
|
|
2897
2980
|
}
|
|
2898
2981
|
},
|
|
2899
2982
|
"unit-economics": {
|
|
@@ -3024,6 +3107,19 @@
|
|
|
3024
3107
|
"origin": "arkaos"
|
|
3025
3108
|
}
|
|
3026
3109
|
},
|
|
3110
|
+
"vue-review": {
|
|
3111
|
+
"depts": [
|
|
3112
|
+
"dev"
|
|
3113
|
+
],
|
|
3114
|
+
"curated": false,
|
|
3115
|
+
"plugins": [
|
|
3116
|
+
"arkaos-dev@arkaos"
|
|
3117
|
+
],
|
|
3118
|
+
"collision": false,
|
|
3119
|
+
"provenance": {
|
|
3120
|
+
"origin": "arkaos"
|
|
3121
|
+
}
|
|
3122
|
+
},
|
|
3027
3123
|
"webinar-funnel": {
|
|
3028
3124
|
"depts": [
|
|
3029
3125
|
"landing"
|
package/package.json
CHANGED