agentera 3.0.0-dev.4 → 3.0.0-dev.5

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 (118) hide show
  1. package/bundle/.agentera-npx-bundle.json +1 -1
  2. package/bundle/references/cli/agent-ready-state-contract.yaml +5 -5
  3. package/bundle/references/cli/bundle-skill-vocabulary.yaml +1 -1
  4. package/bundle/references/cli/capability-instruction-contract.yaml +98 -57
  5. package/bundle/references/cli/routing-execution-vocabulary.yaml +6 -6
  6. package/bundle/references/cli/update-channels.yaml +17 -2
  7. package/bundle/references/cli/vocabulary-index.yaml +3 -3
  8. package/bundle/references/cli/vocabulary.md +22 -16
  9. package/bundle/registry.json +1 -1
  10. package/bundle/skills/agentera/SKILL.md +38 -21
  11. package/bundle/skills/agentera/agents/dokumentera.toml +1 -1
  12. package/bundle/skills/agentera/agents/hej.toml +1 -1
  13. package/bundle/skills/agentera/agents/inspektera.toml +1 -1
  14. package/bundle/skills/agentera/agents/inspirera.toml +1 -1
  15. package/bundle/skills/agentera/agents/optimera.toml +1 -1
  16. package/bundle/skills/agentera/agents/orkestrera.toml +1 -1
  17. package/bundle/skills/agentera/agents/planera.toml +1 -1
  18. package/bundle/skills/agentera/agents/profilera.toml +1 -1
  19. package/bundle/skills/agentera/agents/realisera.toml +1 -1
  20. package/bundle/skills/agentera/agents/resonera.toml +1 -1
  21. package/bundle/skills/agentera/agents/visionera.toml +1 -1
  22. package/bundle/skills/agentera/agents/visualisera.toml +1 -1
  23. package/bundle/skills/agentera/capabilities/orkestrera/schemas/validation.yaml +26 -13
  24. package/bundle/skills/agentera/capability_schema_contract.yaml +33 -14
  25. package/bundle/skills/agentera/references/contract.md +2 -2
  26. package/bundle/skills/agentera/schemas/artifacts/decisions.yaml +1 -1
  27. package/bundle/skills/agentera/schemas/artifacts/progress.yaml +15 -36
  28. package/bundle/skills/agentera/schemas/artifacts/todo.yaml +14 -0
  29. package/bundle/skills/hej/SKILL.md +1 -1
  30. package/dist/capabilities/dokumentera/instructions.js +6 -0
  31. package/dist/capabilities/dokumentera/instructions.js.map +1 -0
  32. package/dist/capabilities/hej/instructions.js +6 -0
  33. package/dist/capabilities/hej/instructions.js.map +1 -0
  34. package/dist/capabilities/index.js +38 -0
  35. package/dist/capabilities/index.js.map +1 -0
  36. package/dist/capabilities/inspektera/instructions.js +6 -0
  37. package/dist/capabilities/inspektera/instructions.js.map +1 -0
  38. package/dist/capabilities/inspirera/instructions.js +6 -0
  39. package/dist/capabilities/inspirera/instructions.js.map +1 -0
  40. package/dist/capabilities/optimera/instructions.js +6 -0
  41. package/dist/capabilities/optimera/instructions.js.map +1 -0
  42. package/dist/capabilities/orkestrera/instructions.js +6 -0
  43. package/dist/capabilities/orkestrera/instructions.js.map +1 -0
  44. package/dist/capabilities/planera/instructions.js +6 -0
  45. package/dist/capabilities/planera/instructions.js.map +1 -0
  46. package/dist/capabilities/profilera/instructions.js +6 -0
  47. package/dist/capabilities/profilera/instructions.js.map +1 -0
  48. package/dist/capabilities/realisera/instructions.js +6 -0
  49. package/dist/capabilities/realisera/instructions.js.map +1 -0
  50. package/dist/capabilities/resonera/instructions.js +6 -0
  51. package/dist/capabilities/resonera/instructions.js.map +1 -0
  52. package/dist/capabilities/visionera/instructions.js +6 -0
  53. package/dist/capabilities/visionera/instructions.js.map +1 -0
  54. package/dist/capabilities/visualisera/instructions.js +6 -0
  55. package/dist/capabilities/visualisera/instructions.js.map +1 -0
  56. package/dist/cli/capabilityContext.js +92 -26
  57. package/dist/cli/capabilityContext.js.map +1 -1
  58. package/dist/cli/commands/capability.js +1 -8
  59. package/dist/cli/commands/capability.js.map +1 -1
  60. package/dist/cli/commands/doctor.js +14 -2
  61. package/dist/cli/commands/doctor.js.map +1 -1
  62. package/dist/cli/commands/state.js +22 -11
  63. package/dist/cli/commands/state.js.map +1 -1
  64. package/dist/cli/commands/validate.js +12 -2
  65. package/dist/cli/commands/validate.js.map +1 -1
  66. package/dist/cli/dispatch.js +470 -172
  67. package/dist/cli/dispatch.js.map +1 -1
  68. package/dist/cli/errors.js +53 -0
  69. package/dist/cli/errors.js.map +1 -0
  70. package/dist/cli/help.js +1 -1
  71. package/dist/cli/help.js.map +1 -1
  72. package/dist/cli/orientation.js +9 -6
  73. package/dist/cli/orientation.js.map +1 -1
  74. package/dist/cli/stateQuery.js +7 -0
  75. package/dist/cli/stateQuery.js.map +1 -1
  76. package/dist/cli/todoMarkdown.js +33 -0
  77. package/dist/cli/todoMarkdown.js.map +1 -0
  78. package/dist/hooks/common.js +0 -2
  79. package/dist/hooks/common.js.map +1 -1
  80. package/dist/hooks/validateArtifact.js +10 -8
  81. package/dist/hooks/validateArtifact.js.map +1 -1
  82. package/dist/registries/capabilityContract.js +12 -11
  83. package/dist/registries/capabilityContract.js.map +1 -1
  84. package/dist/registries/evaluatorHandoffContract.js +171 -0
  85. package/dist/registries/evaluatorHandoffContract.js.map +1 -0
  86. package/dist/setup/codex.js +146 -5
  87. package/dist/setup/codex.js.map +1 -1
  88. package/dist/upgrade/migrateArtifactsV1ToV2.js +0 -1
  89. package/dist/upgrade/migrateArtifactsV1ToV2.js.map +1 -1
  90. package/dist/upgrade/nextMajorDoctor.js +121 -0
  91. package/dist/upgrade/nextMajorDoctor.js.map +1 -0
  92. package/dist/upgrade/runtimeMigration.js +19 -3
  93. package/dist/upgrade/runtimeMigration.js.map +1 -1
  94. package/dist/upgrade/versionResolution.js +4 -4
  95. package/dist/upgrade/versionResolution.js.map +1 -1
  96. package/dist/validate/appHomeContract.js +1 -1
  97. package/dist/validate/appHomeContract.js.map +1 -1
  98. package/dist/validate/capability.js +11 -3
  99. package/dist/validate/capability.js.map +1 -1
  100. package/package.json +3 -3
  101. package/bundle/skills/agentera/capabilities/dokumentera/instructions.md +0 -428
  102. package/bundle/skills/agentera/capabilities/hej/instructions.md +0 -331
  103. package/bundle/skills/agentera/capabilities/inspektera/instructions.md +0 -514
  104. package/bundle/skills/agentera/capabilities/inspirera/instructions.md +0 -280
  105. package/bundle/skills/agentera/capabilities/optimera/instructions.md +0 -437
  106. package/bundle/skills/agentera/capabilities/orkestrera/instructions.md +0 -433
  107. package/bundle/skills/agentera/capabilities/planera/instructions.md +0 -368
  108. package/bundle/skills/agentera/capabilities/profilera/instructions.md +0 -419
  109. package/bundle/skills/agentera/capabilities/realisera/instructions.md +0 -403
  110. package/bundle/skills/agentera/capabilities/resonera/instructions.md +0 -329
  111. package/bundle/skills/agentera/capabilities/visionera/instructions.md +0 -309
  112. package/bundle/skills/agentera/capabilities/visualisera/instructions.md +0 -400
  113. package/dist/cli/commands/backfill.js +0 -84
  114. package/dist/cli/commands/backfill.js.map +0 -1
  115. package/dist/core/git.js +0 -43
  116. package/dist/core/git.js.map +0 -1
  117. package/dist/state/progressCommit.js +0 -289
  118. package/dist/state/progressCommit.js.map +0 -1
