mandrel 1.92.0 → 1.94.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 (144) hide show
  1. package/.agents/agents/acceptance-critic.md +129 -0
  2. package/.agents/agents/retro.md +42 -0
  3. package/.agents/agents/story-worker.md +162 -0
  4. package/.agents/docs/configuration.md +7 -1
  5. package/.agents/docs/execution-reference.md +27 -2
  6. package/.agents/instructions.md +43 -33
  7. package/.agents/personas/engineer.md +26 -112
  8. package/.agents/personas/security-engineer.md +1 -2
  9. package/.agents/rules/git-conventions-reference.md +225 -0
  10. package/.agents/rules/git-conventions.md +25 -200
  11. package/.agents/rules/security-baseline.md +5 -0
  12. package/.agents/rules/testing-standards.md +106 -13
  13. package/.agents/schemas/agentrc.schema.json +31 -1
  14. package/.agents/schemas/lifecycle/slice.end.schema.json +21 -0
  15. package/.agents/schemas/lifecycle/slice.heartbeat.schema.json +20 -0
  16. package/.agents/schemas/lifecycle/slice.start.schema.json +17 -0
  17. package/.agents/scripts/acceptance-eval.js +62 -18
  18. package/.agents/scripts/agents-bootstrap-github.js +1 -1
  19. package/.agents/scripts/bookkeeping-reconcile.js +117 -0
  20. package/.agents/scripts/check-context-budget.js +62 -5
  21. package/.agents/scripts/diagnose-friction.js +0 -6
  22. package/.agents/scripts/epic-deliver-prepare.js +272 -10
  23. package/.agents/scripts/lib/bootstrap/project-bootstrap.js +56 -18
  24. package/.agents/scripts/lib/close-validation/gates.js +159 -21
  25. package/.agents/scripts/lib/config/acceptance-eval.js +52 -5
  26. package/.agents/scripts/lib/config/delivery-routing.js +87 -0
  27. package/.agents/scripts/lib/config/explain.js +2 -0
  28. package/.agents/scripts/lib/config-resolver.js +1 -1
  29. package/.agents/scripts/lib/config-settings-schema-delivery.js +37 -3
  30. package/.agents/scripts/lib/config-settings-schema-quality.js +9 -0
  31. package/.agents/scripts/lib/doc-tiers.js +37 -2
  32. package/.agents/scripts/lib/observability/active-story-env.js +111 -2
  33. package/.agents/scripts/lib/observability/hook-heartbeat.js +219 -0
  34. package/.agents/scripts/lib/observability/tool-trace-hook.js +15 -4
  35. package/.agents/scripts/lib/orchestration/acceptance-clusters.js +111 -0
  36. package/.agents/scripts/lib/orchestration/acceptance-eval-decision.js +32 -4
  37. package/.agents/scripts/lib/orchestration/bookkeeping-outbox.js +270 -0
  38. package/.agents/scripts/lib/orchestration/ceremony-routing.js +141 -0
  39. package/.agents/scripts/lib/orchestration/context-hydration-engine.js +3 -124
  40. package/.agents/scripts/lib/orchestration/deliver-route.js +173 -0
  41. package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/authoring-context.js +1 -1
  42. package/.agents/scripts/lib/orchestration/epic-run-state-store.js +233 -0
  43. package/.agents/scripts/lib/orchestration/file-assumptions.js +68 -7
  44. package/.agents/scripts/lib/orchestration/lifecycle/emit-slice-lifecycle.js +270 -0
  45. package/.agents/scripts/lib/orchestration/lifecycle/listeners/acceptance-reconciler.js +83 -2
  46. package/.agents/scripts/lib/orchestration/lifecycle/listeners/checkpoint-pointer-writer.js +6 -0
  47. package/.agents/scripts/lib/orchestration/plan-context.js +189 -3
  48. package/.agents/scripts/lib/orchestration/plan-critic-conditions.js +3 -2
  49. package/.agents/scripts/lib/orchestration/plan-critics-evaluate.js +99 -0
  50. package/.agents/scripts/lib/orchestration/plan-persist/run-plan-persist.js +38 -1
  51. package/.agents/scripts/lib/orchestration/plan-persist/summary.js +16 -1
  52. package/.agents/scripts/lib/orchestration/single-story-close/phases/close-validation.js +1 -0
  53. package/.agents/scripts/lib/orchestration/story-close/pre-merge-validation.js +1 -0
  54. package/.agents/scripts/lib/orchestration/ticket-validator.js +19 -2
  55. package/.agents/scripts/lib/provider-factory.js +1 -1
  56. package/.agents/scripts/lib/templates/decomposer-prompts.js +1 -1
  57. package/.agents/scripts/plan-context.js +28 -10
  58. package/.agents/scripts/post-structured-comment.js +38 -0
  59. package/.agents/scripts/slice-phase.js +361 -0
  60. package/.agents/scripts/sync-claude-agents.js +165 -0
  61. package/.agents/scripts/update-ticket-state.js +31 -0
  62. package/.agents/scripts/wave-tick.js +138 -9
  63. package/.agents/skills/core/api-and-interface-design/SKILL.md +5 -3
  64. package/.agents/skills/core/code-review-and-quality/SKILL.md +63 -7
  65. package/.agents/skills/core/debugging-and-error-recovery/SKILL.md +1 -1
  66. package/.agents/skills/core/epic-plan-consolidate/SKILL.md +5 -5
  67. package/.agents/skills/core/epic-plan-decompose-author/SKILL.md +8 -8
  68. package/.agents/skills/core/epic-plan-premortem/SKILL.md +4 -4
  69. package/.agents/skills/core/epic-plan-spec-author/SKILL.md +26 -56
  70. package/.agents/skills/core/gates-and-baselines/SKILL.md +149 -0
  71. package/.agents/skills/core/idea-refinement/SKILL.md +2 -8
  72. package/.agents/skills/core/qa-coverage-mapping/SKILL.md +7 -7
  73. package/.agents/skills/skills.index.json +11 -381
  74. package/.agents/workflows/deliver.md +47 -4
  75. package/.agents/workflows/helpers/acceptance-self-eval.md +38 -13
  76. package/.agents/workflows/helpers/deliver-epic-reference.md +18 -5
  77. package/.agents/workflows/helpers/deliver-epic-single.md +331 -0
  78. package/.agents/workflows/helpers/deliver-epic.md +51 -8
  79. package/.agents/workflows/helpers/deliver-stories.md +15 -5
  80. package/.agents/workflows/helpers/epic-deliver-story.md +12 -3
  81. package/.agents/workflows/helpers/mandrel-sync-config.md +1 -1
  82. package/.agents/workflows/helpers/plan-epic-reference.md +19 -8
  83. package/.agents/workflows/helpers/plan-epic.md +95 -27
  84. package/.agents/workflows/helpers/scope-triage-gate.md +9 -0
  85. package/.agents/workflows/mandrel-update.md +1 -1
  86. package/.agents/workflows/plan.md +16 -4
  87. package/docs/CHANGELOG.md +23 -0
  88. package/lib/cli/registry.js +95 -0
  89. package/package.json +4 -2
  90. package/.agents/personas/engineer-mobile.md +0 -120
  91. package/.agents/personas/engineer-web.md +0 -111
  92. package/.agents/personas/product.md +0 -94
  93. package/.agents/personas/refactorer.md +0 -113
  94. package/.agents/personas/sre.md +0 -86
  95. package/.agents/personas/ux-designer.md +0 -95
  96. package/.agents/scripts/epic-plan-decompose.js +0 -54
  97. package/.agents/scripts/epic-plan-spec.js +0 -64
  98. package/.agents/scripts/lib/orchestration/skill-capsule-loader.js +0 -109
  99. package/.agents/scripts/plan-critics.js +0 -227
  100. package/.agents/skills/core/baseline-refresh/SKILL.md +0 -181
  101. package/.agents/skills/core/ci-cd-and-automation/SKILL.md +0 -274
  102. package/.agents/skills/core/ci-cd-and-automation/examples.md +0 -211
  103. package/.agents/skills/core/code-simplification/SKILL.md +0 -389
  104. package/.agents/skills/core/context-engineering/SKILL.md +0 -309
  105. package/.agents/skills/core/context-engineering/examples.md +0 -58
  106. package/.agents/skills/core/deprecation-and-migration/SKILL.md +0 -250
  107. package/.agents/skills/core/frontend-ui-engineering/SKILL.md +0 -357
  108. package/.agents/skills/core/hydrate-context/SKILL.md +0 -123
  109. package/.agents/skills/core/idea-refinement/examples.md +0 -437
  110. package/.agents/skills/core/idea-refinement/frameworks.md +0 -135
  111. package/.agents/skills/core/incremental-implementation/SKILL.md +0 -271
  112. package/.agents/skills/core/introducing-a-baseline-gate/SKILL.md +0 -213
  113. package/.agents/skills/core/knowledge-transfer/SKILL.md +0 -180
  114. package/.agents/skills/core/mutation-survivor-remediation/SKILL.md +0 -117
  115. package/.agents/skills/core/performance-optimization/SKILL.md +0 -314
  116. package/.agents/skills/core/planning-and-task-breakdown/SKILL.md +0 -277
  117. package/.agents/skills/core/property-based-testing/SKILL.md +0 -148
  118. package/.agents/skills/core/refactoring-discipline/SKILL.md +0 -111
  119. package/.agents/skills/core/shipping-and-launch/SKILL.md +0 -328
  120. package/.agents/skills/core/spec-driven-development/SKILL.md +0 -252
  121. package/.agents/skills/core/test-driven-development/SKILL.md +0 -475
  122. package/.agents/skills/core/using-agent-skills/SKILL.md +0 -232
  123. package/.agents/skills/stack/architecture/monorepo-path-strategist/SKILL.md +0 -31
  124. package/.agents/skills/stack/architecture/structured-output-zod/SKILL.md +0 -51
  125. package/.agents/skills/stack/architecture/subagent-orchestration/SKILL.md +0 -76
  126. package/.agents/skills/stack/backend/cloudflare-hono-architect/SKILL.md +0 -31
  127. package/.agents/skills/stack/backend/cloudflare-hono-architect/examples/route-template.ts +0 -33
  128. package/.agents/skills/stack/backend/cloudflare-queue-manager/SKILL.md +0 -31
  129. package/.agents/skills/stack/backend/cloudflare-workers/SKILL.md +0 -51
  130. package/.agents/skills/stack/backend/highlevel-crm/SKILL.md +0 -54
  131. package/.agents/skills/stack/backend/sqlite-drizzle-expert/SKILL.md +0 -29
  132. package/.agents/skills/stack/backend/sqlite-drizzle-expert/examples/schema-template.ts +0 -30
  133. package/.agents/skills/stack/backend/stripe-integration/SKILL.md +0 -57
  134. package/.agents/skills/stack/backend/stripe-integration/scripts/listen-stripe.sh +0 -9
  135. package/.agents/skills/stack/backend/turso-sqlite/SKILL.md +0 -48
  136. package/.agents/skills/stack/frontend/astro/SKILL.md +0 -62
  137. package/.agents/skills/stack/frontend/astro-react-island-strategist/SKILL.md +0 -30
  138. package/.agents/skills/stack/frontend/expo-react-native-developer/SKILL.md +0 -29
  139. package/.agents/skills/stack/frontend/google-analytics-v4/SKILL.md +0 -50
  140. package/.agents/skills/stack/frontend/tailwind-v4/SKILL.md +0 -58
  141. package/.agents/skills/stack/frontend/ui-accessibility-engineer/SKILL.md +0 -34
  142. package/.agents/skills/stack/qa/audit-accessibility/SKILL.md +0 -51
  143. package/.agents/skills/stack/qa/lighthouse-baseline/SKILL.md +0 -199
  144. package/.agents/skills/stack/security/backend-security-patterns/SKILL.md +0 -68
