@jaggerxtrm/specialists 3.14.0 → 3.15.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 (84) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +24 -3
  3. package/config/catalog/gitnexus.json +12 -0
  4. package/config/catalog/index.json +59 -0
  5. package/config/catalog/native.json +12 -0
  6. package/config/catalog/serena.json +12 -0
  7. package/config/mandatory-rules/README.md +7 -6
  8. package/config/mandatory-rules/changelog-keeper-scope.md +18 -30
  9. package/config/mandatory-rules/code-quality-defaults.md +5 -0
  10. package/config/mandatory-rules/diagnose-loop.md +13 -0
  11. package/config/mandatory-rules/gitnexus-required.md +1 -0
  12. package/config/mandatory-rules/research-tool-routing.md +12 -0
  13. package/config/mandatory-rules/security-review-defaults.md +9 -0
  14. package/config/mandatory-rules/serena-cheatsheet.md +16 -4
  15. package/config/presets.json +1 -1
  16. package/config/skills/memory-audit-transaction/SKILL.md +196 -0
  17. package/config/skills/memory-audit-transaction/scripts/pre-bulk-export.sh +58 -0
  18. package/config/skills/using-specialists/SKILL.md +13 -12
  19. package/config/skills/using-specialists-auto/SKILL.md +137 -0
  20. package/config/skills/using-specialists-v2/SKILL.md +14 -21
  21. package/config/skills/using-specialists-v3/SKILL.md +399 -27
  22. package/config/specialists/changelog-drafter.specialist.json +3 -2
  23. package/config/specialists/changelog-keeper.specialist.json +8 -13
  24. package/config/specialists/code-sanity.specialist.json +3 -5
  25. package/config/specialists/debugger.specialist.json +4 -8
  26. package/config/specialists/executor.specialist.json +6 -8
  27. package/config/specialists/explorer.specialist.json +7 -8
  28. package/config/specialists/memory-processor.specialist.json +14 -7
  29. package/config/specialists/node-coordinator.specialist.json +2 -2
  30. package/config/specialists/overthinker.specialist.json +7 -10
  31. package/config/specialists/planner.specialist.json +3 -4
  32. package/config/specialists/researcher.specialist.json +15 -19
  33. package/config/specialists/reviewer.specialist.json +4 -8
  34. package/config/specialists/security-auditor.specialist.json +3 -8
  35. package/config/specialists/specialists-creator.specialist.json +4 -2
  36. package/config/specialists/test-runner.specialist.json +10 -10
  37. package/config/specialists/xt-merge.specialist.json +10 -4
  38. package/dist/asset-contract.json +205 -0
  39. package/dist/index.js +1990 -704
  40. package/dist/lib.js +99 -17
  41. package/dist/types/cli/clean.d.ts.map +1 -1
  42. package/dist/types/cli/doctor.d.ts +1 -0
  43. package/dist/types/cli/doctor.d.ts.map +1 -1
  44. package/dist/types/cli/edit.d.ts.map +1 -1
  45. package/dist/types/cli/epic.d.ts +0 -1
  46. package/dist/types/cli/epic.d.ts.map +1 -1
  47. package/dist/types/cli/feed.d.ts.map +1 -1
  48. package/dist/types/cli/finalize.d.ts +2 -0
  49. package/dist/types/cli/finalize.d.ts.map +1 -0
  50. package/dist/types/cli/format-helpers.d.ts.map +1 -1
  51. package/dist/types/cli/init.d.ts.map +1 -1
  52. package/dist/types/cli/list-rules.d.ts.map +1 -1
  53. package/dist/types/cli/merge.d.ts +4 -3
  54. package/dist/types/cli/merge.d.ts.map +1 -1
  55. package/dist/types/cli/ps.d.ts.map +1 -1
  56. package/dist/types/cli/quickstart.d.ts.map +1 -1
  57. package/dist/types/cli/run.d.ts +1 -0
  58. package/dist/types/cli/run.d.ts.map +1 -1
  59. package/dist/types/pi/session.d.ts.map +1 -1
  60. package/dist/types/specialist/epic-lifecycle.d.ts +5 -5
  61. package/dist/types/specialist/epic-lifecycle.d.ts.map +1 -1
  62. package/dist/types/specialist/epic-readiness.d.ts +1 -1
  63. package/dist/types/specialist/epic-readiness.d.ts.map +1 -1
  64. package/dist/types/specialist/jobRegistry.d.ts +5 -0
  65. package/dist/types/specialist/jobRegistry.d.ts.map +1 -1
  66. package/dist/types/specialist/observability-sqlite.d.ts +8 -0
  67. package/dist/types/specialist/observability-sqlite.d.ts.map +1 -1
  68. package/dist/types/specialist/process-health.d.ts +77 -0
  69. package/dist/types/specialist/process-health.d.ts.map +1 -0
  70. package/dist/types/specialist/runner.d.ts.map +1 -1
  71. package/dist/types/specialist/schema.d.ts +162 -0
  72. package/dist/types/specialist/schema.d.ts.map +1 -1
  73. package/dist/types/specialist/script-runner.d.ts +31 -1
  74. package/dist/types/specialist/script-runner.d.ts.map +1 -1
  75. package/dist/types/specialist/supervisor.d.ts +8 -0
  76. package/dist/types/specialist/supervisor.d.ts.map +1 -1
  77. package/dist/types/specialist/timeline-query.d.ts +1 -1
  78. package/dist/types/specialist/timeline-query.d.ts.map +1 -1
  79. package/dist/types/specialist/worktree.d.ts.map +1 -1
  80. package/package.json +32 -7
  81. package/config/benchmarks/executor-benchmark-matrix.json +0 -25
  82. package/config/mandatory-rules/debugger-trace-first.md +0 -5
  83. package/config/skills/using-specialists/evals/evals.json +0 -68
  84. package/config/skills/using-specialists-v3/evals/evals.json +0 -89
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dawid (Jaggerxtrm)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -16,12 +16,33 @@ A specialist is a reusable execution spec: model, allowed tools, skills, system
16
16
 
17
17
  ---