@@ -0,0 +1,6 @@
1
+ // Source: skills/agentera/capabilities/visualisera/instructions.md (relocated D65)
2
+ // Markdown body lifted verbatim; the JSON literal below round-trips to byte-for-byte
3
+ // equivalence with the deleted file (whitespace allowed to differ at line endings only).
4
+ export const instructions = JSON.parse(String.raw `"# VISUALISERA\n\n**Visual Identity: Systematic Unified Aesthetic Language. Render, Establish, Articulate.**\n\nThe visual steward of DESIGN.md. Deep creation through codebase exploration, domain research, and Socratic challenge about aesthetics. Opinionated enough to enforce consistency, flexible enough to evolve, concrete enough for any agent to generate correct UI.\n\nThree modes: **create**, **refine**, **audit**.\n\n---\n\n## Visual identity\n\nGlyph: **◰** (protocol ref: SG11). Used in the mandatory exit marker.\n\n---\n\n## State artifacts\n\nOne file in \u0060.agentera/\u0060.\n\n| Artifact | Purpose | Bootstrap |\n|----------|---------|-----------|\n| \u0060DESIGN.md\u0060 | Visual identity. Colors, typography, spacing, constraints, components, themes. An agent-readable design system. | Created via deep design conversation. |\n\nUse this prose plus \u0060agentera describe --format json\u0060 and its \u0060artifact_schemas\u0060 entry for \u0060design\u0060 as the active design artifact specification; do not search Agentera directories manually. The design schema covers \u0060<!-- design:X -->\u0060 marker syntax, standard sections, YAML token block format, and naming conventions.\n\n### Artifact path resolution\n\nBefore reading or writing any artifact, check if \u0060.agentera/docs.yaml\u0060 exists. If it has an Artifact Mapping section, use the path specified for each canonical filename (.agentera/design.yaml, etc.). If \u0060.agentera/docs.yaml\u0060 doesn't exist or has no mapping for a given artifact, use the default layout: TODO.md, CHANGELOG.md, and DESIGN.md at the project root; canonical VISION.md at \u0060.agentera/vision.yaml\u0060; other agent-facing artifacts at \u0060.agentera/*.yaml\u0060. This applies to all artifact references in this capability, including cross-capability reads (VISION.md, .agentera/decisions.yaml, PROFILE.md).\n\n### Contract values\n\nContract values are inlined where referenced. Visual tokens from protocol: severity arrows VT5-VT8, trend arrows VT12-VT13, progress bar VT18, inline separator VT16 (·), list item VT15 (▸), section divider VT14, flow/target VT17 (→). Skill glyph SG11 for the exit marker. Exit signals EX1-EX4 for the exit marker. Confidence scale CS1-CS5 for decision profile consumption.\n\n\u0060references/contract.md\u0060 (at the v2 skill location \u0060skills/agentera/references/contract.md\u0060) remains available as a full-spec reference for ambiguous cases or cross-checking.\n\n---\n\n## DESIGN.md format (condensed)\n\nStandard Markdown with structured YAML blocks inside fenced code regions, delineated by HTML comment markers for machine parseability.\n\n\u0060\u0060\u0060markdown\n# [Project Name] Design System\n\n## Philosophy\n[Human prose: design principles, aesthetic rationale, visual personality]\n\n## Colors\n<!-- design:colors -->\n\u0060\u0060\u0060yaml\nbrand-primary: oklch(50% 0.25 25)\nbrand-secondary: oklch(60% 0.15 250)\nbackground: oklch(100% 0 0)\nforeground: oklch(0% 0 0)\n\u0060\u0060\u0060\n\n## Typography\n<!-- design:typography -->\n\u0060\u0060\u0060yaml\ntext-heading:\n font-family: \"Inter\", sans-serif\n font-weight: 700\ntext-body:\n font-family: \"Inter\", sans-serif\n font-weight: 400\n\u0060\u0060\u0060\n\n## Constraints\n<!-- design:constraints -->\n\u0060\u0060\u0060yaml\naesthetic:\n - property: box-shadow\n rule: prohibited\n reason: \"Depth via borders and contrast, not shadows\"\nstructural:\n - pattern: arbitrary-values\n rule: prohibited\n scope: [colors, spacing]\n\u0060\u0060\u0060\n\n\u0060\u0060\u0060\n\nStandard sections: \u0060colors\u0060, \u0060font-sizes\u0060, \u0060fonts\u0060, \u0060typography\u0060, \u0060spacing\u0060, \u0060radius\u0060, \u0060shadows\u0060, \u0060theme\u0060, \u0060constraints\u0060, \u0060components\u0060, \u0060tw-merge-preserve\u0060. All optional. Custom sections use the same \u0060design:\u0060 prefix with any name.\n\nUse this section and \u0060skills/agentera/references/contract.md\u0060 as the active specification for token block formats, theme mappings, component contracts, naming conventions, and monorepo nesting rules.\n\n---\n\n## Step 0: Detect mode\n\n**If DESIGN.md does NOT exist**: Proceed to **Create** mode (Step 1).\n\n**If DESIGN.md exists**: Present the mode choice.\n\nNarration voice (riff, don't script):\n\n- \"Design system's already in place. Evolve it, audit it, or start fresh?\" · \"Found your visual identity. Refine, check for mismatches, or clean slate?\"\n\nOffer:\n\n> **Refine**: Evolve the existing design system based on what you've learned. Reads the current DESIGN.md, the codebase state, and recent progress to propose informed updates.\n>\n> **Audit**: Check the current design system for consistency, completeness, and mismatches with the codebase.\n>\n> **Replace**: Start fresh with a deep design conversation. Archives the current DESIGN.md and creates a new one from scratch.\n\nIf **Refine**, skip to Refine mode.\nIf **Audit**, skip to Audit mode.\nIf **Replace**, archive current DESIGN.md to \u0060.agentera/archive/design-{date}.yaml\u0060, then proceed to Create mode.\n\n---\n\n## Create mode\n\nStep markers: display \u0060── step N/7: verb\u0060 before each step.\nSteps: explore, research, converse, audit, write, validate, next.\n\n### Step 1: Explore the codebase\n\nIf code exists, read deeply before asking questions. Arriving informed distinguishes visualisera from a blank-slate design interview.\n\n1. **Map the structure**: directory layout, UI components, pages\n2. **VISION.md Identity section**: declared personality, voice, emotional register. The visual system must cohere with this.\n3. **Existing theme/style files**: CSS properties, Tailwind config, color declarations, font imports, component libraries\n4. **Dependency manifests**: UI framework, component library, CSS approach (determines token format)\n5. **Parent DESIGN.md**: for monorepos, the inherited design system (nested overrides)\n6. **CLAUDE.md, AGENTS.md**: existing design instructions\n7. **Decision profile**: read \u0060$PROFILERA_PROFILE_DIR/PROFILE.md\u0060 (default: \u0060$XDG_DATA_HOME/agentera/PROFILE.md\u0060) directly per protocol confidence scale (CS1-CS5) conventions. Aesthetic preferences inform the design conversation. If missing, proceed without persona grounding.\n8. \u0060git log --oneline -20\u0060: recent visual story\n\nSynthesize: \"The project uses X with Y. Palette is Z. Typography is A. Strongest patterns: B. Inconsistencies: C.\" If VISION.md Identity exists, connect it to the visual system.\n\nGreenfield? Skip to Step 2.\n\n### Step 2: Research the domain\n\nSearch for design context that grounds the identity in what works:\n\n1. **Stack design systems**: Tailwind themes, shadcn/ui, Radix, Material Design. Defaults and customization points.\n2. **Similar projects**: competing tools, adjacent products, established patterns\n3. **State of the art**: recent trends, emerging patterns in similar domains\n4. **Stack constraints**: framework limitations, component library opinions\n\n3-5 targeted searches. Read promising results deeply. Synthesize: \"Common approach is X. Opportunity to differentiate is Y.\"\n\n### Step 3: The conversation\n\nEngage the user. Ask one question at a time through the runtime question tool\n(\u0060AskUserQuestion\u0060, always include \u0060Done\u0060 option).\n\n**Personality**: the sharp colleague, here to design, not collect requirements. Exacting about details: \"That's good, but what if the palette was braver?\"\n\nFollow a narrative arc, not a checklist. Adapt, but cover:\n\n1. **The philosophy**: \"Based on what I see in the codebase [and the VISION.md Identity], here's the visual impression I'd expect: [synthesis]. What should this project FEEL like visually? If someone sees the UI for 3 seconds, what impression should they have? Brutalist? Playful? Clinical? Luxurious?\"\n\n If VISION.md Identity exists, propose defaults: \"Your identity says 'bold and direct.' That suggests sharp edges, high contrast, no decorative shadows. Does that resonate?\"\n\n Push beyond generic: \"'Clean and modern' is too vague. Apple-clean with whitespace, or Stripe-clean with dense information hierarchy? Very different.\"\n\n2. **The color strategy**: \"What's the color philosophy? Monochrome with a single punctuation color? Rich and saturated? Muted and professional? What color means 'this is us'?\"\n\n Be specific: \"Two-color with single accent, or multi-color with semantic meaning? What carries the brand: background or foreground?\"\n\n Reference existing code colors: \"\u0060#2563eb\u0060 as primary: intentional or inherited?\"\n\n3. **The typography**: \"How should text feel? Monospace for that developer-tool edge? Clean sans-serif for clarity? What's the hierarchy: how do you distinguish a label from a heading from body text?\"\n\n Push: \"System fonts or custom? Geometric (Inter), humanist (Source Sans), industrial (JetBrains Mono)?\"\n\n4. **The constraints**: \"What should NEVER happen in this UI? Shadows? Rounded corners? Gradients? Arbitrary values? What are the bright lines?\"\n\n Maps to \u0060<!-- design:constraints -->\u0060. \"Every constraint prevents a class of visual mismatch.\"\n\n5. **The components**: \"What are the core UI building blocks? Buttons, cards, inputs. What variants does each need? What's the interaction pattern?\"\n\n Maps to \u0060<!-- design:components -->\u0060. Focus on contracts: \"What props, variants, refusals? This becomes the contract agents build against.\"\n\n### Step 4: Pre-write self-audit\n\nPre-write self-audit: run \u0060agentera lint --artifact <ARTIFACT> --text \"<DRAFT>\"\u0060 (or \u0060--file <PATH>\u0060; schema names such as \u0060decisions\u0060 auto-resolve the artifact file when no input is given) on the draft entry to check verbosity overruns (per-artifact budget), abstraction creep (>=1 concrete anchor), and filler accumulation (banned patterns).\nMax 3 revision attempts. Flag with [post-audit-flagged] if still failing.\n\nNarration voice (riff, don't script):\n\n- \"Tightening this up...\" · \"Cutting the filler first...\" · \"One more pass...\"\n\n### Step 5: Write DESIGN.md\n\nSynthesize the conversation into a structured design system document.\n\n**Tone**: prose sections opinionated and evocative (why tokens exist, how they relate); YAML blocks precise and machine-parseable.\n\n**Structure**: follow the spec. Every section gets prose + YAML. At minimum:\n\n- **Philosophy**: prose only, the aesthetic rationale\n- **Colors**: \u0060<!-- design:colors -->\u0060 with OKLCH/HSL values and semantic aliases\n- **Typography**: \u0060<!-- design:typography -->\u0060 with composite token definitions\n- **Spacing**: \u0060<!-- design:spacing -->\u0060 with a consistent scale (8pt grid recommended)\n- **Constraints**: \u0060<!-- design:constraints -->\u0060 with aesthetic and structural rules\n- **Components**: \u0060<!-- design:components -->\u0060 with variant contracts (if the project has UI)\n\nAdd \u0060theme\u0060, \u0060radius\u0060, \u0060shadows\u0060, \u0060font-sizes\u0060, \u0060fonts\u0060 as warranted.\n\nUse established scales: OKLCH for colors, 8pt grid for spacing, modular scale for type. No arbitrary values. Present draft, get explicit approval before writing.\n\nArtifact writing follows contract Section 24 (Artifact Writing Conventions): banned verbosity patterns, 25-word sentence cap, preferred vocabulary, and lead-with-conclusion structure.\n\n### Step 6: Validate\n\nValidate the written file against the \u0060DESIGN.md\u0060 structure described in this capability. Agentera v2 does not ship a standalone design validator; fix malformed sections, missing token fields, or unresolved references before presenting.\n\n### Step 7: Next steps\n\n▸ **Set up enforcement**: propose project-local checks for tokens, component usage, and visual mismatches; no separate Agentera enforcement reference ships in v2\n▸ **Build to the spec**: use ⧉ realisera to implement UI that respects the design tokens\n▸ **Document it**: use ▤ dokumentera to add the design system to project documentation\n▸ **Refine later**: use ◰ visualisera again to evolve the design as the project matures\n\n---\n\n## Refine mode\n\nEvolve an existing design system based on what's changed.\n\nStep markers: display \u0060── step N/4: verb\u0060 before each step.\nSteps: read, propose, audit, update.\n\n### Step 1: Read current state\n\n1. Current DESIGN.md: all token blocks, constraints, prose\n2. Codebase: focused on changes since DESIGN.md was written (git log, new components)\n3. VISION.md Identity: has verbal identity evolved?\n4. PROGRESS.md: UI work and inline design decisions\n5. TODO.md: design-related issues\n\n### Step 2: Propose changes\n\n> Here's what's changed since the design system was written:\n>\n> - New components [A, B] were built that aren't in the component contracts\n> - The color palette is out of sync: [file:line] uses [value] not in the token set\n> - VISION.md Identity now says [X], and the visual system [does/doesn't] reflect that\n>\n> I'd suggest updating:\n>\n> - [Section]: [what to change and why]\n\nBrief conversation (2-4 exchanges) to refine proposed changes.\n\n### Step 3: Pre-write self-audit\n\nPre-write self-audit: run \u0060agentera lint --artifact <ARTIFACT> --text \"<DRAFT>\"\u0060 (or \u0060--file <PATH>\u0060; schema names such as \u0060decisions\u0060 auto-resolve the artifact file when no input is given) on the draft entry to check verbosity overruns (per-artifact budget), abstraction creep (>=1 concrete anchor), and filler accumulation (banned patterns).\nMax 3 revision attempts. Flag with [post-audit-flagged] if still failing.\n\nNarration voice (riff, don't script):\n\n- \"Tightening this up...\" · \"Cutting the filler first...\" · \"One more pass...\"\n\n### Step 4: Update DESIGN.md\n\nShow diff with rationale. Get approval. Run validation after writing.\n\nArtifact writing follows contract Section 24 (Artifact Writing Conventions): banned verbosity patterns, 25-word sentence cap, preferred vocabulary, and lead-with-conclusion structure.\n\n---\n\n## Audit mode\n\nTwo-phase check: deterministic validation (script), then agent-driven code analysis.\n\nStep markers: display \u0060── step N/3: verb\u0060 before each step.\nSteps: validate, check, report.\n\n### Step 1: Validate structure\n\nInspect \u0060DESIGN.md\u0060 and report structural issues: malformed YAML blocks, missing sections, unresolved references, or token entries without category/name/value.\n\n### Step 2: Check adherence\n\nScan codebase for design mismatches:\n\n1. **Token usage**: undeclared colors, fonts, or spacing values in code\n2. **Constraint violations**: prohibited properties in use (e.g., shadows when banned)\n3. **Component mismatch**: undeclared variants or prohibited props\n4. **Consistency**: ad-hoc styling on similar elements\n\n### Step 3: Report\n\nCategorize findings by severity (protocol refs: SF1-SF3 for finding severity):\n\n- ⇶ **Critical** (VT5): tokens in code that don't exist in DESIGN.md (uncontrolled styling)\n- ⇉ **Warning** (VT6): declared tokens not used anywhere (dead tokens), mild inconsistencies\n- ⇢ **Info** (VT8): suggestions for new tokens or constraints based on observed patterns\n\nPresent with file:line references. For each finding, offer to:\n▸ **Fix DESIGN.md**: add missing tokens or constraints\n▸ **File to TODO.md**: if the code is wrong (design is right, code is out of sync)\n▸ **Skip**: intentional or not worth fixing\n\nFor framework-specific enforcement beyond audits, derive checks from the project's stack and record them directly in DESIGN.md or TODO.md.\n\n---\n\n## Safety rails\n\n<critical>\n- NEVER modify DESIGN.md without explicit user approval. Present drafts and get confirmation.\n- NEVER write design tokens that conflict with VISION.md Identity. If the verbal identity says \"warm and approachable\" and the user wants a cold, brutalist palette, surface the tension explicitly and let the user resolve it.\n- NEVER impose aesthetic preferences. The user's taste drives the design. Have opinions, push for specificity, but defer to the user's choices.\n- NEVER skip the validation step after writing DESIGN.md. Inspect the structure and fix any errors before presenting the result.\n- NEVER create arbitrary token values. Use established scales (8pt grid for spacing, modular type scale for font sizes, OKLCH for perceptual color uniformity). The design system must practice what it preaches.\n- NEVER modify code files. Visualisera writes DESIGN.md; realisera implements it. The separation of declaration and implementation is fundamental.\n- NEVER skip the codebase exploration (Step 1) when code exists. Arriving informed is what makes the conversation productive rather than generic.\n</critical>\n\n---\n\n## Exit signals\n\nReport one of these statuses at workflow completion (protocol refs: EX1-EX4).\n\nFormat: \u0060◰ visualisera · <status>\u0060 followed by a summary sentence.\nFor flagged, stuck, and waiting: add \u0060▸\u0060 (VT15) bullet details below the summary.\n\n- **complete** (EX1): DESIGN.md was written (Create/Replace mode), updated (Refine mode), or audited with findings reported (Audit mode). Validation script ran without errors, and all changes had explicit user approval before writing.\n- **flagged** (EX2): The design system was produced or audited but with issues worth surfacing. Possible causes: validation passed but with advisory warnings, the design mismatches VISION.md Identity in ways the user acknowledged, or audit findings were discovered that were neither fixed nor filed to TODO.md.\n- **stuck** (EX3): Cannot write DESIGN.md because the user declined to approve the draft, the validation script reports errors that cannot be resolved without user input on the design intent, or the project's UI stack is inaccessible and token defaults cannot be reliably inferred.\n- **waiting** (EX4): The visual identity direction is entirely undefined and the user has not engaged with the design conversation, or the project has no UI layer and DESIGN.md would serve no purpose without clarification of what is being designed.\n\n---\n\n## Cross-capability integration\n\nVisualisera is part of a twelve-capability suite. It is the visual identity layer, the capability that defines how the project looks.\n\n### Visualisera reads visionera output\n\nVISION.md's Identity section declares the verbal personality (bold, warm, playful, etc.). Visualisera reads this to propose visual tokens coherent with the declared identity. If Identity says \"industrial and direct,\" visualisera proposes sharp edges and monospace type. Visionera reads DESIGN.md in return; neither writes the other's artifact.\n\n### Visualisera feeds realisera\n\nDESIGN.md's tokens and constraints guide autonomous UI development. When realisera builds components or pages, it reads DESIGN.md to understand what colors, typography, spacing, and constraints to use. The design system prevents visual mismatches across cycles.\n\n### Visualisera is informed by dokumentera\n\nDOCS.md tracks DESIGN.md in the artifact mapping. Dokumentera may document the design system as part of project documentation.\n\n### Visualisera is informed by inspektera\n\nWhen inspektera audits architecture alignment or pattern consistency, design system adherence is a relevant dimension. Future integration may include design-specific audit dimensions.\n\n### Visualisera is informed by profilera\n\nThe decision profile captures aesthetic preferences, specifically the user's established patterns around visual design, typography choices, and UI conventions. Visualisera reads these as defaults during the create conversation.\n\n### Visualisera is informed by inspirera\n\nWhen inspirera analyzes external design systems or visual patterns, the findings can feed into visualisera's research step or refine mode. External design references enrich the conversation.\n\n### Visualisera is informed by resonera\n\nWhen design decisions require deliberation, suggest ❈ resonera before committing. Use it for competing aesthetics, brand evolution, or significant visual pivots.\n\n---\n\n## Getting started\n\n### New project: design before building\n\n1. ⛥ visionera: create VISION.md with Identity section (who the project IS)\n2. ◰ visualisera: create DESIGN.md (how it LOOKS), coherent with the Identity\n3. ⧉ realisera: build UI to the design spec\n\n### Existing project: capture the visual identity\n\n1. ◰ visualisera: reads existing styles, proposes tokens from what's already there\n2. Review and refine the generated DESIGN.md\n3. Set up enforcement from project-local checks\n\n### Audit existing design\n\n\u0060\u0060\u0060\n\n/agentera design\n\n\u0060\u0060\u0060\n\nSelect \"Audit\" mode. Validates structure and scans code for mismatches.\n\n### Refine after evolution\n\n\u0060\u0060\u0060\n\n/agentera design\n\n\u0060\u0060\u0060\n\nSelect \"Refine\" mode. Reviews what's changed and proposes design system updates.\n"`);
5
+ export default instructions;
6
+ //# sourceMappingURL=instructions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../../src/capabilities/visualisera/instructions.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,qFAAqF;AACrF,yFAAyF;AACzF,MAAM,CAAC,MAAM,YAAY,GAAW,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAA,8opBAA8opB,CAAC,CAAC;AACzspB,eAAe,YAAY,CAAC"}
@@ -7,6 +7,8 @@ import { artifactPath } from "./appContext.js";
7
7
  import { asList, firstPresent, sourceMetadata } from "./stateQuery.js";
