@rudinmax87/united-we-stand 0.1.2 → 0.2.1

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 (46) hide show
  1. package/.united-we-stand/README.md +19 -14
  2. package/.united-we-stand/agents/1-initializer.md +3 -1
  3. package/.united-we-stand/agents/2-planner.md +4 -0
  4. package/.united-we-stand/agents/3-designer.md +2 -0
  5. package/.united-we-stand/agents/4-implementer.md +4 -2
  6. package/.united-we-stand/agents/5-code-reviewer.md +16 -2
  7. package/.united-we-stand/agents/accessibility-reviewer.md +4 -1
  8. package/.united-we-stand/agents/optimizer.md +53 -0
  9. package/.united-we-stand/agents-md-block.md +5 -3
  10. package/.united-we-stand/antigravity-workflow.md +2 -2
  11. package/.united-we-stand/copilot-instructions.md +2 -2
  12. package/.united-we-stand/cursor-rule.mdc +2 -2
  13. package/.united-we-stand/framework/00-index.md +4 -0
  14. package/.united-we-stand/framework/01-core-rules.md +9 -6
  15. package/.united-we-stand/framework/04-command-routing.md +16 -12
  16. package/.united-we-stand/framework/06-spec-writing-standard.md +7 -0
  17. package/.united-we-stand/framework/07-definition-of-done.md +10 -6
  18. package/.united-we-stand/framework/08-skip-force-policy.md +7 -7
  19. package/.united-we-stand/framework/10-review-model.md +20 -3
  20. package/.united-we-stand/framework/12-react-frontend-review-checklist.md +97 -0
  21. package/.united-we-stand/framework/13-vulnerability-audit-matrix.md +54 -0
  22. package/.united-we-stand/framework/profiles/csharp.md +2 -0
  23. package/.united-we-stand/framework/profiles/go.md +2 -1
  24. package/.united-we-stand/framework/profiles/java.md +2 -1
  25. package/.united-we-stand/framework/profiles/javascript-typescript.md +8 -5
  26. package/.united-we-stand/framework/profiles/php.md +2 -0
  27. package/.united-we-stand/framework/profiles/python.md +2 -1
  28. package/.united-we-stand/framework/profiles/ruby.md +2 -0
  29. package/.united-we-stand/framework/profiles/rust.md +2 -1
  30. package/.united-we-stand/framework/profiles/web-app.md +4 -1
  31. package/.united-we-stand/spec-driven/branch-template/01-init.md +3 -0
  32. package/.united-we-stand/spec-driven/branch-template/02-plan.md +3 -0
  33. package/.united-we-stand/spec-driven/branch-template/03-design.md +4 -1
  34. package/.united-we-stand/spec-driven/branch-template/05-code-review.md +13 -1
  35. package/PACKAGE-PUBLISHING.md +403 -0
  36. package/README.md +8 -5
  37. package/dist/commands/branch-init.d.ts.map +1 -1
  38. package/dist/commands/branch-init.js +8 -7
  39. package/dist/commands/branch-init.js.map +1 -1
  40. package/dist/commands/doctor.d.ts.map +1 -1
  41. package/dist/commands/doctor.js +22 -21
  42. package/dist/commands/doctor.js.map +1 -1
  43. package/dist/lib/templates.d.ts.map +1 -1
  44. package/dist/lib/templates.js +1 -0
  45. package/dist/lib/templates.js.map +1 -1
  46. package/package.json +2 -1
@@ -169,11 +169,11 @@ How chat usage works:
169
169
 
170
170
  - if branch memory does not exist yet, explicit initialization prompts should start `1-initializer`
171
171
  - broad start-of-work prompts should also default to `1-initializer` unless you explicitly ask for a later stage
172
- - if branch memory does not exist yet and you ask for direct code changes, the AI should warn that united-we-stand is not initialized and ask whether to proceed outside the framework for the current chat
173
- - once you confirm outside-framework work for the current chat, the AI should not ask that same confirmation again unless you later return to framework mode
172
+ - if branch memory does not exist yet and you ask for direct code changes without explicitly asking to initialize, the AI should continue helping normally and should not interrupt to explain framework setup
173
+ - framework initialization guidance should appear only when you explicitly ask to initialize or explicitly bring up the framework
174
174
  - when initialization is requested, the AI should always do a fresh live check of the current git branch before creating branch memory
175
175
  - it should not reuse an earlier branch check, earlier status output, or remembered branch context from the same chat as the initialization target
176
- - if the current branch is the detected default branch, initialization should warn and ask for confirmation before creating branch memory unless you explicitly use `--force`
176
+ - if the current branch is the detected default branch, any framework write that would create or rewrite branch memory should warn and ask for confirmation first; `--force` does not skip that confirmation
177
177
 
178
178
  The workflow is mainly used in chat after installation:
179
179
 
@@ -194,11 +194,11 @@ After the workflow is initialized, each stage writes or updates its branch file
194
194
  | Stage | File name | General description |
195
195
  |-------|-----------|---------------------|
196
196
  | `0-status-checker` | `00-current-status.md` | Current branch status, blockers, recommended next step, and routing state |
197
- | `1-initializer` | `01-init.md` | Raw idea, scope, assumptions, open questions, and success criteria |
198
- | `2-planner` | `02-plan.md` | Ordered plan, dependencies, risks, and suggested execution order |
199
- | `3-designer` | `03-design.md` | Architecture, interfaces, boundaries, data flow, and design decisions |
197
+ | `1-initializer` | `01-init.md` | Raw idea, scope, assumptions, open questions, success criteria, and early security/dependency concerns |
198
+ | `2-planner` | `02-plan.md` | Ordered plan, dependencies, risks, security/dependency risk handling, and suggested execution order |
199
+ | `3-designer` | `03-design.md` | Architecture, interfaces, boundaries, attack surface, data flow, and design decisions |
200
200
  | `4-implementer` | `04-implementation.md` | What changed in code, validation performed, and remaining gaps |
