@maestria/prime-agent 0.3.12 → 0.3.13
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
CHANGED
|
@@ -19,10 +19,15 @@ For skills-only installs, point Prime at the package's `skills/` directory in se
|
|
|
19
19
|
|
|
20
20
|
## What It Provides
|
|
21
21
|
|
|
22
|
-
- **7
|
|
22
|
+
- **Specialist skills** (7 as of 2026-09-22; see the [package directory](https://github.com/agustinusnathaniel/maestria/blob/main/packages/prime-agent/skills) for the current list) - adventurer, architect, builder, diagnose, planner, reviewer, writer.
|
|
23
23
|
- **Orchestration and rules skills** - `orchestrator`, `global-rules`, `handoff`, `iteration-limits`.
|
|
24
24
|
- **Workflow mode skills** - `fein`, `sonar`, `blitz`, loaded on demand by description matching or invoked explicitly as `/skill:fein` etc.
|
|
25
25
|
- **Executable extension** - `/fein`, `/sonar`, `/blitz`, `/mode-clear`, and `/maestria-status` commands with session-scoped mode state.
|
|
26
|
+
- **Root project customization** - `.maestria/workflow.md` then `.maestria/rules.md` from the session directory, injected every turn as subordinate guidance (never waives safety, authorization, or host permissions).
|
|
27
|
+
|
|
28
|
+
## Root Project Customization
|
|
29
|
+
|
|
30
|
+
Place optional `.maestria/workflow.md` (sequencing) and `.maestria/rules.md` (rules) at the root of the directory you open the session in. Scope is root-only: no ancestor scan, no nested inheritance, and the root is the host-selected session cwd (`ctx.cwd`) read live each turn (never a process-global). Files are re-read in full on every `before_agent_start` turn, so additions, edits, and deletions apply on the next turn with no restart; nothing is persisted to session entries or compaction state, and post-compaction turns pick up the same fresh read. Absent or empty files leave the prompt unchanged. A present-but-unusable file (directory, special file, unreadable, unresolvable, or a symlink escaping the root) surfaces via a UI notification plus a STOP banner in the system prompt telling the model to report the error and wait, instead of running with silently absent config. Diagnostics name only the relative file and the failure kind. Whether subagent turns automatically receive the same injection is unverified, so delegation briefs still carry the active constraints. Limitation [inferred from Pi-lineage behavior, no pinned Prime source verified in this change]: the host is expected to swallow `before_agent_start` handler exceptions, so a broken file cannot cancel the model call itself; the notification plus banner is the loudest supported signal. Project loading is a small Prime-local module with no `shared-pi` runtime import, per the Prime isolation policy.
|
|
26
31
|
|
|
27
32
|
## Support / Platform Notes
|
|
28
33
|
|
package/dist/extension.mjs
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import e from"node:path";import{readFileSync as
|
|
2
|
-
`)
|
|
3
|
-
`)
|
|
1
|
+
import e from"node:path";import{lstatSync as t,readFileSync as n,realpathSync as r}from"node:fs";const i=[`fein`,`sonar`,`blitz`],a={blitz:`[MODE: blitz]`,fein:`[MODE: fein]`,sonar:`[MODE: sonar]`},o=e=>{let t=e.indexOf(`## MODE:`);return t===-1?`${e.replace(/\s+$/u,``)}\n`:`${e.slice(t).replace(/\s+$/u,``)}\n`},s=[`.maestria/workflow.md`,`.maestria/rules.md`],c=e=>typeof e==`string`&&e!==``,l=e=>typeof e==`object`&&!!e&&`code`in e&&e.code===`ENOENT`,u=e=>e instanceof Error&&e.message.startsWith(`[maestria] Project config`),d=(e,t,n)=>u(n)?n:Error(`[maestria] Project config "${e}" ${t}`),f=(e,t)=>{if(t===`directory`)throw Error(`[maestria] Project config "${e}" is a directory, expected a file`);if(t===`other`)throw Error(`[maestria] Project config "${e}" is not a regular file`)},p={kindOf:e=>{try{let n=t(e);return n.isDirectory()?`directory`:n.isFile()||n.isSymbolicLink()?`file`:`other`}catch(e){if(l(e))return`missing`;throw e}},readFile:e=>n(e,`utf-8`),resolveLink:e=>r(e)},m=(t,n)=>{let r=e.relative(t,n);return r===`..`||r.startsWith(`..${e.sep}`)||e.isAbsolute(r)},h=(t,n,r)=>{let i=e.join(t,n),a;try{a=r.kindOf(i)}catch(e){throw d(n,`cannot be accessed`,e)}if(a===`missing`)return;f(n,a);let o;try{o=r.resolveLink(i)}catch(e){throw d(n,`cannot be resolved`,e)}if(m(t,o))throw Error(`[maestria] Project config "${n}" resolves outside the project root`);let s;try{s=r.kindOf(o)}catch(e){throw d(n,`cannot be accessed`,e)}if(s===`missing`)throw Error(`[maestria] Project config "${n}" cannot be accessed`);f(n,s);let c;try{c=r.readFile(i)}catch(e){throw d(n,`exists but cannot be read`,e)}if(c!==``)return{content:c,rel:n}},g=(t,n=p)=>{if(!c(t))return[];let i;try{i=r(t)}catch(n){if(!l(n))throw Error(`[maestria] Project config root cannot be accessed`);i=e.resolve(t)}let a=[];for(let e of s){let t=h(i,e,n);t!==void 0&&a.push(t)}return a},_=e=>[`Project customization from ${e.rel} (subordinate guidance: it may replace configurable workflows but never waives safety, authorization, or host permissions):`,e.content].join(`
|
|
2
|
+
`),v=e=>[`Project customization failed to load. STOP: do not execute the user request on potentially overridden configuration.`,`Report this error to the user and wait for the project files to be fixed.`,e].join(`
|
|
3
|
+
`),y=()=>({mode:null}),b=e=>e.type===`custom`&&`customType`in e&&e.customType===`maestria_mode`,x=e=>{if(typeof e!=`object`||!e||!(`mode`in e))return!1;let{mode:t}=e;return t===null||t===`fein`||t===`sonar`||t===`blitz`},S=e=>{if(!Array.isArray(e))return null;for(let t=e.length-1;t>=0;--t){let n=e[t];if(b(n)&&x(n.data))return n.data}return null},C=(e,t)=>{e.appendEntry(`maestria_mode`,{mode:t.mode})},w=(e,t)=>{e.mode=S(t)?.mode??null},T={blitz:`Set workflow mode to blitz (fast path)`,fein:`Set workflow mode to fein (full pipeline)`,sonar:`Set workflow mode to sonar (research only)`},E={},D=(t,r)=>{let i=E[t];if(i!==void 0)return i;let s=``;try{let i=n(e.join(r,t,`SKILL.md`),`utf-8`);i.includes(`## MODE:`)?s=`${a[t]}\n\n${o(i)}`:console.warn(`[maestria] prime-agent: mode skill "${t}" has no "## MODE:" heading; mode prompt injection disabled for this mode.`)}catch(e){console.warn(`[maestria] prime-agent: failed to load mode skill "${t}" from ${r}; mode prompt injection disabled for this mode.`,e)}return E[t]=s,s},O=(e,t,n)=>(r,i)=>{let a=typeof i?.cwd==`string`&&i.cwd!==``?i.cwd:void 0,o=[];if(a!==void 0)try{o=n===void 0?g(a):g(a,n)}catch(e){let t=e instanceof Error?e.message:String(e);try{i?.ui?.notify?.(t)}catch{}return{systemPrompt:[r.systemPrompt,``,v(t)].join(`
|
|
4
|
+
`)}}if(!e.mode&&o.length===0)return;let s=[r.systemPrompt,``];if(e.mode){let n=D(e.mode,t);if(n)s.push(n,``,`The user has set workflow mode to "${e.mode}". Honor this mode throughout the session until it is changed or cleared.`,``);else if(o.length===0)return}for(let e of o)s.push(_(e),``);return{systemPrompt:s.join(`
|
|
5
|
+
`)}},k=(e,t)=>{for(let n of i)e.registerCommand(n,{description:T[n],handler:async(r,i)=>{t.mode=n,C(e,t),r.trim()?e.sendUserMessage(r.trim(),{deliverAs:`steer`}):i.ui.notify(`Mode set to ${n}. Describe what you'd like to work on.`),await Promise.resolve()}});e.registerCommand(`mode-clear`,{description:`Clear workflow mode and return to neutral routing`,handler:async(n,r)=>{t.mode=null,C(e,t),r.ui.notify(`Workflow mode cleared. Neutral routing is active.`),await Promise.resolve()}}),e.registerCommand(`maestria-status`,{description:`Show the current maestria workflow mode and extension subset`,handler:async(e,n)=>{let r=[`# Maestria status (prime-agent)`,``,`Workflow mode: ${t.mode??`none`}`,``,`Commands: /fein, /sonar, /blitz, /mode-clear`,``,`This extension covers mode selection and mode prompt injection only.`,`Recursive-subagent (rlm) dispatch and JSON/RPC headless mode are NOT provided by this package.`].join(`
|
|
6
|
+
`);n.ui.setEditorText(r),await Promise.resolve()}})},A=()=>{let t=import.meta.dirname;return e.resolve(t,`../skills`)},j=e=>{let t=y(),n=A();k(e,t),e.on(`before_agent_start`,O(t,n)),e.on(`session_start`,(e,n)=>{w(t,n.sessionManager.getBranch())}),e.on(`session_tree`,(e,n)=>{w(t,n.sessionManager.getBranch())})};export{j as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maestria/prime-agent",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Maestria methodology for Prime Agent - specialist roles, orchestrator, global rules, and workflow modes as Agent Skills, plus a small Prime/Pi extension for mode commands and mode prompt injection",
|
|
6
6
|
"keywords": [
|
|
@@ -45,9 +45,8 @@ At acceptance, classify visual evidence as required (changed surfaces, relevant
|
|
|
45
45
|
|
|
46
46
|
### Documentation and changesets
|
|
47
47
|
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
- Keep the assessment proportionate to the change.
|
|
48
|
+
- Required affected docs are part of acceptance; carry them through briefs to final reconciliation.
|
|
49
|
+
- When docs work applies, load the available `docs-update` methodology skill and follow it; a missing skill never blocks ordinary docs work.
|
|
51
50
|
|
|
52
51
|
Keep file, package, and runtime scope explicit. Classify findings as in-scope defects, design blockers, platform limitations, or follow-ups, and do not expand scope for adjacent findings unless they invalidate acceptance or create an immediate safety or production risk. Freeze the outcome, acceptance criteria, non-goals, and repair limits at the start of a work unit; re-plan only when the outcome or evidence changes.
|
|
53
52
|
|
|
@@ -85,26 +84,7 @@ Merge, release, and production operations remain separate authorization boundari
|
|
|
85
84
|
|
|
86
85
|
### PR delivery contract
|
|
87
86
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
1. `## Summary` (what changed and why):
|
|
91
|
-
- Lead with the user-visible outcome, or the maintainer benefit for internal changes, in plain language.
|
|
92
|
-
- Keep it a short paragraph or a few concise bullets; put file-level details in Changes and check results in Verification.
|
|
93
|
-
- Omit internal execution metadata such as session IDs; write for a human reviewer.
|
|
94
|
-
2. `## Changes` (Work Results table with File, What changed, and Why columns):
|
|
95
|
-
- Describe the actual change and its practical purpose, not the editing action.
|
|
96
|
-
- Group related files that share one change and rationale; skip repeating the Summary and list only symbols that help review.
|
|
97
|
-
- Omit internal execution metadata such as session IDs; write for a human reviewer.
|
|
98
|
-
3. `## Verification` (checks run, results, and unresolved acceptance gaps)
|
|
99
|
-
- Note review outcome briefly without pasting identifiers.
|
|
100
|
-
4. `## Visual evidence` when applicable (per the visual-delivery contract)
|
|
101
|
-
5. `## Breaking changes` when applicable (migration guidance)
|
|
102
|
-
|
|
103
|
-
When the project defines an explicit template, follow it while preserving that required information.
|
|
104
|
-
|
|
105
|
-
The reviewer checks rendered coverage against the changed surface; the delivery owner reads back the published body to confirm accessible artifacts, captions, and current coverage.
|
|
106
|
-
|
|
107
|
-
After any push that changes the cumulative diff or verification evidence, update the PR title and body to match, then read back the published body before reporting delivery complete.
|
|
87
|
+
Core owns the outcome, evidence, review, and authorization floors for every reviewable PR. Title, body, and visual-evidence conventions live in the `create-pull-request` methodology skill: for an active PR task, load the available skill before drafting, and follow the project template when one applies while preserving the required information. Stop on explicit project opt-out. A missing skill never blocks delivery and never waives review or authorization; write a sensible body instead. The reviewer checks rendered coverage against the changed surface; after any push that changes diff or verification, refresh the draft and read back the published body before reporting delivery complete.
|
|
108
88
|
|
|
109
89
|
## Canonical Source Invariant
|
|
110
90
|
|
package/skills/handoff/SKILL.md
CHANGED
|
@@ -21,3 +21,5 @@ Use a handoff when another agent or later step needs context. Include only:
|
|
|
21
21
|
|
|
22
22
|
Keep it concise, reference existing artifacts instead of copying history, and
|
|
23
23
|
proceed on ordinary ambiguity after documenting a material assumption.
|
|
24
|
+
|
|
25
|
+
For an optional contract header shape, see the available `spec-contract` skill; still optional and absence is normal.
|
|
@@ -56,7 +56,9 @@ Approve when acceptance evidence is complete and no blocking/material finding re
|
|
|
56
56
|
|
|
57
57
|
## Workflow and Delegation
|
|
58
58
|
|
|
59
|
-
When
|
|
59
|
+
When the host has not already supplied them, load the `global-rules` skill plus project-root `.maestria/workflow.md` then `.maestria/rules.md` using host tools (root only). Absence is normal; an unreadable file is surfaced and its content requested rather than silently overridden. Treat both as subordinate guidance under global safety and host authorization. Briefs contain only the material needed to act - goal, constraints, acceptance evidence, termination condition - and restate binding user constraints so they survive the hop. Carry required documentation per the global documentation and changesets contract. Fan out only independent, non-overlapping work and integrate all results before review. If the user rejects an approach twice, stop and re-evaluate. Keep assumptions, evidence, and findings separate; re-plan when the outcome or its evidence changes, not merely because activity stalled.
|
|
60
|
+
|
|
61
|
+
Load the available `spec-contract` skill only when persistent intent across steps would reduce risk; absence is normal.
|
|
60
62
|
|
|
61
63
|
## Mode Precedence
|
|
62
64
|
|
|
@@ -97,16 +99,7 @@ Report briefly at milestones: outcome, verification limits, delivery state, and
|
|
|
97
99
|
|
|
98
100
|
## Visual Delivery Evidence
|
|
99
101
|
|
|
100
|
-
For changes to rendered UI, including documentation sites and visible CLI output,
|
|
101
|
-
|
|
102
|
-
- Capture the affected screen or interaction, including relevant responsive or state variants, using an available browser or capture tool. A missing desktop display alone does not rule out headless capture. For text-only CLI output, a representative terminal transcript can be sufficient. If vision is available, inspect the capture; otherwise label it visually unverified. Preserve the local artifact at any workable path, including /tmp; do not auto-commit screenshots unless project policy requires it.
|
|
103
|
-
- Hand off implementer evidence as paths plus captions plus coverage gaps: each artifact states what it shows and which variants remain unchecked. The reviewer checks that coverage against the changed surface before delivery.
|
|
104
|
-
- Publish required evidence in the PR body as an attachment or accessible artifact link with a descriptive caption, using supported authorized tooling; check the delivery tool's current help for upload support instead of relying on cached syntax. If upload is unavailable, preserve the local artifact, give its path in the handoff, and state the PR attachment limitation. Capture and upload are separate capabilities.
|
|
105
|
-
- Present evidence concisely by changed screen or behavior: label each artifact with its state and relevant viewport or theme. Use a before/after table when comparison helps and a short captioned list for a single state or when tables would shrink images. Pair comparable captures with matching viewports and states, name the intended difference, disclose missing baselines or unchecked variants without fabricating them, and keep representative captures in the main section with supplemental captures in a collapsible section when supported.
|
|
106
|
-
- Read back the actual PR body as delivery owner before claiming delivery or re-delivery; confirm attachments render or links resolve and evidence matches the current relevant diff. When a later change affects captured appearance or behavior, replace affected captures, update captions and comparisons, and remove obsolete or redundant PR body references; keep intentional clearly labeled before baselines and never present a historical before as current. Refresh only affected evidence, not every commit or unrelated file. Readback is a delivery-owner check, not a second full review.
|
|
107
|
-
- For applicable changes, report evidence captured, unavailable with the checked limitation, or unnecessary with a concrete reason. Source-only documentation edits and mechanical moves preserving rendering can use existing evidence; a refactor label or passing build alone does not establish unchanged visuals. Keep capture effort proportionate to the changed surface.
|
|
108
|
-
|
|
109
|
-
**!!! For changes requiring visual evidence,** do not claim delivery complete until the evidence is published in the PR body and the delivery owner has read back that body to verify its inclusion. Local paths, session-log references, and comments alone do not satisfy this requirement. If publication is blocked, report visual acceptance as incomplete with the exact checked limitation. An explicit user or project requirement for visual evidence remains acceptance work: provide it or report the outcome incomplete with the exact blocker. Optional PR illustration may be omitted with a reason; required evidence cannot silently become a follow-up.
|
|
102
|
+
For changes to rendered UI, including documentation sites and visible CLI output, classify visual evidence as required (changed surfaces, relevant states, expected evidence) or not applicable with a concrete reason, include the evidence requirement in implementation and review briefs, and load the available `create-pull-request` skill for the capture, handoff, publication, and readback procedure before claiming delivery. Follow the project template when one applies; stop on explicit project opt-out. Missing required evidence blocks acceptance: report it incomplete with the checked limitation, and a missing skill never waives it.
|
|
110
103
|
|
|
111
104
|
|
|
112
105
|
## Prime Agent Integration
|
|
@@ -117,7 +110,7 @@ The universal contracts live in the `global-rules` skill; load it once at sessio
|
|
|
117
110
|
|
|
118
111
|
### Executable extension (verified subset)
|
|
119
112
|
|
|
120
|
-
This is a skills-first package: specialist roles are methodology skills, not executable subagents. The package does ship a small compiled Prime/Pi extension (`pi.extensions`) covering the workflow-mode slash commands (`/fein`, `/sonar`, `/blitz`, `/mode-clear`, `/maestria-status`) and mode prompt injection on each agent turn via `before_agent_start`. Mode selection is session-scoped state (custom session entries); it does not spawn or control agents.
|
|
113
|
+
This is a skills-first package: specialist roles are methodology skills, not executable subagents. The package does ship a small compiled Prime/Pi extension (`pi.extensions`) covering the workflow-mode slash commands (`/fein`, `/sonar`, `/blitz`, `/mode-clear`, `/maestria-status`) and mode prompt injection plus project-customization injection on each agent turn via `before_agent_start`. Mode selection is session-scoped state (custom session entries); it does not spawn or control agents.
|
|
121
114
|
|
|
122
115
|
### Deferred: recursive-subagent dispatch
|
|
123
116
|
|
package/skills/planner/SKILL.md
CHANGED
|
@@ -43,4 +43,4 @@ Include planned phases, assumptions, verification and rollback evidence, and the
|
|
|
43
43
|
|
|
44
44
|
## Skills
|
|
45
45
|
|
|
46
|
-
Use available skill descriptions for unresolved requirements, product discovery, issue/PRD creation, or prototyping when that work is part of the assignment. Skip skill loads for one-step plans.
|
|
46
|
+
Use available skill descriptions for unresolved requirements, product discovery, issue/PRD creation, or prototyping when that work is part of the assignment. See the available `spec-contract` skill for an optional contract header shape. Skip skill loads for one-step plans.
|
package/skills/reviewer/SKILL.md
CHANGED
|
@@ -81,6 +81,10 @@ Use these categories to identify relevant risks. Cover the changed contract and
|
|
|
81
81
|
- Does the output read like a professional email to a trusted colleague?
|
|
82
82
|
- Format findings as: `style: [issue] -> [fix/dismiss]`
|
|
83
83
|
|
|
84
|
+
### 10. Spec-contract drift (optional pointer, skip when absent)
|
|
85
|
+
|
|
86
|
+
- When a spec-contract header or owning spec is linked, apply its drift, acceptance-coverage, ambiguity-tagging, delta-stating, and append-only rules; skip when absent.
|
|
87
|
+
|
|
84
88
|
## Questions to Ask Yourself
|
|
85
89
|
|
|
86
90
|
1. Is this specific code change related to the overall intended goal?
|
|
@@ -131,7 +135,7 @@ Then produce:
|
|
|
131
135
|
|
|
132
136
|
## Skills
|
|
133
137
|
|
|
134
|
-
For interface changes, use UI review guidance; for interaction or access risks, accessibility guidance; for page discovery/sharing, metadata guidance; for animation issues, motion guidance. Load `skill-judge` for skill packages. Skip unrelated loads for backend or infrastructure diffs.
|
|
138
|
+
For interface changes, use UI review guidance; for interaction or access risks, accessibility guidance; for page discovery/sharing, metadata guidance; for animation issues, motion guidance. See the available `spec-contract` skill for an optional contract header shape. Load `skill-judge` for skill packages. Skip unrelated loads for backend or infrastructure diffs.
|
|
135
139
|
|
|
136
140
|
## References
|
|
137
141
|
|