8
8
  import { loadNamedArtifact } from "./orientation.js";
9
9
  import { decisionContextEntry, decisionSourceContract, extractDecisionEntries } from "./commands/state.js";
10
+ import { evaluatorHandoffOutputRequirements, loadEvaluatorHandoffContract, } from "../registries/evaluatorHandoffContract.js";
11
+ import { CAPABILITY_INSTRUCTIONS, capabilityInstructionModulePath, capabilityStartupCommand, } from "../capabilities/index.js";
10
12
  export const CAPABILITY_NAMES = [
11
13
  "hej", "visionera", "resonera", "inspirera", "planera", "realisera",
12
14
  "optimera", "inspektera", "dokumentera", "profilera", "visualisera", "orkestrera",
@@ -92,27 +94,32 @@ function capabilityInstructionContract() {
92
94
  }
93
95
  }
94
96
  function capabilityInstructionTarget(capability) {
95
- const skillRoot = String(activeAppModel().skillRoot);
96
- const rel = `skills/agentera/capabilities/${capability}/instructions.md`;
97
- const installedTarget = path.join(skillRoot, "capabilities", capability, "instructions.md");
98
- return { path: rel, exists: isFile(installedTarget), runtime_path: installedTarget };
97
+ const module = capabilityInstructionModulePath(capability);
98
+ const prose = CAPABILITY_INSTRUCTIONS[capability] ?? null;
99
+ return {
100
+ module,
101
+ exists: prose !== null && prose.length > 0,
102
+ runtime_path: module,
103
+ prose_present: prose !== null,
104
+ prose_length: prose === null ? 0 : prose.length,
105
+ };
99
106
  }