201
- | `5-code-reviewer` | `05-code-review.md` | Quality, maintainability, security, and review findings |
201
+ | `5-code-reviewer` | `05-code-review.md` | Quality, maintainability, vulnerability, security, optimization, and review findings |
202
202
  | `6-finalizer` | `06-finalization.md` | Final summary, uncaptured changes, doc updates, and closure confirmation |
203
203
 
204
204
  ## Runtime Branch Memory
@@ -244,7 +244,7 @@ The numbered framework stages are:
244
244
  2. `2-planner`: turn initialized intent into an ordered execution plan with dependencies and risks
245
245
  3. `3-designer`: define architecture, interfaces, boundaries, and implementation approach before coding
246
246
  4. `4-implementer`: make the code changes and record what changed plus how it was validated
247
- 5. `5-code-reviewer`: review implementation quality, security, test sufficiency, and remaining issues
247
+ 5. `5-code-reviewer`: review implementation quality, dependency vulnerabilities, injection/attack risks, test sufficiency, and remaining issues
248
248
  6. `6-finalizer`: summarize delivered scope, identify spec/code mismatches or uncaptured changes, ask for explicit user approval, and only then close the workflow with `Current stage = none`
249
249
 
250
250
  ### Proper Order
@@ -288,6 +288,7 @@ Optional framework stages:
288
288
  - if a request could be interpreted as advancing through two or more phases at once, the AI should explain that united-we-stand only runs one stage at a time, suggest the next recommended numbered stage first, and ask the user to confirm one single stage
289
289
  - for branch-scoped work, the AI should stay inside `.spec-driven/<branch-folder>/` by default and update specs first unless you explicitly say otherwise
290
290
  - later stage files should be created when those stages are actually started or explicitly amended
291
+ - if branch memory is created directly into a later stage by explicit user confirmation, the AI should create only that one numbered stage file plus `00-current-status.md` and `state.json`
291
292
  - `4-implementer` is the first framework stage allowed to change code
292
293
  - `6-finalizer` should check for meaningful code/doc changes that were not captured in the specs, ask the user to confirm the final state, and only then close the workflow with `Current stage = none`
293
294
  - if a closed branch receives new work later, the workflow should reopen `6-finalizer` and require final approval again
@@ -333,10 +334,11 @@ The framework is designed to route short natural requests such as `continue`, `f
333
334
  - If you ask for earlier-stage work while the branch is already in a later stage, the AI should perform that work without moving the workflow backward; instead it should mark downstream state as needing refresh in the status metadata.
334
335
  - The most reliable direct NLP bootstrap for initialization is to reference any installed united-we-stand file together with the init request, for example `AGENTS.md initialize this` or `.united-we-stand/README.md init the following`.
335
336
  - If branch memory does not exist yet, an explicit request such as `init the following` or `initialize this` should be treated as permission to create the branch spec and start `1-initializer`.
336
- - If branch memory does not exist yet and the current branch is detected as the repository default branch, explicit init requests should still warn and ask for confirmation before creating `.spec-driven/...` unless you explicitly use `--force`.
337
+ - If the current branch is detected as the repository default branch and the framework would create or rewrite branch memory there, the AI should still warn and ask for confirmation before writing `.spec-driven/...`; `--force` does not skip that confirmation.
337
338
  - If branch memory does not exist yet, broader natural phrases such as `let's start this`, `help me with the following idea, i want...`, `i want to build...`, `i want to create...`, or `let's work on...` should also default to `1-initializer` unless you explicitly ask for a later stage.
338
- - If branch memory does not exist yet and you ask for concrete code changes or other persistent repo work without explicitly asking to initialize the framework, the AI should first warn that united-we-stand is not initialized for that branch and ask whether you want to proceed outside the framework for the current chat.
339
- - If you confirm that outside-framework work is fine, the AI should continue outside the framework for the rest of the current chat without asking for the same confirmation again unless you later ask to initialize or return to framework flow.
339
+ - If branch memory does not exist yet and you explicitly confirm starting from a later stage such as planning, the AI should create only that single numbered stage file for the pass. It should not backfill `01-init.md` in the same response.
340
+ - If branch memory does not exist yet and you ask for concrete code changes or other persistent repo work without explicitly asking to initialize the framework, the AI should continue helping with that request normally and should not interrupt to explain framework setup.
341
+ - In that situation it should not create `.spec-driven/...` files unless you explicitly ask to initialize or explicitly bring up the framework.
340
342
 
341
343
  ## Framework Stage Chat Routes
342
344
 
@@ -407,7 +409,7 @@ Framework-stage routes:
407
409
 
408
410
  These direct route labels select the acting stage behavior. If the workflow is already in a later stage, they must not regress `Current stage`, `Completed steps`, or `Incompleted stages`.
409
411
 
410
- If branch memory does not exist yet and a direct request such as `implement this`, `fix these vulnerabilities`, `upgrade this dependency`, or `refactor this module` would otherwise cause repo changes, the AI should not silently enter that framework stage. It should first warn that united-we-stand is not initialized for the branch and ask whether you want to proceed outside the framework for the current chat.
412
+ If branch memory does not exist yet and a direct request such as `implement this`, `fix these vulnerabilities`, `upgrade this dependency`, or `refactor this module` would otherwise cause repo changes, the AI should not silently enter that framework stage. It should continue helping with the request normally without announcing missing framework setup unless you explicitly ask to initialize or explicitly bring up the framework.
411
413
 
412
414
  Standalone specialist routes:
413
415
 
@@ -416,6 +418,7 @@ Standalone specialist routes:
416
418
  - `manage this project` -> `project-manager`
417
419
  - `refactor this` -> `refactorer`
418
420
  - `plan tests for this` -> `test-strategist`
421
+ - `check optimization` / `review website optimization` -> `optimizer`
419
422
  - `check performance` -> `performance-reviewer`
420
423
  - `check accessibility` -> `accessibility-reviewer`
421
424
  - `write api contracts` -> `api-contract-writer`
@@ -432,6 +435,7 @@ Standalone route examples:
432
435
  - `document this install process`
433
436
  - `refactor this CLI without changing behavior`
434
437
  - `plan tests for this doctor command`
438
+ - `check optimization for this landing page`
435
439
  - `write api contracts for the new endpoint`
436
440
  - `design sql schema for the booking tables`
437
441
  - `create database diagrams for this workflow`
@@ -448,8 +452,9 @@ Standalone agents can be used at any time when the task needs specialized help.
448
452
  - `project-manager`: summarize scope, blockers, milestones, dependencies, and coordination needs
449
453
  - `refactorer`: plan or execute structural improvements while preserving behavior
450
454
  - `test-strategist`: design proportionate test strategy and identify critical test coverage gaps
455
+ - `optimizer`: review website optimization, mobile Lighthouse/PageSpeed risks, startup cost, media delivery, caching, render blockers, LCP discovery, and real-user performance bottlenecks
451
456
  - `performance-reviewer`: review latency, throughput, memory, and performance hotspots
452
- - `accessibility-reviewer`: review accessibility concerns for UI work, including semantics and navigation
457
+ - `accessibility-reviewer`: review accessibility concerns for UI work, including semantics, navigation, accessible control names, and contrast
453
458
  - `api-contract-writer`: define API request/response boundaries, contracts, and field exposure rules
454
459
  - `data-modeler`: design or review schemas, migrations, and data boundaries
455
460
  - `sql-database-designer`: design SQL schemas, migration layout, and required database flowcharts, sequence diagrams, entity-relationship models, and relational models
@@ -473,7 +478,7 @@ Initialize branch memory for the branch you are working on:
473
478
  united-we-stand branch-init "Describe the change you want to make"
474
479
  ```