18
18
 
19
+ ## Vision
20
+
21
+ Specialists turns one overloaded agent chat into a coordinated agent mind: a central orchestrator keeps task identity and evidence, while fresh specialist sessions act as scoped capabilities with their own prompts, rules, memory, and contracts. See [specialists.scheme.md](specialists.scheme.md) for diagrams comparing the single-chat model with specialist pipelines, herd memory, adaptive chains, and service specialists.
22
+
19
23
  ## Quick start
20
24
 
25
+ 1. Install Bun.
26
+
27
+ ```bash
28
+ bun --version
29
+ curl -fsSL https://bun.sh/install | bash
30
+ ```
31
+
32
+ 2. Install xtrm-tools.
33
+
34
+ ```bash
35
+ npm install -g xtrm-tools
36
+ xt install
37
+ xt init
38
+ ```
39
+
40
+ 3. Install Specialists.
41
+
21
42
  ```bash
22
43
  npm install -g @jaggerxtrm/specialists
23
- specialists init
24
- specialists list
44
+ sp init
45
+ sp list
25
46
  ```
26
47
 
27
48
  `sp` is a shorter alias for `specialists` — both commands are identical:
@@ -62,7 +83,7 @@ specialists run codebase-explorer --prompt "Map the CLI architecture"
62
83
  - creates `specialists/`
63
84
  - creates `.specialists/` runtime dirs (`jobs/`, `ready/`)
64
85
  - adds `.specialists/` to `.gitignore`
65
- - injects the canonical Specialists Workflow block into `AGENTS.md` and `CLAUDE.md`
86
+ - injects the canonical Specialists Workflow block into `AGENTS.md`
66
87
  - registers the Specialists MCP server at project scope
67
88
 
68
89
  Verify bootstrap state:
@@ -0,0 +1,12 @@
1
+ {
2
+ "catalog": "gitnexus",
3
+ "package": "pi-gitnexus",
4
+ "version": "0.6.1",
5
+ "precedence": 1,
6
+ "source_tiers": {
7
+ "READ_ONLY": ["gitnexus_list_repos", "gitnexus_query", "gitnexus_context", "gitnexus_impact", "gitnexus_detect_changes"],
8
+ "LOW": ["gitnexus_list_repos", "gitnexus_query", "gitnexus_context", "gitnexus_impact", "gitnexus_detect_changes"],
9
+ "MEDIUM": ["gitnexus_list_repos", "gitnexus_query", "gitnexus_context", "gitnexus_impact", "gitnexus_detect_changes", "gitnexus_rename", "gitnexus_cypher"],
10
+ "HIGH": ["gitnexus_list_repos", "gitnexus_query", "gitnexus_context", "gitnexus_impact", "gitnexus_detect_changes", "gitnexus_rename", "gitnexus_cypher"]
11
+ }
12
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "precedence_order": ["native", "gitnexus", "serena"],
3
+ "default_overrides": {
4
+ "READ_ONLY": {
5
+ "denied_natives_when_extension": ["read", "grep", "find", "ls"],
6
+ "denied_natives_mode": "hard"
7
+ },
8
+ "LOW": {
9
+ "denied_natives_when_extension": ["read", "grep", "find", "ls"],
10
+ "denied_natives_mode": "hard"
11
+ },
12
+ "MEDIUM": {
13
+ "denied_natives_when_extension": ["read", "grep", "find", "ls"],
14
+ "denied_natives_mode": "hard"
15
+ },
16
+ "HIGH": {
17
+ "denied_natives_when_extension": ["read", "grep", "find", "ls"],
18
+ "denied_natives_mode": "hard"
19
+ }
20
+ },
21
+ "catalogs": [
22
+ {
23
+ "catalog": "native",
24
+ "package": "specialists",
25
+ "version": "3.11.0",
26
+ "precedence": 0,
27
+ "source_tiers": {
28
+ "READ_ONLY": ["read", "grep", "find", "ls"],
29
+ "LOW": ["read", "grep", "find", "ls", "bash"],
30
+ "MEDIUM": ["read", "grep", "find", "ls", "bash", "edit"],
31
+ "HIGH": ["read", "grep", "find", "ls", "bash", "edit", "write"]
32
+ }
33
+ },
34
+ {
35
+ "catalog": "gitnexus",
36
+ "package": "pi-gitnexus",
37
+ "version": "0.6.1",
38
+ "precedence": 1,
39
+ "source_tiers": {
40
+ "READ_ONLY": ["gitnexus_list_repos", "gitnexus_query", "gitnexus_context", "gitnexus_impact", "gitnexus_detect_changes"],
41
+ "LOW": ["gitnexus_list_repos", "gitnexus_query", "gitnexus_context", "gitnexus_impact", "gitnexus_detect_changes"],
42
+ "MEDIUM": ["gitnexus_list_repos", "gitnexus_query", "gitnexus_context", "gitnexus_impact", "gitnexus_detect_changes", "gitnexus_rename", "gitnexus_cypher"],
43
+ "HIGH": ["gitnexus_list_repos", "gitnexus_query", "gitnexus_context", "gitnexus_impact", "gitnexus_detect_changes", "gitnexus_rename", "gitnexus_cypher"]
44
+ }
45
+ },
46
+ {
47
+ "catalog": "serena",
48
+ "package": "pi-serena-tools",
49
+ "version": "0.1.0",
50
+ "precedence": 2,
51
+ "source_tiers": {
52
+ "READ_ONLY": ["serena_list_tools", "find_symbol", "find_referencing_symbols", "read_file", "get_symbols_overview", "jet_brains_get_symbols_overview", "jet_brains_find_symbol", "jet_brains_find_referencing_symbols", "jet_brains_type_hierarchy", "search_for_pattern", "list_dir", "find_file", "get_current_config", "activate_project", "check_onboarding_performed", "initial_instructions", "think_about_collected_information", "think_about_task_adherence", "think_about_whether_you_are_done", "list_memories", "read_memory"],
53
+ "LOW": ["serena_list_tools", "find_symbol", "find_referencing_symbols", "read_file", "get_symbols_overview", "jet_brains_get_symbols_overview", "jet_brains_find_symbol", "jet_brains_find_referencing_symbols", "jet_brains_type_hierarchy", "search_for_pattern", "list_dir", "find_file", "get_current_config", "activate_project", "check_onboarding_performed", "initial_instructions", "think_about_collected_information", "think_about_task_adherence", "think_about_whether_you_are_done", "list_memories", "read_memory", "execute_shell_command"],
54
+ "MEDIUM": ["serena_list_tools", "find_symbol", "find_referencing_symbols", "read_file", "get_symbols_overview", "jet_brains_get_symbols_overview", "jet_brains_find_symbol", "jet_brains_find_referencing_symbols", "jet_brains_type_hierarchy", "search_for_pattern", "list_dir", "find_file", "get_current_config", "activate_project", "check_onboarding_performed", "initial_instructions", "think_about_collected_information", "think_about_task_adherence", "think_about_whether_you_are_done", "list_memories", "read_memory", "execute_shell_command", "insert_after_symbol", "replace_symbol_body", "insert_before_symbol", "rename_symbol", "restart_language_server", "create_text_file", "replace_content", "delete_lines", "replace_lines", "insert_at_line", "remove_project", "switch_modes", "open_dashboard", "onboarding", "prepare_for_new_conversation", "summarize_changes", "write_memory", "delete_memory", "rename_memory", "edit_memory", "serena_mcp_reset"],
55
+ "HIGH": ["serena_list_tools", "find_symbol", "find_referencing_symbols", "read_file", "get_symbols_overview", "jet_brains_get_symbols_overview", "jet_brains_find_symbol", "jet_brains_find_referencing_symbols", "jet_brains_type_hierarchy", "search_for_pattern", "list_dir", "find_file", "get_current_config", "activate_project", "check_onboarding_performed", "initial_instructions", "think_about_collected_information", "think_about_task_adherence", "think_about_whether_you_are_done", "list_memories", "read_memory", "execute_shell_command", "insert_after_symbol", "replace_symbol_body", "insert_before_symbol", "rename_symbol", "restart_language_server", "create_text_file", "replace_content", "delete_lines", "replace_lines", "insert_at_line", "remove_project", "switch_modes", "open_dashboard", "onboarding", "prepare_for_new_conversation", "summarize_changes", "write_memory", "delete_memory", "rename_memory", "edit_memory", "serena_mcp_reset"]
56
+ }
57
+ }
58
+ ]
59
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "catalog": "native",
3
+ "package": "specialists",
4
+ "version": "3.11.0",
5
+ "precedence": 0,
6
+ "source_tiers": {
7
+ "READ_ONLY": ["read", "grep", "find", "ls"],
8
+ "LOW": ["read", "grep", "find", "ls", "bash"],
9
+ "MEDIUM": ["read", "grep", "find", "ls", "bash", "edit"],
10
+ "HIGH": ["read", "grep", "find", "ls", "bash", "edit", "write"]
11
+ }
12
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "catalog": "serena",
3
+ "package": "pi-serena-tools",
4
+ "version": "0.1.0",
5
+ "precedence": 2,
6
+ "source_tiers": {
7
+ "READ_ONLY": ["serena_list_tools", "find_symbol", "find_referencing_symbols", "read_file", "get_symbols_overview", "jet_brains_get_symbols_overview", "jet_brains_find_symbol", "jet_brains_find_referencing_symbols", "jet_brains_type_hierarchy", "search_for_pattern", "list_dir", "find_file", "get_current_config", "activate_project", "check_onboarding_performed", "initial_instructions", "think_about_collected_information", "think_about_task_adherence", "think_about_whether_you_are_done", "list_memories", "read_memory"],
8
+ "LOW": ["serena_list_tools", "find_symbol", "find_referencing_symbols", "read_file", "get_symbols_overview", "jet_brains_get_symbols_overview", "jet_brains_find_symbol", "jet_brains_find_referencing_symbols", "jet_brains_type_hierarchy", "search_for_pattern", "list_dir", "find_file", "get_current_config", "activate_project", "check_onboarding_performed", "initial_instructions", "think_about_collected_information", "think_about_task_adherence", "think_about_whether_you_are_done", "list_memories", "read_memory", "execute_shell_command"],
9
+ "MEDIUM": ["serena_list_tools", "find_symbol", "find_referencing_symbols", "read_file", "get_symbols_overview", "jet_brains_get_symbols_overview", "jet_brains_find_symbol", "jet_brains_find_referencing_symbols", "jet_brains_type_hierarchy", "search_for_pattern", "list_dir", "find_file", "get_current_config", "activate_project", "check_onboarding_performed", "initial_instructions", "think_about_collected_information", "think_about_task_adherence", "think_about_whether_you_are_done", "list_memories", "read_memory", "execute_shell_command", "insert_after_symbol", "replace_symbol_body", "insert_before_symbol", "rename_symbol", "restart_language_server", "create_text_file", "replace_content", "delete_lines", "replace_lines", "insert_at_line", "remove_project", "switch_modes", "open_dashboard", "onboarding", "prepare_for_new_conversation", "summarize_changes", "write_memory", "delete_memory", "rename_memory", "edit_memory", "serena_mcp_reset"],
10
+ "HIGH": ["serena_list_tools", "find_symbol", "find_referencing_symbols", "read_file", "get_symbols_overview", "jet_brains_get_symbols_overview", "jet_brains_find_symbol", "jet_brains_find_referencing_symbols", "jet_brains_type_hierarchy", "search_for_pattern", "list_dir", "find_file", "get_current_config", "activate_project", "check_onboarding_performed", "initial_instructions", "think_about_collected_information", "think_about_task_adherence", "think_about_whether_you_are_done", "list_memories", "read_memory", "execute_shell_command", "insert_after_symbol", "replace_symbol_body", "insert_before_symbol", "rename_symbol", "restart_language_server", "create_text_file", "replace_content", "delete_lines", "replace_lines", "insert_at_line", "remove_project", "switch_modes", "open_dashboard", "onboarding", "prepare_for_new_conversation", "summarize_changes", "write_memory", "delete_memory", "rename_memory", "edit_memory", "serena_mcp_reset"]
11
+ }
12
+ }
@@ -7,17 +7,18 @@ behaviors the model must follow regardless of the specific task.
7
7
  > Filter with `sp list-rules --rule <id>` or `sp list-rules --specialist <name>`,
