arkaos 4.23.0 → 4.25.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/THE-ARKAOS-GUIDE.md +1 -1
- package/VERSION +1 -1
- package/arka/SKILL.md +1 -1
- package/arka/skills/conclave/SKILL.md +11 -0
- package/bin/arka +8 -0
- package/config/claude-agents/shadcn-padronizer.md +3 -3
- package/departments/brand/agents/design-ops/shadcn-padronizer.yaml +1 -1
- package/departments/dev/skills/build-fix/SKILL.md +122 -0
- package/departments/dev/skills/evaluator-build-loop/SKILL.md +93 -0
- package/departments/dev/skills/react-review/SKILL.md +86 -0
- package/departments/dev/skills/spec-miner/SKILL.md +86 -0
- package/departments/ops/skills/hookify/SKILL.md +89 -0
- package/departments/pm/skills/epic-coordination/SKILL.md +79 -0
- package/harness/codex/AGENTS.md +139 -0
- package/harness/copilot/copilot-instructions.md +139 -0
- package/harness/cursor/rules/arkaos-stack-laravel.mdc +16 -0
- package/harness/cursor/rules/arkaos-stack-node.mdc +14 -0
- package/harness/cursor/rules/arkaos-stack-nuxt.mdc +15 -0
- package/harness/cursor/rules/arkaos-stack-php.mdc +14 -0
- package/harness/cursor/rules/arkaos-stack-python.mdc +14 -0
- package/harness/cursor/rules/arkaos-stack-react.mdc +14 -0
- package/harness/cursor/rules/arkaos-stack-vue.mdc +14 -0
- package/harness/cursor/rules/arkaos.mdc +72 -0
- package/harness/gemini/GEMINI.md +139 -0
- package/harness/opencode/AGENTS.md +139 -0
- package/harness/zed/.rules +139 -0
- package/installer/adapters/codex-cli.js +16 -27
- package/installer/adapters/cursor.js +22 -26
- package/installer/adapters/gemini-cli.js +15 -30
- package/installer/cli.js +1 -1
- package/installer/doctor.js +224 -0
- package/installer/harness-bundle.js +34 -0
- package/knowledge/agents-registry-v2.json +2 -2
- package/knowledge/skills-manifest.json +79 -1
- package/package.json +2 -1
- package/pyproject.toml +1 -1
- package/scripts/harness_gen.py +274 -0
package/README.md
CHANGED
package/THE-ARKAOS-GUIDE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# The ArkaOS Guide
|
|
2
2
|
|
|
3
|
-
> v4.
|
|
3
|
+
> v4.25.0 — 86 agents, 17 departments, 298 skills, 270 commands, 16 ADRs.
|
|
4
4
|
> One file, everything you need to start. Generated by `scripts/guide_gen.py` — never hand-edited.
|
|
5
5
|
|
|
6
6
|
## What it is
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.
|
|
1
|
+
4.25.0
|
package/arka/SKILL.md
CHANGED
|
@@ -47,7 +47,7 @@ complementary, not alternatives.
|
|
|
47
47
|
# ArkaOS — Main Orchestrator
|
|
48
48
|
|
|
49
49
|
> **The Operating System for AI Agent Teams**
|
|
50
|
-
> 86 agents. 17 departments.
|
|
50
|
+
> 86 agents. 17 departments. 298 skills. Multi-runtime. Dashboard. Knowledge RAG.
|
|
51
51
|
|
|
52
52
|
## ⛔ Evidence flow — 4 gates (NON-NEGOTIABLE)
|
|
53
53
|
|
|
@@ -72,6 +72,17 @@ Your style: {communication_style}. Your framework: {decision_framework}.
|
|
|
72
72
|
Respond in 3-5 sentences as {name} would. Be specific. Channel their actual thinking.
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
+
## Independence discipline (anti-anchoring)
|
|
76
|
+
|
|
77
|
+
Generate each advisor's take in an isolated context: the advisor sees the
|
|
78
|
+
question and their own persona, never another advisor's answer. Anchoring
|
|
79
|
+
is the failure mode this prevents — the first plausible take pulls every
|
|
80
|
+
later one toward it, and ten dependent opinions collapse into one opinion
|
|
81
|
+
with ten signatures. Disagreement between advisors is the signal the
|
|
82
|
+
synthesis step exists to surface; only the synthesis (and the debate's
|
|
83
|
+
disagreement pass) may read all ten. In `debate`, opening positions are
|
|
84
|
+
likewise collected independently BEFORE the rebuttal round.
|
|
85
|
+
|
|
75
86
|
## Advisor Deep Dive: `/arka conclave advisor <name>`
|
|
76
87
|
|
|
77
88
|
Full advisor profile: all 4 DNA frameworks, mental models with key questions, communication style, decision framework, sources, why matched (aligned/contrarian, score, dimension comparison).
|
package/bin/arka
CHANGED
|
@@ -66,6 +66,14 @@ case "${1:-}" in
|
|
|
66
66
|
;;
|
|
67
67
|
doctor)
|
|
68
68
|
shift
|
|
69
|
+
# Issue #358: the node doctor is canonical (engine/venv/hooks/security
|
|
70
|
+
# + the migrated Claude-layer checks). The bash doctor only audits the
|
|
71
|
+
# legacy v1 layout — keep it strictly as the no-node fallback.
|
|
72
|
+
if command -v npx &>/dev/null; then
|
|
73
|
+
npx arkaos doctor "$@"
|
|
74
|
+
exit $?
|
|
75
|
+
fi
|
|
76
|
+
echo "npx not found — falling back to the legacy v1 doctor (limited scope)." >&2
|
|
69
77
|
bash "$HOME/.local/bin/arka-doctor" "$@"
|
|
70
78
|
exit $?
|
|
71
79
|
;;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: shadcn-padronizer
|
|
3
3
|
description: >
|
|
4
|
-
Leo — Component Library
|
|
4
|
+
Leo — Component Library Standardizer (brand squad). Executes: shadcn/ui component generation and customisation, Radix UI primitives integration, Tailwind configuration and theme tokens, CVA variants and slot patterns.
|
|
5
5
|
model: sonnet
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
<!-- generated by core/agents/behavioral_compiler.py from departments/brand/agents/design-ops/shadcn-padronizer.yaml — DO NOT EDIT; edit the YAML and re-run -->
|
|
9
9
|
|
|
10
|
-
# Leo — Component Library
|
|
10
|
+
# Leo — Component Library Standardizer
|
|
11
11
|
|
|
12
|
-
You are Leo, Component Library
|
|
12
|
+
You are Leo, Component Library Standardizer of the brand squad (Tier 2). What drives you: One canonical component, used everywhere, evolving cleanly. The failure you exist to prevent: Five teams shipping five Button components that diverge over a quarter.
|
|
13
13
|
|
|
14
14
|
## How you work
|
|
15
15
|
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dev/build-fix
|
|
3
|
+
description: >
|
|
4
|
+
Systematic build-failure diagnosis: read the FIRST error bottom-up,
|
|
5
|
+
reproduce it in isolation, classify it (dependency, config, code,
|
|
6
|
+
toolchain, cache), fix the root cause, and prove the fix with two
|
|
7
|
+
clean builds — with per-ecosystem playbooks for the failure
|
|
8
|
+
signatures of Laravel/PHP, Node/TS, Vue/Nuxt, React/Next, and Python.
|
|
9
|
+
TRIGGER: "/dev build-fix", "the build is broken", "o build está a
|
|
10
|
+
falhar", "compila localmente mas falha no CI", "npm run build
|
|
11
|
+
rebenta", "composer install falha", "arranja o build"; any red build
|
|
12
|
+
whose error output exists. SKIP: the code builds but tests fail ->
|
|
13
|
+
dev/code-review or dev/app-test wins; designing the pipeline itself
|
|
14
|
+
-> dev/ci-cd-pipeline wins; a production outage -> dev/incident wins.
|
|
15
|
+
allowed-tools: [Read, Grep, Glob, Bash]
|
|
16
|
+
metadata:
|
|
17
|
+
origin: arkaos
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Build Fix — `/dev build-fix`
|
|
21
|
+
|
|
22
|
+
> **Agent:** Paulo (Tech Lead) | **Framework:** Root-cause classification, first-error discipline
|
|
23
|
+
|
|
24
|
+
A failing build is the most honest bug report you will ever receive:
|
|
25
|
+
deterministic, reproducible, and pointing at itself. Almost every hour
|
|
26
|
+
lost to a broken build is lost the same way — fixing the LAST error on
|
|
27
|
+
the screen, which is usually a cascade symptom of the first one, or
|
|
28
|
+
reaching for the folk remedy (delete the lockfile, clear every cache,
|
|
29
|
+
reinstall the world) before reading what the tool actually said.
|
|
30
|
+
|
|
31
|
+
## Method
|
|
32
|
+
|
|
33
|
+
1. **Find the first error.** Scroll past the cascade; the root error is
|
|
34
|
+
the earliest one, and everything after it is noise until proven
|
|
35
|
+
otherwise.
|
|
36
|
+
2. **Reproduce in isolation.** Run the failing step alone, from a clean
|
|
37
|
+
shell, with the project's pinned tool versions. A build that only
|
|
38
|
+
fails inside CI is still reproducible — replicate the CI's inputs
|
|
39
|
+
(env vars, lockfile, node/php/python version) locally before
|
|
40
|
+
touching anything.
|
|
41
|
+
3. **Classify** the root error into exactly one bucket:
|
|
42
|
+
| Bucket | Signature |
|
|
43
|
+
|---|---|
|
|
44
|
+
| Dependency | resolver conflicts, missing package, lockfile drift |
|
|
45
|
+
| Config | tool config rejects input, wrong paths, env var absent |
|
|
46
|
+
| Code | type error, syntax error, failed macro/codegen |
|
|
47
|
+
| Toolchain | wrong runtime version, missing system binary |
|
|
48
|
+
| Cache | passes clean, fails incrementally (or the reverse) |
|
|
49
|
+
4. **Fix the root, not the symptom.** A cast that silences a type error
|
|
50
|
+
the compiler was right about is a deferred production bug.
|
|
51
|
+
5. **Prove it.** Two consecutive clean builds — one incremental, one
|
|
52
|
+
from clean — with exit codes on record. One green build after a
|
|
53
|
+
cache clear proves nothing about the fix.
|
|
54
|
+
|
|
55
|
+
## Ecosystem playbooks
|
|
56
|
+
|
|
57
|
+
### Laravel / PHP
|
|
58
|
+
|
|
59
|
+
- `Class not found` after moving a file → regenerate the autoload map
|
|
60
|
+
(`composer dump-autoload`); if it persists, the namespace does not
|
|
61
|
+
match the path — fix the namespace, not the autoloader.
|
|
62
|
+
- `composer install` resolver conflict → read WHICH two constraints
|
|
63
|
+
collide before touching version pins; widening the wrong one
|
|
64
|
+
downgrades half the tree.
|
|
65
|
+
- Migration failure mid-build → the schema state is now ahead of the
|
|
66
|
+
migration table; inspect before re-running, never loop `migrate:fresh`
|
|
67
|
+
on shared databases.
|
|
68
|
+
|
|
69
|
+
### Node / TypeScript
|
|
70
|
+
|
|
71
|
+
- `tsc` errors that runtime never hits → the types drifted from the
|
|
72
|
+
code; fix the types, do not add `as any` (the compiler is the only
|
|
73
|
+
reviewer that reads every call site).
|
|
74
|
+
- Works locally, fails in CI → lockfile drift: CI runs `npm ci` (exact
|
|
75
|
+
lockfile) while local `npm install` mutated it. Commit the lockfile
|
|
76
|
+
the build actually needs.
|
|
77
|
+
- `ERR_REQUIRE_ESM` / `Cannot use import` → an ESM-only dependency in a
|
|
78
|
+
CJS context; align the importing module's format instead of pinning
|
|
79
|
+
the dependency to a dead major.
|
|
80
|
+
|
|
81
|
+
### Vue / Nuxt
|
|
82
|
+
|
|
83
|
+
- Auto-import resolution failures (`X is not defined` only in build) →
|
|
84
|
+
the dev server tolerates what nitro's build does not; add the
|
|
85
|
+
explicit import.
|
|
86
|
+
- Hydration-safe code that fails at BUILD time in SSR → browser-only
|
|
87
|
+
API executed at module top level; move it inside a lifecycle hook or
|
|
88
|
+
guard it.
|
|
89
|
+
|
|
90
|
+
### React / Next.js
|
|
91
|
+
|
|
92
|
+
- Server/client boundary violations (`useState in a Server Component`)
|
|
93
|
+
→ mark the leaf `"use client"`, never the whole tree — pushing the
|
|
94
|
+
directive up quietly moves the entire subtree to the client bundle.
|
|
95
|
+
- Build-time data fetching failures → a page assumed a runtime env var
|
|
96
|
+
at static-generation time; decide dynamic vs static explicitly.
|
|
97
|
+
|
|
98
|
+
### Python
|
|
99
|
+
|
|
100
|
+
- Import works in the repl, fails in the build → the venv the build
|
|
101
|
+
uses is not the venv you activated; print `sys.executable` in the
|
|
102
|
+
failing context before debugging imports.
|
|
103
|
+
- Resolver backtracking forever → over-constrained pins; loosen the
|
|
104
|
+
pins you own, never the transitive ones.
|
|
105
|
+
- Circular import only at build/collect time → the cycle was always
|
|
106
|
+
there; imports inside functions defer it, moving the shared symbol
|
|
107
|
+
out removes it.
|
|
108
|
+
|
|
109
|
+
## Output
|
|
110
|
+
|
|
111
|
+
```markdown
|
|
112
|
+
## Build Fix Report
|
|
113
|
+
|
|
114
|
+
**Failing step:** {command} · **First error:** {file}:{line} — {message}
|
|
115
|
+
**Bucket:** {dependency|config|code|toolchain|cache}
|
|
116
|
+
**Root cause:** {one sentence}
|
|
117
|
+
**Fix:** {what changed and why it addresses the root}
|
|
118
|
+
**Proof:** incremental build exit 0 · clean build exit 0 (commands on record)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
A build fixed without the two-build proof, or a symptom silenced with a
|
|
122
|
+
cast or a cache clear, does not close this skill.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dev/evaluator-build-loop
|
|
3
|
+
description: >
|
|
4
|
+
Adversarial build loop for UI work: a generator implements against a
|
|
5
|
+
weighted rubric while an independent, ruthless evaluator tests the LIVE
|
|
6
|
+
app in a real browser — not the code, not screenshots — and the loop
|
|
7
|
+
repeats until the score clears the threshold. TRIGGER: "/dev
|
|
8
|
+
evaluator-build-loop", "build until it passes", "itera até passar",
|
|
9
|
+
"loop de UI", "evaluator loop", "faz e avalia até estar excelente"; any
|
|
10
|
+
UI build where the excellence-mandate visual benchmark applies and the
|
|
11
|
+
operator wants convergence without babysitting. SKIP: one-shot review
|
|
12
|
+
of an existing diff -> dev/code-review wins; UX audit of a shipped page
|
|
13
|
+
without a build loop -> dev/click-path-audit wins; writing E2E suites
|
|
14
|
+
-> dev/app-test wins.
|
|
15
|
+
allowed-tools: [Read, Grep, Glob, Bash, Edit, Write]
|
|
16
|
+
metadata:
|
|
17
|
+
origin: arkaos
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Evaluator Build Loop — `/dev evaluator-build-loop`
|
|
21
|
+
|
|
22
|
+
> **Agents:** Diana (Frontend, generator) + Rita (QA, evaluator) | **Framework:** Generator–evaluator separation, rubric-driven iteration
|
|
23
|
+
|
|
24
|
+
The dev server is up, the screenshot looks fine, and the agent that built
|
|
25
|
+
the page declares it done. Then someone clicks the second tab, resizes to
|
|
26
|
+
390px, or submits the form empty — and the illusion collapses. Builders
|
|
27
|
+
grade their own work with the same eyes that produced it, which is why
|
|
28
|
+
this loop never lets them. One role writes; a different role, in a fresh
|
|
29
|
+
context, tries to make the page fail.
|
|
30
|
+
|
|
31
|
+
## Roles — never merged, never shared
|
|
32
|
+
|
|
33
|
+
| Role | Agent | Contract |
|
|
34
|
+
|---|---|---|
|
|
35
|
+
| **Generator** | Diana | Reads the spec + the latest `feedback-NNN.md`; fixes EVERY open finding in order — functionality → craft → design → originality; keeps the dev server alive; commits once per iteration. |
|
|
36
|
+
| **Evaluator** | Rita | Fresh subagent per iteration, launched with ONLY the spec, the rubric, and the app URL — never the generator's reasoning. Drives the live app via the Playwright MCP. Scores against the rubric; writes the next `feedback-NNN.md`. |
|
|
37
|
+
|
|
38
|
+
The evaluator's launch context is the mechanism, not a detail: any shared
|
|
39
|
+
reasoning re-imports the generator's blind spots.
|
|
40
|
+
|
|
41
|
+
## The rubric
|
|
42
|
+
|
|
43
|
+
Written BEFORE iteration 1, with explicit weights, from the spec plus the
|
|
44
|
+
project design system and a named visual benchmark (excellence-mandate:
|
|
45
|
+
UI work loads frontend-design, ui-ux-pro-max, and the project design
|
|
46
|
+
system at maximum effort). Typical weighting: functionality 40 · craft
|
|
47
|
+
(states, a11y, responsiveness) 30 · design fidelity 20 · originality 10.
|
|
48
|
+
A dimension the spec does not care about gets weight 0 — do not invent
|
|
49
|
+
criteria mid-loop.
|
|
50
|
+
|
|
51
|
+
## Evaluator discipline
|
|
52
|
+
|
|
53
|
+
- Test the **live app** in the browser: click paths, keyboard, empty and
|
|
54
|
+
error states, viewport extremes. Not the code. Not screenshots.
|
|
55
|
+
- Be ruthless by instruction: hunt the edge case, penalize
|
|
56
|
+
default-looking output, refuse partial credit for "almost works".
|
|
57
|
+
- **Default-refuted:** when unsure whether a criterion passes, it fails.
|
|
58
|
+
Optimism is the generator's disease; the evaluator is the cure.
|
|
59
|
+
- Every finding names the concrete reproduction — URL, action, expected
|
|
60
|
+
vs. observed — so the generator fixes instead of guessing.
|
|
61
|
+
|
|
62
|
+
## Loop mechanics
|
|
63
|
+
|
|
64
|
+
1. Generator builds iteration N; commits on the working branch; emits the
|
|
65
|
+
`[arka:design]` evidence marker (frontend gate).
|
|
66
|
+
2. Evaluator (fresh context) scores the live app → `feedback-NNN.md` with
|
|
67
|
+
the score per dimension and ranked findings.
|
|
68
|
+
3. Score ≥ threshold (default 90/100) → exit to Quality Gate. Otherwise
|
|
69
|
+
loop.
|
|
70
|
+
4. **Circuit breaker:** 5 iterations without clearing the threshold, or
|
|
71
|
+
two consecutive iterations with no score improvement → stop and
|
|
72
|
+
escalate to the operator with the score history. Never grind silently.
|
|
73
|
+
|
|
74
|
+
All handoff is by file — spec, rubric, feedback — so the loop survives a
|
|
75
|
+
`/clear` and either role can be resumed cold.
|
|
76
|
+
|
|
77
|
+
## Output
|
|
78
|
+
|
|
79
|
+
```markdown
|
|
80
|
+
## Evaluator Build Loop Report
|
|
81
|
+
|
|
82
|
+
**Spec:** {path} | **Rubric threshold:** {n}
|
|
83
|
+
**Iterations:** {k} | **Final score:** {score}/100
|
|
84
|
+
|
|
85
|
+
| Iter | Functionality | Craft | Design | Originality | Total |
|
|
86
|
+
|---|---|---|---|---|---|
|
|
87
|
+
|
|
88
|
+
**Open findings:** {none, or the escalation list with reproductions}
|
|
89
|
+
**Evidence:** commits {range}, feedback files, `[arka:design]` markers
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The loop feeds the Quality Gate; it does not replace it. Marta still has
|
|
93
|
+
the veto.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dev/react-review
|
|
3
|
+
description: >
|
|
4
|
+
React / Next.js review for the framework's own traps — stale closures
|
|
5
|
+
in hooks, dependency arrays that lie, derived state stored instead of
|
|
6
|
+
computed, keys that force remounts, effects doing render work, and
|
|
7
|
+
server/client boundary leaks in the App Router — with the fix each
|
|
8
|
+
needs. Hooks and TypeScript assumed. TRIGGER: "/dev react-review",
|
|
9
|
+
"review this React", "review the Next.js", "revê este componente
|
|
10
|
+
React", "revê o hook", "porque é que o efeito corre duas vezes?", any
|
|
11
|
+
diff touching *.tsx components or custom hooks. SKIP:
|
|
12
|
+
language-agnostic review -> dev/code-review wins; TypeScript type
|
|
13
|
+
design without React specifics -> dev/typescript-review wins; a
|
|
14
|
+
handler-ordering/state-cancellation bug -> dev/click-path-audit wins;
|
|
15
|
+
visual/brand review -> brand/design-review wins.
|
|
16
|
+
allowed-tools: [Read, Grep, Glob]
|
|
17
|
+
metadata:
|
|
18
|
+
origin: arkaos
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# React Review — `/dev react-review`
|
|
22
|
+
|
|
23
|
+
> **Agent:** Diana (Senior Frontend Developer) | **Framework:** Hooks semantics, render-cycle discipline, RSC boundaries
|
|
24
|
+
|
|
25
|
+
Where Vue's traps announce themselves — reactivity silently lost is
|
|
26
|
+
still lost — React's traps ship working code that is wrong later: the
|
|
27
|
+
closure that captured last render's state, the dependency array that
|
|
28
|
+
omits what the effect reads, the memo that never invalidates. This
|
|
29
|
+
review walks the render cycle, not the file: what each render reads,
|
|
30
|
+
what it captures, and what survives to the next one.
|
|
31
|
+
|
|
32
|
+
## The traps, and the fix each needs
|
|
33
|
+
|
|
34
|
+
| # | Trap | Signature | Fix |
|
|
35
|
+
|---|------|-----------|-----|
|
|
36
|
+
| 1 | Stale closure | callback reads state captured N renders ago | functional updater (`setX(v => ...)`) or include the dep and let the callback re-create |
|
|
37
|
+
| 2 | Lying dependency array | effect reads `a`, deps say `[b]` | list what the effect READS; if that loops, the effect does too much — split it |
|
|
38
|
+
| 3 | Derived state stored | `useState` mirroring a computable value, synced by effect | compute during render (`useMemo` if costly); delete the effect |
|
|
39
|
+
| 4 | Key-forced remounts | `key={index}` on reorderable lists, or key changing identity every render | stable identity key; component state survives reorders |
|
|
40
|
+
| 5 | Effects doing render work | formatting/filtering in `useEffect` + `setState` | that is render logic — move it into render; effects are for the outside world |
|
|
41
|
+
| 6 | Boundary leak (App Router) | `"use client"` at the top of a tree because one leaf needs a hook | push the directive to the leaf; a client parent drags every child into the bundle |
|
|
42
|
+
| 7 | Context re-render storm | one broad context carrying fast-changing values | split contexts by change rate, memoize the provider value |
|
|
43
|
+
| 8 | Unstable references as props | inline objects/functions into memoized children | hoist or `useCallback`/`useMemo` — or drop the memo, half-memoized is unmemoized |
|
|
44
|
+
|
|
45
|
+
## Process
|
|
46
|
+
|
|
47
|
+
For every component and custom hook in scope:
|
|
48
|
+
|
|
49
|
+
1. **Trace one render**: what it reads, what it computes, what it
|
|
50
|
+
captures in closures handed to children, effects, or timers.
|
|
51
|
+
2. **Interrogate every `useEffect`**: does it synchronize with an
|
|
52
|
+
external system (fetch, subscription, DOM)? If it only moves state
|
|
53
|
+
around, it is a trap-3 or trap-5 candidate.
|
|
54
|
+
3. **Check every dependency array against the closure it feeds** — the
|
|
55
|
+
array documents what the closure reads; any omission is a latent
|
|
56
|
+
staleness bug, not an optimization.
|
|
57
|
+
4. **Walk the server/client boundary** (Next.js App Router): where does
|
|
58
|
+
`"use client"` sit, and does anything serialize a non-serializable
|
|
59
|
+
prop across it?
|
|
60
|
+
5. **Confirm list keys carry identity**, not position.
|
|
61
|
+
|
|
62
|
+
## Proactive Triggers
|
|
63
|
+
|
|
64
|
+
Surface these WITHOUT being asked:
|
|
65
|
+
|
|
66
|
+
- an async callback using state without a functional updater → the
|
|
67
|
+
stale-closure race it hides
|
|
68
|
+
- `useEffect` + `setState` whose only input is other state → the
|
|
69
|
+
derived-state rewrite that deletes both
|
|
70
|
+
- a `"use client"` higher than the hook that needs it → the bundle cost
|
|
71
|
+
and the RSC benefits silently forfeited
|
|
72
|
+
|
|
73
|
+
## Output
|
|
74
|
+
|
|
75
|
+
```markdown
|
|
76
|
+
## React Review Report
|
|
77
|
+
|
|
78
|
+
**Scope:** {components / hooks reviewed}
|
|
79
|
+
|
|
80
|
+
### {Component / hook} — {file}:{line}
|
|
81
|
+
**Trap:** {#N name} · **Evidence:** {what the render trace shows}
|
|
82
|
+
**Consequence:** {what goes wrong, when}
|
|
83
|
+
**Fix:** {the specific rewrite}
|
|
84
|
+
|
|
85
|
+
**Verdict:** {clean / N findings, ranked by user impact}
|
|
86
|
+
```
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dev/spec-miner
|
|
3
|
+
description: >
|
|
4
|
+
Mines a spec OUT of an existing codebase: maps entry points into
|
|
5
|
+
capabilities, samples the code under an explicit token budget, and
|
|
6
|
+
emits machine-parseable WHEN→THEN requirements and invariants — with
|
|
7
|
+
uncertainty marked, nothing invented, and the source commit recorded so
|
|
8
|
+
the spec knows when it has aged. TRIGGER: "/dev spec-miner", "extrai a
|
|
9
|
+
spec", "reverse-engineer the spec", "what does this code actually do,
|
|
10
|
+
as requirements", "documenta o comportamento existente", brownfield
|
|
11
|
+
onboarding, and always BEFORE refactoring code that has no spec. SKIP:
|
|
12
|
+
spec for something new -> dev/spec wins (greenfield WHAT); a guided
|
|
13
|
+
tour of the codebase -> dev/codebase-onboard wins; library or
|
|
14
|
+
framework evaluation -> dev/research wins.
|
|
15
|
+
allowed-tools: [Read, Grep, Glob, Bash, Write]
|
|
16
|
+
metadata:
|
|
17
|
+
origin: arkaos
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Spec Miner — `/dev spec-miner`
|
|
21
|
+
|
|
22
|
+
> **Agent:** Gabriel (Architect) | **Framework:** Living Specs, budgeted behavioral sampling
|
|
23
|
+
|
|
24
|
+
`arka-spec` answers "what should we build?" before code exists. This
|
|
25
|
+
skill answers the inverse — "what did we already build?" — for the far
|
|
26
|
+
more common case: a working system whose only specification is the code
|
|
27
|
+
itself, about to be refactored by someone who cannot afford to be wrong
|
|
28
|
+
about current behavior.
|
|
29
|
+
|
|
30
|
+
## Phase 1 — Map
|
|
31
|
+
|
|
32
|
+
Detect the structure and group entry points into capabilities: HTTP
|
|
33
|
+
routes, CLI commands, queued jobs, scheduled tasks, event handlers,
|
|
34
|
+
public package exports. Each capability gets a name and its entry files.
|
|
35
|
+
No code reading yet — this phase is inventory, and it bounds phase 2.
|
|
36
|
+
|
|
37
|
+
## Phase 2 — Sample and expand, under budget
|
|
38
|
+
|
|
39
|
+
Reading everything is a trap: the budget burns on utilities while the
|
|
40
|
+
behavior lives at the surface. So:
|
|
41
|
+
|
|
42
|
+
1. Read the entry and facade files of each capability first — in most
|
|
43
|
+
codebases they encode ~70% of observable behavior.
|
|
44
|
+
2. Descend ONE level into the call chain, only where the facade defers a
|
|
45
|
+
decision (validation, branching, persistence rules).
|
|
46
|
+
3. **Stop** at external boundaries (SDKs, frameworks, network) or at 15
|
|
47
|
+
files per capability, whichever comes first.
|
|
48
|
+
4. Whatever was deferred is listed in the spec as explicitly unmined —
|
|
49
|
+
deferred scope is visible scope, never silent scope.
|
|
50
|
+
|
|
51
|
+
## Phase 3 — Emit
|
|
52
|
+
|
|
53
|
+
Requirements in WHEN→THEN form, invariants as standalone guarantees, both
|
|
54
|
+
machine-parseable, written as a markdown document that sits beside the
|
|
55
|
+
authored specs in `core/specs/`:
|
|
56
|
+
|
|
57
|
+
```markdown
|
|
58
|
+
### Requirement: {capability} — {behavior}
|
|
59
|
+
WHEN {trigger and preconditions}
|
|
60
|
+
THEN {observable outcome}
|
|
61
|
+
<!-- source: {file}:{lines} -->
|
|
62
|
+
|
|
63
|
+
### Invariant: {guarantee}
|
|
64
|
+
<!-- source: {file}:{lines} -->
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Three hard rules:
|
|
68
|
+
|
|
69
|
+
- **Never invent behavior.** If the code is ambiguous, write the
|
|
70
|
+
requirement with an `<!-- uncertainty: {what is unclear} -->` marker
|
|
71
|
+
instead of a guess. A wrong spec is worse than a gap — the gap gets
|
|
72
|
+
investigated, the wrong spec gets trusted.
|
|
73
|
+
- **Every claim carries a source pointer.** A requirement nobody can
|
|
74
|
+
trace to a file and line is an opinion.
|
|
75
|
+
- **Stamp the mined commit hash** in the spec frontmatter. When HEAD
|
|
76
|
+
moves, the spec's age is measurable with a single
|
|
77
|
+
`git log <hash>..HEAD`, so drift is visible instead of quiet.
|
|
78
|
+
|
|
79
|
+
## Output
|
|
80
|
+
|
|
81
|
+
The mined spec is a markdown document beside the authored ones, and
|
|
82
|
+
`status: mined` in its frontmatter is a proposed convention, not an
|
|
83
|
+
engine state: it stays `mined` until a human reviews the document and
|
|
84
|
+
changes the status by hand. The report ends with the coverage summary —
|
|
85
|
+
capabilities mined, files read vs. deferred, uncertainty count — so the
|
|
86
|
+
reader knows exactly how much of the system the spec actually saw.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ops/hookify
|
|
3
|
+
description: >
|
|
4
|
+
Compiles a repeated correction into a deterministic hook: identify
|
|
5
|
+
the behavior that keeps being corrected by hand, express it as a
|
|
6
|
+
machine-checkable predicate, and install it on the right ArkaOS hook
|
|
7
|
+
surface (PreToolUse deny, Stop lint, UserPromptSubmit nudge) —
|
|
8
|
+
warn-first with telemetry, hard only when the false-positive rate
|
|
9
|
+
earns it. TRIGGER: "/ops hookify", "make this automatic", "torna isto
|
|
10
|
+
automático", "estou farto de corrigir isto", "enforce this rule",
|
|
11
|
+
"isto devia ser um hook"; the third manual correction of the same
|
|
12
|
+
behavior. SKIP: capturing a reusable feature build -> arka-recipes
|
|
13
|
+
wins; automating a business process -> ops/workflow-automate wins;
|
|
14
|
+
writing an SOP for humans -> ops/sop-create wins.
|
|
15
|
+
allowed-tools: [Read, Grep, Glob, Bash, Write, Edit]
|
|
16
|
+
metadata:
|
|
17
|
+
origin: arkaos
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Hookify — `/ops hookify`
|
|
21
|
+
|
|
22
|
+
> **Agent:** Daniel (Operations Lead) | **Framework:** Correction-to-predicate compilation, warn-first enforcement
|
|
23
|
+
|
|
24
|
+
A hook is a correction that stopped needing you. The third time the
|
|
25
|
+
same behavior gets fixed by hand — the commit message pattern, the file
|
|
26
|
+
that must never be edited directly, the command that needs a flag — the
|
|
27
|
+
correction has stopped being feedback and become a specification
|
|
28
|
+
nobody wrote down. This skill writes it down as executable policy.
|
|
29
|
+
|
|
30
|
+
## Step 1 — Extract the predicate
|
|
31
|
+
|
|
32
|
+
From the repeated correction, derive a predicate a machine can decide
|
|
33
|
+
WITHOUT judgment calls:
|
|
34
|
+
|
|
35
|
+
- **Good**: "Edit on `config/claude-agents/*.md` → deny (generated
|
|
36
|
+
file; the YAML is the source)."
|
|
37
|
+
- **Not hookifiable**: "commit messages should be clearer" — no
|
|
38
|
+
decidable predicate. Route vague quality intents to review skills,
|
|
39
|
+
not hooks; a hook that needs judgment produces false positives that
|
|
40
|
+
teach the operator to ignore every hook.
|
|
41
|
+
|
|
42
|
+
State the predicate as: *surface* (which tool calls / which moment),
|
|
43
|
+
*condition* (decidable test), *action* (deny / warn / inject context).
|
|
44
|
+
|
|
45
|
+
## Step 2 — Pick the surface
|
|
46
|
+
|
|
47
|
+
| Surface | When it fires | Right for | House examples |
|
|
48
|
+
|---|---|---|---|
|
|
49
|
+
| PreToolUse (`core/hooks/pre_tool_use.py`) | before a tool call | preventing an edit/command that must not happen | frontend gate, research gate |
|
|
50
|
+
| Stop (`core/hooks/stop.py`) | end of turn | measuring compliance, scoped lint over changed files | stop-lint, KB-cite check |
|
|
51
|
+
| UserPromptSubmit (`config/hooks/user-prompt-submit.sh`) | before the turn | nudges and context injection, never blocking | token hygiene checks |
|
|
52
|
+
|
|
53
|
+
Constraints that are not negotiable: hooks respect their timeout budget
|
|
54
|
+
(UserPromptSubmit 10s, PostToolUse 5s), never block on network, exit 0
|
|
55
|
+
on the non-blocking surfaces, and parse JSON with jq (python3
|
|
56
|
+
fallback). A hook that exceeds its budget degrades every turn to save
|
|
57
|
+
one correction — that trade is always refused.
|
|
58
|
+
|
|
59
|
+
## Step 3 — Warn first, harden on evidence
|
|
60
|
+
|
|
61
|
+
New enforcement ALWAYS lands warn-only with telemetry (house pattern:
|
|
62
|
+
the stop-lint and frontend-gate flips). The hook logs would-block
|
|
63
|
+
events to `~/.arkaos/telemetry/`; promotion to hard deny is a separate,
|
|
64
|
+
deliberate change gated on the observed false-positive rate — a gate
|
|
65
|
+
that fires wrongly even 1 turn in 50 gets disabled by hand and trains
|
|
66
|
+
contempt for the ones that fire rightly.
|
|
67
|
+
|
|
68
|
+
## Step 4 — Install with proof
|
|
69
|
+
|
|
70
|
+
1. Implement on the chosen surface, following that surface's existing
|
|
71
|
+
pattern (read the sibling hooks first).
|
|
72
|
+
2. Reproduce the original correction scenario and show the hook
|
|
73
|
+
catching it — a hook whose trigger was never exercised is a hope,
|
|
74
|
+
not a control.
|
|
75
|
+
3. Show a benign scenario passing untouched (the false-positive probe).
|
|
76
|
+
4. Register the telemetry line and, if the hook grows a flag, document
|
|
77
|
+
it where the surface's flags live.
|
|
78
|
+
|
|
79
|
+
## Output
|
|
80
|
+
|
|
81
|
+
```markdown
|
|
82
|
+
## Hookify Report
|
|
83
|
+
|
|
84
|
+
**Correction observed:** {what kept being fixed by hand, with instances}
|
|
85
|
+
**Predicate:** {surface} · {condition} · {action}
|
|
86
|
+
**Mode:** warn-only (telemetry: {file}) · hard-flip criterion: {rate}
|
|
87
|
+
**Proof:** trigger scenario caught ✓ · benign scenario untouched ✓
|
|
88
|
+
**Files:** {hook file, config, telemetry}
|
|
89
|
+
```
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pm/epic-coordination
|
|
3
|
+
description: >
|
|
4
|
+
Turns an epic into a coordinated set of GitHub issues with an explicit
|
|
5
|
+
dependency graph, then drives it: sweep for unblocked work, dispatch
|
|
6
|
+
in dependency order, keep issue state honest against merged reality,
|
|
7
|
+
and close the epic only when the graph is empty. TRIGGER: "/pm epic",
|
|
8
|
+
"break this epic into issues", "parte isto em issues", "coordena
|
|
9
|
+
estes issues", "what can start now?", "o que está desbloqueado?",
|
|
10
|
+
multi-PR work spanning more than one workstream. SKIP: sizing and
|
|
11
|
+
cadence for a sprint -> pm/sprint-plan wins; writing one story well
|
|
12
|
+
-> pm/story-write wins; branch/merge discipline within a single
|
|
13
|
+
change -> ops/github-ops wins; ranking the backlog -> pm/backlog-groom
|
|
14
|
+
wins.
|
|
15
|
+
allowed-tools: [Read, Grep, Glob, Bash]
|
|
16
|
+
metadata:
|
|
17
|
+
origin: arkaos
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Epic Coordination — `/pm epic`
|
|
21
|
+
|
|
22
|
+
> **Agent:** Carolina (Product Manager) | **Framework:** Dependency-graph decomposition, single-source issue state
|
|
23
|
+
|
|
24
|
+
An epic dies in one of two ways: as a monolith pull request nobody can
|
|
25
|
+
review, or as twenty issues nobody sequenced — where three developers
|
|
26
|
+
block each other by lunchtime and the "done" column fills with work
|
|
27
|
+
that cannot ship because its dependency never started. Both deaths have
|
|
28
|
+
the same cause: the dependencies existed, but only in someone's head.
|
|
29
|
+
|
|
30
|
+
## Phase 1 — Decompose against the graph
|
|
31
|
+
|
|
32
|
+
1. Break the epic into issues where each issue is **independently
|
|
33
|
+
mergeable**: it can go to master alone without breaking the build,
|
|
34
|
+
even if the feature is not yet user-visible behind it.
|
|
35
|
+
2. For each issue record what it **blocks** and what it is **blocked
|
|
36
|
+
by**. A dependency that cannot be named in one sentence ("B reads
|
|
37
|
+
the schema A creates") is usually a sign the split is wrong — re-cut
|
|
38
|
+
the boundary before creating anything.
|
|
39
|
+
3. Write the graph INTO the issues (`gh issue create` with "Blocked by
|
|
40
|
+
#N" / "Blocks #N" in the body, labels for the epic and workstream).
|
|
41
|
+
GitHub is the single source of state — a graph kept in a document
|
|
42
|
+
diverges from reality by the second merge.
|
|
43
|
+
|
|
44
|
+
## Phase 2 — Drive by sweep
|
|
45
|
+
|
|
46
|
+
Repeat until the graph is empty:
|
|
47
|
+
|
|
48
|
+
1. **Sweep**: an issue is *unblocked* when every "Blocked by" reference
|
|
49
|
+
is closed AND its commits are actually on the target branch —
|
|
50
|
+
closed-but-unmerged is still blocked, whatever the issue state says.
|
|
51
|
+
2. **Dispatch** every unblocked issue; independent issues run in
|
|
52
|
+
parallel, dependent ones never do.
|
|
53
|
+
3. **Reconcile** after each merge: close what merged, update "Blocked
|
|
54
|
+
by" lists the merge invalidated, and re-sweep. Reality moves the
|
|
55
|
+
graph; the graph never moves reality.
|
|
56
|
+
4. **Escalate stalls**: an issue unblocked for longer than the epic's
|
|
57
|
+
agreed cadence with no movement is a decision waiting to be made —
|
|
58
|
+
name it to the operator instead of letting the graph silt up.
|
|
59
|
+
|
|
60
|
+
## Invariants
|
|
61
|
+
|
|
62
|
+
- Every issue names its epic; the epic issue links every child. Orphan
|
|
63
|
+
work inside an epic is scope creep with a paper trail.
|
|
64
|
+
- The critical path (longest dependency chain) is stated in the epic
|
|
65
|
+
issue and re-derived after every reconcile — priorities follow it,
|
|
66
|
+
not the order issues were created in.
|
|
67
|
+
- Closing the epic requires the graph empty AND the epic's acceptance
|
|
68
|
+
line verified against the merged state, not against the issue list.
|
|
69
|
+
|
|
70
|
+
## Output
|
|
71
|
+
|
|
72
|
+
```markdown
|
|
73
|
+
## Epic Status — {epic title} (#{epic issue})
|
|
74
|
+
|
|
75
|
+
**Issues:** {open}/{total} · **Critical path:** #{a} → #{b} → #{c}
|
|
76
|
+
**Unblocked now:** #{n}, #{m} · **Blocked:** #{x} (by #{y})
|
|
77
|
+
**Stalled:** {none, or issue + the decision it waits on}
|
|
78
|
+
**Next dispatch:** {what starts now, in what order, and why}
|
|
79
|
+
```
|