475
480
 
476
- If you are on the repository default branch, `branch-init` should warn and ask for confirmation before creating branch memory there. This is meant to reduce long-lived workflow state on `main`/`master`-style branches when a feature branch would be safer.
481
+ If you are on the repository default branch, `branch-init` should warn and ask for confirmation before creating or rewriting branch memory there. This confirmation is still required even when `--force` is used. This is meant to reduce long-lived workflow state on `main`/`master`-style branches when a feature branch would be safer.
477
482
 
478
483
  If you are in detached HEAD, provide the branch name explicitly:
479
484
 
@@ -22,12 +22,13 @@ None.
22
22
 
23
23
  - Convert user idea into initial branch definition.
24
24
  - Capture scope boundaries, assumptions, questions, and success criteria.
25
+ - Capture security-sensitive context early when relevant, including risky dependencies, trust boundaries, sensitive data, and likely attack surface.
25
26
  - Capture out-of-scope explicitly to reduce downstream ambiguity.
26
27
  - When initialization is requested, always perform a fresh live check of the current git branch before creating or updating branch memory.
27
28
  - Do not rely on a previous branch check, previous status output, or remembered branch context from earlier in the same chat.
28
29
  - If branch memory does not exist yet and the user explicitly asks to initialize or init the work, create the branch spec for `1-initializer`.
29
30
  - If branch memory does not exist yet and the user uses natural bootstrap language such as `let's start this`, `help me with this idea`, `i want to build...`, or `let's work on...`, treat that as initialization intent by default.
30
- - If the current branch is detected as the repository default branch and branch memory does not exist yet, warn about default-branch risks and ask for confirmation before creating the branch spec unless the user explicitly used `--force` or equivalent force/bypass wording.
31
+ - If the current branch is detected as the repository default branch and framework memory would be written there, warn about default-branch risks and ask for confirmation before creating or rewriting the branch spec. Force or bypass wording does not skip that confirmation.
31
32
  - Do not implement code.
32
33
  - If the user asks to modify initializer content, update `01-init.md` in place and keep `Current stage = 1-initializer` unless the user explicitly advances.
33
34
  - Do not create or populate planning content just because initializer content now looks complete.
@@ -42,6 +43,7 @@ None.
42
43
  - Assumptions
43
44
  - Open questions
44
45
  - Success criteria
46
+ - Security / dependency concerns
45
47
 
46
48
  ## Next-Step Status Rules
47
49
 
@@ -24,6 +24,9 @@ Turn initialized intent into an actionable sequence.
24
24
  - Produce ordered plan, dependencies, and risk visibility.
25
25
  - Define suggested execution order and critical blockers.
26
26
  - Finish the planning step by reviewing and updating the full task list so it captures all work that still needs to be done.
27
+ - Plan for dependency/package risk reduction and identify when later stages must run vulnerability audits or explicit attack-surface reviews.
28
+ - If branch memory does not exist yet and the user explicitly confirms starting from planning, bootstrap only `00-current-status.md`, `state.json`, and `02-plan.md`.
29
+ - When planning is the first explicit stage on a branch, do not auto-create `01-init.md` or any other numbered stage file in the same pass.
27
30
  - Do not implement code.
28
31
  - If code/spec drift is observed, apply canonical conflict policy.
29
32
  - If the user asks to add or modify planning content, update `02-plan.md` in place.
@@ -35,6 +38,7 @@ Turn initialized intent into an actionable sequence.
35
38
  - Objectives
36
39
  - Dependencies
37
40
  - Risks / unknowns
41
+ - Security / dependency risk plan
38
42
  - Suggested execution order
39
43
  - Detailed task list
40
44
  - Status
@@ -23,6 +23,7 @@ Define architecture, boundaries, and implementation approach before coding.
23
23
 
24
24
  - Document architecture and interface decisions.
25
25
  - Define boundaries (security, data exposure, ownership checks) when relevant.
26
+ - Identify attack surface and injection risks when relevant, including XSS, SQL/NoSQL injection, command injection, path traversal, SSRF, CSRF, open redirects, and unsafe deserialization.
26
27
  - Define testing boundaries and observability expectations for non-trivial changes.
27
28
  - Add diagrams/flows when they reduce ambiguity.
28
29
  - For complex integrations (external APIs, databases, third-party services), include explicit sequence/flow diagrams.
@@ -40,6 +41,7 @@ Define architecture, boundaries, and implementation approach before coding.
40
41
  - Key components
41
42
  - Interfaces / data flow
42
43
  - Constraints
44
+ - Security boundaries / attack surface
43
45
  - Design decisions
44
46
  - Diagrams/flows when useful (Mermaid allowed)