8
8
  > machine output via `--json`.
9
9
 
10
- ## Layout (three tiers)
10
+ ## Layout (four tiers)
11
11
 
12
- The loader reads and unions indexes from three paths, in this precedence:
12
+ The loader reads and unions indexes from four paths, in this precedence:
13
13
 
14
14
  | Tier | Path | Writer | Role |
15
15
  |------|------|--------|------|
16
- | 1. Source | `config/mandatory-rules/` | specialists repo commits | Canonical source of truth. Ships with the tool. |
17
- | 2. Canonical copy | `.specialists/default/mandatory-rules/` | `sp init --sync-defaults` | Mirror of canonical, placed in every downstream project. |
18
- | 3. Overlay | `.specialists/mandatory-rules/` | you (per-repo) | Repo-specific additions and overrides. Wins on set-id conflict. |
16
+ | 1. User overlay | `.specialists/user/mandatory-rules/` | you (per-repo) | Highest-priority repo-specific additions and overrides. Wins on set-id conflict. |
17
+ | 2. Source | `config/mandatory-rules/` | specialists repo commits | Canonical source of truth. Ships with the tool. |
18
+ | 3. Canonical copy | `.specialists/default/mandatory-rules/` | `sp init --sync-defaults` | Mirror of canonical, placed in every downstream project. |
19
+ | 4. Overlay | `.specialists/mandatory-rules/` | you (per-repo) | Repo-specific additions and overrides. Wins on set-id conflict. |
19
20
 
20
- A rule set defined in tier 3 overrides a same-id rule set from tier 2 or 1,
21
+ A rule set defined in tier 4 overrides a same-id rule set from tier 3, 2, or 1,
21
22
  letting a repo tailor or replace canonical rules without editing the source.
22
23
 
23
24
  ## What gets injected
@@ -2,49 +2,37 @@
2
2
  name: changelog-keeper-scope
3
3
  kind: mandatory-rule
4
4
  ---
5
- SINGLE PURPOSE. You exist to produce one release: draft the next CHANGELOG.md section, bump package.json, rebuild dist, commit, tag, and push. Nothing else.
5
+ SINGLE PURPOSE. You exist to fill or top-up the `[Unreleased]` block of `CHANGELOG.md` from xt session reports + commit subjects. Nothing else. The `/releasing` skill (not you) bumps the version, runs the build, commits, tags, pushes, and publishes.
6
6
 
7
- EDIT WHITELIST. You may write to ONLY these paths:
8
- - `CHANGELOG.md` (insert the new release section above the previous one)
9
- - `package.json` (version field only — no other field)
10
- - `dist/index.js`, `dist/lib.js`, `dist/types/**` (regenerated by `npm run build` — never hand-edit)
7
+ EDIT WHITELIST. You may write to ONLY:
8
+ - `CHANGELOG.md`
11
9
 
12
10
  EDIT BLACKLIST. NEVER write to ANY of:
13
- - `src/**` (source code — out of scope, ever)
14
- - `tests/**` (test code — out of scope)
15
- - `docs/**` (any markdown except CHANGELOG.md is out of scope)
16
- - `config/**` (specialist configs, mandatory rules, skills — out of scope)
17
- - `.specialists/**` (runtime state — out of scope)
18
- - `.xtrm/**`, `.wolf/**`, `.beads/**` (session bookkeeping — out of scope)
19
- - `README.md`, `CLAUDE.md`, `AGENTS.md`, `XTRM-GUIDE.md` (top-level docs — out of scope)
11
+ - `package.json`, `package-lock.json`, `bun.lock`, `pnpm-lock.yaml`
12
+ - `dist/**` (regenerated by `npm run build` — out of your scope)
13
+ - `src/**`, `tests/**`, `docs/**`, `config/**`
14
+ - `.specialists/**`, `.xtrm/**`, `.wolf/**`, `.beads/**`
15
+ - `README.md`, `CLAUDE.md`, `AGENTS.md`, `XTRM-GUIDE.md`
20
16
  - Any other file not in the EDIT WHITELIST above.
21
17
 
22
- If you believe a file outside the whitelist must be edited, STOP and emit `BLOCKED: scope-violation` naming the file and the reason. Do not attempt the edit.
18
+ If a file outside the whitelist seems necessary, STOP and emit `BLOCKED: scope-violation` naming the file and the reason. Do not attempt the edit.
23
19
 
24
- INPUT DISCIPLINE. Your synthesis input is xtrm session reports under `.xtrm/reports/`. The bead's SCOPE field names the relevant tag range. Read reports with `Read` and decide which apply. Supplement with `git log --oneline <prev-tag>..HEAD` for tag verification. Do not crawl `src/`, `docs/`, or other source. The reports are pre-filtered, curated synthesis input — that is why they exist.
20
+ INPUT DISCIPLINE. Your synthesis input is xtrm session reports under `.xtrm/reports/`. The bead's SCOPE/RANGE names the relevant tag range. Read reports with `Read` and decide which apply. Supplement with `git log --oneline <prev-tag>..HEAD` for commit verification. Do not crawl `src/`, `docs/`, or other source. Reports are pre-filtered, curated input — that is why they exist.
25
21
 
26
- SECTION FORMAT. Apply changelog-conventions (Keep-a-Changelog v1.0.0, one-line bullets, bead-id refs in parens, sections in order Added/Changed/Fixed/Removed/Deprecated/Security, omit empty). Default bucket is Changed. Deprecated is ONLY for explicit sunset/removal notices. No meta-commentary in bullets ("Conventional commit mapping applied", "Bead IDs included parenthetically", etc. — banned).
22
+ SECTION FORMAT. Apply changelog-conventions (Keep-a-Changelog v1.0.0, one-line bullets, bead-id refs in parens, sections in order Added / Changed / Fixed / Removed / Deprecated / Security, omit empty). Default bucket is Changed. Deprecated is ONLY for explicit sunset/removal notices. No meta-commentary in bullets ("Conventional commit mapping applied", "Bead IDs included parenthetically", etc. — banned).
27
23
 
