arkaos 5.1.1 → 5.3.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 (63) hide show
  1. package/CONSTITUTION.md +1 -1
  2. package/README.md +3 -1
  3. package/THE-ARKAOS-GUIDE.md +2 -2
  4. package/VERSION +1 -1
  5. package/arka/SKILL.md +17 -1
  6. package/arka/skills/comfyui/SKILL.md +2 -2
  7. package/config/constitution.yaml +2 -2
  8. package/core/governance/evidence_checks.py +69 -11
  9. package/core/hooks/session_start.py +1 -1
  10. package/core/sync/features/forge.yaml +1 -1
  11. package/core/sync/features/spec-gate.yaml +1 -1
  12. package/core/sync/features/workflow-tiers.yaml +1 -1
  13. package/departments/brand/SKILL.md +1 -1
  14. package/departments/dev/SKILL.md +26 -1
  15. package/departments/dev/skills/adversarial-review/SKILL.md +5 -0
  16. package/departments/dev/skills/api-design/SKILL.md +8 -0
  17. package/departments/dev/skills/architecture-design/SKILL.md +6 -0
  18. package/departments/dev/skills/build-fix/SKILL.md +8 -2
  19. package/departments/dev/skills/clean-code-review/SKILL.md +8 -0
  20. package/departments/dev/skills/code-review/SKILL.md +14 -0
  21. package/departments/dev/skills/dependency-audit/SKILL.md +8 -0
  22. package/departments/dev/skills/refactor-plan/SKILL.md +7 -0
  23. package/departments/dev/skills/research/SKILL.md +52 -6
  24. package/departments/dev/skills/stack-check/SKILL.md +9 -0
  25. package/harness/codex/AGENTS.md +2 -2
  26. package/harness/copilot/copilot-instructions.md +2 -2
  27. package/harness/cursor/rules/arkaos.mdc +3 -3
  28. package/harness/gemini/GEMINI.md +2 -2
  29. package/harness/opencode/AGENTS.md +2 -2
  30. package/harness/opencode/agents/arka-architect-gabriel.md +1 -1
  31. package/harness/opencode/agents/arka-brand-director-valentina.md +1 -1
  32. package/harness/opencode/agents/arka-cfo-helena.md +1 -1
  33. package/harness/opencode/agents/arka-chief-of-staff-afonso.md +1 -1
  34. package/harness/opencode/agents/arka-community-strategist-beatriz.md +1 -1
  35. package/harness/opencode/agents/arka-content-strategist-rafael.md +1 -1
  36. package/harness/opencode/agents/arka-conversion-strategist-ines.md +1 -1
  37. package/harness/opencode/agents/arka-coo-sofia.md +1 -1
  38. package/harness/opencode/agents/arka-copy-director-eduardo.md +1 -1
  39. package/harness/opencode/agents/arka-cqo-marta.md +1 -1
  40. package/harness/opencode/agents/arka-cto-marco.md +1 -1
  41. package/harness/opencode/agents/arka-design-ops-lead-iris.md +1 -1
  42. package/harness/opencode/agents/arka-ecom-director-ricardo.md +1 -1
  43. package/harness/opencode/agents/arka-knowledge-director-clara.md +1 -1
  44. package/harness/opencode/agents/arka-leadership-director-rodrigo.md +1 -1
  45. package/harness/opencode/agents/arka-marketing-director-luna.md +1 -1
  46. package/harness/opencode/agents/arka-ops-lead-daniel.md +1 -1
  47. package/harness/opencode/agents/arka-pm-director-carolina.md +1 -1
  48. package/harness/opencode/agents/arka-revops-lead-vicente.md +1 -1
  49. package/harness/opencode/agents/arka-saas-strategist-tiago.md +1 -1
  50. package/harness/opencode/agents/arka-sales-director-miguel.md +1 -1
  51. package/harness/opencode/agents/arka-strategy-director-tomas.md +1 -1
  52. package/harness/opencode/agents/arka-tech-director-francisca.md +1 -1
  53. package/harness/opencode/agents/arka-tech-lead-paulo.md +1 -1
  54. package/harness/opencode/agents/arka-video-producer-simao.md +1 -1
  55. package/harness/zed/.rules +2 -2
  56. package/knowledge/commands-keywords.json +10 -2
  57. package/knowledge/commands-registry.json +35 -3
  58. package/knowledge/skills-manifest.json +1 -1
  59. package/package.json +1 -1
  60. package/pyproject.toml +1 -1
  61. package/scripts/skills_catalog_gen.py +234 -0
  62. package/scripts/workflows_catalog_gen.py +161 -0
  63. package/knowledge/commands-registry.json.bak +0 -6462
package/CONSTITUTION.md CHANGED
@@ -115,7 +115,7 @@ Level re-tiering requires explicit operator approval and a recorded
115
115
  ## Compressed Context (Synapse L0)
116
116
 