45
47
 
@@ -20,19 +20,20 @@ Implement branch changes while preserving traceability and quality.
20
20
 
21
21
  ## Prerequisites
22
22
 
23
- - If branch memory does not exist yet, do not treat the request as automatic entry into `4-implementer`. Warn that united-we-stand is not initialized for the branch and ask whether to proceed outside the framework for the current chat.
23
+ - If branch memory does not exist yet, do not treat the request as automatic entry into `4-implementer`. Continue helping with the implementation request normally unless the user explicitly asks to initialize or explicitly asks for framework-stage behavior.
24
24
  - Step `1-initializer` complete unless explicit bypass/force behavior applies.
25
25
  - If `2-planner`/`3-designer` are missing, warn and get confirmation before direct implementation.
26
26
 
27
27
  ## Behavior
28
28
 
29
29
  - Update specs first when user intent changes.
30
- - If the user confirms outside-framework work because branch memory is missing, continue the rest of that chat outside the framework without re-asking for the same confirmation unless the user later asks to initialize or return to framework flow.
30
+ - If branch memory is missing and the user did not ask to initialize, do not mention missing framework setup or create stage metadata from ordinary implementation requests.
31
31
  - Implement code changes and add/update tests proportionate to risk.
32
32
  - Apply selected profiles (language + project-type) for coding/testing specifics.
33
33
  - Treat `../steering/coding-steering.md` as mandatory for every code change.
34
34
  - Follow repository linting, parser-based analysis, and static-analysis rules during implementation instead of treating them as review-only concerns.
35
35
  - When repo commands or configured tools exist for linting or parser/static-analysis checks, use them during implementation close and fix straightforward violations in the changed scope before considering the implementation ready for review.
36
+ - When the requested work includes a fix, especially a security or dependency fix, re-verify afterward that the project still builds/compiles when applicable, relevant tests still pass when available, and no intended functionality was removed or changed unintentionally.
36
37
  - Add the required file-level/function/block comments from coding steering during implementation instead of leaving them for review cleanup.
37
38
  - Do not leave large multi-responsibility functions behind when they can be split into smaller helpers during the implementation step.
38
39
  - If code/spec drift exists, reconcile using canonical conflict policy.
@@ -46,6 +47,7 @@ Implement branch changes while preserving traceability and quality.
46
47
  - Why it changed
47
48
  - Files touched
48
49
  - Validation and tests executed
50
+ - Post-fix build/compile/runtime verification performed when applicable
49
51
  - Lint/parser/static-analysis checks executed for the changed scope, or an explicit note when such checks were not available
50
52
  - Remaining gaps / follow-ups
51
53
 
@@ -6,12 +6,14 @@
6
6
 
7
7
  ## Purpose
8
8
 
9
- Review implementation for conformance, quality, security, and test sufficiency.
9
+ Review implementation for conformance, quality, security, optimization, and test sufficiency.
10
10
 
11
11
  ## Canonical References
12
12
 
13
13
  - State updates: `../framework/02-state-model.md`
14
14
  - Review model: `../framework/10-review-model.md`
15
+ - React/frontend checklist: `../framework/12-react-frontend-review-checklist.md`
16
+ - Vulnerability audit matrix: `../framework/13-vulnerability-audit-matrix.md`
15
17
  - Conflict policy: `../framework/05-conflict-resolution.md`
16
18
  - Done criteria: `../framework/07-definition-of-done.md`
17
19
  - Profile selection: `../framework/profiles/00-profile-selection.md`
@@ -22,15 +24,24 @@ Review implementation for conformance, quality, security, and test sufficiency.
22
24
 
23
25
  ## Behavior
24
26
 
25
- - By default review both quality and security dimensions.
27
+ - By default review quality, security, and optimization dimensions.
28
+ - Treat optimization as the third default check and apply the standalone `optimizer` checklist when the reviewed scope includes a website, frontend, landing page, or user-facing performance path.
29
+ - For React/frontend scope, apply `12-react-frontend-review-checklist.md` as a manual/static-analysis review lens even when no extra tool is installed.
30
+ - For website/frontend scope, include mobile Lighthouse/PageSpeed-style blockers in the default review, especially cache lifetime issues, image delivery issues, render-blocking requests, LCP breakdown/resource discovery issues, network dependency tree problems, unused JS/CSS, unnamed interactive controls, and insufficient contrast.
31
+ - Do not treat a website review as clean when those issues would predictably keep the first production-like mobile Lighthouse/PageSpeed run below a strong score unless the residual risk is explicitly documented.
32
+ - If optimization is not materially applicable, say so explicitly instead of silently skipping it.
26
33
  - User may request narrower review scope.
27
34
  - Report findings and recommended fixes.
35
+ - Run the proper repo-native vulnerability audit command for the detected stack/package manager whenever a safe no-extra-install command exists, or explicitly state why that audit was unavailable.
36
+ - Report all detected dependency vulnerabilities as high priority in `05-code-review.md`, even when the underlying tool reports a lower severity.
28
37
  - Treat coding-steering violations as real findings, not optional style suggestions.
29
38
  - Flag missing required comments, large multi-responsibility functions, duplicated logic, unused code, and routine SonarQube-style maintainability issues when they are present in reviewed scope.
30
39
  - Run repository linting, parser-based analysis, and static-analysis checks when they are available for the changed stack or package, or explicitly state that they were unavailable or not run.
40
+ - Review code for injection and attack risks when relevant, including XSS, SQL/NoSQL injection, command injection, path traversal, SSRF, CSRF, open redirects, unsafe deserialization, and secret exposure.
31
41
  - Surface the relevant lint/parser/static-analysis observations to the user as part of the review output instead of silently relying on them.
32
42
  - Do not perform implementation rewrites unless user explicitly requests them.
33
43
  - If implementation or design work is requested while review is the current stage, perform the requested earlier-stage work through the appropriate specs/code paths without regressing workflow metadata.
44
+ - If the user asks for fixes from review findings, require post-fix verification of build/compile health, available tests, and functionality preservation before treating the fixes as complete.
34
45
  - If the user asks to modify review notes, update `05-code-review.md` in place.