28
- VERSION POLICY. Default is patch bump (`v3.10.0` `v3.10.1`). Use minor for new features (`v3.11.0`), major only on explicit operator instruction. The bead names the target version explicitly OR specifies the bump type; if neither is present, STOP and emit `BLOCKED: version-not-specified`.
24
+ EDIT TARGET. The `[Unreleased]` block at the top of `CHANGELOG.md`. Preserve its heading shape and any existing bullets. Merge missing entries into the correct subsections. Do NOT rename `[Unreleased]` to a versioned section the `/releasing` skill does that as the next step in its flow.
29
25
 
30
- INSERT POSITION. The new section goes immediately above the most recent existing release section, below the `[Unreleased]` placeholder. Re-emit an empty `[Unreleased]` placeholder above the new section.
26
+ NO INVENTION. Every bullet you add must trace to either a session report under `.xtrm/reports/` or a commit subject in the named range. If a commit lacks a covering report and is plausibly user-facing, add a one-line bullet referenced to the commit; flag the synthesis in your output.
31
27
 
32
- GIT DISCIPLINE. After file edits + rebuild succeed:
33
- - `git add CHANGELOG.md package.json dist/` (no other paths)
34
- - `git diff --cached --stat` and confirm only whitelisted paths are staged. If anything else is staged, STOP and report.
35
- - `git commit -m "release: vX.Y.Z"` (exactly this format, no other prefix or suffix)
36
- - `git tag -a vX.Y.Z -m "<one-line summary derived from changelog section>"`
37
- - `git push --follow-tags origin <branch>`
38
- - Optional: `gh release create vX.Y.Z --notes "<the changelog section body>"` (only if `gh` is available and the bead requests it)
28
+ NO RELEASE OPS. NEVER run any of: `npm run build`, `npm publish`, `git add` (other than `CHANGELOG.md`), `git commit`, `git tag`, `git push`, `gh release`. NEVER edit `package.json` or `package-lock.json`. NEVER `git reset --hard`, `git push --force`, delete tags, or rewrite history. The `/releasing` skill performs all of these after you return.
39
29
 
40
- NO DESTRUCTIVE OPS. Never `git reset --hard`, never `git push --force`, never delete tags, never rewrite history. If a prior release commit/tag is wrong, STOP and report operator handles repair.
30
+ NO DESTRUCTIVE OPS. If a prior `[Unreleased]` block contains entries that look wrong, do NOT delete them. Add what is missing and report the suspected drift in your output. The operator decides whether to prune.
41
31
 
42
- SELF-VERIFY. Before finishing, run `git diff --stat HEAD~1 HEAD` and confirm the result matches:
32
+ SELF-VERIFY. Before finishing, run `git status --short` and confirm the result matches:
43
33
  - `CHANGELOG.md` modified
44
- - `package.json` modified
45
- - `dist/**` modified
46
34
  - nothing else
47
35
 
48
- If anything else appears, the operator's manual edits leaked in. STOP and emit `BLOCKED: scope-leak` naming the offending paths.
36
+ If anything else appears, STOP and emit `BLOCKED: scope-leak` naming the offending paths.
49
37
 
50
- OUTPUT SHAPE. Final report must include: `VERSION: vX.Y.Z`, `VERDICT: <RELEASED|BLOCKED>`, `SECTION_DRAFTED: <one-line summary>`, `FILES_CHANGED: <list>`, `COMMIT: <sha>`, `TAG: <vX.Y.Z>`, `PUSHED: <true|false>`, `GH_RELEASE: <url|none>`. On BLOCKED, name the precondition violated.
38
+ OUTPUT SHAPE. Final report must include: `VERDICT: <FILLED|NO_GAPS|BLOCKED>`, `RANGE: <prev-tag>..<ref>`, `ADDED_BULLETS: <count>`, `SYNTHESIZED_FROM_COMMITS: <count or 0>`, `FILES_CHANGED: CHANGELOG.md`, `NOTES: <one line about anything notable, e.g. dropped older reports, commits without reports>`. On BLOCKED, name the precondition violated.
@@ -0,0 +1,5 @@
1
+ ---
2
+ name: code-quality-defaults
3
+ kind: mandatory-rule
4
+ ---
5
+ SRP, DRY, KISS, YAGNI. No premature abstraction. No speculative features. Don't add comments to explain what well-named code already says. Match existing project conventions; never invent a new style mid-file.
@@ -0,0 +1,13 @@
1
+ ---
2
+ name: diagnose-loop
3
+ kind: mandatory-rule
4
+ ---
5
+ Trace symptom to root cause before editing. Pinpoint suspects via stack trace and call graph, apply the minimal fix on the fault line, then verify. Do not refactor surrounding code, change style, or expand scope. Cite evidence as `file:line` for every claim.
6
+
7
+ Discipline:
8
+
9
+ - Build a fast deterministic feedback loop before any code change. If you cannot reproduce the symptom, report it as a blocker — do not patch in the dark.
10
+ - After reproducing, write 3–5 falsifiable hypotheses before touching code. Test one variable at a time.
11
+ - Tag any temporary instrumentation with `[DEBUG-<short-id>]` so it is greppable. Remove every tagged line before completing the fix.
12
+ - When a correct test seam exists, convert the minimized repro into a regression test. When it does not, name the missing seam as an architecture/testability finding and route it to overthinker or planner instead of forcing a brittle test.
13
+ - Verify with targeted lint/typecheck and the focused repro. Full suites belong to test-runner — do not run them yourself.
@@ -8,6 +8,7 @@ Tools (prefer MCP; fall back to CLI if MCP unavailable):
8
8
  - Blast radius before edit: `gitnexus_impact({target, direction:"upstream"})` or `npx gitnexus impact <target>`. STOP and warn if HIGH/CRITICAL.