100
107
  function firstInvocationReadMetadata(capability) {
101
108
  const authority = capabilityInstructionContract();
102
109
  const firstRead = authority.first_invocation_read && typeof authority.first_invocation_read === "object" ? authority.first_invocation_read : {};
103
110
  const allowedValues = firstRead.allowed_values && typeof firstRead.allowed_values === "object" ? firstRead.allowed_values : {};
104
- const value = capability === "planera" ? "compact_startup" : "full";
111
+ const value = "prime_context";
105
112
  const valueContract = (allowedValues[value] ?? {});
106
- const fullContract = (allowedValues.full ?? {});
107
113
  return {
108
114
  field: "first_invocation_read",
109
115
  value,
110
116
  allowed_values: Object.keys(allowedValues),
111
117
  default_rule: firstRead.default_rule ?? firstRead.default_future_rule ?? null,
112
- instruction_target: capabilityInstructionTarget(capability),
113
- obligation_summary: valueContract.obligation ?? fullContract.obligation ?? null,
118
+ module_target: capabilityInstructionTarget(capability),
119
+ startup_command: capabilityStartupCommand(capability),
120
+ obligation_summary: valueContract.obligation ?? `shell out to ${capabilityStartupCommand(capability)}`,
114
121
  meaning: valueContract.meaning ?? null,
115
- runtime_enforcement: false,
122
+ runtime_enforcement: true,
116
123
  provenance: {
117
124
  authority_path: "references/cli/capability-instruction-contract.yaml",
118
125
  authority_status: authority.status ?? null,
@@ -129,8 +136,8 @@ function planeraStartupContract() {
129
136
  bounded: true,
130
137
  instructions_runtime_read_required: false,
131
138
  instructions_authority: {
132
- normal_startup: "Use this compact context for normal Planera execution startup before reading " +
133
- "skills/agentera/capabilities/planera/instructions.md.",
139
+ normal_startup: "Use this compact context for normal Planera execution startup; " +
140
+ "shell out to `agentera prime --context planera --format json` for the full Planera prose.",
134
141
  read_planera_instructions_when: PLANERA_INSTRUCTIONS_AUTHORITY_EXCEPTIONS,
135
142
  },
136
143
  planning: {
@@ -467,6 +474,7 @@ function slimCapabilityContext(capability, mode, appHome, bundle, profile, plan,
467
474
  contextPayload[name] = slimBespokeContext(name, value);
468
475
  }
469
476
  }
477
+ const prose = CAPABILITY_INSTRUCTIONS[capability] ?? null;
470
478
  return {
471
479
  schemaVersion: "agentera.capabilityContext.v1",
472
480
  capability,
@@ -483,6 +491,7 @@ function slimCapabilityContext(capability, mode, appHome, bundle, profile, plan,
483
491
  schema_error: context.schema_error ?? null,
484
492
  },
485
493
  context: contextPayload,
494
+ prose: prose ?? "",
486
495
  raw_artifact_read_policy: context.raw_artifact_read_policy ?? null,
487
496
  };
488
497
  }
@@ -511,7 +520,7 @@ function orchestrationTaskSummary(task) {
511
520
  const evidenceItems = Array.isArray(evidence) ? evidence : evidence === null || evidence === undefined || evidence === "" ? [] : [evidence];
512
521
  return {
513
522
  ...taskRef(task),
514
- depends_on: asList(task.depends_on),
523
+ depends_on: planDependsOnList(task),
515
524
  acceptance_summary: { count: asList(task.acceptance).length, items: asList(task.acceptance) },
516
525
  evidence_summary: { count: evidenceItems.length, items: evidenceItems },
517
526
  };
@@ -567,8 +576,21 @@ function retryState() {
567
576
  caveats: ["Retry attempt state is not recorded; no attempt count is exposed."],
568
577
  };
569
578
  }
579
+ function evaluatorHandoffOutputRequirementsFromContract() {
580
+ const contractPath = capabilityInstructionContractPath();
581
+ if (!isFile(contractPath))
582
+ return {};
583
+ try {
584
+ const contract = loadEvaluatorHandoffContract(contractPath);
585
+ return evaluatorHandoffOutputRequirements(contract);
586
+ }
587
+ catch {
588
+ return {};
589
+ }
590
+ }
570
591
  function evaluatorHandoff(selected, progressVerification, retry, stateCaveats) {
571
592
  const caveats = [...stateCaveats, ...(progressVerification.caveats ?? []), ...(retry.caveats ?? [])];
593
+ const outputRequirements = evaluatorHandoffOutputRequirementsFromContract();
572
594
  if (selected === null) {
573
595
  caveats.push("No dependency-ready task is selected for evaluator handoff.");
574
596
  return {
@@ -578,6 +600,7 @@ function evaluatorHandoff(selected, progressVerification, retry, stateCaveats) {
578
600
  evidence_requirements: [],
579
601
  latest_progress_verification_pointer: progressVerification.latest_progress_verification_pointer ?? null,
580
602
  evaluation_caveats: caveats,
603
+ output_requirements: outputRequirements,
581
604
  };
582
605
  }
583
606
  const evidenceRequirements = (selected.evidence_summary?.items ?? []);
@@ -591,6 +614,7 @@ function evaluatorHandoff(selected, progressVerification, retry, stateCaveats) {
591
614
  evidence_requirements: evidenceRequirements,
592
615
  latest_progress_verification_pointer: progressVerification.latest_progress_verification_pointer ?? null,
593
616
  evaluation_caveats: caveats,
617
+ output_requirements: outputRequirements,
594
618
  };
595
619
  }
596
620
  function uniqueList(items) {
@@ -600,14 +624,59 @@ function uniqueList(items) {
600
624
  out.push(item);
601
625
  return out;
602
626
  }
627
+ /** Coerce plan task numbers and depends_on refs to comparable lookup keys (int/string/object forms). */
628
+ function planTaskRefKeys(value) {
629
+ if (value === null || value === undefined)
630
+ return [];
631
+ if (typeof value === "object" && !Array.isArray(value)) {
632
+ const entry = value;
633
+ const nested = entry.number ?? entry.task_number ?? entry.id;
634
+ return nested === null || nested === undefined ? [] : planTaskRefKeys(nested);
635
+ }
636
+ const text = String(value).trim();
637
+ if (!text)
638
+ return [];
639
+ const keys = new Set([text]);
640
+ const numeric = Number(text);
641
+ if (Number.isFinite(numeric) && Number.isInteger(numeric))
642
+ keys.add(String(numeric));
643
+ return [...keys];
644
+ }
645
+ function formatPlanTaskDepRef(dep) {
646
+ const keys = planTaskRefKeys(dep);
647
+ return keys.length > 0 ? keys[0] : String(dep);
648
+ }
649
+ function planDependsOnList(task) {
650
+ const raw = task.depends_on;
651
+ if (Array.isArray(raw))
652
+ return raw;
653
+ if (raw === null || raw === undefined || raw === "")
654
+ return [];
655
+ return [raw];
656
+ }
657
+ function indexPlanTasksByNumber(tasks) {
658
+ const taskByNumber = {};
659
+ for (const task of tasks) {
660
+ if (task.number === null || task.number === undefined)
661
+ continue;
662
+ for (const key of planTaskRefKeys(task.number))
663
+ taskByNumber[key] = task;
664
+ }
665
+ return taskByNumber;
666
+ }
667
+ function resolvePlanTaskByRef(taskByNumber, dep) {
668
+ for (const key of planTaskRefKeys(dep)) {
669
+ const hit = taskByNumber[key];
670
+ if (hit !== undefined)
671
+ return hit;
672
+ }
673
+ return undefined;
674
+ }
603
675
  function orchestrationContext(capability, plan, progress, health, todoItems, docs, profile, nextAction) {
604
676
  if (capability !== "orkestrera")
605
677
  return null;
606
678
  const tasks = asList(plan.tasks).filter((t) => t && typeof t === "object" && !Array.isArray(t));
607
- const taskByNumber = {};
608
- for (const task of tasks)
609
- if (task.number !== null && task.number !== undefined)
610
- taskByNumber[String(task.number)] = task;
679
+ const taskByNumber = indexPlanTasksByNumber(tasks);
611
680
  const dependencyReady = [];
612
681
  const blocked = [];
613
682
  for (const task of tasks) {
@@ -617,12 +686,12 @@ function orchestrationContext(capability, plan, progress, health, todoItems, doc
617
686
  const reasons = [];
618
687
  if (BLOCKED_STATUSES_ORCH.has(status))
619
688
  reasons.push(`task status is ${status}`);
620
- for (const dep of asList(task.depends_on)) {
621
- const dependency = taskByNumber[String(dep)];
689
+ for (const dep of planDependsOnList(task)) {
690
+ const dependency = resolvePlanTaskByRef(taskByNumber, dep);
622
691
  if (dependency === undefined)
623
- reasons.push(`dependency ${dep} is not present in plan tasks`);
692
+ reasons.push(`dependency ${formatPlanTaskDepRef(dep)} is not present in plan tasks`);
624
693
  else if (!DONE_STATUSES_ORCH.has(entryStatus(dependency, "pending"))) {
625
- reasons.push(`dependency ${dep} is ${entryStatus(dependency, "pending")}`);
694
+ reasons.push(`dependency ${formatPlanTaskDepRef(dep)} is ${entryStatus(dependency, "pending")}`);
626
695
  }
627
696
  }
628
697
  if (reasons.length > 0)
@@ -765,18 +834,15 @@ function bespokeCapabilityContexts(capabilityName, state) {
765
834
  // ── realisera execution bespoke context ─────────────────────────────
766
835
  const TARGET_VERSION_RE = /\b\d+\.\d+\.\d+\b/;
767
836
  function dependencyReadyTasks(tasks) {
768
- const taskByNumber = {};
769
- for (const task of tasks)
770
- if (task.number !== null && task.number !== undefined)
771
- taskByNumber[String(task.number)] = task;
837
+ const taskByNumber = indexPlanTasksByNumber(tasks);
772
838
  const ready = [];
773
839
  for (const task of tasks) {
774
840
  const status = entryStatus(task, "pending");
775
841
  if (DONE_STATUSES_ORCH.has(status) || BLOCKED_STATUSES_ORCH.has(status))
776
842
  continue;
777
843
  let blocked = false;
778
- for (const dep of asList(task.depends_on)) {
779
- const dependency = taskByNumber[String(dep)];
844
+ for (const dep of planDependsOnList(task)) {
845
+ const dependency = resolvePlanTaskByRef(taskByNumber, dep);
780
846
  if (dependency === undefined || !DONE_STATUSES_ORCH.has(entryStatus(dependency, "pending"))) {
781
847
  blocked = true;
782
848
  break;