35
46
  - Do not create or populate `06-finalization.md` from a review amendment alone.
36
47
  - Keep `Current stage = 5-code-reviewer` unless the user explicitly advances, skips, or bypasses.
@@ -38,10 +49,13 @@ Review implementation for conformance, quality, security, and test sufficiency.
38
49
  ## Required Output (`05-code-review.md`)
39
50
 
40
51
  - Quality & maintainability findings
52
+ - Vulnerability audit findings
41
53
  - Security & boundary findings
54
+ - Optimization findings
42
55
  - Severity / priority
43
56
  - Recommended fixes
44
57
  - Lint/parser/static-analysis observations and whether those checks were run
58
+ - Residual risks
45
59
  - Reviewed scope and non-reviewed scope
46
60
 
47
61
  ## Next-Step Status Rules
@@ -6,10 +6,13 @@
6
6
 
7
7
  ## Purpose
8
8
 
9
- Review accessibility risks for UI work, including semantics, navigation, and assistive-tech impact.
9
+ Review accessibility risks for UI work, including semantics, navigation, assistive-tech impact, and Lighthouse-weighted issues that commonly drag mobile release scores.
10
10
 
11
11
  ## Behavior
12
12
 
13
13
  - Read `AGENTS.md`, relevant framework rules, relevant steering, and current branch specs if present.
14
+ - Prioritize Lighthouse-impacting accessibility failures when relevant, especially unnamed interactive controls and insufficient foreground/background contrast.
15
+ - For icon-only buttons or custom controls, verify accessible names explicitly instead of assuming visible icons are sufficient.
16
+ - For text and UI surfaces, verify contrast with mobile readability in mind and flag combinations that are likely to fail WCAG AA or Lighthouse.
14
17
  - Do not silently update framework stage files.
15
18
  - If the user explicitly asks to persist output, write only the requested files.
@@ -0,0 +1,53 @@
1
+ # Optimizer
2
+
3
+ > **Category:** Standalone role agent
4
+ > **May change code:** Only if explicitly requested by the user and allowed by repo/framework rules
5
+ > **Default framework file updates:** None unless explicitly asked, or when invoked as part of `5-code-reviewer`
6
+
7
+ ## Purpose
8
+
9
+ Review websites and user-facing applications for optimization risks that affect real-user speed, Lighthouse/PageSpeed results, stability, and production behavior.
10
+
11
+ ## Behavior
12
+
13
+ - Read `AGENTS.md`, relevant framework rules, relevant steering, and current branch specs if present.
14
+ - Use website optimization as the default audit lens, not only narrow runtime profiling.
15
+ - When invoked by `5-code-reviewer`, write findings into the `## Optimization findings` section of `05-code-review.md`.
16
+ - When used standalone, do not silently update framework stage files unless the user explicitly asks to persist findings.
17
+ - Prefer concrete findings with the affected route/component/asset, likely user impact, and recommended fix.
18
+ - If a checklist area is not applicable, say so explicitly instead of implying it was checked.
19
+ - For website/frontend scope, treat mobile Lighthouse/PageSpeed on a production-like URL as a first-class release signal, not a nice-to-have after desktop looks good.
20
+ - Do not clear a mobile optimization review while predictable Lighthouse blockers such as cache-lifetime failures, render-blocking resources, late-discovered LCP assets, oversized images, unused JS/CSS, unnamed buttons, or low-contrast UI remain unresolved without an explicit documented reason.
21
+ - If the user wants a launch-ready review, require post-deploy or production-like verification on mobile and explicitly state whether the remaining findings are compatible with a realistic 90+ mobile score target.
22
+
23
+ ## Default Optimization Checklist
24
+
25
+ Review all of the following when relevant:
26
+
27
+ 1. Reduce initial page work and startup cost.
28
+ 2. Split JavaScript carefully without over-splitting critical paths.
29
+ 3. Avoid duplicated app initialization and repeated global bootstrap work.
30
+ 4. Delay non-critical UI, effects, analytics, widgets, and third-party scripts.
31
+ 5. Optimize images, responsive delivery, compression, dimensions, and lazy loading.
32
+ 6. Optimize audio and video loading, preload behavior, posters, and autoplay choices.
33
+ 7. Optimize animations and visual effects, including canvas, parallax, observers, and reduced-motion behavior.
34
+ 8. Reduce main-thread work from startup logic, rerenders, heavy parsing, and synchronous DOM work.
35
+ 9. Prevent forced reflow and layout thrashing.
36
+ 10. Optimize fonts, weights, render-blocking CSS, and loading behavior.
37
+ 11. Verify good caching behavior for built assets, images, fonts, media, and CDN/browser headers, and treat missing long-lived cache headers as release blockers when Lighthouse flags them.
38
+ 12. Shorten the network dependency tree and reduce render-blocking chains, especially CSS, fonts, and late-discovered hero assets.
39
+ 13. Limit third-party impact and measure it separately.
40
+ 14. Optimize DOM size and structure.
41
+ 15. Avoid rendering offscreen content too early.
42
+ 16. Handle mobile differently when lower-power behavior should be simplified.
43
+ 17. Preserve layout stability and prevent CLS regressions.
44
+ 18. Fix Lighthouse-accessibility issues that overlap with optimization work, especially unnamed buttons/controls and insufficient foreground/background contrast.
45
+ 19. Fix SEO and metadata hygiene that affect Lighthouse and sharing quality.
46
+ 20. Watch for production-only bundle breakage from chunking, stale assets, or minification-sensitive behavior.
47
+ 21. Test optimization work in local, staging, and production-like environments when possible.
48
+ 22. Measure with the right tools, not Lighthouse alone, but always include a mobile Lighthouse/PageSpeed pass when launch-readiness is in scope.
49
+ 23. Verify what the browser is actually downloading in the network panel, including LCP resource discovery timing and whether the critical hero asset is fetched early enough.
50
+ 24. Re-test after meaningful changes and compare trends rather than trusting one run.
51
+ 25. Prioritize fixes in sensible order: runtime errors, eager media, JS startup cost, code splitting, images, decorative effects, main-thread work, caching, render blockers, LCP discovery, accessibility, environment verification, then re-test.
52
+ 26. Treat an optimized website as one that is fast, interactive, stable, cache-sane, mobile-aware, accessible enough to avoid score drag, and free of unnecessary early downloads.
53
+ 27. Before calling work done, verify console health, duplicate bootstrap avoidance, media/image behavior, chunking, decorative effects, main-thread work, forced reflow hotspots, fonts, cache headers, render-blocking requests, LCP breakdown/discovery, unused JS/CSS, accessibility warnings, and post-deploy mobile Lighthouse/PageSpeed checks.
@@ -36,9 +36,10 @@ This repository uses **united-we-stand**, a spec-driven AI workflow framework th
36
36
  - If branch memory does not exist yet, explicit init requests such as `init the following`, `initialize this`, `let's init this`, `help me with the following idea, i want...`, `let's start building this`, `i want to build...`, `i want to create...`, or `let's work on...` should be treated as permission to create the branch spec and start `1-initializer`.