9
9
  - Symbol callers/callees: `gitnexus_context({name})` or `npx gitnexus context <name>`.
10
10
  - Concept search: `gitnexus_query({query})` or `npx gitnexus query "<text>"`.
11
+ - Execution flow trace: `gitnexus_query({query: "<flow-keyword>"})` (process-grouped results) or read the MCP resource `gitnexus://repo/<name>/process/<flow-name>` for the step-by-step trace.
11
12
  - Pre-commit scope check: `gitnexus_detect_changes()` (MCP only — fallback: `git diff --stat`).
12
13
 
13
14
  Rules:
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: research-tool-routing
3
+ kind: mandatory-rule
4
+ ---
5
+ Pick the right source before invoking research. Default to the project knowledge graph and repo evidence first; reach for external tools only when the answer cannot come from local sources.
6
+
7
+ - `find-docs` / context7 — library, framework, SDK, CLI, or cloud-service docs (API syntax, config, migration).
8
+ - `deepwiki` — public GitHub repo internals (architecture, conventions, code paths).
9
+ - `github-search` (ghgrep) — real-world code patterns and API usage examples.
10
+ - `last30days` — recent web/social signals (Reddit, X, HN, YouTube). Early-warning only, never authoritative.
11
+
12
+ Invoke skills on demand, not by default. Cite the source for every external claim.
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: security-review-defaults
3
+ kind: mandatory-rule
4
+ ---
5
+ Scan-only stance. Do not edit files, modify dependencies, run destructive tools, exfiltrate secrets, or run exploits against live targets. Recommend fixes; let executor apply them in a separate bead.
6
+
7
+ Threat-model surfaces: auth, session, input validation, injection sinks, file upload, SSRF, deserialization, secrets and crypto, dependency CVEs, agent/MCP/hook config, prompt-injection vectors.
8
+
9
+ Evidence required for any finding: a local path with line/symbol, an audit-tool output line, or an authoritative advisory (OSV, GHSA, NVD/CVE, vendor). Community chatter cannot be the sole proof. Keep findings to plausible user-controlled paths to a meaningful sink; drop low-signal noise.
@@ -5,6 +5,9 @@ rules:
5
5
  - id: prefer-serena
6
6
  level: required
7
7
  text: "Prefer Serena tools over read/grep/find/ls for source code (.ts .py .go .rs .js etc.). Native tools fine for .md .json .yaml configs."
8
+
9
+ # --- Read tier (always applicable) ---
10
+
8
11
  - id: get_symbols_overview
9
12
  level: required
10
13
  text: "get_symbols_overview <path> — symbol skeleton of a file or dir (~300 tokens vs reading the whole file). Use first to pick what you actually need."
@@ -23,18 +26,27 @@ rules:
23
26
  - id: read_file
24
27
  level: required
25
28
  text: "read_file <path> — full or sliced read. Use only when navigation tools are not enough; check get_symbols_overview first."
29
+
30
+ # --- Edit tier (apply only if your specialist permission_required is MEDIUM or HIGH; READ_ONLY skip) ---
31
+
32
+ - id: edit-tier-applicability
33
+ level: info
34
+ text: "The rules below are edit-only. If your specialist's permission_required is READ_ONLY, ignore them — you cannot call these tools and they do not apply to your work."
26
35
  - id: replace_symbol_body
27
36
  level: required
28
- text: "replace_symbol_body <name_path> — swap a function or class body in place. Use instead of Edit string-match for symbol-scoped changes (MEDIUM+ permission)."
37
+ text: "replace_symbol_body <name_path> — swap a function or class body in place. Use instead of Edit string-match for symbol-scoped changes. (MEDIUM+ permission)"
29
38
  - id: insert_around_symbol
30
39
  level: required
31
- text: "insert_before_symbol / insert_after_symbol <name_path> — add adjacent code such as imports or helpers (MEDIUM+ permission)."
40
+ text: "insert_before_symbol / insert_after_symbol <name_path> — add adjacent code such as imports or helpers. (MEDIUM+ permission)"
32
41
  - id: rename_symbol
33
42
  level: required
34
- text: "rename_symbol <name_path> <new_name> — refactor-safe across all references. Use instead of find-and-replace (MEDIUM+ permission)."
43
+ text: "rename_symbol <name_path> <new_name> — refactor-safe across all references. Use instead of find-and-replace. (MEDIUM+ permission)"
35
44
  - id: replace_content
36
45
  level: required
37
- text: "replace_content <path> <pattern> <replacement> — line-range or regex edits when no symbol target fits (MEDIUM+ permission)."
46
+ text: "replace_content <path> <pattern> <replacement> — line-range or regex edits when no symbol target fits. (MEDIUM+ permission)"
47
+
48
+ # --- Cost guidance ---
49
+
38
50
  - id: cost-rule
39
51
  level: info
40
52
  text: "Rule of thumb: read of a 500-line source file ~5000 tokens; find_symbol on one function ~200 tokens (~25x cheaper). Use get_symbols_overview before deciding."