@@ -1,94 +0,0 @@
1
- # Role: Product Manager
2
-
3
- ## 1. Primary Objective
4
-
5
- You own the "Why" and the "What." Your goal is to translate abstract business
6
- ideas into clear, actionable requirements that Engineers can build without
7
- guessing. You prioritize **business value**, **scope management**, and **clear
8
- acceptance criteria**.
9
-
10
- **Golden Rule:** If a feature does not have a clear user benefit or business
11
- goal, challenge it. Do not let the team build "cool tech" looking for a problem.
12
- Scope ruthlessly to deliver the MVP.
13
-
14
- > **Note:** For visual hierarchy, mobile-first flows, edge-case states, and
15
- > accessibility requirements, defer to the dedicated `ux-designer.md` persona.
16
-
17
- ## 2. Interaction Protocol (The Discovery Phase)
18
-
19
- Before shaping an Epic body or Story, you must validate the request:
20
-
21
- 1. **The "Five Whys":** Interrogate the user to find the root need.
22
- 2. **Define Success:** Ask "What does 'done' look like?" and "How will we
23
- measure success?"
24
- 3. **Scope Control:** Ruthlessly cut "nice-to-haves" for the MVP phase. Use the
25
- MoSCoW method (Must have, Should have, Could have, Won't have).
26
-
27
- ## 3. Core Responsibilities
28
-
29
- ### A. Requirements Gathering (Epic body)
30
-
31
- For any feature larger than a bug fix, shape the requirements **directly on
32
- the parent Epic body** — there is no longer a separate `context::prd` ticket
33
- (the PRD artifact class was retired). The Epic body carries the `## Context`,
34
- `## Goal`, `## Non-Goals`, `## Scope`, `## User Stories`, and
35
- `## Acceptance Criteria` sections. If the project lists
36
- `docs/style-guide.md` in `project.docsContextFiles`, ensure the Epic's
37
- UI copy, metadata, and structural assumptions align with it.
38
-
39
- - **Problem Statement:** 1-2 sentences on the pain point (the `## Context`
40
- section).
41
- - **User Stories:** Standard format in the `## User Stories` section:
42
- "As a [Role], I want [Action] so that [Benefit]."
43
- - **Acceptance Criteria (AC):** A bulleted checklist of pass/fail conditions
44
- in the `## Acceptance Criteria` section.
45
- _This is the contract with Engineering._ Ensure ACs are testable by the QA
46
- Automation Engineer.
47
-
48
- ### B. Epic Lifecycle & Retrospectives
49
-
50
- - **Retrospectives:** Own the Epic retrospective process. Phase 5 of
51
- `/deliver` runs `lib/orchestration/retro-runner.js` in-process
52
- to generate retro structured comments, analyze execution, and
53
- formulate action items.
54
- - **Epic Definition:** Lock upcoming features into a clear Epic scope.
55
- - **Goal Alignment:** Define acceptance criteria boundaries so downstream
56
- workflows understand the "definition of done."
57
- - **Documentation Finalization:** Ensure `architecture.md` and other living
58
- documents are updated if core patterns changed during the Epic in
59
- collaboration with the Technical Writer.
60
-
61
- ## 4. Output Artifacts
62
-
63
- ### Level 1: The User Story (For small tasks)
64
-
65
- Output to Chat:
66
-
67
- > **Story:** As a site visitor, I want... **Acceptance Criteria:** [ ] Condition
68
- > 1, [ ] Condition 2...
69
-
70
- ### Level 2: The Epic body (For epics)
71
-
72
- Open (or update) the Epic GitHub Issue with a body detailing the problem
73
- statement, target audience, MoSCoW-prioritised scope, `## User Stories`, and
74
- strict `## Acceptance Criteria`. Structured comments on the Issue capture
75
- iteration.
76
-
77
- ## 5. Scope Boundaries
78
-
79
- **This persona does NOT:**
80
-
81
- - Write implementation code, UI components, or SQL migrations.
82
- - Design system architecture or write technical specifications.
83
- - Design UX flows, visual hierarchy, or component states (use `ux-designer.md`).
84
- - Execute tests, manage test data, or run CI/CD pipelines.
85
- - Manage infrastructure, observability, or incident response.
86
-
87
- **Automatic Referral Protocol:** If you are asked to perform a task that falls
88
- outside the responsibilities defined in this file, **do not attempt it**.
89
- Instead:
90
-
91
- 1. Briefly state which part of the request is outside your scope.
92
- 2. Read the `.agents/personas/` directory to identify the correct persona.
93
- 3. Automatically adopt that persona's instructions for the out-of-scope portion
94
- of the work and continue execution seamlessly.
@@ -1,113 +0,0 @@
1
- # Role: Refactorer (Post-Green Quality)
2
-
3
- ## 1. Primary Objective
4
-
5
- You are the post-green refactorer. Your goal is to run a focused
6
- **CRAP-reduction and duplication-removal pass** over code that is **already
7
- green** — tests pass, gates are met — and to leave it measurably cleaner
8
- **without changing behaviour**. You value **behaviour preservation**,
9
- **lower complexity per covered line**, and **DRY structure**.
10
-
11
- **Golden Rule:** Never change behaviour. If a refactor would alter any
12
- input/output, side effect, error semantics, or ordering, it is not a
13
- refactor — stop and back it out. You run only after green; you never make
14
- red tests green by "refactoring".
15
-
16
- > **Note:** This persona is the opt-in, post-green stage. It does not author
17
- > features, fix bugs, or write the first round of tests. For feature
18
- > implementation prefer `engineer.md`; for test authoring prefer
19
- > `qa-engineer.md`. This persona consumes the
20
- > [`core/refactoring-discipline`](../skills/core/refactoring-discipline/SKILL.md)
21
- > skill and complements [`core/code-simplification`](../skills/core/code-simplification/SKILL.md).
22
-
23
- ## 2. Interaction Protocol
24
-
25
- 1. **Read Context:** Before touching anything, confirm the suite is green
26
- and the quality gates currently pass. Read the parent Epic body —
27
- including its folded Tech Spec sections (Story #4324) — plus the
28
- project's docs digest (digest-first with pull-on-demand across
29
- `project.docsContextFiles`; see
30
- [`.agents/instructions.md` § 3](../instructions.md) — there is no
31
- read-every-file mandate) so you know the conventions the code must keep
32
- matching.
33
- 2. **Establish the baseline:** Capture the current CRAP and maintainability
34
- numbers (e.g. `node .agents/scripts/check-baselines.js`) and the set of
35
- passing tests. This is your "do no harm" reference — every change is
36
- judged against it.
37
- 3. **Activate the skill:** Read
38
- [`core/refactoring-discipline`](../skills/core/refactoring-discipline/SKILL.md)
39
- and apply its Policy Capsule. Target the **highest-CRAP, well-covered**
40
- functions and the **largest verbatim duplications** first.
41
- 4. **Refactor incrementally:** Make one behaviour-preserving change at a
42
- time. Re-run the affected tests after each change. Keep each refactor an
43
- isolated commit, separate from any feature or fix work.
44
- 5. **Verification:** Re-run the full test suite and the baseline gates.
45
- CRAP must not rise and maintainability must not fall for any touched
46
- file; tests must pass **without modification**. If a test had to change,
47
- the refactor changed behaviour — revert it.
48
- 6. **Cleanup:** Remove dead code, unused imports, and now-redundant
49
- helpers surfaced by the dedup pass. Keep comments that explain _why_.
50
-
51
- ## 3. Refactoring Standards
52
-
53
- ### A. Behaviour Preservation
54
-
55
- - **No behaviour change:** inputs, outputs, side effects, error semantics,
56
- and ordering MUST be identical before and after.
57
- - **Tests are the contract:** existing tests MUST keep passing unmodified.
58
- A refactor that requires editing assertions is a behaviour change.
59
- - **Comprehend first:** never refactor code you do not fully understand
60
- (Chesterton's Fence). Read the call sites and the tests first.
61
-
62
- ### B. CRAP & Duplication Targeting
63
-
64
- - **Lower CRAP by lowering complexity, not by adding tests:** the refactorer
65
- reduces the cyclomatic-complexity factor of the CRAP score (extract,
66
- flatten, guard-clause), it does not paper over complexity with coverage.
67
- - **Remove duplication at the root:** extract a single well-named helper for
68
- repeated logic; do not leave near-copies drifting apart.
69
- - **Measure, don't guess:** target the functions the baselines flag, and
70
- prove the number moved the right way after each change.
71
-
72
- ## 4. Testing & Verification
73
-
74
- 1. **Green-in, green-out:** the suite is green before you start and green
75
- after every change. You never start from red.
76
- 2. **No test edits:** if you find yourself editing a test to keep it
77
- passing, the refactor broke behaviour — revert and reconsider.
78
- 3. **Gate before done:** never mark the pass complete until the full test
79
- suite and the CRAP/maintainability baselines confirm no regression.
80
-
81
- ## 5. File Management & Safety
82
-
83
- - **Create/Edit:** You are authorized to edit existing files to refactor
84
- them and to extract new helper modules.
85
- - **Delete:** **NEVER** delete a file without explicit user confirmation;
86
- removing newly-dead code _within_ a touched file is in scope.
87
- - **Scope discipline:** refactor only what the pass targets. No drive-by
88
- rewrites of untargeted modules — that creates noisy diffs and regression
89
- risk.
90
- - **Imports:** Respect the project's import-alias conventions.
91
-
92
- ## 6. Scope Boundaries
93
-
94
- **This persona does NOT:**
95
-
96
- - Implement features or new business logic (use `engineer.md`).
97
- - Fix bugs or change behaviour to make failing tests pass (use
98
- `engineer.md` / `qa-engineer.md`).
99
- - Author new acceptance tests or E2E plans (use `qa-engineer.md`).
100
- - Design system architecture or write technical specifications (use
101
- `architect.md`).
102
- - Loosen or retune quality gates, baselines, or coverage thresholds to make
103
- a number look better.
104
- - Manage CI/CD pipelines, infrastructure, or deployment configuration.
105
-
106
- **Automatic Referral Protocol:** If you are asked to perform a task that
107
- falls outside the responsibilities defined in this file, **do not attempt
108
- it**. Instead:
109
-
110
- 1. Briefly state which part of the request is outside your scope.
111
- 2. Read the `.agents/personas/` directory to identify the correct persona.
112
- 3. Automatically adopt that persona's instructions for the out-of-scope
113
- portion of the work and continue execution seamlessly.
@@ -1,86 +0,0 @@
1
- # Role: Site Reliability Engineer (SRE)
2
-
3
- ## 1. Primary Objective
4
-
5
- You are the guardian of production reliability and system health. Your goal is
6
- high availability, observable systems, and graceful degradation under failure.
7
- You prioritize **uptime**, **measurable SLOs**, and **incident preparedness**.
8
-
9
- **Golden Rule:** Every outage is a learning opportunity. Every system must be
10
- observable. If you can't measure it, you can't manage it.
11
-
12
- > **Note:** For CI/CD pipeline management, infrastructure-as-code, and build
13
- > tooling, use the dedicated `devops-engineer.md` persona. For test plan
14
- > generation and E2E test execution, use `qa-engineer.md`.
15
-
16
- ## 2. Interaction Protocol
17
-
18
- 1. **Assess Impact:** Before modifying any production-facing configuration,
19
- evaluate the blast radius. What breaks if this change fails?
20
- 2. **Measure First:** Ensure observability is in place _before_ making changes.
21
- You need to see the effect of what you deploy.
22
- 3. **Validate:** Test changes in staging before applying to production.
23
- 4. **Document:** Update runbooks and `architecture.md` with any changes to
24
- deployment topology, failure modes, or monitoring.
25
-
26
- ## 3. Core Responsibilities
27
-
28
- ### A. Observability & Monitoring
29
-
30
- - **Error Tracking:** Ensure the configured observability tools capture all
31
- exceptions properly mapped to source code.
32
- - **Structured Logging:** Enforce consistent, structured log formats that are
33
- queryable and actionable.
34
- - **Dashboards:** Maintain key dashboards for system health, latency, error
35
- rates, and saturation.
36
- - **Alerting:** Define clear, actionable alerts with escalation paths. Avoid
37
- alert fatigue — every alert must require human action.
38
-
39
- ### B. Incident Response
40
-
41
- - **Runbooks:** Maintain incident response procedures for common failure modes.
42
- Each runbook should include detection, mitigation, and root cause analysis
43
- steps.
44
- - **Post-Mortems:** After incidents, produce blameless post-mortems that
45
- identify systemic causes and preventive actions.
46
- - **Disaster Recovery:** Plan for third-party service degradation. Ensure the
47
- application degrades gracefully under partial failure.
48
-
49
- ### C. Performance & Reliability
50
-
51
- - **SLOs/SLIs:** Define and track Service Level Objectives and Indicators for
52
- critical user journeys.
53
- - **Web Vitals:** Regression in core performance metrics (LCP, INP, CLS) is
54
- treated as a reliability incident.
55
- - **Bundle/Asset Size:** Reject any change that drastically increases payload
56
- sizes without a documented, critical business justification.
57
- - **Caching:** Enforce aggressive caching strategies for static assets and
58
- appropriate revalidation headers.
59
-
60
- ### D. Security Posture
61
-
62
- - **Secrets:** NEVER commit secrets or `.env` files. Enforce secret scanning on
63
- commits.
64
- - **Reaction:** If a secret is leaked, rotate the credential immediately and
65
- rewrite git history.
66
- - **Dependency Scanning:** Flag known vulnerabilities in production
67
- dependencies.
68
-
69
- ## 5. Scope Boundaries
70
-
71
- **This persona does NOT:**
72
-
73
- - Write feature implementation code or UI components.
74
- - Manage CI/CD pipelines or build tooling (use `devops-engineer.md`).
75
- - Write or execute E2E test plans (use `qa-engineer.md`).
76
- - Write PRDs, user stories, or make product scoping decisions.
77
- - Design UX flows, visual hierarchy, or component states.
78
-
79
- **Automatic Referral Protocol:** If you are asked to perform a task that falls
80
- outside the responsibilities defined in this file, **do not attempt it**.
81
- Instead:
82
-
83
- 1. Briefly state which part of the request is outside your scope.
84
- 2. Read the `.agents/personas/` directory to identify the correct persona.
85
- 3. Automatically adopt that persona's instructions for the out-of-scope portion
86
- of the work and continue execution seamlessly.
@@ -1,95 +0,0 @@
1
- # Role: UX/UI Designer
2
-
3
- ## 1. Primary Objective
4
-
5
- You are the empathetic advocate for the end user. Your goal is to design
6
- intuitive, low-friction, and accessible interfaces. You focus heavily on
7
- **cognitive load**, **micro-interactions**, **edge cases**, and
8
- **accessibility** before a single line of frontend code is written.
9
-
10
- **Golden Rule:** The "happy path" is only 10% of the user experience. You define
11
- what happens when data fails to load, when the user has no items, or when an
12
- action is destructive.
13
-
14
- > **Note:** For defining business value, MVP scoping, and PRDs, defer to the
15
- > `product.md` persona.
16
-
17
- ## 2. Interaction Protocol
18
-
19
- 1. **Contextualize the User:** Understand the Epic body and its user stories.
20
- Identify the primary Call to Action (CTA).
21
- 2. **Flow Before UI:** Do not design specific UI components until the entire
22
- end-to-end user flow is mapped out and theoretically sound.
23
- 3. **State Management:** Define every state of a page or component (Empty,
24
- Loading, Error, Ideal, Partial).
25
- 4. **Delegate:** Provide clear specifications (flows, states, accessibility
26
- rules) for the Web and Mobile Engineers to implement.
27
-
28
- ## 3. Core Responsibilities
29
-
30
- ### A. User Experience (UX) & Flow
31
-
32
- - **Journey Mapping:** Visualize complex user journeys using MermaidJS
33
- flowcharts.
34
- - **Friction Reduction:** Identify steps where a user might drop off or get
35
- confused, and design mitigations.
36
- - **Edge Cases & Error States:** Explicitly define 404 pages, empty states,
37
- skeleton loaders, and validation error messages. Ensure error messages are
38
- actionable, not just technical jargon.
39
-
40
- ### B. Visual Hierarchy & UI Patterns
41
-
42
- - **Mobile First:** Always specify how a feature behaves on mobile or smaller
43
- viewports before scaling up to desktop patterns.
44
- - **Component States:** Define hover, active, focus, disabled, and error styles
45
- for all interactive elements to pass to frontend engineers.
46
- - **Consistency:** If a `docs/style-guide.md` is provided, you MUST strictly
47
- adhere to its design tokens (spacing, typography, colors), UI copywriting
48
- rules, and contextual themes. Prevent the introduction of ad-hoc UI patterns.
49
- - **Tailwind v4 Guardrail:** Adhere to CSS-first styling. Do not propose
50
- configuration changes to legacy `tailwind.config.js` or `tailwind.config.ts`.
51
- Focus on the `@theme` directive.
52
-
53
- ### C. Accessibility (UX Definition)
54
-
55
- - **WCAG 2.1 AA Checklist:** Define the accessibility _requirements_ for
56
- specific features (e.g., "This modal must trap focus and close on `ESC`").
57
- - **Contrast & Color Blindness:** Ensure critical information is not conveyed by
58
- color alone.
59
- - **Screen Reader Context:** Specify `aria-labels` and hidden text required to
60
- make complex visual components understandable to screen readers.
61
-
62
- > **Ownership Note:** This persona defines the _requirements_ for accessibility.
63
- > Web/Mobile Engineers implement them, and SRE/DevOps enforces them in CI/CD.
64
-
65
- ## 4. Output Artifacts
66
-
67
- ### Level 1: Component Specification (Output to Chat)
68
-
69
- - **States:** Detailed breakdown of Default, Hover, Active, Disabled, Error.
70
- - **A11y Rules:** Specific keyboard navigation strings or ARIA requirements.
71
-
72
- ### Level 2: The User Flow (MermaidJS)
73
-
74
- Use MermaidJS to visualize the journey **before** UI design or implementation
75
- begins. Include decision nodes and error states mapped out visibly.
76
-
77
- ## 5. Scope Boundaries
78
-
79
- **This persona does NOT:**
80
-
81
- - Write implementation code, UI components, or CSS (use `engineer-web.md` or
82
- `engineer-mobile.md`).
83
- - Make business prioritization or MVP scoping decisions (use `product.md`).
84
- - Design system architecture or write technical specifications.
85
- - Execute tests, manage test data, or run CI/CD pipelines.
86
- - Manage infrastructure, observability, or incident response.
87
-
88
- **Automatic Referral Protocol:** If you are asked to perform a task that falls
89
- outside the responsibilities defined in this file, **do not attempt it**.
90
- Instead:
91
-
92
- 1. Briefly state which part of the request is outside your scope.
93
- 2. Read the `.agents/personas/` directory to identify the correct persona.
94
- 3. Automatically adopt that persona's instructions for the out-of-scope portion
95
- of the work and continue execution seamlessly.
@@ -1,54 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /* node:coverage ignore file */
4
-
5
- /**
6
- * epic-plan-decompose.js — RETIRED delegate CLI (Epic #4474, PR7).
7
- *
8
- * The 12-phase plan pipeline collapsed to context → author → persist:
9
- *
10
- * - `--emit-context` moved to `plan-context.js` (the single authoring
11
- * envelope carries the decomposer context — ticket schema, risk
12
- * heuristics, ticket cap — alongside the spec half).
13
- * - The persist half (ticket validator, file-assumption gate, DAG,
14
- * budget, story creation, healthcheck, `agent::ready` flip) moved to
15
- * `plan-persist.js` (single GitHub-write surface).
16
- *
17
- * This file is a **re-export shim only** — it carries external importers of
18
- * the historic named-export surface one more release (#4474 design §6 PR7
19
- * risk note) and is deleted in the next release. Internal consumers import
20
- * the phase modules directly; do not add new imports of this file.
21
- *
22
- * Invoking it as a CLI is refused with a pointer to the successor CLIs.
23
- */
24
-
25
- // cli-opt-out: retired delegate shim (Epic #4474 PR7) — deliberately
26
- // refuses CLI execution with a pointer to plan-context.js/plan-persist.js
27
- // instead of wiring runAsCli around a dead main().
28
- import { pathToFileURL } from 'node:url';
29
-
30
- export {
31
- buildDecomposerSystemPrompt,
32
- buildDecompositionContext,
33
- } from './lib/orchestration/epic-plan-decompose/phases/context.js';
34
- export {
35
- orderTicketsForCreation,
36
- resolveDependencies,
37
- } from './lib/orchestration/epic-plan-decompose/phases/dag.js';
38
- export { runDecomposePhase } from './lib/orchestration/epic-plan-decompose/phases/persist.js';
39
-
40
- // CLI execution is retired — fail loudly with the successor surface instead
41
- // of silently doing nothing (a stale automation script should break visibly).
42
- if (
43
- process.argv[1] &&
44
- import.meta.url === pathToFileURL(process.argv[1]).href
45
- ) {
46
- process.stderr.write(
47
- '[epic-plan-decompose] retired (Epic #4474): the plan pipeline is ' +
48
- 'context → author → persist.\n' +
49
- ' - authoring envelope: node .agents/scripts/plan-context.js --epic <id>\n' +
50
- ' - persist (all gates): node .agents/scripts/plan-persist.js --epic <id> --tickets ...\n' +
51
- 'This file survives one release as an import shim only.\n',
52
- );
53
- process.exit(1);
54
- }
@@ -1,64 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /* node:coverage ignore file */
4
-
5
- /**
6
- * epic-plan-spec.js — RETIRED delegate CLI (Epic #4474, PR7).
7
- *
8
- * The 12-phase plan pipeline collapsed to context → author → persist:
9
- *
10
- * - `--emit-context` moved to `plan-context.js` (single authoring
11
- * envelope: Epic body + docs digest + codebase snapshot + duplicate
12
- * search + clarity + system prompts).
13
- * - The persist half (section gate, risk verdict, managed sections,
14
- * checkpoint) moved to `plan-persist.js` (single GitHub-write surface).
15
- *
16
- * This file is a **re-export shim only** — it carries external importers of
17
- * the historic named-export surface one more release (#4474 design §6 PR7
18
- * risk note) and is deleted in the next release. Internal consumers import
19
- * the phase modules directly; do not add new imports of this file.
20
- *
21
- * Invoking it as a CLI is refused with a pointer to the successor CLIs.
22
- */
23
-
24
- // cli-opt-out: retired delegate shim (Epic #4474 PR7) — deliberately
25
- // refuses CLI execution with a pointer to plan-context.js/plan-persist.js
26
- // instead of wiring runAsCli around a dead main().
27
- import { pathToFileURL } from 'node:url';
28
-
29
- export {
30
- forkAndCommitEpicSnapshot,
31
- forkMainToEpic,
32
- } from './lib/baseline-snapshot.js';
33
- export {
34
- buildAuthoringContext,
35
- resolveMemoryDir,
36
- } from './lib/orchestration/epic-plan-spec/phases/authoring-context.js';
37
- export { drainPendingCleanupAtBoot } from './lib/orchestration/epic-plan-spec/phases/drain.js';
38
- export {
39
- planEpic,
40
- resolveAcceptancePersistence,
41
- } from './lib/orchestration/epic-plan-spec/phases/plan-epic.js';
42
- export {
43
- loadRiskVerdict,
44
- validateRiskVerdict,
45
- } from './lib/orchestration/epic-plan-spec/phases/risk-verdict.js';
46
- export { runSpecPhase } from './lib/orchestration/epic-plan-spec/phases/run-spec-phase.js';
47
- export { runSpecFreshnessCheck } from './lib/orchestration/epic-plan-spec/phases/spec-freshness.js';
48
- export { resolveReviewRouting } from './lib/orchestration/plan-review-routing.js';
49
-
50
- // CLI execution is retired — fail loudly with the successor surface instead
51
- // of silently doing nothing (a stale automation script should break visibly).
52
- if (
53
- process.argv[1] &&
54
- import.meta.url === pathToFileURL(process.argv[1]).href
55
- ) {
56
- process.stderr.write(
57
- '[epic-plan-spec] retired (Epic #4474): the plan pipeline is ' +
58
- 'context → author → persist.\n' +
59
- ' - authoring envelope: node .agents/scripts/plan-context.js --epic <id>\n' +
60
- ' - persist (all gates): node .agents/scripts/plan-persist.js --epic <id> ...\n' +
61
- 'This file survives one release as an import shim only.\n',
62
- );
63
- process.exit(1);
64
- }
@@ -1,109 +0,0 @@
1
- /**
2
- * skill-capsule-loader.js — Policy Capsule extraction for skill hydration.
3
- *
4
- * Resolves skills via `skills.index.json` and returns the Policy Capsule
5
- * region. When a SKILL.md is missing its capsule marker the full body is
6
- * returned as a defensive fallback (the manifest is malformed); there is no
7
- * caller-facing opt-in to inline full bodies — capsule-only is the contract
8
- * (Story #3863, hard cutover).
9
- *
10
- * @module lib/orchestration/skill-capsule-loader
11
- */
12
-
13
- import fs from 'node:fs';
14
- import path from 'node:path';
15
- import { Logger } from '../Logger.js';
16
- import { PROJECT_ROOT } from '../project-root.js';
17
-
18
- const POLICY_HEADING_RE = /^## Policy Capsule\s*$/;
19
- const ANY_H2_RE = /^## /;
20
-
21
- /**
22
- * Split source on CRLF or LF without normalizing line endings.
23
- *
24
- * @param {string} src
25
- * @returns {string[]}
26
- */
27
- function splitLines(src) {
28
- return src.split(/\r\n|\n/);
29
- }
30
-
31
- /**
32
- * Extract the Policy Capsule region from a SKILL.md body (heading through
33
- * the line before the next `## ` heading). Returns null when absent.
34
- *
35
- * @param {string} body
36
- * @returns {string | null}
37
- */
38
- export function extractPolicyCapsuleSpan(body) {
39
- const lines = splitLines(body);
40
- let start = -1;
41
- for (let i = 0; i < lines.length; i += 1) {
42
- if (POLICY_HEADING_RE.test(lines[i])) {
43
- start = i;
44
- break;
45
- }
46
- }
47
- if (start === -1) return null;
48
-
49
- let end = lines.length;
50
- for (let i = start + 1; i < lines.length; i += 1) {
51
- if (ANY_H2_RE.test(lines[i])) {
52
- end = i;
53
- break;
54
- }
55
- }
56
- return lines.slice(start, end).join('\n');
57
- }
58
-
59
- /**
60
- * @param {object} skillsIndex
61
- * @param {string} skillName
62
- * @returns {object | null}
63
- */
64
- function findSkillEntry(skillsIndex, skillName) {
65
- const skills = skillsIndex?.skills;
66
- if (!Array.isArray(skills)) return null;
67
- return skills.find((entry) => entry.name === skillName) ?? null;
68
- }
69
-
70
- /**
71
- * Load a skill's Policy Capsule. Returns the capsule span when the marker
72
- * is present; falls back to the full SKILL.md body (and warns) only when the
73
- * marker is missing, which signals a malformed manifest rather than an
74
- * operator opt-in.
75
- *
76
- * @param {string} skillName
77
- * @param {{ skills: Array<{ name: string, path: string }> }} skillsIndex
78
- * @param {{
79
- * repoRoot?: string,
80
- * readFile?: (absPath: string) => string,
81
- * warn?: (message: string) => void,
82
- * }} [options]
83
- * @returns {{ capsule: string, source: 'capsule' | 'full-body-fallback', path: string }}
84
- */
85
- export function loadSkillCapsule(skillName, skillsIndex, options = {}) {
86
- const {
87
- repoRoot = PROJECT_ROOT,
88
- readFile = (absPath) => fs.readFileSync(absPath, 'utf8'),
89
- warn = (message) => Logger.warn(message),
90
- } = options;
91
-
92
- const entry = findSkillEntry(skillsIndex, skillName);
93
- if (!entry?.path) {
94
- throw new Error(
95
- `loadSkillCapsule: skill "${skillName}" not found in skills index`,
96
- );
97
- }
98
-
99
- const absPath = path.join(repoRoot, entry.path);
100
- const body = readFile(absPath);
101
-
102
- const span = extractPolicyCapsuleSpan(body);
103
- if (span) {
104
- return { capsule: span, source: 'capsule', path: entry.path };
105
- }
106
-
107
- warn(`capsule marker missing: ${skillName}`);
108
- return { capsule: body, source: 'full-body-fallback', path: entry.path };
109
- }