37
37
  - When initialization is requested, always perform a fresh live check of the current git branch before creating branch memory.
38
38
  - Never reuse an earlier branch check, earlier status output, or remembered branch context from the same chat as the initialization target.
39
- - If branch memory does not exist yet and the user asks for concrete code changes or other persistent repo work without explicitly asking to initialize, warn that united-we-stand is not initialized for the branch and ask whether to proceed outside the framework instead of inferring a numbered stage.
40
- - If the user confirms outside-framework work, continue outside the framework for the rest of the current chat and do not ask for the same confirmation again unless the user later asks to initialize or return to normal framework flow.
41
- - If branch memory does not exist yet and the current branch is detected as the repository default branch, explicit init requests must warn about default-branch risks and ask for confirmation before creating `.spec-driven/...` files unless the user explicitly uses `--force`.
39
+ - If branch memory does not exist yet and the user asks for concrete code changes or other persistent repo work without explicitly asking to initialize, do not interrupt to explain missing framework setup. Help with the request normally instead of inferring a numbered stage.
40
+ - Do not create `.spec-driven/...` files from that request alone. Only surface initialization/framework guidance when the user explicitly asks to initialize or explicitly brings up the framework.
41
+ - If the current branch is detected as the repository default branch and the framework would create or rewrite branch memory there, warn about default-branch risks and ask for confirmation before writing `.spec-driven/...` files. Force or bypass wording does not skip that confirmation.
42
+ - If branch memory does not exist yet and the user explicitly confirms starting from a later stage, create only `00-current-status.md`, `state.json`, and the single targeted numbered stage file. Never create two numbered stage files in the same pass.
42
43
  - The most reliable direct NLP bootstrap is to reference any installed united-we-stand file together with the init request, for example `AGENTS.md initialize this` or `.united-we-stand/README.md init the following`.
43
44
  - Runtime branch memory is writable under `.spec-driven/` only.
44
45
  - Treat `.united-we-stand/` as installed framework content (do not use it for runtime branch memory updates).
@@ -87,6 +88,7 @@ Canonical source of these rules:
87
88
  - `project-manager`
88
89
  - `refactorer`
89
90
  - `test-strategist`
91
+ - `optimizer`
90
92
  - `performance-reviewer`
91
93
  - `accessibility-reviewer`
92
94
  - `api-contract-writer`
@@ -8,10 +8,10 @@ Before acting:
8
8
  3. Read and update branch state under `.spec-driven/<sanitized-current-branch>/`.
9
9
  4. If present, read `.spec-driven/.branch-routing.json` to resolve branch-folder exceptions.
10
10
 
11
- If branch memory does not exist yet and the user asks for concrete code changes or other persistent repo work without explicitly asking to initialize the framework, warn that united-we-stand is not initialized for the branch and ask whether to proceed outside the framework for the current chat.
11
+ If branch memory does not exist yet and the user asks for concrete code changes or other persistent repo work without explicitly asking to initialize the framework, continue helping with the request normally and do not interrupt to explain framework setup. Do not create `.spec-driven/...` files unless the user explicitly asks to initialize or explicitly brings up the framework.
12
12
 
13
13
  When initialization is requested, always perform a fresh live check of the current git branch before creating branch memory. Do not rely on a previous branch check, previous status output, or remembered branch context from earlier in the same chat.
14
14
 
15
- If branch memory does not exist yet and the current branch is detected as the repository default branch, explicit init requests must warn about default-branch risks and ask for confirmation before creating `.spec-driven/...` files unless the user explicitly uses `--force`.
15
+ If the current branch is detected as the repository default branch and the framework would create or rewrite branch memory there, warn about default-branch risks and ask for confirmation before writing `.spec-driven/...` files. Force or bypass wording does not skip that confirmation.
16
16
 
17
17
  For the most reliable natural-language initialization when branch memory does not exist yet, reference any installed united-we-stand file together with the init request, for example `AGENTS.md initialize this`.
@@ -8,10 +8,10 @@ Before acting:
8
8
  3. Read and update branch state under `.spec-driven/<sanitized-current-branch>/`.
9
9
  4. If present, read `.spec-driven/.branch-routing.json` to resolve branch-folder exceptions.
10
10
 
11
- If branch memory does not exist yet and the user asks for concrete code changes or other persistent repo work without explicitly asking to initialize the framework, warn that united-we-stand is not initialized for the branch and ask whether to proceed outside the framework for the current chat.
11
+ If branch memory does not exist yet and the user asks for concrete code changes or other persistent repo work without explicitly asking to initialize the framework, continue helping with the request normally and do not interrupt to explain framework setup. Do not create `.spec-driven/...` files unless the user explicitly asks to initialize or explicitly brings up the framework.
12
12
 
13
13
  When initialization is requested, always perform a fresh live check of the current git branch before creating branch memory. Do not rely on a previous branch check, previous status output, or remembered branch context from earlier in the same chat.
14
14
 