@@ -2,7 +2,7 @@
2
2
  "cheap": {
3
3
  "description": "Low-cost, fast responses — best for exploration and simple tasks",
4
4
  "fields": {
5
- "specialist.execution.model": "dashscope/qwen3.5-plus",
5
+ "specialist.execution.model": "nano-gpt/moonshotai/kimi-k2.5",
6
6
  "specialist.execution.thinking_level": "off",
7
7
  "specialist.execution.stall_timeout_ms": 60000
8
8
  }
@@ -0,0 +1,196 @@
1
+ ---
2
+ name: memory-audit-transaction
3
+ kind: skill
4
+ ---
5
+
6
+ # Memory Audit Transaction
7
+
8
+ Pattern for auditing the project's persistent bd memories at any scale (N=500, N=2000+) without exhausting the agent's context window.
9
+
10
+ The naive workflow — `bd memories` → per-key `bd recall` → per-entry classification text in chat → per-key `bd forget` — collapses past ~150-200 memories because every classification row cumulates in conversation history. This skill replaces it with a **transactional file-backed audit ledger**: per-entry decisions persist to a JSONL artifact on disk, chunked work bounds the per-turn token cost, and pruning happens through one hash-guarded batch step rather than N inline `bd forget` calls.
11
+
12
+ ## When This Activates
13
+
14
+ - The memory-processor specialist's input bead targets `.xtrm/memory.md` consolidation
15
+ - Project has more than ~50 bd memories (`bd memories | wc -l`)
16
+ - A previous memory-processor run hit context CRITICAL or produced "all current" without per-entry evidence
17
+
18
+ ## Workflow
19
+
20
+ ### Phase 1 — Read existing synthesized memory
21
+
22
+ Read `.xtrm/memory.md` if present. Single Read call. Tells you what was synthesized last time and prevents regressions.
23
+
24
+ ### Phase 2 — Read last 3 session reports (targeted sections)
25
+
26
+ For each of the latest 3 `.xtrm/reports/*.md`, extract only:
27
+ - `## Summary`
28
+ - `## Problems Encountered`
29
+ - `## Memories Saved`
30
+ - `## Suggested Next Priority`
31
+
32
+ Ignore everything else. These are the highest-signal sections.
33
+
34
+ ### Phase 3 — Bulk-export memories (already done by pre-script)
35
+
36
+ The specialist's pre-script (`config/skills/memory-audit-transaction/scripts/pre-bulk-export.sh`, registered in `skills.scripts` phase=pre) has **already executed before your first turn** and produced three artifacts:
37
+
38
+ - `.tmp/memory-audit/memories.json` — full `{key: content}` JSON object from one `bd memories --json` call (single dolt query, no per-key round-trips)
39
+ - `.tmp/memory-audit/keys.txt` — one key per line, for chunking
40
+ - `.tmp/memory-audit/decisions.jsonl` — initialized empty, you append to it
41
+
42
+ Verify the pre-script summary in `$pre_script_output` (injected at the top of the task). Confirm `keys.txt` count matches expectation. Do NOT re-export — running `bd recall` 500+ times in your bash window WILL time out (~150-300ms per call × 500 = 75-150s vs 120s bash stall window). The pre-script bypasses that entirely.
43
+
44
+ Read a chunk's content by slicing the JSON object:
45
+
46
+ ```bash
47
+ # extract the next 20-30 keys for this chunk
48
+ sed -n '1,30p' .tmp/memory-audit/keys.txt > .tmp/memory-audit/chunk-1-keys.txt
49
+ # fetch their content from the bulk JSON
50
+ jq --slurpfile keys <(jq -R . .tmp/memory-audit/chunk-1-keys.txt | jq -s .) \
51
+ 'with_entries(select(.key as $k | $keys[0] | index($k)))' \
52
+ .tmp/memory-audit/memories.json > .tmp/memory-audit/chunk-1.json
53
+ ```
54
+
55
+ Simpler if jq feels heavy — just read keys.txt for the chunk's slice and look up each key with `jq -r --arg k "<key>" '.[$k]' memories.json` one at a time in a bash heredoc. Either way, the dump is on disk; do NOT echo memories.json into chat.
56
+
57
+ ### Phase 4 — Fill gaps from project state (single pass)
58
+
59
+ One Bash call combining several quick reads:
60
+
61
+ ```bash
62
+ git log --oneline -30
63
+ cat CLAUDE.md 2>/dev/null | head -100
64
+ cat README.md 2>/dev/null | head -50
65
+ ```
66
+
67
+ Use this as the cross-reference baseline for Phase 5 classification.
68
+
69
+ ### Phase 5 — Chunked classification with on-disk ledger
70
+
71
+ Read `.tmp/memory-audit/keys.txt` to know how many memories there are. Process them in **chunks of 20-30 keys**. For each chunk:
72
+
73
+ 1. Read only the slice of `memories.txt` for the chunk's keys (use `awk`/`sed` to extract `=== key ===` … blocks for the N keys in this chunk).
74
+ 2. For each memory in the chunk, decide its classification using the cross-reference baseline from Phase 4 plus targeted file spot-checks where needed.
75
+ 3. **Append decisions to `.tmp/memory-audit/decisions.jsonl`** — one JSON line per memory:
76
+
77
+ ```json
78
+ {"key":"<memory-key>","content_hash":"sha256:<hex>","status":"Current|Stale|Contradicted|Redundant|Skipped","confidence":"high|medium|low","evidence":["file:line or memory-key or report-ref"],"reason":"one sentence","duplicate_of":"optional-key"}
79
+ ```
80
+
81
+ 4. **Do NOT print the decisions to chat**. Use a single Bash heredoc to append the chunk's rows to the JSONL file. The chat-side summary for each chunk is just one line: `chunk N: X classified (Current=a, Stale=b, Contradicted=c, Redundant=d, Skipped=e)`.
82
+
83
+ 5. After each chunk, optionally write a checkpoint marker file `.tmp/memory-audit/chunk-N.done` so a re-dispatch can resume.
84
+
85
+ Compute `content_hash` with `sha256sum` against the exact `bd recall` output captured in Phase 3. The hash will be re-verified at Phase 7 apply time.
86
+
87
+ ### Phase 6 — Ledger completeness validation (HARD GATE)
88
+
89
+ Before writing `.xtrm/memory.md`:
90
+
91
+ ```bash
92
+ KEYS=$(wc -l < .tmp/memory-audit/keys.txt)
93
+ ROWS=$(wc -l < .tmp/memory-audit/decisions.jsonl)
94
+ echo "keys=${KEYS} rows=${ROWS}"
95
+ test "${KEYS}" = "${ROWS}" || { echo "INCOMPLETE — missing $((KEYS - ROWS)) decisions"; exit 1; }
96
+ ```
97
+
98
+ If the count does not match, the audit is incomplete. **Do not proceed to Phase 7 or Phase 8**. Report the gap and stop. Never default missing rows to `Current` to "make it work" — that is the c791ef failure mode (`bead unitAI-aofbp` empirical evidence).
99
+
100
+ ### Phase 7 — Atomic prune with hash guard
101
+
102
+ When bd CLI gains `bd forget --batch --apply --if-hash-matches --transaction --backup` (tracked in Phase B of the parent epic, `unitAI-pwojn.2`), use it directly. Until then, the Phase A fallback is a single bash loop that re-verifies the hash before each delete and writes a backup:
103
+
104
+ ```bash
105
+ mkdir -p .tmp/memory-audit/backup
106
+ PRUNED=0; SKIPPED_HASH=0
107
+ jq -c 'select(.status=="Stale" or .status=="Contradicted" or .status=="Redundant")' \
108
+ .tmp/memory-audit/decisions.jsonl > .tmp/memory-audit/prune-set.jsonl
109
+
110
+ while read -r row; do
111
+ key=$(echo "${row}" | jq -r .key)
112
+ want_hash=$(echo "${row}" | jq -r .content_hash | sed 's/^sha256://')
113
+ have_hash=$(bd recall "${key}" 2>/dev/null | sha256sum | awk '{print $1}')
114
+ if [ "${want_hash}" = "${have_hash}" ]; then
115
+ bd recall "${key}" > ".tmp/memory-audit/backup/${key}.txt"
116
+ bd forget "${key}" && PRUNED=$((PRUNED + 1))
117
+ else
118
+ SKIPPED_HASH=$((SKIPPED_HASH + 1))
119
+ echo "${key}: hash mismatch — skipping" >> .tmp/memory-audit/apply-log.txt
120
+ fi
121
+ done < .tmp/memory-audit/prune-set.jsonl
122
+
123
+ echo "pruned=${PRUNED} skipped_hash=${SKIPPED_HASH}"
124
+ ```
125
+
126
+ The chat output stays the count line only. The list of pruned keys lives in the apply-log file on disk; the report links to it.
127
+
128
+ ### Phase 8 — Write .xtrm/memory.md from Current rows
129
+
130
+ Use `jq` to filter `decisions.jsonl` to only `Current` entries, then synthesize the 3-section `.xtrm/memory.md`:
131
+
132
+ ```markdown
133
+ # Project Memory — <project-name>
134
+ _Updated: <YYYY-MM-DD> | <N-current> memories synthesized, <N-pruned> pruned, <N-skipped> skipped | last session: <YYYY-MM-DD>_
135
+
136
+ ## Do Not Repeat
137
+ - ❌ <wrong action> → ✅ <correct action>
138
+
139
+ ## How This Project Works
140
+ - <directive bullet>
141
+
142
+ ## Active Context
143
+ - <situational brief from last 2-3 session reports>
144
+ ```
145
+
146
+ Target 100-200 lines. Imperative voice. No descriptive prose. Each bullet ends in "do Y" or "never Z".
147
+
148
+ ### Phase 9 — Final report (counts only, NOT per-entry text)
149
+
150
+ ```
151
+ ## Memory Processor Report
152
+
153
+ ### Synthesized → .xtrm/memory.md
154
+ <N> memories synthesized into 3 sections (~<line count> lines)
155
+
156
+ ### Pruned (<N> applied, <M> hash-mismatch-skipped)
157
+ See `.tmp/memory-audit/apply-log.txt` for the full list and `.tmp/memory-audit/backup/` for restore data.
158
+
159
+ ### Kept in bd (<N> entries)
160
+ Raw detail store intact. Use `bd recall <key>` to dig deeper.
161
+
162
+ ### Ledger artifact
163
+ `.tmp/memory-audit/decisions.jsonl` (one row per memory, every status decision evidence-backed).
164
+ ```
165
+
166
+ ## Conservative-Pruning Rule (Inviolable)
167
+
168
+ When in doubt, **status=Skipped** — never default to Current. A false negative (slightly stale memory survives) is less harmful than a false positive (delete still-relevant entry). The completeness validator (Phase 6) ensures missing rows do not slip through as "all current."
169
+
170
+ ## Decision-Row Evidence Requirements
171
+
172
+ Every row in `decisions.jsonl` must have non-empty `evidence`. Acceptable evidence forms:
173
+
174
+ - `"src/foo.ts:42"` — file:line reference verified against current repo
175
+ - `"memory:other-key"` — duplicate-of reference to another existing memory
176
+ - `"reports/2026-05-10:Summary"` — section reference in a recent session report
177
+ - `"commit:abc1234"` — git commit hash that fixed/changed the memorialized behavior
178
+ - `"unverifiable: <reason>"` — explicit acknowledgment when nothing concrete supports the classification → forces `status=Skipped`
179
+
180
+ A row with status not in {Current, Skipped} and evidence `["unverifiable: …"]` is a contract violation and is treated as Skipped during Phase 7.
181
+
182
+ ## Failure-Mode Mapping
183
+
184
+ | Past failure | Symptom | Guarded by |
185
+ |---|---|---|
186
+ | c791ef (deepseek pre-DSML-fix) | 82% context, false "all 507 current" without per-entry evidence | Phase 6 completeness validator + evidence requirement; missing/uncertain → Skipped |
187
+ | fad36f (qwen with bulk-export) | 105% context, STALE for 80s, then flailing into gitnexus_* + destructive git | Phase 5 chunked decisions written to disk not chat; Phase 7 single batch not N inline forget; prompt forbids git sync commands |
188
+
189
+ ## Anti-Patterns (Do Not)
190
+
191
+ - **Do not** echo `bd recall` output into chat. Read from `.tmp/memory-audit/memories.txt` slice instead.
192
+ - **Do not** classify multiple chunks worth of memories in one turn. Cap N at 20-30 per chunk.
193
+ - **Do not** emit per-entry decision text to chat. Append to the JSONL ledger; chat gets the count summary.
194
+ - **Do not** run `bd forget` inline per decision. Always go through Phase 7 batch path.
195
+ - **Do not** run `git pull --rebase`, `git push`, `git reset --hard`, or any destructive git command. The memory audit is a project-local read+forget+single-file-write operation. No remote sync, no history rewrite.
196
+ - **Do not** proceed to Phase 8 if Phase 6 completeness check fails. Stop and report the gap.