117
117
  ```
118
- [Constitution] NON-NEGOTIABLE: branch-isolation, security-gate, mandatory-qa, evidence-flow, arkaos-not-yes-man, excellence-mandate | QUALITY-GATE: marta-cqo, eduardo-copy, francisca-tech-ux | MUST (28) incl.: squad-routing, spec-driven, conventional-commits, test-coverage, subagent-discipline, persona-vs-artifact
118
+ [Constitution] NON-NEGOTIABLE: branch-isolation, security-gate, mandatory-qa, evidence-flow, arkaos-not-yes-man, excellence-mandate | QUALITY-GATE: marta-cqo, eduardo-copy, francisca-tech-ux | MUST (29) incl.: squad-routing, spec-driven, conventional-commits, test-coverage, subagent-discipline, persona-vs-artifact
119
119
  ```
120
120
 
121
121
  ---
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # ArkaOS
2
2
 
3
+ <img src="assets/github-social.png" alt="ArkaOS — The Operating System for AI Agent Teams" width="100%">
4
+
3
5
  **The Operating System for AI Agent Teams.**
4
6
 
5
7
  89 agents. 17 departments. 333 skills. Enterprise frameworks. Multi-runtime. One install.
@@ -8,7 +10,7 @@
8
10
  npx arkaos install