15
- If branch memory does not exist yet and the current branch is detected as the repository default branch, explicit init requests must warn about default-branch risks and ask for confirmation before creating `.spec-driven/...` files unless the user explicitly uses `--force`.
15
+ If the current branch is detected as the repository default branch and the framework would create or rewrite branch memory there, warn about default-branch risks and ask for confirmation before writing `.spec-driven/...` files. Force or bypass wording does not skip that confirmation.
16
16
 
17
17
  For the most reliable natural-language initialization when branch memory does not exist yet, reference any installed united-we-stand file together with the init request, for example `AGENTS.md initialize this`.
@@ -11,10 +11,10 @@ Before acting:
11
11
  3. Read and update branch state under `.spec-driven/<sanitized-current-branch>/`.
12
12
  4. If present, read `.spec-driven/.branch-routing.json` to resolve branch-folder exceptions.
13
13
 
14
- If branch memory does not exist yet and the user asks for concrete code changes or other persistent repo work without explicitly asking to initialize the framework, warn that united-we-stand is not initialized for the branch and ask whether to proceed outside the framework for the current chat.
14
+ If branch memory does not exist yet and the user asks for concrete code changes or other persistent repo work without explicitly asking to initialize the framework, continue helping with the request normally and do not interrupt to explain framework setup. Do not create `.spec-driven/...` files unless the user explicitly asks to initialize or explicitly brings up the framework.
15
15
 
16
16
  When initialization is requested, always perform a fresh live check of the current git branch before creating branch memory. Do not rely on a previous branch check, previous status output, or remembered branch context from earlier in the same chat.
17
17
 
18
- If branch memory does not exist yet and the current branch is detected as the repository default branch, explicit init requests must warn about default-branch risks and ask for confirmation before creating `.spec-driven/...` files unless the user explicitly uses `--force`.
18
+ If the current branch is detected as the repository default branch and the framework would create or rewrite branch memory there, warn about default-branch risks and ask for confirmation before writing `.spec-driven/...` files. Force or bypass wording does not skip that confirmation.
19
19
 
20
20
  For the most reliable natural-language initialization when branch memory does not exist yet, reference any installed united-we-stand file together with the init request, for example `AGENTS.md initialize this`.
@@ -19,6 +19,8 @@ Provide reusable, deterministic rules for spec-driven AI development across repo
19
19
  9. `09-traceability-model.md`
20
20
  10. `10-review-model.md`
21
21
  11. `11-glossary.md`
22
+ 12. `12-react-frontend-review-checklist.md`
23
+ 13. `13-vulnerability-audit-matrix.md`
22
24
 
23
25
  Then read:
24
26
 
@@ -41,6 +43,8 @@ Then read:
41
43
  - Requirement mapping across stages: `09-traceability-model.md`
42
44
  - Review dimensions, deep checks, and outputs: `10-review-model.md`
43
45
  - Shared definitions: `11-glossary.md`
46
+ - React/frontend static review heuristics: `12-react-frontend-review-checklist.md`
47
+ - Native vulnerability audit command guidance: `13-vulnerability-audit-matrix.md`
44
48
 
45
49
  ## Design Goals
46
50
 
@@ -77,10 +77,10 @@ This file is the canonical source for global framework invariants.
77
77
  Workflow metadata is not independent from the branch folder contents. `Current stage` must always match the highest existing numbered stage file among `01-init.md` through `06-finalization.md`, and status checks must validate that alignment.
78
78
 
79
79
  25. **No implicit framework entry when branch memory is missing**
80
- If branch memory does not exist yet and the user requests concrete code changes or other persistent work without explicitly asking to initialize the framework, do not silently enter a numbered framework stage. Warn that united-we-stand is not initialized for the branch and ask whether to proceed outside the framework.
80
+ If branch memory does not exist yet and the user requests concrete code changes or other persistent work without explicitly asking to initialize the framework, do not silently enter a numbered framework stage and do not interrupt the user to announce missing framework setup. Continue helping with the request normally unless the user explicitly asks to initialize or explicitly brings up the framework.
81
81
 
82
- 26. **Outside-framework confirmation is sticky for the current chat**
83
- If the user confirms that the work should continue outside the framework, continue helping outside the framework for the rest of the current chat without asking for the same confirmation again unless the user later asks to initialize or return to normal framework flow.
82
+ 26. **Framework guidance should be user-invoked when branch memory is missing**
83
+ If branch memory does not exist yet, do not keep re-raising initialization or framework setup on ordinary work. Only surface initialization/framework guidance when the user explicitly asks to initialize, mentions the framework, or references installed framework files or commands.
84
84
 
85
85
  27. **Finalizer requires explicit closure confirmation**
86
86
  `6-finalizer` never treats itself as definitively done on its own. It must surface final observations, ask the user to confirm that the final state is acceptable, and only then close the workflow.
@@ -91,12 +91,15 @@ This file is the canonical source for global framework invariants.
91
91
  29. **Post-closure work reopens finalizer**
92
92
  If the workflow was explicitly closed and the user later requests more branch changes, reopen `6-finalizer` as the current stage, clear closed/finalized state, and require finalization approval again after the new work is incorporated.
93
93
 
94
- 30. **Default-branch initialization requires confirmation**
95
- If the current branch is detected as the repository default branch and branch memory does not yet exist, explicit initialization requests must warn about default-branch risks and ask for confirmation before creating `.spec-driven/...` files. Explicit `--force` semantics are the only bypass for that confirmation.
94
+ 30. **Default-branch framework writes require confirmation**
95
+ If the current branch is detected as the repository default branch and the framework would create or rewrite branch memory there, warn about default-branch risks and ask for confirmation before writing `.spec-driven/...` files. Force or bypass wording never skips that confirmation.
96
+
97
+ 31. **Bootstrap only the targeted stage file**
98
+ When branch memory does not exist yet and the user explicitly confirms starting from a later stage, create only `00-current-status.md`, `state.json`, and the single targeted numbered stage file for that pass. Never backfill another numbered stage file in the same pass.
96
99
 
97
100
  ## Stage Mandatory Set
98
101
 
99
- Mandatory framework stages:
102
+ Mandatory framework stages in the normal forward flow:
100
103
 
101
104
  - `1-initializer`
102
105
  - `4-implementer`
@@ -127,21 +127,23 @@ If the user explicitly asks to initialize or init the work and branch memory doe
127
127
 
128
128
  Initialization bootstrap does not grant permission to pre-create or populate planning, design, implementation, review, or finalization files.
129
129
 
130
- ## Default Branch Initialization Rule
130
+ ## Default Branch Spec-Creation Rule
131
131
 
132
- If branch memory does not exist yet and the current branch is detected as the repository default branch and the user asks to initialize:
132
+ If the current branch is detected as the repository default branch and the framework would create or rewrite branch memory there:
133
133
 
134
- 1. warn clearly that initialization is being requested on the default branch
134
+ 1. warn clearly that framework memory is about to be written on the default branch
135
135
  2. explain that default-branch framework memory can make later feature-branch flow, branch-specific specs, and long-lived workflow state harder to manage
136
136
  3. ask for explicit confirmation before creating `.spec-driven/<branch>/`
137
- 4. if the user confirms, continue with normal `1-initializer` bootstrap
138
- 5. if the user explicitly uses `--force` or equally explicit force/bypass semantics, proceed without asking again
137
+ 4. if the user confirms, continue with the single requested framework stage bootstrap
138
+ 5. force or bypass wording does not skip this confirmation on the default branch
139
139
 
140
140
  Examples:
141
141
 
142
142
  - `initialize this on main`
143
143
  - `branch-init this work on master`
144
144
  - `init this branch` while currently on the detected default branch
145
+ - `start planning on main`
146
+ - `create the review spec on master`
145
147
 
146
148
  Examples:
147
149
 
@@ -165,13 +167,14 @@ Interpretation rule:
165
167
  If branch memory does not exist yet and the user requests concrete code changes or other persistent work without explicitly asking to initialize the framework:
166
168
 
167
169
  1. do not infer entry into `2-planner`, `3-designer`, `4-implementer`, `5-code-reviewer`, or `6-finalizer`
168
- 2. warn clearly that united-we-stand is not initialized for the current branch
169
- 3. ask whether to proceed outside the framework for the current chat
170
- 4. if the user confirms outside-framework work, continue normally outside the framework and do not repeat the same confirmation again in that chat unless the user later asks to initialize or return to framework mode
170
+ 2. do not warn about missing framework initialization by default
171
+ 3. continue helping with the requested repo work normally
172
+ 4. do not create `.spec-driven/...` files or numbered stage files unless the user explicitly asks to initialize or explicitly mentions the framework
171
173
  5. if the user explicitly asks to initialize instead, create branch memory and start `1-initializer`
172
174
  6. if the user explicitly asks to start the framework from a later stage or uses force/bypass semantics, require confirmation of one exact target stage before proceeding
175
+ 7. once that exact later-stage start is confirmed, create only `00-current-status.md`, `state.json`, and the single requested stage file; do not backfill `01-init.md` or any other numbered stage file in the same pass
173
176
 
174
- This one-time outside-framework confirmation stays sticky on the default branch too. Do not keep re-asking in the same chat once the user already chose to continue outside the framework.
177
+ This silent fallback applies on the default branch too. Do not interrupt ordinary work on `main`/default branches just to explain framework setup.
175
178
 
176
179
  Examples that should trigger this warning-and-confirm flow when branch memory is missing:
177
180
 
@@ -188,6 +191,7 @@ Examples that should trigger this warning-and-confirm flow when branch memory is
188
191
  - `manage this project` -> `project-manager`
189
192
  - `refactor this` -> `refactorer`
190
193
  - `plan tests for this` -> `test-strategist`
194
+ - `check optimization` / `review website optimization` -> `optimizer`
191
195
  - `check performance` -> `performance-reviewer`
192
196
  - `check accessibility` -> `accessibility-reviewer`
193
197
  - `write api contracts` -> `api-contract-writer`
@@ -204,9 +208,9 @@ Standalone routes should not mutate stage files unless user asks explicitly.
204
208
 
205
209
  When branch memory does not exist yet and user requests implementation or other persistent repo changes without explicit framework initialization:
206
210
 
207
- - warn that united-we-stand is not initialized for the branch
208
- - ask whether to proceed outside the framework for the current chat
209
- - if user confirms, continue outside the framework and do not re-ask unless the user later asks to initialize or return to framework mode
211
+ - continue helping with the implementation request normally
212
+ - do not mention missing framework setup unless the user explicitly asks about initialization or framework flow
213
+ - do not create `.spec-driven/...` files or enter `4-implementer` metadata unless the user explicitly asks to initialize or explicitly asks for framework-stage behavior
210
214
  - if user explicitly wants to start the framework from implementation or another later stage, require explicit confirmation of that bypass path first
211
215
 
212
216
  When branch memory exists and user requests implementation and stages `2-planner` and/or `3-designer` are missing:
@@ -53,12 +53,14 @@ Required fields:
53
53
  - Assumptions
54
54
  - Open questions
55
55
  - Success criteria
56
+ - Security / dependency concerns
56
57
 
57
58
  ### `02-plan.md`
58
59
 
59
60
  - Objectives
60
61
  - Dependencies
61
62
  - Risks / unknowns
63
+ - Security / dependency risk plan
62
64
  - Suggested execution order
63
65
  - Detailed task list
64
66
  - Status
@@ -69,6 +71,7 @@ Required fields:
69
71
  - Key components
70
72
  - Interfaces / data flow
71
73
  - Constraints
74
+ - Security boundaries / attack surface
72
75
  - Design decisions
73
76
  - Diagrams/flows when useful (Mermaid allowed)
74
77
 
@@ -83,9 +86,13 @@ Required fields:
83
86
  ### `05-code-review.md`
84
87
 
85
88
  - Quality & maintainability findings
89
+ - Vulnerability audit findings
86
90
  - Security / boundary findings
91
+ - Optimization findings
87
92
  - Severity / priority
88
93
  - Recommended fixes
94
+ - Lint/parser/static-analysis observations
95
+ - Residual risks
89
96
  - Reviewed scope and non-reviewed scope
90
97
 
91
98
  ### `06-finalization.md`