9
11
  ```
10
12
 
11
- [![npm](https://img.shields.io/npm/v/arkaos)](https://www.npmjs.com/package/arkaos) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![Tests](https://img.shields.io/badge/tests-4500%2B%20passing-brightgreen)]()
13
+ [![npm](https://img.shields.io/npm/v/arkaos)](https://www.npmjs.com/package/arkaos) [![npm](https://img.shields.io/npm/dw/arkaos)](https://www.npmjs.com/package/arkaos) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![Tests](https://img.shields.io/badge/tests-4500%2B%20passing-brightgreen)]()
12
14
 
13
15
  > All counts in this document are generated by `python scripts/tools/docs_stats.py`
14
16
  > and locked by a test — they cannot drift from the repository.
@@ -1,6 +1,6 @@
1
1
  # The ArkaOS Guide
2
2
 
3
- > v5.1.1 — 89 agents, 17 departments, 333 skills, 298 commands, 19 ADRs.
3
+ > v5.3.0 — 89 agents, 17 departments, 333 skills, 299 commands, 20 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
@@ -41,7 +41,7 @@ answers as a generic assistant.
41
41
  | `/brand` | 12 |
42
42
  | `/community` | 15 |
43
43
  | `/content` | 20 |
44
- | `/dev` | 36 |
44
+ | `/dev` | 37 |
45
45
  | `/do` | 1 |
46
46
  | `/ecom` | 18 |
47
47
  | `/fin` | 10 |
package/VERSION CHANGED
@@ -1 +1 @@
1
- 5.1.1
1
+ 5.3.0
package/arka/SKILL.md CHANGED
@@ -22,6 +22,22 @@ external research (Context7, WebSearch, WebFetch, Firecrawl):
22
22
  explicitly declare a KB gap.
23
23
  4. Only after (1)–(3) may external tools run.
24
24
 
25
+ **Which external tool, for code questions.** Once the KB step is done, two
26
+ externals answer different questions and neither substitutes for the other:
27
+
28
+ | Tool | Answers | Reach for it when |
29
+ | --- | --- | --- |
30
+ | `mcp__context7__query-docs` | the contract — what the official docs say | you need documented signatures, config keys, version changes |
31
+ | `mcp__gh-grep__searchGitHub` | the practice — how N public repos really implement it | you need real call-sites, idioms, migration patterns, or an error signature seen in the wild |
32
+
33
+ Adopting an unfamiliar API wants both: the contract, then the practice.
34
+ `gh-grep` is **literal grep with regex over public repos** — query it with
35
+ code tokens (`createBrowserRouter`, `defineConfig({`), never with a natural
36
+ language sentence, and filter by language or path. What it returns is a
37
+ prior about practice, not ground truth: confirm against the docs before
38
+ adopting. It cannot see private code (use the KB or codebase-memory) and it
39
+ is the wrong tool for non-code topics (use WebSearch/Firecrawl).
40
+
25
41
  **Fail-open:** Graphify runs on a per-user endpoint (home LAN, localhost,
26
42
  or VPS — see `knowledge.graphify` config). When it is not configured or
27
43
  not reachable, treat it as a gap and proceed with Obsidian alone; never
@@ -75,7 +91,7 @@ ends with a single line:
75
91
  | Field | Meaning | Allowed values |
76
92
  | --- | --- | --- |
77
93
  | `kb=N` | Number of Obsidian / KB notes consulted | integer ≥ 0 |
78
- | `research=X` | MCPs invoked (or 'none') | `none` or comma-list: `perplexity,exa,context7,firecrawl,xmcp` |
94
+ | `research=X` | MCPs invoked (or 'none') | `none` or comma-list: `perplexity,exa,context7,ghgrep,firecrawl,xmcp` |
79
95
  | `persona=Y` | Conclave / squad-lead persona who drove the response | `Tomas`, `Marco`, `Marta`, `Eduardo`, `Francisca`, `Paulo`, `Iris`, etc., or `orchestrator` |
80
96
  | `gap=Z` | KB gap topic when external research filled a missing area | `none` or short topic slug |
81
97
  | `critic=W` | Self-critic verdict | `passed` \| `failed` \| `skipped` |
@@ -82,7 +82,7 @@ The Forge for multi-agent planning before execution.
82
82
  - Phase 0.5: Forge analysis (after spec creation, before squad planning)
83
83
  - Complexity assessment: automatic via Synapse L8 (ForgeContextLayer)
84
84
  - Manual invocation: `/forge` command
85
- - Handoff: Forge outputs structured plan -> squad executes phases
85
+ - Handoff: Forge outputs structured plan squad executes phases
86
86
  <!-- arka:feature:forge-integration:end -->
87
87
 
88
88
  <!-- arka:feature:quality-gate:start -->
@@ -115,7 +115,7 @@ Three workflow tiers based on task complexity:
115
115
  | Tier | Phases | When |
116
116
  |------|--------|------|
117
117
  | Enterprise | 7-10 phases | Complex features, multi-file changes |
118
- | Focused | 3-5 phases | Medium tasks, single-domain changes |
118
+ | Focused | 3-4 phases | Medium tasks, single-domain changes |
119
119
  | Specialist | 1-2 phases | Simple tasks, quick fixes |
120
120
 
121
121
  Tier selection is automatic based on complexity assessment.
@@ -205,7 +205,7 @@ enforcement_levels:
205
205
  description: "Best practices. Encouraged but not enforced."
206
206
  rules:
207
207
  - id: research-first
208
- rule: "Research before building. Check Context7, existing solutions, and prior art."
208
+ rule: "Research before building. Check Context7 for the documented contract, gh-grep for how public code really implements it, the KB for what we already decided, and existing solutions and prior art wherever they live — papers, standards, and closed-source products included."
209
209
 
210
210
  - id: self-critique
211
211
  rule: "Every implementation should include a self-critique phase"
@@ -243,7 +243,7 @@ enforcement_levels:
243
243
  enforcement: "Critic-pass-per-phase mandatory; sycophancy detector rejects 'tens razão' / 'OK doing what you say' responses without pushback; reviewer dispatch is sub-fragmented with checkpoints rather than monolithic execution."
244
244
 
245
245
  - id: always-research
246
- rule: "Every substantive task consults the Client KB FIRST (Obsidian vault + memory files + project descriptors), then relevant Personas, then Context MCPs (Context7, Perplexity, Exa, Firecrawl, XMCP) for gaps. No exceptions, including mechanical edits — the KB lookup is cheap and the cost of missing context is paid by the user."
246
+ rule: "Every substantive task consults the Client KB FIRST (Obsidian vault + memory files + project descriptors), then relevant Personas, then Context MCPs (Context7 for documented contracts, gh-grep for how public repos really implement it, Perplexity, Exa, Firecrawl, XMCP) for gaps. No exceptions, including mechanical edits — the KB lookup is cheap and the cost of missing context is paid by the user."
247
247
  enforcement: "[arka:meta] transparency line lists kb=N research=X persona=Y on every substantive response; absence is treated as work-not-done. Hierarchy: Client KB > Personas > Context MCPs."
248
248
 
249
249
  - id: inter-agent-checkpoints
@@ -27,6 +27,7 @@ import configparser
27
27
  import fnmatch
28
28
  import importlib.util
29
29
  import json
30
+ import os
30
31
  import re
31
32
  import shlex
32
33
  import shutil
@@ -165,6 +166,24 @@ def _skip(check: str, reason: str) -> CheckResult:
165
166
  )
166
167
 
167
168
 
169
+ def _expand_argv(argv: list[str]) -> list[str]:
170
+ """Expand `~` where it means a path; shlex.split leaves it literal.
171
+
172
+ argv[0] is always a program path, so both `~/` and `~user` expand
173
+ there. Later tokens expand only in the `~/` form: a bare `~word` is
174
+ far more likely to be a filter expression (`pytest -k ~root`) than a
175
+ home directory, and rewriting it would silently change what runs.
176
+ """
177
+ if not argv:
178
+ return argv
179
+ head = os.path.expanduser(argv[0]) if argv[0].startswith("~") else argv[0]
180
+ tail = [
181
+ os.path.expanduser(tok) if tok.startswith("~/") else tok
182
+ for tok in argv[1:]
183
+ ]
184
+ return [head, *tail]
185
+
186
+
168
187
  def _run(
169
188
  check: str, cmd: list[str], project_dir: Path, timeout: int,
170
189
  ) -> CheckResult:
@@ -177,6 +196,15 @@ def _run(
177
196
  )
178
197
  except FileNotFoundError:
179
198
  return _skip(check, f"tool not found: {cmd[0]}")
199
+ except OSError as exc:
200
+ # Anything else exec can refuse — a directory, a non-executable
201
+ # file, a broken symlink. The gate must report, never raise: an
202
+ # uncaught error here produces no EvidenceReport at all, which is
203
+ # worse than the silent skip this module works to avoid.
204
+ return CheckResult(
205
+ check=check, ran=True, passed=False, command=command_str,
206
+ exit_code=None, summary=f"cannot execute {cmd[0]}: {exc.strerror}",
207
+ )
180
208
  except subprocess.TimeoutExpired:
181
209
  # subprocess.run kills the child on expiry before raising.
182
210
  return CheckResult(
@@ -323,6 +351,12 @@ def _check_lint(
323
351
  project_dir: Path, changed: list[str] | None,
324
352
  test_command: str | None, timeout: int,
325
353
  ) -> CheckResult:
354
+ if changed is not None and not changed:
355
+ # A KNOWN-empty diff must not inherit the project-wide baseline:
356
+ # a zero-write deliverable was gated on master's pre-existing
357
+ # ruff debt (QG 2026-08-04). None still means "scope unknown"
358
+ # and keeps the project-wide run.
359
+ return _skip("lint", "no changed files (empty diff)")
326
360
  if changed:
327
361
  scoped = _lint_scoped(project_dir, changed, timeout)
328
362
  if scoped is not None:
@@ -371,6 +405,11 @@ def _check_typecheck(
371
405
  project_dir: Path, changed: list[str] | None,
372
406
  test_command: str | None, timeout: int,
373
407
  ) -> CheckResult:
408
+ if changed is not None and not changed:
409
+ # Same zero-diff contract as lint: mypy/tsc run project-wide and
410
+ # never read the diff, so a known-empty diff would inherit
411
+ # master's type debt the moment tooling is configured.
412
+ return _skip("typecheck", "no changed files (empty diff)")
374
413
  if _mypy_configured(project_dir) and shutil.which("mypy"):
375
414
  return _run("typecheck", ["mypy", "."], project_dir, timeout)
376
415
  if (project_dir / "tsconfig.json").is_file():
@@ -431,21 +470,38 @@ def _degrade_pytest_no_tests(result: CheckResult) -> CheckResult:
431
470
  return replace(result, passed=None, summary=prefix + result.summary)
432
471
 
433
472
 
473
+ def _run_pinned_tests(
474
+ test_command: str, project_dir: Path, timeout: int,
475
+ ) -> CheckResult:
476
+ """Run the operator's pinned --test-command. Never skips."""
477
+ argv = _expand_argv(shlex.split(test_command))
478
+ result = _run("tests", argv, project_dir, timeout)
479
+ if not result.ran:
480
+ # A command the operator pinned explicitly is not optional.
481
+ # _run reports an unresolvable binary as ran=False, which an
482
+ # aggregator reads as "not applicable" — so a typo in the
483
+ # path would let a PR through on a suite that never ran.
484
+ return CheckResult(
485
+ check="tests", ran=True, passed=False,
486
+ command=" ".join(argv), exit_code=None,
487
+ summary=f"pinned --test-command could not run: {result.summary}",
488
+ )
489
+ # exit 5 is pytest's "no tests collected"; scan the first 3
490
+ # tokens so `python -m pytest` / `arka-py -m pytest` degrade too,
491
+ # while non-pytest runners (npm test) stay a real FAIL. Bounded to
492
+ # argv[:3] so a later test-path arg named *pytest* never matches
493
+ # (issue #354).
494
+ if any("pytest" in Path(tok).name for tok in argv[:3]):
495
+ return _degrade_pytest_no_tests(result)
496
+ return result
497
+
498
+
434
499
  def _check_tests(
435
500
  project_dir: Path, changed: list[str] | None,
436
501
  test_command: str | None, timeout: int,
437
502
  ) -> CheckResult:
438
503
  if test_command:
439
- argv = shlex.split(test_command)
440
- result = _run("tests", argv, project_dir, timeout)
441
- # exit 5 is pytest's "no tests collected"; scan the first 3
442
- # tokens so `python -m pytest` / `arka-py -m pytest` degrade too,
443
- # while non-pytest runners (npm test) stay a real FAIL. Bounded to
444
- # argv[:3] so a later test-path arg named *pytest* never matches
445
- # (issue #354).
446
- if any("pytest" in Path(tok).name for tok in argv[:3]):
447
- return _degrade_pytest_no_tests(result)
448
- return result
504
+ return _run_pinned_tests(test_command, project_dir, timeout)
449
505
  if _has_python(project_dir, changed):
450
506
  local_pytest = _project_pytest(project_dir)
451
507
  if local_pytest:
@@ -1024,8 +1080,10 @@ def _build_parser() -> argparse.ArgumentParser:
1024
1080
 
1025
1081
 
1026
1082
  def _csv(value: str | None) -> list[str] | None:
1027
- if not value:
1083
+ if value is None:
1028
1084
  return None
1085
+ # `--changed-files ""` is a KNOWN-empty diff and maps to [] so the
1086
+ # zero-diff skip fires; an omitted flag stays None (scope unknown).
1029
1087
  return [item.strip() for item in value.split(",") if item.strip()]
1030
1088
 
1031
1089
 
@@ -96,7 +96,7 @@ _META_TAG_CONTRACT = (
96
96
  "\n\n[ARKA:META-TAG] Every substantive response ends with a single line:"
97
97
  "\n [arka:meta] kb=N research=X persona=Y gap=Z critic=W"
98
98
  "\nFields: kb=N (Obsidian/KB notes consulted), research=X (MCPs invoked:"
99
- " perplexity,exa,context7,firecrawl,xmcp or 'none'), persona=Y (advisor"
99
+ " perplexity,exa,context7,ghgrep,firecrawl,xmcp or 'none'), persona=Y (advisor"
100
100
  " name or 'orchestrator'), gap=Z (KB gap topic or 'none'), critic=W"
101
101
  " (passed|failed|skipped)."
102
102
  "\nMandatory after: EFFECT tool calls, plan/recommendation outputs, QG"
@@ -2,7 +2,7 @@ name: forge-integration
2
2
  added_in: "2.14.0"
3
3
  mandatory: true
4
4
  section_title: "Forge Integration"
5
- detection_pattern: "arka:feature:forge-integration|## Forge Integration|arka-forge"
5
+ detection_pattern: "arka:feature:forge-integration|## Forge Integration|arka-forge(?![\\w-])"
6
6
  deprecated_in: null
7
7
  content: |
8
8
  <!-- arka:feature:forge-integration:start -->
@@ -2,7 +2,7 @@ name: spec-driven-gate
2
2
  added_in: "2.13.0"
3
3
  mandatory: true
4
4
  section_title: "Spec-Driven Development"
5
- detection_pattern: "arka:feature:spec-driven-gate|## Spec-Driven Development|arka-spec"
5
+ detection_pattern: "arka:feature:spec-driven-gate|## Spec-Driven Development|arka-spec(?![\\w-])"
6
6
  deprecated_in: null
7
7
  content: |
8
8
  <!-- arka:feature:spec-driven-gate:start -->
@@ -13,7 +13,7 @@ content: |
13
13
  | Tier | Phases | When |
14
14
  |------|--------|------|
15
15
  | Enterprise | 7-10 phases | Complex features, multi-file changes |
16
- | Focused | 3-5 phases | Medium tasks, single-domain changes |
16
+ | Focused | 3-4 phases | Medium tasks, single-domain changes |
17
17
  | Specialist | 1-2 phases | Simple tasks, quick fixes |
18
18
 
19
19
  Tier selection is automatic based on complexity assessment.
@@ -2,7 +2,7 @@
2
2
  name: arka-brand
3
3
  description: >
4
4
  Brand & Design department. Full brand identity creation, UX/UI design, design systems,
5
- visual identity, and brand strategy. 4-agent team applying Primal Branding, StoryBrand,
5
+ visual identity, and brand strategy. 10-agent team applying Primal Branding, StoryBrand,
6
6
  12 Archetypes, Nielsen Heuristics, Atomic Design, and Dieter Rams principles.
7
7
  allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, Agent, WebFetch, WebSearch]
8
8
  ---
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: arka-dev
3
3
  description: >
4
- Full-stack development department. Enterprise-grade 9-agent team with structured
4
+ Full-stack development department. Enterprise-grade 15-agent team with structured
5
5
  multi-phase workflows. Implements features, APIs, reviews code, manages architecture,
6
6
  security audits, CI/CD, database design, and AI-assisted development.
7
7
  Frameworks: Clean Architecture, DDD, TDD, DORA Metrics, OWASP Top 10.
@@ -37,6 +37,7 @@ allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, Agent, WebFetch, WebSearch]
37
37
  | `/dev performance <target>` | Performance audit (CWV, API latency, DB) | Focused |
38
38
  | `/dev pipeline <project>` | CI/CD pipeline design and setup | Focused |
39
39
  | `/dev clean-review <file>` | Clean Code + SOLID compliance review | Specialist |
40
+ | `/dev research <topic>` | Library evaluation and pattern discovery (KB + Context7 + gh-grep + web) | Specialist |
40
41
  | `/dev spec <description>` | Create feature specification (mandatory pre-impl) | Specialist |
41
42
  | `/dev scaffold <type> <name>` | Project scaffolding from starter repos | Specialist |
42
43
  | `/dev do <description>` | Smart routing to the right dev command | Orchestrator |
@@ -81,6 +82,30 @@ Diagnose step: `get_architecture` for the structural map,
81
82
  PRIOR, not ground truth: verify with Read before editing. When the MCP
82
83
  is absent the phases run as before (Grep/Read exploration).
83
84
 
85
+ ## Real-world grounding (gh-grep MCP)
86
+
87
+ `codebase-memory` answers "how does OUR code do this". When the question
88
+ is "how does anyone do this", call `mcp__gh-grep__searchGitHub` — literal
89
+ grep with regex over public repositories — in Phase 1 RESEARCH and in
90
+ Diagnose, whenever an external API, library idiom, or error signature is
91
+ unfamiliar or disputed.
92
+
93
+ Query it with **code tokens**: `useSyncExternalStore`, `from
94
+ sqlalchemy.orm import`, `Cannot read properties of undefined`. Filter by
95
+ language and path. A natural-language sentence returns noise, so a first
96
+ attempt that phrases the question in prose will look like the tool failing
97
+ when it is the query that failed.
98
+
99
+ Pair it with Context7, which answers the complementary question: Context7
100
+ gives the documented contract; gh-grep gives the practice N teams actually
101
+ shipped. Where they disagree, the docs win and the divergence itself is
102
+ worth reporting. Treat results as a prior about practice — they carry no
103
+ authority over our own code, which you still read directly.
104
+
105
+ Skip it for private code (it indexes public repositories only — use
106
+ `codebase-memory` or the KB), for documentation lookups (Context7), and for
107
+ anything that is not code (WebSearch, Firecrawl).
108
+
84
109
  ## Focused Workflow (4 Phases)
85
110
 
86
111
  For `/dev debug`, `/dev refactor`, `/dev db`, `/dev performance`, `/dev pipeline`: Diagnose → Implement with tests → Rita validates → Quality Gate (Marta).
@@ -85,6 +85,11 @@ allowed-tools: [Read, Bash, Grep, Glob, Agent]
85
85
  - [ ] Assume every variable could be null/undefined
86
86
  - [ ] Assume every external call will fail
87
87
  - [ ] Ask: "If I deleted this change, what would break?"
88
+ - [ ] For an abuse vector that depends on how a third-party library
89
+ behaves, confirm the behaviour with `mcp__gh-grep__searchGitHub`
90
+ (real call-sites) plus Context7 (documented contract) before
91
+ raising it as CRITICAL — a hostile persona that invents the
92
+ library's behaviour is refuting itself, not the code
88
93
 
89
94
  ## Verdicts
90
95
 
@@ -28,6 +28,14 @@ allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, Agent]
28
28
  7. **Consistent response** — `{ "data": ..., "meta": { "pagination": ... } }`
29
29
  8. **Error format** — `{ "error": { "code": "VALIDATION_FAILED", "message": "...", "details": [...] } }`
30
30
 
31
+ When the contract has to interoperate with something you do not control — a
32
+ partner API, an SDK's expectations, a webhook consumer — check the shape
33
+ that already exists in the wild. `mcp__gh-grep__searchGitHub` on the field
34
+ names or the header (`X-Idempotency-Key`, `"cursor":`) shows what clients
35
+ are already written against. Matching an established shape costs nothing
36
+ and removes a whole class of integration surprise; diverging from one is a
37
+ decision that belongs in the ADR with its reason.
38
+
31
39
  ## Output: OpenAPI Snippet
32
40
 
33
41
  ```yaml
@@ -35,6 +35,12 @@ allowed-tools: [Read, Write, Edit, Grep, Glob, Agent, WebFetch]
35
35
  - Ask user: What system/feature needs architecture?
36
36
  - Clarify: Scale requirements, team size, tech constraints
37
37
  - Identify: Domain boundaries, data flows, external integrations
38
+ - Where the design leans on a specific framework or infrastructure
39
+ primitive, check the precedent with `mcp__gh-grep__searchGitHub`: grep
40
+ the structural tokens (a config key, a base class, a directory
41
+ convention) and read how real systems wired it. Feed what you find into
42
+ Step 4's Alternatives Considered — a pattern that public repos abandoned
43
+ is an alternative you can rule out with evidence instead of taste.
38
44
 
39
45
  ### Step 3: Architecture Design
40
46
  Apply the appropriate pattern:
@@ -46,9 +46,15 @@ reinstall the world) before reading what the tool actually said.
46
46
  | Code | type error, syntax error, failed macro/codegen |
47
47
  | Toolchain | wrong runtime version, missing system binary |
48
48
  | Cache | passes clean, fails incrementally (or the reverse) |
49
- 4. **Fix the root, not the symptom.** A cast that silences a type error
49
+ 4. **When the signature is unfamiliar, search it.** Paste the literal
50
+ error string into `mcp__gh-grep__searchGitHub` (strip the paths and
51
+ line numbers, keep the message). Repos that hit the same signature
52
+ often carry the fix in the surrounding config or lockfile, and the
53
+ search shows which fixes were adopted rather than merely proposed —
54
+ frequently faster than reading the issue tracker.
55
+ 5. **Fix the root, not the symptom.** A cast that silences a type error
50
56
  the compiler was right about is a deferred production bug.
51
- 5. **Prove it.** Two consecutive clean builds — one incremental, one
57
+ 6. **Prove it.** Two consecutive clean builds — one incremental, one
52
58
  from clean — with exit codes on record. One green build after a
53
59
  cache clear proves nothing about the fix.
54
60
 
@@ -47,6 +47,14 @@ report with issues categorized as BLOCKER, WARNING, or NOTE.
47
47
  - [ ] **No business logic in controllers** — Controllers delegate to services
48
48
  - [ ] **Repository pattern** — Data access abstracted from business logic
49
49
 
50
+ ### Idiom disputes
51
+
52
+ "This is not the idiomatic way to use X" is a claim about a community, and
53
+ it needs evidence before it becomes a blocker. Grep the symbol with
54
+ `mcp__gh-grep__searchGitHub` and let the call-sites settle it. If real repos
55
+ split evenly between two forms, downgrade the finding to a NOTE about
56
+ staying consistent inside our own codebase.
57
+
50
58
  ## Output Format
51
59
 
52
60
  ```markdown
@@ -28,6 +28,20 @@ allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, Agent, WebFetch, WebSearch]
28
28
 
29
29
  Code review against Clean Code and SOLID. Checks naming, SRP, DIP, test coverage, security.
30
30
 
31
+ ## Before you call it a BLOCKER
32
+
33
+ When the finding rests on a claim about a third-party API — "this hook must
34
+ not run in an effect", "that option is ignored here" — and you are not
35
+ certain, verify it before writing it down. `mcp__gh-grep__searchGitHub` on
36
+ the literal symbol shows how the API is used across public repos; Context7
37
+ shows what its maintainer documents. A blocker that turns out to describe
38
+ the reviewer's assumption rather than the library's behaviour costs the
39
+ author a cycle and costs the review its authority.
40
+
41
+ Run this check only when a claim about someone else's library is in
42
+ dispute. Findings about our own code — naming, SRP, coupling, coverage —
43
+ are settled by reading the code in front of you.
44
+
31
45
  ## Output
32
46
 
33
47
  Review report: BLOCKER/WARNING/NOTE with line references and fix suggestions
@@ -68,6 +68,14 @@ Run these per ecosystem:
68
68
  | Major (1.2.3 -> 2.0.0) | High | Read migration guide, plan sprint work |
69
69
  | Deprecated | Critical | Find replacement, schedule migration |
70
70
 
71
+ Registry download counts measure installs, not health: CI runs, mirrors,
72
+ proxies, and bots inflate them, while a vendored dependency is fetched once
73
+ and committed, after which it stops counting altogether even though the
74
+ project still depends on it. For a dependency you suspect is abandoned or
75
+ about to be, check real usage with `mcp__gh-grep__searchGitHub`: grep its
76
+ import path and read whether recent code still calls it, or only wraps it in
77
+ a shim on the way out.
78
+
71
79
  ## Supply Chain Checks
72
80
 
73
81
  - [ ] Lock files committed and up to date
@@ -34,6 +34,13 @@ analysis), `search_graph` to find duplicated implementations worth
34
34
  consolidating. The graph is a prior — verify with Read before planning
35
35
  an edit.
36
36
 
37
+ When the refactor moves toward an unfamiliar shape — splitting a service,
38
+ adopting a new boundary, restructuring around a library's expected layout —
39
+ look at how public repos structure the same thing before committing to it.
40
+ `mcp__gh-grep__searchGitHub` on the framework's structural tokens shows the
41
+ layouts that survived contact with real teams. Precedent is an argument, not
42
+ an authority: our constraints still decide.
43
+
37
44
  ## Output
38
45
 
39
46
  Refactoring plan with patterns, risk assessment, and test verification steps
@@ -3,14 +3,16 @@ name: dev/research
3
3
  description: >
4
4
  Dev-scoped technical research (Lucas, Analyst): library evaluation,
5
5
  framework/package selection, code pattern comparison, and engineering
6
- best-practice discovery via Context7 official docs + web research,
7
- ending in a trade-off report with a recommendation.
6
+ best-practice discovery grounded in the KB first, then Context7 for the
7
+ documented contract, gh-grep for how public repos really implement it,
8
+ and web research — ending in a trade-off report with a recommendation.
8
9
  TRIGGER: user types "/dev research", "avalia a biblioteca", "que
9
10
  lib/framework usamos", "compara X vs Y" for code dependencies,
10
11
  "library evaluation", "which package/ORM/framework should we use",
11
- "best practice" questions about implementation choices load BEFORE
12
- adding a new dependency or committing to an architecture-relevant
13
- library.
12
+ "best practice" questions about implementation choices, and real-world
13
+ usage lookups ("exemplos reais", "prior art", "como implementam os
14
+ outros", "how do others use this API") — load BEFORE adding a new
15
+ dependency or committing to an architecture-relevant library.
14
16
  SKIP: general, market, or knowledge-base research whose deliverable
15
17
  is an Obsidian KB note, including "best practices for" a non-code
16
18
  topic — arka-research (/arka research, 5-source fan-out) wins;
@@ -27,12 +29,56 @@ allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, Agent, WebFetch, WebSearch]
27
29
 
28
30
  # Research — `/dev research <topic>`
29
31
 
30
- > **Agent:** Lucas (Analyst) | **Framework:** Context7 + Web Research
32
+ > **Agent:** Lucas (Analyst) | **Framework:** KB-first + Context7 + gh-grep + Web Research
31
33
 
32
34
  ## What It Does
33
35
 
34
36
  Research a technical topic: library evaluation, pattern comparison, best practice discovery.
35
37
 
38
+ ## Sources, and the question each one answers
39
+
40
+ Work through all four before writing a recommendation. Each answers
41
+ something the others cannot, and a report built on one of them is a report
42
+ with a blind spot.
43
+
44
+ | Source | Question it answers |
45
+ | --- | --- |
46
+ | Obsidian + Graphify | what WE already decided, and what it cost us |
47
+ | `mcp__context7__query-docs` | what the maintainer documents — the contract |
48
+ | `mcp__gh-grep__searchGitHub` | what N teams actually shipped — the practice |
49
+ | WebSearch / WebFetch | everything that is not code: pricing, licensing, maintainer intent, incident history |
50
+
51
+ The gap between Context7 and gh-grep — between the contract and the
52
+ practice — is often the finding itself: an API that is documented one way
53
+ and used another way in every real repo is telling you where the sharp
54
+ edge is.
55
+
56
+ ### Querying gh-grep
57
+
58
+ It runs literal grep with regex over public repos. Query with **code
59
+ tokens**; a sentence returns noise.
60
+
61
+ Evaluating a library — is this API actually used the way the README shows?
62
+
63
+ ```
64
+ query: "unstable_cache(" · language: TypeScript
65
+ → read the call-sites: which options do people really pass, what do they
66
+ wrap, and what do they never do
67
+ ```
68
+
69
+ Comparing two options — which one shows up in serious codebases?
70
+
71
+ ```
72
+ query: "from pydantic import BaseSettings" · language: Python
73
+ query: "from pydantic_settings import BaseSettings" · language: Python
74
+ → the ratio, and the migration commits between them, answer the version
75
+ question faster than any changelog
76
+ ```
77
+
78
+ Cite what you find with the repo path, and mark it as practice, not
79
+ contract. Where docs and practice disagree, the docs win in the
80
+ recommendation and the divergence goes in the risks section.
81
+
36
82
  ## Output
37
83
 
38
84
  Research report with options, trade-offs, and recommendation
@@ -27,6 +27,15 @@ allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, Agent, WebFetch, WebSearch]
27
27
 
28
28
  Audit current tech stack: versions, dependencies, security, performance, upgrade paths.
29
29
 
30
+ ## Evidence for the upgrade path
31
+
32
+ A recommended upgrade needs more than a changelog. Search the target
33
+ version's real configs with `mcp__gh-grep__searchGitHub` using code tokens
34
+ from the new API — a config key, an import path, a renamed export — and read
35
+ what teams that already migrated had to change. Repos that pin the old
36
+ version and never moved are evidence too: treat an upgrade nobody adopted
37
+ as a risk in its own right.
38
+
30
39
  ## Output
31
40
 
32
41
  Stack health report with upgrade recommendations and risk assessment
@@ -1,6 +1,6 @@
1
1
  # ArkaOS — The Operating System for AI Agent Teams
2
2
 
3
- > v5.1.1 — 89 agents, 17 departments, 333 skills. Generated by `scripts/harness_gen.py`; do not edit.
3
+ > v5.3.0 — 89 agents, 17 departments, 333 skills. Generated by `scripts/harness_gen.py`; do not edit.
4
4
 
5
5
  You are operating within ArkaOS. Every request routes through the
6
6
  appropriate department squad — never respond as a generic assistant.
@@ -22,7 +22,7 @@ appropriate department squad — never respond as a generic assistant.
22
22
 
23
23
  | Prefix | Lead | Commands |
24
24
  |---|---|---|
25
- | `/dev` | Paulo | 36 |
25
+ | `/dev` | Paulo | 37 |
26
26
  | `/mkt` | Luna | 30 |
27
27
  | `/brand` | Valentina | 12 |
28
28
  | `/fin` | Helena | 10 |
@@ -1,6 +1,6 @@
1
1
  # ArkaOS — The Operating System for AI Agent Teams
2
2
 
3
- > v5.1.1 — 89 agents, 17 departments, 333 skills. Generated by `scripts/harness_gen.py`; do not edit.
3
+ > v5.3.0 — 89 agents, 17 departments, 333 skills. Generated by `scripts/harness_gen.py`; do not edit.
4
4
 
5
5
  You are operating within ArkaOS. Every request routes through the
6
6
  appropriate department squad — never respond as a generic assistant.
@@ -22,7 +22,7 @@ appropriate department squad — never respond as a generic assistant.
22
22
 
23
23
  | Prefix | Lead | Commands |
24
24
  |---|---|---|
25
- | `/dev` | Paulo | 36 |
25
+ | `/dev` | Paulo | 37 |
26
26
  | `/mkt` | Luna | 30 |
27
27
  | `/brand` | Valentina | 12 |
28
28
  | `/fin` | Helena | 10 |
@@ -1,11 +1,11 @@
1
1
  ---
2
- description: ArkaOS v5.1.1 agent-team contract
2
+ description: ArkaOS v5.3.0 agent-team contract
3
3
  alwaysApply: true
4
4
  ---
5
5
 
6
6
  # ArkaOS — The Operating System for AI Agent Teams
7
7
 
8
- > v5.1.1 — 89 agents, 17 departments, 333 skills. Generated by `scripts/harness_gen.py`; do not edit.
8
+ > v5.3.0 — 89 agents, 17 departments, 333 skills. Generated by `scripts/harness_gen.py`; do not edit.
9
9
 
10
10
  You are operating within ArkaOS. Every request routes through the
11
11
  appropriate department squad — never respond as a generic assistant.
@@ -27,7 +27,7 @@ appropriate department squad — never respond as a generic assistant.
27
27
 
28
28
  | Prefix | Lead | Commands |
29
29
  |---|---|---|
30
- | `/dev` | Paulo | 36 |
30
+ | `/dev` | Paulo | 37 |
31
31
  | `/mkt` | Luna | 30 |
32
32
  | `/brand` | Valentina | 12 |
33
33
  | `/fin` | Helena | 10 |